/*
Theme Name: KIFAHA
Theme URI: https://kifaha.de
Author: arax.systems
Description: Individuelles WordPress-Theme für das Kinder- und Familienhaus St. Alban - St. Jakobus. Kein Framework, JavaScript vollständig lokal, Font Inter lokal eingebunden, ACF (nur kostenlose Basisversion).
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: kifaha
*/

/* ==========================================================================
   1. Fonts
   ========================================================================== */

@font-face {
	font-family: 'Inter';
	src: url('assets/fonts/Inter-VariableFont.ttf') format('truetype-variations'),
		 url('assets/fonts/Inter-VariableFont.ttf') format('truetype');
	font-weight: 100 900;
	font-style: normal;
	font-display: swap;
}

/* ==========================================================================
   2. Design Tokens
   ========================================================================== */

:root {
	--color-cream: #FBF7EE;
	--color-white: #FFFFFF;
	--color-text: #1F1F1F;
	--color-text-muted: #5A5A5A;

	--color-accent-red: #E85868;
	--color-accent-red-hover: #D8404F;
	--color-orange: #F7975D;
	--color-blue: #5D98F4;

	/* Regenbogenfarben (nur für Logo/Colorbanner-Assets relevant) */
	--color-rainbow-red: #F36267;
	--color-rainbow-yellow: #F7F6A3;
	--color-rainbow-green: #B9DC45;
	--color-rainbow-purple: #BA94DD;

	--color-footer-bg: #F2F2F2;

	--radius-s: 8px;
	--radius-m: 16px;
	--radius-l: 19px;
	--radius-pill: 999px;

	--container-width: 1240px;
	--container-padding: 24px;

	--font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ==========================================================================
   3. Reset / Base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: var(--font-body);
	color: var(--color-text);
	background: var(--color-white);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

ul { margin: 0; padding: 0; list-style: none; }

button { font-family: inherit; cursor: pointer; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; }

p { margin: 0 0 1em; }

.container {
	width: 100%;
	max-width: var(--container-width);
	margin: 0 auto;
	padding: 0 var(--container-padding);
}

.screen-reader-text {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ==========================================================================
   4. Buttons
   ========================================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 14px 28px;
	background: var(--color-accent-red);
	color: var(--color-white);
	border: none;
	border-radius: var(--radius-pill);
	font-weight: 600;
	font-size: 15px;
	transition: background .2s ease, transform .15s ease;
}

.btn:hover { background: var(--color-accent-red-hover); transform: translateY(-1px); }

.btn .btn__arrow { width: 16px; height: 13px; flex-shrink: 0; }

/* ==========================================================================
   5. Header
   ========================================================================== */

.site-header {
	background: var(--color-cream);
	position: relative;
	z-index: 100;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	position: relative;
	padding: 20px var(--container-padding);
	max-width: var(--container-width);
	margin: 0 auto;
	gap: 32px;
}

.site-logo img { height: 44px; width: auto; }

/* Primary nav */

.primary-nav {
	flex: 1;
	/* Platz für die absolut positionierte Vogel-Grafik am rechten Rand freihalten */
	padding-right: 170px;
}

.primary-nav > ul {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 4px;
}

.primary-nav li { position: relative; }

.primary-nav > ul > li > a {
	display: inline-block;
	padding: 10px 11px;
	font-weight: 600;
	font-size: 14px;
	color: var(--color-text);
	border-bottom: 3px solid transparent;
	transition: color .15s ease, border-color .15s ease;
}

.primary-nav > ul > li:hover > a,
.primary-nav > ul > li.menu-item-has-children:hover > a {
	color: var(--color-orange);
}

.primary-nav > ul > li.current-menu-item > a,
.primary-nav > ul > li.current-menu-ancestor > a {
	color: var(--color-accent-red);
	border-color: var(--color-accent-red);
}

/* Submenu - max 1 level */

.primary-nav .sub-menu {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: var(--color-orange);
	border-radius: 0 var(--radius-l) var(--radius-l) var(--radius-l);
	padding: 8px 0;
	box-shadow: 0 12px 24px rgba(0,0,0,.12);
}

.primary-nav li.menu-item-has-children:hover > .sub-menu,
.primary-nav li.menu-item-has-children:focus-within > .sub-menu {
	display: block;
}

.primary-nav .sub-menu li a {
	display: block;
	padding: 10px 20px;
	font-weight: 500;
	font-size: 14px;
	color: var(--color-white);
	white-space: nowrap;
	transition: color .15s ease;
}

.primary-nav .sub-menu li a:hover,
.primary-nav .sub-menu li a:focus {
	color: var(--color-white);
	background: rgba(255,255,255,.18);
}

/* Bird / Vogel hover graphic - freigestellt, bleedet bewusst unten aus dem Header heraus */

.site-header__bird {
	position: absolute;
	top: 22px;
	right: var(--container-padding);
	width: clamp(150px, 15vw, 240px);
	aspect-ratio: 443 / 122;
	z-index: 10;
	pointer-events: auto;
}

.site-header__bird img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	object-position: right top;
	transition: opacity .2s ease;
}

.site-header__bird img.is-hover { opacity: 0; }

.site-header__bird:hover img.is-default { opacity: 0; }
.site-header__bird:hover img.is-hover { opacity: 1; }

/* Mobile nav toggle */

.nav-toggle {
	display: none;
	background: none;
	border: none;
	width: 32px;
	height: 24px;
	position: relative;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 2px;
	background: var(--color-text);
	transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle::before { top: 0; }
.nav-toggle span { top: 11px; }
.nav-toggle::after { bottom: 0; }

.site-header.is-nav-open .nav-toggle::before { transform: translateY(11px) rotate(45deg); }
.site-header.is-nav-open .nav-toggle::after { transform: translateY(-11px) rotate(-45deg); }
.site-header.is-nav-open .nav-toggle span { opacity: 0; }

/* ==========================================================================
   6. Teaser (Startseite, direkt unter dem Header)
   ========================================================================== */

.teaser {
	background: var(--color-cream);
	padding-bottom: 64px;
}

/* ==========================================================================
   7. Hero
   ========================================================================== */

.hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 64px;
	align-items: center;
	padding-top: 40px;
}

.hero__title-row {
	display: flex;
	align-items: stretch;
	gap: 20px;
}

.hero__banner {
	flex-shrink: 0;
	width: 6px;
	border-radius: 3px;
	overflow: hidden;
}

.hero__banner img { width: 6px; height: 100%; object-fit: cover; }

.hero__title-row h1 {
	font-size: clamp(28px, 3.5vw, 40px);
	text-transform: uppercase;
}

/* Text/Button richten sich links am Titeltext aus, nicht am Farbbalken */
.hero__text {
	margin-left: calc(6px + 20px);
}

.hero__text p {
	color: var(--color-text-muted);
	max-width: 440px;
}

/* Slider */

.hero-slider {
	position: relative;
	background: var(--color-white);
	border-radius: var(--radius-m);
	overflow: hidden;
	box-shadow: 0 20px 40px rgba(0,0,0,.06);
}

.hero-slider__track {
	display: flex;
	transition: transform .5s ease;
}

.hero-slider__slide {
	flex: 0 0 100%;
	aspect-ratio: 4 / 3;
}

.hero-slider__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hero-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--color-white);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 12px rgba(0,0,0,.15);
	border: none;
}

.hero-slider__arrow img { width: 12px; height: 12px; }

.hero-slider__arrow--prev { left: 16px; }
.hero-slider__arrow--next { right: 16px; }

/* ==========================================================================
   8. Werte (4 Spalten)
   ========================================================================== */

.values {
	padding: 80px 0;
}

.values__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 32px;
	text-align: center;
}

.values__icon {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	background: var(--color-blue);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 20px;
}

.values__icon img { width: 36px; height: 36px; filter: brightness(0) invert(1); }

.values__item h3 { font-size: 18px; }

.values__item p { color: var(--color-text-muted); font-size: 14px; }

/* ==========================================================================
   9. Aktuelles
   ========================================================================== */

.aktuelles { padding: 40px 0 80px; }

.aktuelles__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin-top: 32px;
}

.post-card {
	background: var(--color-cream);
	border-radius: var(--radius-m);
	padding: 28px;
	display: flex;
	flex-direction: column;
}

.post-card__date {
	align-self: flex-end;
	font-size: 13px;
	color: var(--color-text-muted);
	margin-bottom: 12px;
}

.post-card h3 { font-size: 17px; }

.post-card p { color: var(--color-text-muted); font-size: 14px; flex: 1; }

.post-card__link {
	font-weight: 600;
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

/* ==========================================================================
   10. CTA zweispaltig
   ========================================================================== */

.cta-two-col {
	padding: 40px 0 80px;
}

.cta-two-col__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
}

.cta-two-col__item p { color: var(--color-text-muted); }

/* ==========================================================================
   11. Footer-Start (Ansprechpartner / Kontakt)
   ========================================================================== */

.footer-start { background: var(--color-cream); padding: 0 0 80px; }

.footer-start__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px;
}

.footer-start__box {
	background: var(--color-blue);
	color: var(--color-white);
	border-radius: var(--radius-m);
	padding: 32px;
}

.footer-start__box h3 { font-size: 20px; }

.contact-person { margin-bottom: 16px; }
.contact-person:last-child { margin-bottom: 0; }
.contact-person__name { font-weight: 700; display: block; }
.contact-person__role { font-style: italic; opacity: .9; font-size: 14px; }

.contact-info p { margin-bottom: 12px; }
.contact-info strong { display: block; margin-bottom: 2px; }
.contact-info a { text-decoration: underline; }

/* ==========================================================================
   12. Footer
   ========================================================================== */

.site-footer {
	background: var(--color-footer-bg);
	position: relative;
	overflow: hidden;
	padding: 32px 0;
}

.site-footer__inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	position: relative;
	z-index: 1;
	min-height: 90px;
}

.site-footer__deco {
	position: absolute;
	left: -20px;
	bottom: -10px;
	width: 300px;
	z-index: 0;
}

.footer-nav ul { display: flex; gap: 24px; }
.footer-nav a { font-size: 14px; color: var(--color-text-muted); }
.footer-nav a:hover { color: var(--color-text); }

/* ==========================================================================
   13. Unterseiten (page.php)
   ========================================================================== */

.page-content {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 64px;
	padding: 56px 0 96px;
}

.page-content__main h1 { font-size: 32px; }

.page-content__main blockquote {
	margin: 24px 0;
	padding-left: 20px;
	border-left: 3px solid var(--color-orange);
}

.page-sidebar h2 { font-size: 22px; }

.page-sidebar ul li { margin-bottom: 10px; }

.page-sidebar ul li a { font-size: 15px; }
.page-sidebar ul li a:hover { color: var(--color-orange); }

/* ==========================================================================
   14. Responsive
   ========================================================================== */

@media (max-width: 960px) {
	.hero { grid-template-columns: 1fr; }
	.values__grid { grid-template-columns: repeat(2, 1fr); }
	.aktuelles__grid { grid-template-columns: 1fr; }
	.cta-two-col__grid { grid-template-columns: 1fr; }
	.footer-start__grid { grid-template-columns: 1fr; }
	.page-content { grid-template-columns: 1fr; }
}

@media (max-width: 782px) {
	.nav-toggle { display: block; }

	.site-header__bird { display: none; }

	.primary-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		background: var(--color-cream);
		box-shadow: 0 12px 24px rgba(0,0,0,.1);
	}

	.site-header.is-nav-open .primary-nav { display: block; }

	.primary-nav > ul { flex-direction: column; align-items: stretch; padding: 16px; }

	.primary-nav .sub-menu {
		display: none;
		position: static;
		border-radius: var(--radius-s);
		margin: 4px 0 8px;
	}

	.primary-nav li.menu-item-has-children.is-open > .sub-menu { display: block; }
}

@media (max-width: 600px) {
	.values__grid { grid-template-columns: 1fr; }
}
