/**
 * Portal & Boxen – Maggan22
 *
 * Anpassen im eigenen Style, z. B.:
 *   :root { --mportal-akzent: #7a3e9d; --mportal-radius: 10px; }
 */
:where(:root) {
	--mportal-akzent: #105289;
	--mportal-radius: 7px;
	--mportal-bildtext-bg: linear-gradient(to top, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
	--mportal-bildtext-farbe: #fff;
}

/* ---------- Zeilen: Boxen nebeneinander (12er-Raster) ---------- */
.mportal-zeile {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: var(--mportal-abstand, 10px);
	margin-bottom: var(--mportal-abstand, 10px);
	align-items: start;
}
.mportal-zeile > * { grid-column: span 12; margin: 0; min-width: 0; }
.mportal-zeile > .mportal-b9 { grid-column: span 9; }
.mportal-zeile > .mportal-b8 { grid-column: span 8; }
.mportal-zeile > .mportal-b6 { grid-column: span 6; }
.mportal-zeile > .mportal-b4 { grid-column: span 4; }
.mportal-zeile > .mportal-b3 { grid-column: span 3; }

.mportal-pos-kopf, .mportal-pos-fuss { margin-top: var(--mportal-abstand, 10px); }
.mportal-pos-fuss { margin-bottom: 0; }

/* ---------- Hero ---------- */
.mportal-hero { margin: var(--mportal-abstand, 10px) 0; }
.mportal-hero > * + * { margin-top: var(--mportal-abstand, 10px); }

/* ---------- Seitenspalten ---------- */
.mportal-raster {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas: "inhalt";
	gap: var(--mportal-abstand, 10px);
	align-items: start;
}
.mportal-raster.mportal-mit-links { grid-template-columns: var(--mportal-links) minmax(0, 1fr); grid-template-areas: "links inhalt"; }
.mportal-raster.mportal-mit-rechts { grid-template-columns: minmax(0, 1fr) var(--mportal-rechts); grid-template-areas: "inhalt rechts"; }
.mportal-raster.mportal-mit-links.mportal-mit-rechts { grid-template-columns: var(--mportal-links) minmax(0, 1fr) var(--mportal-rechts); grid-template-areas: "links inhalt rechts"; }
.mportal-inhalt { grid-area: inhalt; min-width: 0; }
.mportal-links { grid-area: links; min-width: 0; }
.mportal-rechts { grid-area: rechts; min-width: 0; }
.mportal-spalte > * { margin-top: 0; margin-bottom: var(--mportal-abstand, 10px); }

/* ---------- Box-Rahmen ---------- */
.mportal-box.forabg { margin-bottom: 0; }
.mportal-spalte > .mportal-box.forabg { margin-bottom: var(--mportal-abstand, 10px); }
.mportal-box ul.topiclist dt,
.mportal-box ul.topiclist dt .list-inner { margin-right: 0; width: auto; }
.mportal-box ul.topiclist li.header dt { width: 100%; }
.mportal-box .mportal-kopf { padding-left: 5px; font-weight: bold; }
.mportal-box-inhalt {
	padding: 8px 10px;
	border-radius: 0 0 var(--mportal-radius) var(--mportal-radius);
	overflow-wrap: anywhere;
}
.mportal-box.panel { margin-bottom: 0; }
.mportal-spalte > .mportal-box.panel { margin-bottom: var(--mportal-abstand, 10px); }
.mportal-titel { margin: 0 0 6px; font-size: 1.1em; border-bottom: 0; padding-bottom: 0; }
.mportal-stil-ohne { min-width: 0; }
.mportal-box p { margin: 0 0 .5em; }
.mportal-box p:last-child { margin-bottom: 0; }
.mportal-seitentitel { margin-top: 0; }

.mportal-klein { font-size: .9em; opacity: .8; }
.mportal-liste { list-style: none; margin: 0; padding: 0; }
.mportal-liste > li { padding: 5px 0; border-bottom: 1px solid rgba(128, 128, 128, .2); }
.mportal-liste > li:last-child { border-bottom: 0; }
.mportal-liste-titel { display: block; font-weight: bold; }
.mportal-kompakt > li { padding: 3px 0; }

/* Text-Box */
.mportal-text img { max-width: 100%; height: auto; }

/* News */
.mportal-news + .mportal-news { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(128, 128, 128, .25); }
.mportal-news h3 { margin: 0 0 2px; border: 0; padding: 0; font-size: 1.2em; text-transform: none; font-family: inherit; }
.mportal-news-text { margin: 6px 0; }
.mportal-news-fuss { display: flex; gap: 12px; flex-wrap: wrap; }

/* Statistik */
.mportal-statistik { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin: 0 0 6px; }
.mportal-statistik dt { font-weight: normal; }
.mportal-statistik dd { margin: 0; font-weight: bold; text-align: right; }

/* Benutzermenü */
.mportal-benutzer { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mportal-avatar img { max-width: 56px; max-height: 56px; width: auto; height: auto; border-radius: 50%; }
.mportal-benutzer-name { font-weight: bold; font-size: 1.1em; }
.mportal-login label { display: block; margin-top: 4px; }
.mportal-login .inputbox { width: 100%; box-sizing: border-box; }
.mportal-login .button1 { margin: 8px 0 6px; }

/* Suche */
.mportal-suche { display: flex; gap: 4px; margin-bottom: 4px; }
.mportal-suche .inputbox { flex: 1; min-width: 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Countdown */
.mportal-countdown { text-align: center; }
.mportal-countdown-zahlen { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.mportal-countdown-zahlen span { display: flex; flex-direction: column; min-width: 3.2em; }
.mportal-countdown-zahlen b { font-size: 1.8em; line-height: 1.1; color: var(--mportal-akzent); font-variant-numeric: tabular-nums; }
.mportal-countdown-zahlen small { font-size: .8em; opacity: .75; }
.mportal-countdown-danach { font-size: 1.2em; font-weight: bold; }

/* ---------- Bilder, Slideshow, Banner ---------- */
.mportal-bilder { position: relative; overflow: hidden; }
.mportal-bilder.mportal-rund { border-radius: var(--mportal-radius); }
.mportal-bilder-buehne {
	position: relative;
	aspect-ratio: var(--mportal-verhaeltnis, auto);
}
.mportal-feste-hoehe .mportal-bilder-buehne { height: var(--mportal-hoehe); }
.mportal-bild { margin: 0; position: relative; height: 100%; }
.mportal-bild > a { display: block; height: 100%; }
.mportal-bild img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: var(--mportal-anpassung, cover);
}

/* Bildtext */
.mportal-bild figcaption {
	position: absolute;
	left: 0; right: 0;
	padding: 18px 16px 12px;
	color: var(--mportal-bildtext-farbe);
	background: var(--mportal-bildtext-bg);
	font-size: 1.15em;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.mportal-text-unten figcaption { bottom: 0; }
.mportal-text-oben figcaption { top: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, .65), rgba(0, 0, 0, 0)); padding: 12px 16px 18px; }
.mportal-text-mitte figcaption { top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, .35); text-align: center; font-size: 1.6em; }

/* „Einpassen“: Bild nicht beschneiden, Text unter das Bild statt darüber */
.mportal-anp-contain .mportal-bild,
.mportal-anp-contain .mportal-bild > a { display: flex; flex-direction: column; }
.mportal-anp-contain .mportal-bild img { flex: 1 1 auto; min-height: 0; }
.mportal-anp-contain .mportal-bild figcaption {
	position: static;
	transform: none;
	padding: 4px 0 0;
	background: none;
	color: inherit;
	text-shadow: none;
	font-size: 1em;
	text-align: center;
}

/* Banner nebeneinander */
.mportal-art-reihe .mportal-bilder-buehne {
	display: grid;
	grid-template-columns: repeat(var(--mportal-spalten, 2), minmax(0, 1fr));
	gap: var(--mportal-abstand, 10px);
	aspect-ratio: auto;
	height: auto;
}
.mportal-art-reihe .mportal-bild { aspect-ratio: var(--mportal-verhaeltnis, auto); }
.mportal-feste-hoehe.mportal-art-reihe .mportal-bild { height: var(--mportal-hoehe); aspect-ratio: auto; }

/* Slideshow */
.mportal-art-slideshow .mportal-bild {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity .8s ease, transform .7s ease, visibility 0s linear .8s;
}
.mportal-art-slideshow .mportal-bild.aktiv { opacity: 1; visibility: visible; transition: opacity .8s ease, transform .7s ease; }
.mportal-art-slideshow.mportal-effekt-schieben .mportal-bild { opacity: 1; transform: translateX(100%); }
.mportal-art-slideshow.mportal-effekt-schieben .mportal-bild.vorher { transform: translateX(-100%); }
.mportal-art-slideshow.mportal-effekt-schieben .mportal-bild.aktiv { transform: translateX(0); }
.mportal-art-slideshow.mportal-effekt-schieben .mportal-bild.raus { visibility: visible; }

.mportal-pfeil {
	position: absolute; top: 50%; transform: translateY(-50%);
	width: 38px; height: 38px; border: 0; border-radius: 50%;
	background: rgba(0, 0, 0, .35); color: #fff; cursor: pointer;
	opacity: .55; transition: opacity .2s; z-index: 2;
}
.mportal-bilder:hover .mportal-pfeil, .mportal-pfeil:focus-visible { opacity: 1; }
.mportal-zurueck { left: 10px; }
.mportal-weiter { right: 10px; }
.mportal-punkte { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.mportal-punkte button {
	width: 10px; height: 10px; padding: 0; border-radius: 50%; cursor: pointer;
	border: 1px solid rgba(255, 255, 255, .9); background: rgba(255, 255, 255, .3);
}
.mportal-punkte button.aktiv { background: #fff; }
.mportal-text-unten .mportal-punkte { bottom: auto; top: 8px; }

@media (prefers-reduced-motion: reduce) {
	.mportal-art-slideshow .mportal-bild { transition: none; }
}

/* ---------- Geräte ---------- */
@media (max-width: 700px) {
	.mportal-nur-gross { display: none !important; }
}
@media (min-width: 701px) {
	.mportal-nur-klein { display: none !important; }
}

/* ---------- Kleinere Bildschirme ---------- */
@media (max-width: 1000px) {
	.mportal-zeile > .mportal-b3 { grid-column: span 6; }
	.mportal-raster.mportal-mit-links.mportal-mit-rechts {
		grid-template-columns: minmax(0, 1fr) var(--mportal-rechts);
		grid-template-areas: "inhalt rechts" "links rechts";
	}
}
@media (max-width: 800px) {
	.mportal-zeile > * { grid-column: span 12 !important; }
	.mportal-raster,
	.mportal-raster.mportal-mit-links,
	.mportal-raster.mportal-mit-rechts,
	.mportal-raster.mportal-mit-links.mportal-mit-rechts {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "inhalt" "links" "rechts";
	}
	/* feste Höhen auf dem Handy begrenzen, damit Banner nicht zu hohen Streifen werden */
	.mportal-feste-hoehe:not(.mportal-art-reihe) .mportal-bilder-buehne { height: min(var(--mportal-hoehe), 60vw); }
	.mportal-art-reihe .mportal-bilder-buehne { grid-template-columns: minmax(0, 1fr); }
	.mportal-text-mitte figcaption { font-size: 1.2em; }
}
