/* GPGS Schulkalender – Frontend Styles
   Alle Selektoren sind unter .gpgs-schulkalender gescopet, damit das Divi-Theme
   nicht durchschlaegt. Farben werden ueber CSS-Variablen am Root-Element gesetzt.
*/

.gpgs-schulkalender {
	--gpgs-primary: #0f2444;
	--gpgs-primary-text: #ffffff;
	--gpgs-highlight: #f5c23a;
	--gpgs-highlight-text: #0f2444;
	--gpgs-today: #0f2444;
	--gpgs-dot: #f5c23a;
	--gpgs-bg: #eef1f7;
	--gpgs-heading: #0f2444;
	--gpgs-cal-header: #0f2444;
	--gpgs-cal-header-text: #ffffff;
	--gpgs-surface: #ffffff;
	--gpgs-border: #e1e6ef;
	--gpgs-text: #0f2444;
	--gpgs-muted: #6b7a93;
	--gpgs-radius: 14px;
	--gpgs-radius-sm: 10px;

	box-sizing: border-box;
	color: var(--gpgs-text);
	font-family: inherit;
	background: var(--gpgs-bg);
	padding: 24px;
	border-radius: var(--gpgs-radius);
	width: 100%;
}

.gpgs-schulkalender *,
.gpgs-schulkalender *::before,
.gpgs-schulkalender *::after {
	box-sizing: border-box;
}

.gpgs-schulkalender__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.gpgs-schulkalender__grid--no-cal {
	grid-template-columns: 1fr;
}

@media (max-width: 900px) {
	.gpgs-schulkalender__grid {
		grid-template-columns: 1fr;
	}
}

/* -------- Header -------- */
.gpgs-schulkalender__header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 16px;
	margin-bottom: 16px;
}

.gpgs-schulkalender__header--no-title {
	justify-content: flex-end;
}

.gpgs-schulkalender__title {
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	color: var(--gpgs-heading);
	line-height: 1.2;
}

.gpgs-schulkalender__more {
	font-size: 14px;
	font-weight: 600;
	color: var(--gpgs-primary);
	text-decoration: none;
	white-space: nowrap;
}

.gpgs-schulkalender__more:hover,
.gpgs-schulkalender__more:focus {
	text-decoration: underline;
}

/* -------- Liste -------- */
.gpgs-schulkalender__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.gpgs-schulkalender__empty {
	margin: 0;
	padding: 24px;
	background: var(--gpgs-surface);
	border-radius: var(--gpgs-radius-sm);
	color: var(--gpgs-muted);
	text-align: center;
}

/* -------- Event-Card -------- */
.gpgs-event {
	background: var(--gpgs-surface);
	border-radius: var(--gpgs-radius-sm);
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.gpgs-event:hover {
	box-shadow: 0 2px 10px rgba(15, 36, 68, 0.08);
}

.gpgs-event__inner {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	align-items: center;
	gap: 16px;
	padding: 14px 16px;
	width: 100%;
	background: transparent;
	border: none;
	text-align: left;
	font: inherit;
	color: inherit;
	cursor: default;
}

.gpgs-event--has-details .gpgs-event__inner {
	grid-template-columns: 64px 1fr auto auto;
	cursor: pointer;
}

.gpgs-event--has-details .gpgs-event__inner:hover {
	background: rgba(15, 36, 68, 0.03);
}

.gpgs-event--has-details .gpgs-event__inner:focus-visible {
	outline: 2px solid var(--gpgs-primary);
	outline-offset: -2px;
}

.gpgs-event__date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: var(--gpgs-primary);
	color: var(--gpgs-primary-text);
	border-radius: var(--gpgs-radius-sm);
	width: 56px;
	height: 56px;
	line-height: 1;
	font-weight: 700;
}

.gpgs-event--next .gpgs-event__date {
	background: var(--gpgs-highlight);
	color: var(--gpgs-highlight-text);
}

.gpgs-event__day {
	font-size: 22px;
}

.gpgs-event__month {
	font-size: 11px;
	letter-spacing: 0.05em;
	margin-top: 2px;
}

.gpgs-event__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.gpgs-event__title {
	font-size: 16px;
	font-weight: 700;
	color: var(--gpgs-text);
	line-height: 1.3;
}

.gpgs-event__meta {
	font-size: 13px;
	color: var(--gpgs-muted);
	line-height: 1.4;
}

.gpgs-event__badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: #dbe3f3;
	color: var(--gpgs-primary);
	white-space: nowrap;
}

.gpgs-event__chevron {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--gpgs-muted);
	transition: transform 0.2s ease;
}

.gpgs-event[aria-expanded="true"] .gpgs-event__chevron,
.gpgs-event__inner[aria-expanded="true"] .gpgs-event__chevron {
	transform: rotate(180deg);
	color: var(--gpgs-primary);
}

.gpgs-event__details {
	padding: 0 16px 16px 96px;
	color: var(--gpgs-text);
	font-size: 14px;
	line-height: 1.55;
}

.gpgs-event__details[hidden] {
	display: none !important;
}

.gpgs-event__details-inner > :first-child {
	margin-top: 0;
}

.gpgs-event__details-inner > :last-child {
	margin-bottom: 0;
}

.gpgs-event__details-inner a {
	color: var(--gpgs-primary);
	text-decoration: underline;
}

@media (max-width: 520px) {
	.gpgs-event__inner {
		grid-template-columns: 52px 1fr auto;
		gap: 12px;
	}
	.gpgs-event__date {
		width: 48px;
		height: 48px;
	}
	.gpgs-event__day { font-size: 18px; }
	.gpgs-event__badge {
		grid-column: 2 / 4;
		grid-row: 2;
		justify-self: start;
		margin-top: 2px;
	}
	.gpgs-event__chevron {
		grid-column: 3;
		grid-row: 1;
	}
	.gpgs-event__details {
		padding-left: 16px;
	}
}

/* -------- Footer-Link -------- */
.gpgs-schulkalender__footer-link {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 14px;
	padding: 14px 16px;
	background: var(--gpgs-surface);
	border: 1px solid var(--gpgs-primary);
	border-radius: var(--gpgs-radius-sm);
	color: var(--gpgs-primary);
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.gpgs-schulkalender__footer-link:hover,
.gpgs-schulkalender__footer-link:focus {
	background: var(--gpgs-primary);
	color: var(--gpgs-primary-text);
}

.gpgs-schulkalender__footer-icon {
	display: inline-flex;
}

/* -------- Kalender -------- */
.gpgs-cal {
	background: var(--gpgs-surface);
	border-radius: var(--gpgs-radius-sm);
	overflow: hidden;
}

.gpgs-cal__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 18px;
	background: var(--gpgs-cal-header);
	color: var(--gpgs-cal-header-text);
}

.gpgs-schulkalender .gpgs-cal__head,
.gpgs-schulkalender .gpgs-cal__head * {
	color: var(--gpgs-cal-header-text) !important;
}

.gpgs-cal__title,
.gpgs-cal__title span {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
}

.gpgs-cal__nav {
	display: flex;
	gap: 4px;
}

.gpgs-cal__prev,
.gpgs-cal__next {
	width: 28px;
	height: 28px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	background: transparent;
	color: inherit;
	font-size: 20px;
	line-height: 1;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.15s ease;
}

.gpgs-cal__prev:hover,
.gpgs-cal__next:hover,
.gpgs-cal__prev:focus-visible,
.gpgs-cal__next:focus-visible {
	background: rgba(255, 255, 255, 0.15);
	outline: none;
}

.gpgs-cal__grid {
	display: grid;
	grid-template-columns: repeat(7, 1fr);
	gap: 2px;
	padding: 14px 12px 8px;
}

.gpgs-cal__weekday {
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	color: var(--gpgs-muted);
	padding: 6px 0;
}

.gpgs-cal__day {
	position: relative;
	aspect-ratio: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--gpgs-text);
	border-radius: 50%;
}

.gpgs-cal__day--other {
	color: #c9d1e0;
	font-weight: 500;
}

.gpgs-cal__day--today {
	background: var(--gpgs-today);
	color: #ffffff;
}

.gpgs-cal__day--has-event {
	color: var(--gpgs-text);
}

.gpgs-cal__day--has-event.gpgs-cal__day--today {
	color: #ffffff;
}

.gpgs-cal__num {
	position: relative;
	z-index: 1;
}

.gpgs-cal__dot {
	position: absolute;
	bottom: 14%;
	left: 50%;
	transform: translateX(-50%);
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--gpgs-dot);
}

.gpgs-cal__day--today .gpgs-cal__dot {
	background: #ffffff;
}

.gpgs-cal__legend {
	display: flex;
	gap: 18px;
	padding: 6px 18px 16px;
	font-size: 13px;
	color: var(--gpgs-text);
}

.gpgs-cal__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.gpgs-cal__legend-dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--gpgs-dot);
	display: inline-block;
}

.gpgs-cal__legend-today {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--gpgs-today);
	display: inline-block;
}

/* Screen-reader helper (kompatibel mit WP-Default) */
.gpgs-schulkalender .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}
