/* --------------------------------------------------------------------------
   Schulverein GaW – Ergänzungen, die theme.json nicht abbilden kann.
   Alles Gestalterische, das dort möglich ist, gehört auch dorthin.
   -------------------------------------------------------------------------- */

/* Sichtbarer Fokus im gesamten Frontend – Pflicht für Tastaturbedienung. */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* "Zum Inhalt springen" erst bei Tastaturfokus einblenden. */
.sgaw-skip-link {
	position: absolute;
	left: -9999px;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	text-decoration: none;
	border-radius: 0 0 6px 0;
}
.sgaw-skip-link:focus {
	left: 0;
	top: 0;
}

/* ---------- Kopfbereich ---------------------------------------------------- */

.sgaw-header {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* Logo und Schriftzug bilden zusammen die Marke. */
.sgaw-marke {
	gap: 0.9rem;
}
.sgaw-logo {
	display: block;
	flex: 0 0 auto;
	line-height: 0;
}
.sgaw-logo svg {
	display: block;
	width: 60px;
	height: 60px;
	border-radius: 4px;
}
@media (max-width: 480px) {
	.sgaw-logo svg {
		width: 46px;
		height: 46px;
	}
}

/* Wortmarke im Duktus des Schullogos: Trennstriche in Orange. */
.sgaw-wordmark a,
.sgaw-wordmark {
	text-decoration: none;
	font-family: var(--wp--preset--font-family--serif);
	line-height: 1.15;
	color: var(--wp--preset--color--contrast);
}
.sgaw-wordmark .sgaw-wordmark__rule {
	color: var(--wp--preset--color--accent);
	font-weight: 400;
	padding-inline: 0.3em;
}

/* Navigation: Unterstreichung wächst beim Hover, statt Farbwechsel-Geflacker. */
.sgaw-nav .wp-block-navigation-item__content {
	text-decoration: none;
	padding-block: 0.35rem;
	border-bottom: 2px solid transparent;
	transition: border-color var(--wp--custom--transition--base);
}
.sgaw-nav .wp-block-navigation-item__content:hover,
.sgaw-nav .wp-block-navigation-item__content:focus-visible {
	border-bottom-color: var(--wp--preset--color--accent);
}
.sgaw-nav .current-menu-item > .wp-block-navigation-item__content {
	border-bottom-color: var(--wp--preset--color--primary);
	font-weight: 600;
}

/* Untermenüs abheben, damit sie nicht im Seiteninhalt verschwimmen. */
.sgaw-nav .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--border);
	box-shadow: var(--wp--preset--shadow--card);
	border-radius: 8px;
	padding-block: 0.4rem;
}

/* ---------- Startseite ----------------------------------------------------- */

/* Aufmacher: Sandfläche mit feinem Orange-Verlauf am oberen Rand. */
.sgaw-hero {
	position: relative;
	overflow: hidden;
}
.sgaw-hero::before {
	content: "";
	position: absolute;
	inset-inline: 0;
	top: 0;
	height: 4px;
	background: linear-gradient(90deg,
		var(--wp--preset--color--accent) 0%,
		var(--wp--preset--color--primary) 60%,
		var(--wp--preset--color--accent) 100%);
}

/* Der Aufmacher nutzt die breite Spalte, der Text bleibt auf Lesebreite. */
/* Der Aufmacher nutzt die breite Spalte, der Text bleibt auf Lesebreite.
   Die Hülle bleibt absichtlich unbegrenzt: Das constrained-Layout zentriert
   begrenzte Kinder mit margin:auto !important. Begrenzt wird deshalb erst eine
   Ebene tiefer, im Fluss-Layout der Hülle, wo diese Regel nicht greift. */
.sgaw-hero .sgaw-hero__text > * {
	max-width: 38rem;
}

/* Faktenleiste: Zahlen groß, Beschriftung ruhig darunter. */
.sgaw-fact__value {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1;
	color: var(--wp--preset--color--primary);
}
.sgaw-fact__label {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast-soft);
}

/* Block-Stil "Karte" – im Editor unter Gruppe > Stile auswählbar. */
.is-style-sgaw-card {
	height: 100%;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	background: var(--wp--preset--color--base);
	transition: box-shadow var(--wp--custom--transition--base),
	            transform var(--wp--custom--transition--base);
}
.is-style-sgaw-card:hover {
	box-shadow: var(--wp--preset--shadow--raised);
	transform: translateY(-2px);
}
/* Bilder sitzen bündig an der oberen Kartenkante. */
.is-style-sgaw-card > figure:first-child img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

/* Block-Stil "Umrandet" für Buttons – zweite Priorität neben dem vollen Button. */
.wp-block-button.is-style-sgaw-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--primary);
	box-shadow: inset 0 0 0 2px currentColor;
}
.wp-block-button.is-style-sgaw-outline .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	box-shadow: none;
}

/* Block-Stil "Mit Häkchen" für Listen. */
.wp-block-list.is-style-sgaw-checks {
	list-style: none;
	padding-left: 0;
}
.wp-block-list.is-style-sgaw-checks > li {
	padding-left: 1.9em;
	position: relative;
	margin-block: 0.5em;
}
.wp-block-list.is-style-sgaw-checks > li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.42em;
	width: 1.1em;
	height: 0.55em;
	border-left: 2.5px solid var(--wp--preset--color--primary);
	border-bottom: 2.5px solid var(--wp--preset--color--primary);
	transform: rotate(-45deg);
}
@media (prefers-reduced-motion: reduce) {
	.is-style-sgaw-card,
	.sgaw-nav .wp-block-navigation-item__content {
		transition: none;
	}
	.is-style-sgaw-card:hover {
		transform: none;
	}
}

/* ---------- Beitragslisten ------------------------------------------------- */

.sgaw-postlist .wp-block-post-title a {
	text-decoration: none;
	/* In Listen tragen die Titel die Linkfunktion – Orange wäre hier zu laut. */
	color: var(--wp--preset--color--contrast);
}
.sgaw-postlist .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Beiträge ohne Titel gibt es im Bestand – Platzhalter statt Leerzeile. */
.sgaw-postlist .wp-block-post-title:empty::after {
	content: "Ohne Titel";
	color: var(--wp--preset--color--contrast-soft);
	font-style: italic;
}

/* ---------- Inhalte aus der Altseite --------------------------------------- */

/* Importierte Beiträge bringen Inline-Styles und Tabellenlayouts mit.
   Diese Regeln fangen die häufigsten Fälle ab, ohne die Inhalte anzufassen. */
.sgaw-content img {
	height: auto;
	max-width: 100%;
	border-radius: 6px;
}
.sgaw-content table {
	display: block;
	overflow-x: auto;
	max-width: 100%;
}
.sgaw-content :is(h1, h2, h3, h4, h5, h6) {
	margin-block-start: var(--wp--preset--spacing--50);
}

/* ---------- Fußbereich ----------------------------------------------------- */

.sgaw-footer a {
	color: inherit;
	text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
	text-underline-offset: 3px;
}
.sgaw-footer a:hover {
	text-decoration-color: currentColor;
}

/* ---------- Druck ---------------------------------------------------------- */

@media print {
	.sgaw-header,
	.sgaw-footer,
	.sgaw-skip-link,
	.wp-block-post-navigation-link {
		display: none !important;
	}
	.sgaw-content a::after {
		content: " (" attr(href) ")";
		font-size: 0.8em;
		word-break: break-all;
	}
}
