/**
 * Month-grid calendar styling.
 *
 * Accessible table layout, large high-contrast text for the older-audience baseline. On
 * phones the month grid collapses to day numbers + coloured kind dots (no tiny text); the
 * titles live in a phone-only month list beneath the grid that the day cells link to.
 */

.skt-calendar-wrap {
	margin: 0 0 2rem;
}

.skt-calendar-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.skt-calendar-nav a {
	padding: 0.4em 0.8em;
	border: 1px solid currentColor;
	border-radius: 4px;
	text-decoration: none;
	font-weight: 600;
	white-space: nowrap;
}

.skt-calendar-nav__today {
	opacity: 0.85;
}

.skt-calendar {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.skt-calendar__caption {
	caption-side: top;
	font-size: 1.25em;
	font-weight: 700;
	text-align: center;
	padding-bottom: 0.5rem;
}

.skt-calendar th {
	padding: 0.4em;
	text-align: center;
	font-weight: 700;
	border: 1px solid #ddd;
	background: #f3f3f3;
}

.skt-calendar__day {
	width: 14.28%;
	height: 6.5em;
	vertical-align: top;
	padding: 0.3em;
	border: 1px solid #ddd;
}

.skt-calendar__num {
	display: block;
	font-weight: 700;
	margin-bottom: 0.2em;
}

.skt-calendar__day.is-othermonth {
	background: #fafafa;
	color: #999;
}

.skt-calendar__day.is-today {
	outline: 2px solid #2f5d3a; /* Tannengrün (Corporate Design) */
	outline-offset: -2px;
}

.skt-calendar__day.has-events {
	background: #faf4e8; /* Creme (Corporate Design) */
}

.skt-calendar__events {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.8em;
	line-height: 1.3;
}

.skt-calendar__events li {
	margin: 0 0 0.25em;
}

.skt-calendar__events a {
	display: block;
	text-decoration: none;
	padding: 0.15em 0.3em;
	border-radius: 3px;
	background: #2f5d3a; /* fallback; per-kind colours below */
	color: #fff;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Event colours by kind (Corporate Design palette). */
.skt-calendar__event.is-recurring {
	background: #2f5d3a; /* Tannengrün — regelmäßig */
	color: #fff;
}

.skt-calendar__event.is-multi {
	background: #2f80b8; /* Himmelblau — mehrere Termine */
	color: #fff;
}

.skt-calendar__event.is-single {
	background: #e0801b; /* Sonnen-Orange — einmalig */
	color: #1d1d1b;      /* dark text for contrast on orange */
}

.skt-calendar__time {
	font-weight: 700;
	margin-right: 0.2em;
}

/* Legend explaining the event colours. */
.skt-calendar-legend {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
	margin: 0.9rem 0 0;
	padding: 0;
	font-size: 0.9em;
}

.skt-calendar-legend__item {
	display: flex;
	align-items: center;
}

.skt-calendar-legend__item::before {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-right: 0.4em;
	border-radius: 3px;
	background: currentColor; /* overridden per kind below */
}

.skt-calendar-legend__item.is-recurring::before {
	background: #2f5d3a;
}

.skt-calendar-legend__item.is-multi::before {
	background: #2f80b8;
}

.skt-calendar-legend__item.is-single::before {
	background: #e0801b;
}

/* --- View toggle (Monat | Jahr) --- */

.skt-calendar-views {
	display: flex;
	margin-bottom: 0.75rem;
}

.skt-calendar-views__btn {
	padding: 0.4em 1.1em;
	border: 1px solid #2f5d3a; /* Tannengrün (Corporate Design) */
	text-decoration: none;
	font-weight: 700;
	color: #2f5d3a;
	background: #fff;
}

.skt-calendar-views__btn + .skt-calendar-views__btn {
	border-left: none;
}

.skt-calendar-views__btn:first-child {
	border-radius: 4px 0 0 4px;
}

.skt-calendar-views__btn:last-child {
	border-radius: 0 4px 4px 0;
}

.skt-calendar-views__btn.is-active {
	background: #2f5d3a;
	color: #fff;
}

/* --- Year overview: grid of mini-months --- */

.skt-calendar__caption--year {
	font-size: 1.5em;
	font-weight: 700;
	text-align: center;
	margin: 0.25rem 0 1rem;
}

.skt-calendar-year {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.25rem;
}

.skt-calendar-mini {
	min-width: 0;
}

.skt-calendar-mini__head {
	display: block;
	text-align: center;
	font-weight: 700;
	text-decoration: none;
	color: #2f5d3a;
	margin-bottom: 0.3rem;
}

.skt-calendar-mini__head:hover,
.skt-calendar-mini__head:focus-visible {
	text-decoration: underline;
}

.skt-calendar-mini__grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	font-size: 0.8em;
}

.skt-calendar-mini__grid th {
	padding: 0.15em 0;
	text-align: center;
	font-weight: 700;
	color: #555;
}

.skt-calendar-mini__day {
	text-align: center;
	vertical-align: top;
	padding: 0.1em 0;
	height: 2.2em;
}

.skt-calendar-mini__day.is-othermonth .skt-calendar-mini__num {
	color: #bbb;
}

.skt-calendar-mini__day.is-today {
	outline: 2px solid #2f5d3a;
	outline-offset: -2px;
	border-radius: 3px;
}

.skt-calendar-mini__num {
	display: block;
	line-height: 1.2;
}

.skt-calendar-mini__link {
	display: block;
	text-decoration: none;
	color: inherit;
	border-radius: 3px;
}

.skt-calendar-mini__link:hover,
.skt-calendar-mini__link:focus-visible {
	background: #faf4e8; /* Creme (Corporate Design) */
}

.skt-calendar-mini__dots {
	display: flex;
	justify-content: center;
	gap: 2px;
	min-height: 6px;
	margin-top: 1px;
}

.skt-calendar-mini__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #2f5d3a;
}

.skt-calendar-mini__dot.is-recurring {
	background: #2f5d3a; /* Tannengrün — regelmäßig */
}

.skt-calendar-mini__dot.is-multi {
	background: #2f80b8; /* Himmelblau — mehrere Termine */
}

.skt-calendar-mini__dot.is-single {
	background: #e0801b; /* Sonnen-Orange — einmalig */
}

/* Year grid reflows to fewer columns as the viewport narrows. */
@media ( max-width: 900px ) {
	.skt-calendar-year {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media ( max-width: 700px ) {
	.skt-calendar-year {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media ( max-width: 480px ) {
	.skt-calendar-year {
		grid-template-columns: 1fr;
	}
}

/* --- Phone month view ---
   The 7-column grid with text pills can't fit a 360px screen, so on phones each day cell
   shows only its number plus one dot per event kind (.skt-calendar__daylink), and the
   phone-only .skt-calendar-month-list beneath the grid carries titles/times. Both are
   hidden on wide screens; the pills are hidden on phones. */

.skt-calendar__daylink,
.skt-calendar-month-list {
	display: none;
}

/* Events page: on phones the calendar moves below "Nächste Termine". The page wraps the two
   sections in .skt-events-page (core Group blocks); the mobile-only "Kalender" heading
   labels the calendar once it sits after the list. */
.skt-events-page__calendar-title {
	display: none;
}

@media ( max-width: 600px ) {
	.skt-calendar-nav a {
		padding: 0.4em 0.6em;
	}

	.skt-calendar__caption {
		font-size: 1.15em;
	}

	.skt-calendar th {
		padding: 0.3em 0;
	}

	.skt-calendar__day {
		position: relative;
		height: 44px; /* table cells treat height as a minimum: comfortable tap target */
		padding: 0.25em 0.1em;
		text-align: center;
	}

	.skt-calendar__num {
		margin: 0;
	}

	.skt-calendar__events {
		display: none;
	}

	.skt-calendar__daylink {
		display: block;
		margin-top: 2px;
	}

	/* Stretched link: the whole day cell is the tap target. */
	.skt-calendar__daylink::after {
		content: "";
		position: absolute;
		inset: 0;
	}

	.skt-calendar-month-list {
		display: block;
		margin-top: 1.25rem;
	}

	.skt-calendar-month-list__title {
		font-size: 1.1em;
		margin: 0 0 0.5rem;
	}

	.skt-calendar-month-list__day {
		font-size: 1em;
		margin: 0.9rem 0 0.3rem;
		scroll-margin-top: 5rem;
	}

	.skt-calendar-month-list__empty {
		margin: 0;
	}

	.skt-calendar-month-list__events {
		list-style: none;
		margin: 0;
		padding: 0;
		display: grid;
		gap: 0.35rem;
	}

	.skt-calendar-month-list__events a {
		display: block;
		padding: 0.5em 0.7em;
		border-radius: 6px;
		text-decoration: none;
	}

	.skt-events-page {
		display: flex;
		flex-direction: column;
	}

	.skt-events-page__upcoming {
		order: 1;
	}

	.skt-events-page__calendar {
		order: 2;
		margin-top: 2rem;
	}

	.skt-events-page__calendar-title {
		display: block;
	}
}
