/*
 * Abwesenheitshinweis auf der Website.
 *
 * Eigene kleine Datei: Sie lädt nur, wenn der Hinweis gerade aktiv ist, und
 * auf allen Seiten der Website ausser dem Portal. Farben kommen aus den
 * Impreza-Variablen der Website (Gold als Akzent, das dunkle Anthrazit der
 * Kopfzeile), jeweils mit Rückfallwert.
 *
 * Aufbau: abgedunkelter Hintergrund, darauf eine weisse Karte mit dunkler
 * Kopfleiste (Sprachwahl links, Schliessen rechts). Beide Sprachfassungen
 * stehen im Dokument, das Skript blendet eine ein.
 */

.dup-absence {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	font-family: var( --body-font-family, Urbanist, sans-serif );
	color: var( --color-content-text, #33353d );
	line-height: 1.55;
}

.dup-absence[hidden] {
	display: none;
}

.dup-absence__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 18, 19, 22, 0.66 );
	backdrop-filter: blur( 3px );
	-webkit-backdrop-filter: blur( 3px );
}

.dup-absence__card {
	position: relative;
	width: min( 940px, 100% );
	max-height: 92vh;
	overflow: auto;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 30px 90px rgba( 0, 0, 0, 0.4 );
	outline: none;
	animation: dup-absence-in 260ms cubic-bezier( 0.2, 0.7, 0.2, 1 ) both;
}

@keyframes dup-absence-in {
	from {
		opacity: 0;
		transform: translateY( 14px ) scale( 0.985 );
	}

	to {
		opacity: 1;
		transform: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.dup-absence__card {
		animation: none;
	}
}

/* ---------------------------------------------------------------------
 * Kopfleiste: dunkel wie die Kopfzeile der Website, mit goldener Kante.
 * ------------------------------------------------------------------ */

.dup-absence__head {
	position: sticky;
	top: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 14px 12px 18px;
	background: var( --color-header-middle-bg, #121316 );
	border-bottom: 3px solid var( --color-content-primary, #ecba20 );
}

.dup-absence__lang {
	display: inline-flex;
	padding: 3px;
	border-radius: 999px;
	background: rgba( 255, 255, 255, 0.08 );
}

.dup-absence__lang-btn {
	appearance: none;
	margin: 0;
	padding: 5px 13px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: rgba( 255, 255, 255, 0.7 );
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	cursor: pointer;
	transition: background 160ms ease, color 160ms ease;
}

.dup-absence__lang-btn[aria-pressed="true"] {
	background: var( --color-content-primary, #ecba20 );
	color: #121316;
}

.dup-absence__lang-btn:hover:not( [aria-pressed="true"] ) {
	color: #fff;
}

.dup-absence__lang-btn:focus-visible,
.dup-absence__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.dup-absence__close {
	appearance: none;
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba( 255, 255, 255, 0.08 );
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transition: background 160ms ease;
}

.dup-absence__close:hover {
	background: rgba( 255, 255, 255, 0.18 );
}

/* ---------------------------------------------------------------------
 * Inhalt
 * ------------------------------------------------------------------ */

/*
 * Zwei Spalten am Desktop: links Überschrift, Text und Knöpfe, rechts
 * Notfall und Vertretung. So geht das Fenster auf gängigen Bildschirmen
 * ohne Scrollen aus. Auf schmalen Schirmen lösen sich die Spalten auf
 * (display: contents), die Kinder ordnen sich untereinander an und die
 * Knöpfe wandern per order ans Ende.
 */
.dup-absence__body {
	display: flex;
	flex-direction: column;
	padding: 22px 28px 26px;
}

.dup-absence__body[hidden] {
	display: none;
}

.dup-absence__main,
.dup-absence__aside {
	display: contents;
}

.dup-absence__actions {
	order: 10;
}

@media ( min-width: 861px ) {
	.dup-absence__body {
		display: grid;
		grid-template-columns: minmax( 0, 1.1fr ) minmax( 0, 1fr );
		gap: 0 36px;
		align-items: start;
	}

	.dup-absence__main,
	.dup-absence__aside {
		display: block;
		min-width: 0;
	}

	.dup-absence__aside {
		display: flex;
		flex-direction: column;
		gap: 16px;
		padding-top: 4px;
	}

	.dup-absence__aside .dup-absence__emergency {
		margin: 0;
	}

	.dup-absence__aside .dup-absence__cover {
		margin: 0;
		padding: 0;
		border-top: 0;
	}

	/* Rechts stehen die Vertretungen untereinander - nebeneinander wären
	 * sie in der halben Breite zu eng. */
	.dup-absence__cover-list {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.dup-absence__person {
		padding: 12px 14px;
	}

	.dup-absence__actions {
		margin-top: 22px;
	}
}

.dup-absence__eyebrow {
	margin: 0 0 6px;
	color: var( --color-content-faded, #999 );
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.dup-absence__title {
	margin: 0 0 12px;
	color: var( --color-content-heading, #121316 );
	font-family: var( --h1-font-family, inherit );
	font-size: clamp( 23px, 2.4vw, 28px );
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.dup-absence__period {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 18px;
	padding: 7px 14px 7px 12px;
	border-radius: 999px;
	background: var( --color-content-primary-faded, rgba( 236, 186, 32, 0.15 ) );
	color: var( --color-content-heading, #121316 );
	font-size: 15px;
	font-weight: 600;
}

.dup-absence__icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
}

.dup-absence__period .dup-absence__icon {
	color: #b58e12;
}

.dup-absence__text p {
	margin: 0 0 10px;
	font-size: 15.5px;
}

.dup-absence__text p:last-child {
	margin-bottom: 0;
}

/* Notfall: ruhig hervorgehoben - warmer Grund, kräftige linke Kante, kein
 * Alarmrot. Der Hinweis soll auffallen, nicht erschrecken. */
.dup-absence__emergency {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin: 20px 0 0;
	padding: 14px 16px;
	border-left: 4px solid var( --color-content-primary, #ecba20 );
	border-radius: 0 12px 12px 0;
	background: #fdf6e3;
	color: var( --color-content-heading, #121316 );
}

.dup-absence__emergency .dup-absence__icon {
	margin-top: 2px;
	color: #b58e12;
}

.dup-absence__emergency p {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
}

.dup-absence__cover {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var( --color-content-border, #e8e8e8 );
}

.dup-absence__subtitle {
	margin: 0 0 6px;
	color: var( --color-content-heading, #121316 );
	font-family: var( --h1-font-family, inherit );
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
}

.dup-absence__cover-intro {
	margin: 0 0 14px;
	font-size: 15px;
}

.dup-absence__cover-list {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 220px, 1fr ) );
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dup-absence__person {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	padding: 14px 16px;
	border: 1px solid var( --color-content-border, #e8e8e8 );
	border-radius: 12px;
	background: var( --color-content-bg-alt, #f5f5f5 );
	font-size: 15px;
}

.dup-absence__person-name {
	color: var( --color-content-heading, #121316 );
	font-weight: 700;
}

.dup-absence__person-address {
	color: var( --color-content-faded, #999 );
	font-size: 13.5px;
	margin-bottom: 4px;
}

.dup-absence__person-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var( --color-content-heading, #121316 );
	text-decoration: none;
	word-break: break-word;
}

.dup-absence__person-link .dup-absence__icon {
	width: 16px;
	height: 16px;
	color: #b58e12;
}

.dup-absence__person-link:hover span,
.dup-absence__person-link:focus-visible span {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.dup-absence__person-link:focus-visible {
	outline: 2px solid var( --color-content-heading, #121316 );
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------------------------------------------------------------------
 * Knöpfe: Pillenform wie die Knöpfe der Website (Impreza-Stil 1).
 * ------------------------------------------------------------------ */

.dup-absence__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 24px;
}

.dup-absence__btn,
.dup-absence__btn:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	padding: 10px 22px;
	border-radius: 999px;
	border: 1px solid transparent;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.dup-absence__btn--primary,
.dup-absence__btn--primary:visited {
	background: var( --color-content-primary, #ecba20 );
	color: #121316 !important;
}

.dup-absence__btn--primary:hover,
.dup-absence__btn--primary:focus-visible {
	background: var( --color-content-secondary, #ebc654 );
	box-shadow: 0 8px 24px rgba( 236, 186, 32, 0.35 );
}

.dup-absence__btn--secondary,
.dup-absence__btn--secondary:visited {
	background: transparent;
	border-color: #c9cacf;
	color: var( --color-content-heading, #121316 ) !important;
}

.dup-absence__btn--secondary:hover,
.dup-absence__btn--secondary:focus-visible {
	border-color: var( --color-content-heading, #121316 );
	background: var( --color-content-bg-alt, #f5f5f5 );
}

.dup-absence__btn:focus-visible {
	outline: 2px solid var( --color-content-heading, #121316 );
	outline-offset: 3px;
}

/* Hinter dem Fenster nicht scrollen. */
body.dup-absence-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------------
 * Telefon: Karte füllt den Schirm von unten, Inhalt scrollt.
 * ------------------------------------------------------------------ */

@media ( max-width: 560px ) {
	.dup-absence {
		padding: 0;
		align-items: flex-end;
	}

	.dup-absence__card {
		width: 100%;
		max-height: 94vh;
		max-height: 94dvh;
		border-radius: 18px 18px 0 0;
	}

	@keyframes dup-absence-in {
		from {
			opacity: 0;
			transform: translateY( 28px );
		}

		to {
			opacity: 1;
			transform: none;
		}
	}

	.dup-absence__body {
		padding: 20px 20px 28px;
	}

	.dup-absence__title {
		font-size: 23px;
	}

	.dup-absence__actions {
		flex-direction: column;
	}

	.dup-absence__btn {
		width: 100%;
	}
}
