/*
Theme Name: DRK Waghäusel
Theme URI: https://drk-waghaeusel.de
Author: Felix / Claude
Description: Schlankes Block-Theme für den DRK-Ortsverein Waghäusel e.V. Design wird zentral in theme.json gepflegt.
Version: 0.7.4
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: drk-waghaeusel
*/

/* Nur was theme.json nicht abdeckt. Farben immer über Presets. */

/* Kopfbereich */
.drk-topbar a { text-decoration: none; font-weight: 400; }
.drk-topbar a:hover { text-decoration: underline; color: inherit; }
.drk-topbar-social { margin-left: auto; }
.drk-topbar .drk-topbar-text { margin: 0; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.01em; }
/* Inhalte der Topbar immer senkrecht mittig, unabhängig von Block-Abständen */
.drk-topbar > .alignwide { align-items: center !important; }
.drk-topbar > .alignwide > * { margin-block: 0 !important; }
.drk-topbar-social { align-self: center; padding: 0 !important; }
.drk-topbar-social .wp-social-link { margin: 0 !important; }
/* Social-Icons: weiße Kreise, Größe je Bereich */
.drk-topbar-social { gap: 0.5rem !important; }
.drk-topbar-social .wp-social-link { font-size: 18px; }
.drk-fuss-social { gap: 0.6rem !important; }
.drk-fuss-social .wp-social-link { font-size: 22px; }
:is(.drk-topbar-social, .drk-fuss-social) .wp-social-link { transition: transform 0.15s ease; }
:is(.drk-topbar-social, .drk-fuss-social) .wp-social-link:hover { transform: scale(1.1); }
:is(.drk-topbar-social, .drk-fuss-social) .wp-social-link a:focus-visible { outline: 2px solid var(--wp--preset--color--weiss); outline-offset: 2px; border-radius: 50%; }
.drk-kopf { box-shadow: 0 2px 6px rgb(0 0 0 / 8%); position: relative; z-index: 10; }
.drk-logo:not(.drk-absender) img { display: block; height: auto; }
.wp-block-navigation .wp-block-navigation__submenu-container {
	border: 0 !important;
	box-shadow: 0 6px 16px rgb(0 0 0 / 12%);
	text-transform: none;
	letter-spacing: 0;
	font-weight: 400;
}
.wp-block-navigation .current-menu-item > a,
.wp-block-navigation .current-menu-ancestor > a {
	box-shadow: inset 0 -2px 0 var(--wp--preset--color--rot);
}

/* Überschrift mit roter Linie (Block-Stil „Mit roter Linie“) */
.is-style-drk-linie::after {
	content: "";
	display: block;
	width: 4rem;
	height: 2px;
	margin-top: 0.75rem;
	background: var(--wp--preset--color--rot);
}
.is-style-drk-linie.has-text-align-center::after { margin-inline: auto; }

/* Zeile mit Piktogramm links und Text rechts */
.drk-icon-zeile { align-items: flex-start !important; }
.drk-icon-zeile > .wp-block-image { flex: 0 0 auto; margin: 0; }
.drk-icon-zeile > .wp-block-group { flex: 1 1 0; min-width: 0; }
.drk-icon-zeile h3, .drk-icon-zeile h4, .drk-icon-zeile h5 { margin-top: 0.15rem; margin-bottom: 0.25rem; }
.drk-icon-zeile p { margin-top: 0; }

/* Ablauf in Schritten */
.drk-schritt-nummer {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3.5rem;
	height: 3.5rem;
	margin: 0 auto 0.75rem;
	border: 2px solid var(--wp--preset--color--rot);
	border-radius: 50%;
	color: var(--wp--preset--color--rot);
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1;
}

/* Bild mit versetztem Rahmen (Block-Stil „Versetzter Rahmen“) */
.wp-block-image.is-style-drk-rahmen { position: relative; isolation: isolate; margin: 0 1.5rem 1.5rem 0; }
.wp-block-image.is-style-drk-rahmen::before {
	content: "";
	position: absolute;
	inset: 1.5rem -1.5rem -1.5rem 1.5rem;
	z-index: -1;
	border: 3px solid var(--wp--preset--color--dunkelblau);
}
.wp-block-image.is-style-drk-rahmen img { box-shadow: 0 10px 30px rgb(0 0 0 / 20%); }

/* Logos und Partnerbilder: nie beschneiden, weißer Grund für das Rote Kreuz */
.drk-logo-raster img { object-fit: contain; background: #fff; }
/* Logo-Reihen (z. B. JRK, DRK, SSD): halbe Spaltenbreite, mittig */
.drk-logo-raster .wp-block-image img { display: block; width: 50%; height: auto; margin-inline: auto; }
.drk-fuss-logo:not(.drk-absender) img { background: #fff; padding: 0.5rem; }

@media (max-width: 781px) {
	.wp-block-image.is-style-drk-rahmen { margin-right: 0.75rem; }
	.wp-block-image.is-style-drk-rahmen::before { inset: 0.75rem -0.75rem -0.75rem 0.75rem; }
}

/* Dunkle Abschnitte (Dunkelblau): Überschriften und Links weiß */
.has-dunkelblau-background-color :is(h1, h2, h3, h4, h5, h6),
.wp-block-cover :is(h1, h2, h3, h4, h5, h6) { color: var(--wp--preset--color--weiss); }
.has-dunkelblau-background-color a:not(.wp-element-button),
.wp-block-cover a:not(.wp-element-button) { color: var(--wp--preset--color--weiss); }

/* Aufzählungszeile ohne Piktogramm: roter Doppelpfeil wie auf der Bestandsseite */
.drk-pfeil::before {
	content: "»";
	flex: 0 0 auto;
	color: var(--wp--preset--color--rot);
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1;
}

/* Platzhalter für noch offene Einbindungen (nur Testphase) */
.drk-platzhalter {
	padding: 0.75rem 1rem;
	border: 2px dashed var(--wp--preset--color--rot);
	background: var(--wp--preset--color--hellgrau);
	color: var(--wp--preset--color--dunkelgrau);
	font-weight: 500;
}

/* Formulare (Contact Form 7) – einheitlich für alle Formulare */
.wpcf7 label { display: block; margin-bottom: 1rem; font-weight: 400; }
.wpcf7 :is(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="date"], select, textarea) {
	display: block;
	box-sizing: border-box;
	width: 100%;
	margin-top: 0.3rem;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--wp--preset--color--mittelgrau);
	border-radius: 2px;
	background: var(--wp--preset--color--weiss);
	color: var(--wp--preset--color--dunkelgrau);
	font: inherit;
	font-weight: 400;
}
.wpcf7 textarea { min-height: 8rem; }
.wpcf7 :is(input, select, textarea):focus-visible {
	outline: 3px solid var(--wp--preset--color--dunkelblau);
	outline-offset: 1px;
}
.wpcf7 input[type="submit"] {
	padding: 0.95em 2.2em;
	border: 0;
	border-radius: 2px;
	background: var(--wp--preset--color--rot);
	color: var(--wp--preset--color--weiss);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover:enabled { background: var(--wp--preset--color--dunkelrot); }
.wpcf7 input[type="submit"]:disabled { background: var(--wp--preset--color--mittelgrau); cursor: not-allowed; }
.drk-form-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0 1.25rem; }
.drk-form-spalte--voll { grid-column: 1 / -1; }
.drk-formular h3 {
	margin: 2.4em 0 1.2em;
	padding: 0.55em 0.9em;
	border-left: 5px solid var(--wp--preset--color--rot);
	background: var(--wp--preset--color--hellblau);
	color: var(--wp--preset--color--dunkelblau);
	font-size: 1.1rem;
}
.drk-formular h4 {
	margin: 1.7em 0 0.8em;
	padding-bottom: 0.3em;
	border-bottom: 1px solid var(--wp--preset--color--mittelgrau);
	color: var(--wp--preset--color--dunkelblau);
	font-size: 1rem;
}
.drk-form-hinweis { font-style: italic; }
.drk-form-ssl { font-size: 0.9rem; }
/* Auswahl- und Zustimmungsfelder: eine Option je Zeile, Text neben dem Kästchen */
.wpcf7 :is(.wpcf7-checkbox, .wpcf7-acceptance) .wpcf7-list-item { display: block; margin: 0 0 0.5em; }
.wpcf7 :is(.wpcf7-checkbox, .wpcf7-acceptance) .wpcf7-list-item > label { display: flex; align-items: flex-start; gap: 0.6em; margin: 0; }
.wpcf7 :is(.wpcf7-checkbox, .wpcf7-acceptance) input[type="checkbox"] { flex: 0 0 auto; margin-top: 0.35em; }
.wpcf7 .wpcf7-list-item-label { margin: 0; }
@media (max-width: 480px) {
	.wpcf7 input[type="submit"] { width: 100%; }
}

/* Fußbereich: Logo links, Menü mittig, Social-Icons rechts */
.drk-fuss-raster {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1.5rem;
}
.drk-fuss-raster > * { margin-block: 0 !important; }
.drk-fuss-raster > .drk-fuss-logo { grid-column: 1; justify-self: start; }
.drk-fuss-raster > .drk-fuss-menue { grid-column: 2; justify-self: center; }
.drk-fuss-raster > .drk-fuss-social { grid-column: 3; justify-self: end; }
.drk-fuss-menue { font-size: var(--wp--preset--font-size--klein); text-transform: none; letter-spacing: 0; }
.drk-fuss-menue a { color: var(--wp--preset--color--weiss) !important; }
.drk-fuss-menue a:hover { text-decoration: underline; }
@media (max-width: 781px) {
	.drk-fuss-raster { grid-template-columns: 1fr; justify-items: center; text-align: center; }
	.drk-fuss-raster > .drk-fuss-logo,
	.drk-fuss-raster > .drk-fuss-menue,
	.drk-fuss-raster > .drk-fuss-social { grid-column: 1; justify-self: center; }
}

/*
 * Logo nach DRK-Logosystematik (Verbände, Querformat), alle Maße relativ zur Logohöhe --h (= 15 mm):
 * Abstand 5 mm = h/3 · Strich 1 pt = 0,3528 mm · Schrift 14 pt = 4,939 mm · Zeilenabstand 16 pt = 5,644 mm.
 */
.drk-absender {
	--h: 48px;
	display: inline-flex;
	align-items: flex-start;
	gap: calc(var(--h) / 3);
	color: #000 !important;
	text-decoration: none !important;
	line-height: 1;
}
.drk-absender__logo { display: block; width: auto; height: var(--h); }
.drk-absender__strich {
	flex: 0 0 auto;
	width: max(1px, calc(var(--h) * 0.3528 / 15));
	height: var(--h);
	background: #000;
}
.drk-absender__text {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-weight: 400;
	font-size: calc(var(--h) * 4.939 / 15);
	line-height: calc(var(--h) * 5.644 / 15);
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	/* Oberkante der Großbuchstaben bündig mit der Logo-Oberkante (Arial-Metrik) */
	margin-top: -0.2em;
}
@supports (text-box: trim-start cap alphabetic) {
	.drk-absender__text { margin-top: 0; text-box: trim-start cap alphabetic; }
}
/* Fußbereich: Rotes Kreuz immer auf Weiß, Schutzzone = Balkenbreite (h/3) */
.drk-fuss-logo.drk-absender { --h: 40px; padding: calc(var(--h) / 3); background: #fff; }
@media (max-width: 600px) {
	.drk-logo.drk-absender { --h: 36px; }
}

/* Social-Icons: Kreis mit fester Größe, Symbol exakt mittig (unabhängig von Browser-Standardabständen) */
:is(.drk-topbar-social, .drk-fuss-social) .wp-social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.5em;
	height: 1.5em;
	padding: 0;
	line-height: 0;
	border-radius: 50%;
}
:is(.drk-topbar-social, .drk-fuss-social) .wp-social-link a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0 !important;
	line-height: 0;
}
:is(.drk-topbar-social, .drk-fuss-social) .wp-social-link svg {
	display: block;
	flex: none;
	width: 0.95em;
	height: 0.95em;
	margin: 0;
}

/* Ganzzahlige Pixelmaße, damit Kreis und Symbol nicht auf halbe Pixel fallen (sonst wirkt das Symbol verschoben) */
.drk-topbar-social .wp-social-link { width: 28px; height: 28px; font-size: 18px; }
.drk-topbar-social .wp-social-link svg { width: 18px; height: 18px; }
.drk-fuss-social .wp-social-link { width: 34px; height: 34px; font-size: 22px; }
.drk-fuss-social .wp-social-link svg { width: 22px; height: 22px; }
.drk-topbar .drk-topbar-text { line-height: 28px; }
