/* EAMON.WORLD */
/* calendars.css: Rules for calendar and other timekeeping elements */

.calendar {
}

/* Calendar legend */
.calendarLegend ul {
	display: inline-block;
	list-style-type: none;
    font-size: 0.75rem;
	margin: 0;
	padding: 0;
}
.calendarLegend li {
	display: inline-block;
	padding-right: 0.5rem !important;
}
.calendarLegend span {
	display: inline-block;
}
.calendarLegendEvents span {
	min-width: 0.75rem;
	min-height: 0.75rem;
	position: relative;
	top: 2px;
}

/* Calendar year */
.calendar .calendarYear {
	border: 1px solid #ccc;
	margin: 0.25rem;
}
.calendar .calendarYear figcaption {
	background: #ccc;
	font-size: 1.125rem;
	font-style: normal;
	line-height: inherit;
	font-weight: bold;
	margin: 0;
	opacity: 1;
	padding: 0.125rem;
	text-align: center;
}
.calendar .ecalPresentYearOffset {
	display: block;
	font-size: 0.8rem;
	font-weight: normal;
}

/* Calendar months */
.calendar .calendarMonths {
	display: flex;
	flex-wrap: wrap;
}
.calendar .calendarMonth {
	border: 1px solid #ddd;
	float: left;
	margin: 0.25rem;
}
.calendar caption {
	background: #ddd;
	cursor: pointer;
	font-weight: bold;
}
.calendar .calendarMonth:hover caption {
	background: #ebb;
}

/* Intercalary strip */
.calendarIntercalaryStrip {
	table-layout: fixed;
	width: 2rem;            /* tweak to match day-cell width */
	min-width: 2rem;
	align-self: stretch;    /* helps it match neighbor height in flex/grid containers */
	border: 1px solid #ddd;
	float: left;
	margin: 0.25rem;
}
/* If it ever becomes 2-day (leap-end), let it size to 2 columns */
.calendarIntercalaryStrip:has(thead th:nth-child(2)) {
	width: 4rem;            /* 2-day width */
	min-width: 4rem;
}

/* Calendar weekday headers */
.calendarWeekday {
	border-bottom: 1px solid rgba(0,0,0,0.06);
	font-size: 0.75rem;
}
.calendarWeekday span:last-child {
	display: none;
}

/* Calendar day box */
.calendarDay {
	background: rgba(255,255,255,0.5);
	cursor: pointer;
	font-size: 0.875rem;
	text-align: center;
	min-width: 1.7rem;
	height: 2rem;
}
.calendarDay .liner {
	position: relative;
    width: 100%;
    height: 100%;
}
.calendarDay:hover {
	outline: 2px solid #a43030;
}
.calendarDay span {
}
.calendarIntercalaryStrip .calendarDay {
  vertical-align: middle;
}
.calendarDay.intercalary .calendarDayLabel {
	writing-mode: vertical-rl;
	text-orientation: mixed;
	font-weight: 500;
	margin: 0.2rem 0;
}

/* Calendar day number */
.calendarDayNum {
	position: absolute;
	top: 2px;
	left: 2px;
}

/* Calendar day icons */
.calendarIcons {
	display: flex;
	gap: 1px;
	justify-content: center;
	align-items: center;
	height: 10px;
	margin-bottom: 2px;
	position: absolute;
	bottom: 0;
}

/* Calendar day event-specific rules */
.named_event {
	background: #dddddd;
}
.season_marker,
.cardinal,
.leap_day {
	background: #e0e0ee;
	color: #00a;
}
.feast_of_carroll,
.feast_of_tannam {
	background: #eeccee;
}
.named_event_sky_extrema  {
	background: #eecccc;
}

.calIcon {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	opacity: 1;
	display: none;
}
.calIcon.lunar_full_silla,
.calIcon.lunar_full_niria,
.calIcon.lunar_full_geona {
	display: inline-block;
}
.calIcon.lunar_full_silla { 
	background: #cfe8cf;
}
.calIcon.lunar_full_niria {
	background: #ffd6c2;
}
.calIcon.lunar_full_geona {
	background: #c8c8c8;
}

/* Panel */
.calDayPanel {
	background: var(--paper, #f6f6f6);
	border-radius: 8px;
	border: 1px solid rgba(0,0,0,0.15);
	box-shadow: 0 8px 24px rgba(0,0,0,0.2);
	display: none;
	font-size: 0.9rem;
	max-width: calc(100vw - 20px);
	max-height: 70vh;
	position: fixed;
	overflow: auto;
	padding: 0.75rem 0.9rem;
	width: 320px;
	z-index: 9999;
}
.calDayPanel.open {
	display: block;
}
.calDayPanelClose {
	position: absolute;
	top: 0.35rem;
	right: 0.5rem;
	background: transparent;
	border: 0;
	font-size: 1.2rem;
	cursor: pointer;
}
.calDayPanel h4 {
	font-size: 1.2rem;
	margin: 0 1.5rem 0.25rem 0;
}
.calDayPanel h5 {
	margin: 0.75rem 0 0.25rem;
}
.calDayPanel .muted {
	opacity: 0.75;
}

/* Buttons */
.ecalPrev, .ecalNext {
	position: absolute;
	top: 0.5rem;
}
.ecalPrev {
	left: 0.25rem;
}
.ecalNext {
	right: 0.25rem;
}

/* For screen readers */
.sr-only {
	position: absolute;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0,0,0,0);
	white-space: nowrap;
	border: 0;
}

/* Extras / overrides */
.calendarIntercalaryStrip .liner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	height: 100%;
}
/* Keep icons below the label, centered */
.calendarDay.intercalary .calendarIcons {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	align-items: center;
	justify-content: center;
	margin-top: 0.35rem;
}

