/*
Theme Name: Heilig Kreuz
Description: Schlankes Block-Theme für den Förderverein Heilig Kreuz, Volksdorf e.V. Farben und Schrift nach dem Flyer.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: heilig-kreuz
*/

/* ---------- Grundlagen ---------- */

html { scroll-behavior: smooth; }
body { -webkit-font-smoothing: antialiased; }

:where(.wp-site-blocks) > main { min-height: 50vh; }
.wp-site-blocks > main { margin-block-start: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 3px solid var(--wp--preset--color--klinker-hell);
	outline-offset: 2px;
}

.wp-element-caption,
figcaption {
	color: var(--wp--preset--color--grau-dunkel);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 300;
	margin-top: 0.4em;
}

/* ---------- Kopfzeile ---------- */

.hk-header {
	border-bottom: 3px solid var(--wp--preset--color--klinker-hell);
	position: relative;
	z-index: 10;
}
.hk-marke { gap: 0.75rem; min-width: 0; }
.hk-marke .hk-logo { flex-shrink: 0; margin: 0; }
.hk-marke .hk-logo img { width: 110px; height: auto; display: block; }
.hk-marke .wp-block-site-title {
	min-width: 9rem;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.15;
	max-width: 12.5rem;
}
.hk-marke .wp-block-site-title a { color: var(--wp--preset--color--klinker-dunkel); text-decoration: none; }

.hk-header .wp-block-navigation { font-size: 1.05rem; font-weight: 700; }
.hk-header .wp-block-navigation-item__content { color: var(--wp--preset--color--klinker-dunkel); text-decoration: none; padding: 0.25em 0; border-bottom: 2px solid transparent; }
.hk-header .wp-block-navigation-item__content:hover,
.hk-header .wp-block-navigation-item__content[aria-current="page"] { border-bottom-color: var(--wp--preset--color--klinker-hell); }

/* „Mitglied werden“ und „Jetzt spenden“ als Knöpfe */
.hk-header .hk-nav-knopf .wp-block-navigation-item__content {
	background: var(--wp--preset--color--klinker-dunkel);
	color: var(--wp--preset--color--weiss);
	padding: 0.45em 0.9em;
	border-radius: 3px;
	border-bottom: 0;
}
.hk-header .hk-nav-knopf .wp-block-navigation-item__content:hover { background: var(--wp--preset--color--nacht); }
/* im aufgeklappten Menü setzt WordPress den Innenabstand sonst auf 0 */
.hk-header .wp-block-navigation__responsive-container.is-menu-open .hk-nav-knopf .wp-block-navigation-item__content { padding: 0.45em 0.9em; }

/* Unter 1260px passt das Menü nicht mehr neben Logo und Namen: dann das Menü-Symbol zeigen.
   (WordPress schaltet erst unter 600px um.) */
@media (min-width: 600px) and (max-width: 1259px) {
	.hk-header .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.hk-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}

/* Mobiles Menü */
.wp-block-navigation__responsive-container.is-menu-open { padding: 1.5rem; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { gap: 1rem; font-size: 1.3rem; }
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg { width: 32px; height: 32px; }

@media (max-width: 599px) {
	.hk-marke .hk-logo img { width: 72px !important; }
	.hk-marke .wp-block-site-title { font-size: 1rem; max-width: 12rem; }
}

/* ---------- Fußzeile ---------- */

.hk-footer a { color: inherit; }
.hk-footer p { margin: 0 0 0.6em; }
.hk-footer .hk-footer-klein { opacity: 0.85; font-size: var(--wp--preset--font-size--small); }

/* ---------- Startseite ---------- */

.hk-hero .wp-block-cover__background {
	background: linear-gradient(180deg, rgba(31, 27, 27, 0) 35%, rgba(31, 27, 27, 0.72) 100%) !important;
	opacity: 1 !important;
}
/* Prozentwerte beziehen sich auf den Inhaltsbereich ohne Seitenrand – daher den Rand wieder addieren. */
.hk-hero {
	padding-left: max(var(--wp--preset--spacing--30), calc((100% + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right) - var(--wp--style--global--wide-size)) / 2)) !important;
	padding-right: max(var(--wp--preset--spacing--30), calc((100% + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right) - var(--wp--style--global--wide-size)) / 2)) !important;
}
.hk-hero .wp-block-cover__inner-container { width: 100% !important; max-width: none !important; margin: 0 !important; }
/* Parallax: Das Foto wandert beim Scrollen langsamer mit als die Seite.
   Nur wo der Browser scrollgesteuerte Animationen kann und niemand „Bewegung reduzieren“ eingestellt hat. */
.hk-hero { overflow: hidden; }
@supports (animation-timeline: scroll()) {
	@media (prefers-reduced-motion: no-preference) {
		.hk-hero .wp-block-cover__image-background {
			animation: hk-parallax linear both;
			animation-timeline: scroll(root block);
			animation-range: 0px 80vh;
		}
	}
}
@keyframes hk-parallax {
	from { transform: translateY(0); }
	to { transform: translateY(35%); }
}
.hk-hero h1 { text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35); margin-bottom: 0.2em; }
.hk-hero p { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4); font-weight: 300; }
.hk-credit,
.hk-hero .hk-credit {
	font-size: 0.8rem !important;
	font-weight: 300;
	opacity: 0.85;
}
/* Fotoangabe an der Unterkante des Bildes: der Textblock endet um den unteren Innenabstand darüber */
.hk-hero .hk-credit { position: absolute; right: 0; bottom: calc(0.5rem - var(--wp--preset--spacing--50)); margin: 0; line-height: 1.2; }

.hk-lead { font-weight: 300; line-height: 1.45; }
/* Flyer-Text: überall derselbe Abstand zwischen den Absätzen und Zwischenüberschriften */
.hk-botschaft > * { margin-block: 0 !important; }
.hk-botschaft > * + * { margin-block-start: 1.25rem !important; }
/* kein einzelnes Wort allein in der letzten Zeile */
.hk-botschaft p { text-wrap: pretty; }
.hk-ausruf { color: var(--wp--preset--color--klinker-dunkel); font-weight: 700; line-height: 1.2; }

.hk-zaehler { text-align: center; border-radius: 4px; }
.hk-zahl {
	font-size: clamp(3.5rem, 10vw, 6rem);
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--klinker-dunkel);
	margin: 0.1em 0 0.15em !important;
}

/* ---------- Bildstreifen & Galerie ---------- */

.wp-block-gallery.has-nested-images figure.wp-block-image { flex-direction: column; justify-content: flex-start; }
/* :not(#hk) hebt die Priorität auf die der WordPress-Regel (…:not(#individual-image) img { height: 100% }),
   sonst fallen nachgeladene Bilder auf 0 Pixel Höhe zusammen. */
.wp-block-gallery.has-nested-images.is-cropped figure.wp-block-image:not(#hk):not(#hk2) img { aspect-ratio: 3 / 2; width: 100%; height: auto; flex: none; object-fit: cover; }
/* Bildunterschriften unter das Bild statt darüber */
.wp-block-gallery.has-nested-images figure.wp-block-image:has(figcaption)::before { display: none; }
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
	position: static;
	max-height: none;
	overflow: visible;
	background: none;
	color: var(--wp--preset--color--grau-dunkel);
	text-shadow: none;
	text-align: left;
	padding: 0.4em 0 0;
	margin: 0;
	font-size: var(--wp--preset--font-size--small);
	backdrop-filter: none;
	will-change: auto;
}
.wp-block-gallery .blocks-gallery-caption { text-align: left; }
/* Auf dem Handy Bilder untereinander statt zweispaltig (laut Seitenkonzept) */
@media (max-width: 599px) {
	.wp-block-gallery.has-nested-images figure.wp-block-image:not(#hk):not(#hk2) { width: 100%; }
}

/* ---------- Zeitstrahl ---------- */

.hk-zeitstrahl { position: relative; padding-left: 2.25rem; }
.hk-zeitstrahl::before {
	content: "";
	position: absolute;
	left: 0.55rem;
	top: 0.5rem;
	bottom: 0.5rem;
	width: 3px;
	background: var(--wp--preset--color--klinker-hell);
}
.hk-station { position: relative; margin-block: 0 1.4rem !important; }
.hk-station::before {
	content: "";
	position: absolute;
	left: -2.05rem;
	top: 0.35rem;
	width: 0.95rem;
	height: 0.95rem;
	border-radius: 50%;
	background: var(--wp--preset--color--weiss);
	border: 3px solid var(--wp--preset--color--klinker-dunkel);
}
.hk-station .hk-jahr { font-size: var(--wp--preset--font-size--large); margin: 0 0 0.15em; }
.hk-station p { margin: 0; }
.hk-station--ziel {
	background: var(--wp--preset--color--hell);
	padding: 1rem 1.25rem;
	border-radius: 4px;
}
.hk-station--ziel::before { background: var(--wp--preset--color--klinker-dunkel); top: 1.35rem; }
.hk-station--ziel .hk-jahr { font-size: var(--wp--preset--font-size--x-large); }
.hk-station .hk-station-bild { max-width: 30rem; margin-top: 0.8rem !important; margin-bottom: 0.4rem; }
.hk-station .wp-block-gallery.hk-station-bild { max-width: 38rem; }

/* ---------- Vorstand ---------- */

.hk-personen .wp-block-image img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.hk-personen p { margin: 0.15em 0; }
.hk-personen .hk-amt { color: var(--wp--preset--color--grau-dunkel); font-weight: 300; }
@media (max-width: 781px) {
	.wp-block-columns.hk-personen { gap: 1.5rem 1rem; }
	.wp-block-columns.hk-personen > .wp-block-column { flex-basis: calc(50% - 0.5rem) !important; flex-grow: 0; }
	.hk-personen p { font-size: var(--wp--preset--font-size--small); }
}

/* ---------- Spenden ---------- */

.hk-konto {
	border-left: 5px solid var(--wp--preset--color--klinker-dunkel);
	border-radius: 0 4px 4px 0;
}
.hk-konto p { margin: 0.2em 0; }
.hk-iban { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.hk-kopieren {
	margin-left: 0.6em;
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--wp--preset--color--klinker-dunkel);
	background: var(--wp--preset--color--weiss);
	border: 2px solid var(--wp--preset--color--klinker-dunkel);
	border-radius: 3px;
	padding: 0.1em 0.6em;
	cursor: pointer;
}
.hk-kopieren:hover { background: var(--wp--preset--color--hell); }
.hk-girocode img { max-width: 180px; }
@media (max-width: 781px) {
	.hk-girocode { display: none; }
}

/* ---------- Beiträge (Ein- und Ausblicke) ---------- */

.hk-beitraege .wp-block-post-template { gap: 0; }
.hk-beitrag {
	border-top: 1px solid var(--wp--preset--color--grau);
	padding-block: 1.75rem;
}
.hk-beitrag .wp-block-post-date { color: var(--wp--preset--color--grau-dunkel); font-size: var(--wp--preset--font-size--small); }
.hk-beitrag .wp-block-post-title { margin: 0.15em 0 0.4em; }
.hk-beitrag .wp-block-post-title a { text-decoration: none; }
.hk-beitrag .wp-block-post-title a:hover { text-decoration: underline; }
.hk-beitrag .wp-block-post-excerpt__more-link { font-weight: 700; }
@media (min-width: 782px) {
	.hk-beitrag:has(.wp-block-post-featured-image) {
		display: grid;
		grid-template-columns: 15rem 1fr;
		grid-template-rows: auto auto 1fr;
		column-gap: 1.75rem;
		grid-template-areas: "bild datum" "bild titel" "bild text";
	}
	.hk-beitrag:has(.wp-block-post-featured-image) > * { margin: 0 !important; }
	.hk-beitrag .wp-block-post-featured-image { grid-area: bild; align-self: start; }
	.hk-beitrag .wp-block-post-date { grid-area: datum; }
	.hk-beitrag .wp-block-post-title { grid-area: titel; padding: 0.15em 0 0.4em; }
	.hk-beitrag .wp-block-post-excerpt { grid-area: text; }
}

/* ---------- Formulare (Contact Form 7) ---------- */

.wpcf7 form { max-width: 40rem; }
.wpcf7 form p,
.wpcf7 .hk-feld { margin: 0 0 1rem; }
.wpcf7 label { display: block; font-weight: 700; }
.wpcf7 .hk-feldreihe { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.wpcf7 .hk-feldreihe--schmal-breit { grid-template-columns: 1fr 2fr; }
.wpcf7 .hk-feldreihe--breit-schmal { grid-template-columns: 2fr 1fr; }
@media (max-width: 599px) {
	.wpcf7 .hk-feldreihe { grid-template-columns: 1fr; }
	.wpcf7 .hk-feldreihe--schmal-breit { grid-template-columns: 2fr 3fr; }
	.wpcf7 .hk-feldreihe--breit-schmal { grid-template-columns: 3fr 2fr; }
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 input[type="number"],
.wpcf7 input[type="date"],
.wpcf7 textarea {
	display: block;
	width: 100%;
	box-sizing: border-box;
	margin-top: 0.3rem;
	padding: 0.6rem 0.75rem;
	font: inherit;
	font-weight: 400;
	color: var(--wp--preset--color--nacht);
	background: var(--wp--preset--color--weiss);
	border: 1px solid var(--wp--preset--color--grau-dunkel);
	border-radius: 3px;
}
.wpcf7 textarea { min-height: 10rem; }
.wpcf7 fieldset { border: 0; padding: 0; margin: 0 0 1.5rem; }
.wpcf7 legend,
.wpcf7 .hk-abschnitt {
	font-size: var(--wp--preset--font-size--large);
	font-weight: 700;
	color: var(--wp--preset--color--klinker-dunkel);
	margin: 0 0 0.6rem;
	padding: 0;
}
.wpcf7 .hk-hinweis { font-weight: 400; font-size: var(--wp--preset--font-size--small); margin-top: -0.4rem; }
.wpcf7 .wpcf7-acceptance { display: block; }
.wpcf7 .wpcf7-acceptance .wpcf7-list-item { margin: 0 0 0.6rem; display: block; }
.wpcf7 .wpcf7-acceptance label { display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400; }
.wpcf7 .wpcf7-acceptance input { margin-top: 0.35rem; width: 1.15rem; height: 1.15rem; flex: none; }
.wpcf7 input[type="submit"] {
	font: inherit;
	font-weight: 700;
	color: var(--wp--preset--color--weiss);
	background: var(--wp--preset--color--klinker-dunkel);
	border: 0;
	border-radius: 3px;
	padding: 0.75rem 1.5rem;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--wp--preset--color--nacht); }
.wpcf7 input[type="submit"]:disabled { opacity: 0.6; cursor: not-allowed; }
.wpcf7-not-valid-tip { color: #a12a2a; font-weight: 700; font-size: var(--wp--preset--font-size--small); }
.wpcf7 form .wpcf7-response-output {
	margin: 1rem 0 0;
	padding: 1rem 1.25rem;
	border: 2px solid var(--wp--preset--color--klinker-hell);
	border-radius: 4px;
}
/* Nach erfolgreichem Absenden nur die Erfolgsmeldung zeigen */
.wpcf7 form.sent > *:not(.wpcf7-response-output) { display: none; }
.wpcf7 form.sent .wpcf7-response-output {
	margin: 0;
	border-color: var(--wp--preset--color--klinker-dunkel);
	background: var(--wp--preset--color--hell);
	font-size: var(--wp--preset--font-size--medium);
}
/* Fangfeld für Roboter – für Menschen unsichtbar */
.hk-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Kleinkram ---------- */

.hk-kontakt-hinweis { border-radius: 4px; }
.hk-kontakt-hinweis p { margin: 0; }

@media (max-width: 781px) {
	.wp-block-columns.hk-umbruch-umkehren { flex-direction: column-reverse; }
}
