/**
 * Theme base styles — Kirmesverein Hohenkirchen
 * Baut auf design-system.css (Tokens) auf. Liefert den "roten Faden":
 * Grundtypografie, Header, Footer, Buttons, Formulare, Utilities.
 */

/* ============================================================
   Reset / Box-Modell
   ============================================================ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--kh-header-height) + 1rem);
}

body {
	margin: 0;
	font-family: var(--kh-font-body);
	font-size: var(--kh-fs-base);
	line-height: var(--kh-lh-body);
	color: var(--kh-white);
	background-color: var(--kh-navy);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	overflow-x: clip;
}

img,
svg {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--kh-gold);
	text-decoration: none;
	transition: color var(--kh-transition);
}

a:hover,
a:focus {
	color: var(--kh-gold-light);
}

:focus-visible {
	outline: 3px solid var(--kh-gold);
	outline-offset: 2px;
}

/* ============================================================
   Typografie
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--kh-font-display);
	font-weight: 700;
	line-height: var(--kh-lh-tight);
	margin: 0 0 var(--kh-space-3);
	color: var(--kh-white);
}

h1 { font-size: var(--kh-fs-h1); text-transform: uppercase; letter-spacing: 0.01em; }
h2 { font-size: var(--kh-fs-h2); text-transform: uppercase; }
h3 { font-size: var(--kh-fs-h3); }
h4 { font-size: var(--kh-fs-h4); }

p { margin: 0 0 var(--kh-space-3); }

.kh-script {
	font-family: var(--kh-font-script);
	font-weight: 700;
	color: var(--kh-white);
	font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem);
	line-height: 1.2;
}

/* Gold-Pinselstrich unter Überschriften (derselbe wie auf den Bannern) */
.kh-brush-underline {
	position: relative;
	display: inline-block;
	padding-bottom: 0.35em;
}
.kh-brush-underline::after {
	content: "";
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: -0.15em;
	width: 112%;
	min-width: 140px;
	height: 0.5em;
	background: url("../images/Farbstrich.png") no-repeat center / 100% 100%;
	pointer-events: none;
}

/* ============================================================
   Layout-Helfer
   ============================================================ */
.kh-container {
	width: 100%;
	max-width: var(--kh-container);
	margin-inline: auto;
	padding-inline: var(--kh-space-4);
}
.kh-container--narrow { max-width: var(--kh-container-narrow); }

.kh-section { padding-block: var(--kh-space-8); }

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	word-wrap: normal !important;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	background: var(--kh-gold);
	color: var(--kh-ink);
	padding: var(--kh-space-2) var(--kh-space-4);
	border-radius: 0 0 var(--kh-radius) 0;
	font-weight: 600;
}
.skip-link:focus {
	left: 0;
	color: var(--kh-ink);
}

/* ============================================================
   Buttons
   ============================================================ */
.kh-btn,
.wp-block-button__link,
button,
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--kh-space-2);
	font-family: var(--kh-font-display);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1;
	padding: 0.85em 1.6em;
	border-radius: var(--kh-radius-pill);
	border: 2px solid var(--kh-gold);
	background: var(--kh-gold);
	color: var(--kh-ink);
	cursor: pointer;
	transition: transform var(--kh-transition), background var(--kh-transition), color var(--kh-transition);
	text-transform: uppercase;
	letter-spacing: 0.02em;
}
.kh-btn:hover,
.wp-block-button__link:hover,
button:hover {
	background: var(--kh-gold-light);
	border-color: var(--kh-gold-light);
	color: var(--kh-ink);
	transform: translateY(-2px);
}
.kh-btn--outline {
	background: transparent;
	color: var(--kh-white);
}
.kh-btn--outline:hover {
	background: var(--kh-gold);
	color: var(--kh-ink);
}

/* ============================================================
   Header
   ============================================================ */
.kh-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(15, 28, 43, 0.92);
	backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--kh-border);
}
.kh-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--kh-space-4);
	min-height: var(--kh-header-height);
}
.kh-brand {
	grid-column: 1;
	justify-self: start;
	display: flex;
	align-items: center;
	gap: var(--kh-space-3);
	flex-shrink: 0;
}
.kh-nav {
	grid-column: 2;
	justify-self: center;
}
.kh-nav-toggle {
	grid-column: 3;
	justify-self: end;
}
.kh-brand__logo {
	width: auto;
	height: 80px;
}
.kh-brand__logo img,
.kh-brand__logo svg {
	height: 100%;
	width: auto;
}
.kh-brand__text {
	font-family: var(--kh-font-display);
	font-weight: 700;
	font-size: 1.1rem;
	color: var(--kh-white);
	line-height: 1.1;
	text-transform: uppercase;
}

/* Navigation */
.kh-nav__list {
	display: flex;
	align-items: center;
	gap: var(--kh-space-4);
	list-style: none;
	margin: 0;
	padding: 0;
}
.kh-nav__list a {
	color: var(--kh-white);
	font-family: var(--kh-font-display);
	font-weight: 500;
	font-size: 1.05rem;
	padding: var(--kh-space-1) 0;
	position: relative;
}
.kh-nav__list a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -4px;
	width: 0;
	height: 3px;
	background: var(--kh-gold);
	border-radius: var(--kh-radius-pill);
	transition: width var(--kh-transition);
}
.kh-nav__list a:hover::after,
.kh-nav__list a.is-active::after {
	width: 100%;
}
.kh-nav__list a.is-active {
	color: var(--kh-gold);
}

/* Burger */
.kh-nav-toggle {
	display: none;
	flex-direction: column;
	gap: 5px;
	width: 46px;
	height: 46px;
	padding: 10px;
	background: transparent;
	border: 1px solid var(--kh-border);
	border-radius: var(--kh-radius);
}
.kh-nav-toggle span {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--kh-white);
	border-radius: 2px;
	transition: transform var(--kh-transition), opacity var(--kh-transition);
}
.kh-nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.kh-nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.kh-nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 880px) {
	.kh-nav-toggle { display: flex; }
	.kh-nav {
		position: fixed;
		inset: var(--kh-header-height) 0 auto 0;
		background: var(--kh-navy-900);
		border-bottom: 1px solid var(--kh-border);
		max-height: 0;
		overflow: hidden;
		transition: max-height 0.3s ease;
	}
	.kh-nav.is-open { max-height: 80vh; }
	.kh-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: var(--kh-space-3) var(--kh-space-4);
	}
	.kh-nav__list li { border-bottom: 1px solid var(--kh-border); }
	.kh-nav__list a { display: block; padding: var(--kh-space-3) 0; }
	.kh-brand__text { display: none; }
}

/* ============================================================
   Footer
   ============================================================ */
.kh-footer {
	background: var(--kh-navy-900);
	color: var(--kh-muted);
	border-top: 3px solid var(--kh-gold);
	padding-block: var(--kh-space-7) var(--kh-space-4);
	margin-top: auto;
}
.kh-footer__grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: var(--kh-space-6);
}
.kh-footer__brand-logo { height: 90px; margin-bottom: var(--kh-space-3); }
.kh-footer__mutti { margin-top: var(--kh-space-3); }
.kh-footer h4 {
	color: var(--kh-gold);
	font-size: 1.1rem;
	margin-bottom: var(--kh-space-3);
	text-transform: uppercase;
}
.kh-footer ul { list-style: none; margin: 0; padding: 0; }
.kh-footer li { margin-bottom: var(--kh-space-2); }
.kh-footer a { color: var(--kh-muted); }
.kh-footer a:hover { color: var(--kh-gold); }
.kh-socials {
	display: flex;
	gap: var(--kh-space-3);
	margin-top: var(--kh-space-3);
}
.kh-socials a {
	display: inline-flex;
	width: 42px;
	height: 42px;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--kh-border);
	border-radius: 50%;
	color: var(--kh-white);
}
.kh-socials a:hover {
	background: var(--kh-gold);
	border-color: var(--kh-gold);
	color: var(--kh-ink);
}
.kh-footer__bottom {
	margin-top: var(--kh-space-6);
	padding-top: var(--kh-space-4);
	border-top: 1px solid var(--kh-border);
	display: flex;
	flex-wrap: wrap;
	gap: var(--kh-space-3);
	justify-content: space-between;
	font-size: 0.9rem;
}
@media (max-width: 780px) {
	.kh-footer__grid { grid-template-columns: 1fr; gap: var(--kh-space-5); }
}

/* ============================================================
   Page-Layout (Nicht-Elementor-Seiten / Blog)
   ============================================================ */
.site {
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}
/* Dezente Kirchen-Silhouette als durchgehender Marken-Hintergrund */
.site::before {
	content: "";
	position: fixed;
	right: -6%;
	bottom: -4%;
	width: min(46vw, 600px);
	aspect-ratio: 574 / 779;
	background: url("../images/church-white.svg") no-repeat center / contain;
	opacity: 0.05;
	pointer-events: none;
	z-index: 0;
}
.site-main,
.kh-footer {
	position: relative;
	z-index: 1;
}
.kh-page { padding-block: var(--kh-space-7); }
.kh-page__title { margin-bottom: var(--kh-space-5); }

.kh-entry { margin-bottom: var(--kh-space-6); }
.kh-entry a { text-decoration: underline; }
.kh-entry__meta { color: var(--kh-muted); font-size: 0.9rem; margin-bottom: var(--kh-space-3); }
.kh-entry img { border-radius: var(--kh-radius); }

.kh-card {
	background: var(--kh-navy-700);
	border: 1px solid var(--kh-border);
	border-radius: var(--kh-radius-lg);
	padding: var(--kh-space-5);
	box-shadow: var(--kh-shadow-soft);
}

/* Pagination */
.kh-pagination {
	display: flex;
	gap: var(--kh-space-2);
	flex-wrap: wrap;
	margin-top: var(--kh-space-5);
}
.kh-pagination .page-numbers {
	display: inline-flex;
	min-width: 44px;
	height: 44px;
	align-items: center;
	justify-content: center;
	padding-inline: var(--kh-space-2);
	border: 1px solid var(--kh-border);
	border-radius: var(--kh-radius);
	color: var(--kh-white);
}
.kh-pagination .page-numbers.current,
.kh-pagination .page-numbers:hover {
	background: var(--kh-gold);
	border-color: var(--kh-gold);
	color: var(--kh-ink);
}

/* Formulare */
input[type="text"],
input[type="email"],
input[type="search"],
input[type="url"],
textarea,
select {
	width: 100%;
	padding: 0.7em 0.9em;
	background: var(--kh-navy-700);
	border: 1px solid var(--kh-border);
	border-radius: var(--kh-radius);
	color: var(--kh-white);
	font-family: inherit;
	font-size: 1rem;
}
input::placeholder,
textarea::placeholder { color: rgba(255,255,255,0.5); }

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001ms !important;
		scroll-behavior: auto !important;
	}
}
