/*
Theme Name: Löwenschule Bräunlingen
Author: Benjamin Nierlich
Description: Schlankes Theme für die Löwenschule Bräunlingen. Layout und Inhalte der Seiten kommen aus Elementor (Free genügt), Gestaltung steckt komplett in dieser Datei.
Version: 1.1.3
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: loewenschule
*/

/* ---------- Schriften (lokal, kein Google-CDN → DSGVO) ---------- */
@font-face { font-family: "Bricolage Grotesque"; src: url(assets/fonts/bricolage-grotesque-latin-wght-normal.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(assets/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(assets/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url(assets/fonts/atkinson-hyperlegible-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

/* ---------- Tokens ----------
   Kontraste (WCAG): ink/weiß 15,9 · forest/weiß 10,9 · gold auf forest 5,9 · ink auf gold 8,5.
   Gold nie als Textfarbe auf Weiß (1,9:1) – nur als Fläche mit dunklem Text oder als Text auf forest. */
:root {
	--ink: #1a2420;
	--forest: #14452f;
	--gold: #f4b223;
	--mist: #f2f5f0;
	--muted: #4b5a52;
	--line: #d9dfd8;
	--font-display: "Bricolage Grotesque", system-ui, sans-serif;
	--font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
	--wrap: 72rem;
	--gutter: clamp(1rem, 4vw, 2rem);
	--cut: 3.5vw; /* Neigung der schrägen Kanten (Kopf, Hero, Fuß) */
}

/* Elementor bringt ein eigenes Standarddesign mit (Hellblau, Grün, Roboto). Alle seine Widgets lesen diese Variablen –
   hier werden sie auf unsere Werte gesetzt. `body[class*=…]` schlägt die Regel des Elementor-Kits (.elementor-kit-N) in der Spezifität. */
body[class*="elementor-kit-"] {
	--e-global-color-primary: var(--forest);
	--e-global-color-secondary: var(--muted);
	--e-global-color-text: var(--ink);
	--e-global-color-accent: var(--gold);
	--e-global-typography-primary-font-family: "Bricolage Grotesque";
	--e-global-typography-secondary-font-family: "Bricolage Grotesque";
	--e-global-typography-text-font-family: "Atkinson Hyperlegible";
	--e-global-typography-accent-font-family: "Bricolage Grotesque";
	--e-global-typography-primary-font-weight: 700;
	--e-global-typography-secondary-font-weight: 700;
	--e-global-typography-accent-font-weight: 700;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; } /* 18 px bei Standard-Einstellung, skaliert mit Browser-Schrift */
body { margin: 0; font: 1rem/1.6 var(--font-body); color: var(--ink); background: #fff; }
img { max-width: 100%; height: auto; }
a { color: var(--forest); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 5px #fff; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; color: var(--forest); text-wrap: balance; overflow-wrap: break-word; hyphens: auto; } /* lange Wörter (Schulkindbetreuung) sprengen sonst das Handy-Layout */
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 100; padding: .75rem 1rem; background: var(--gold); color: var(--ink); font-weight: 700; }
.skip-link:focus { top: 1rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

/* ---------- Kopf: schräge Logo-Platte + Menüband ---------- */
.topbar { background: var(--mist); font-size: .875rem; }
.topbar .wrap { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem 1.5rem; padding-block: .4rem; }
.topbar .widget, .topbar p { margin: 0; }
.site-header { background: var(--forest); }
.site-header__inner { display: flex; align-items: center; }
.brand {
	flex: none; display: flex; align-items: center;
	padding: 1rem 5rem 1rem max(var(--gutter), calc((100vw - var(--wrap)) / 2));
	background: linear-gradient(100deg, #fff 0 calc(100% - 1.6rem), var(--gold) calc(100% - 1.6rem) calc(100% - .6rem), transparent 0);
}
.brand__name { font: 800 1.6rem/1.1 var(--font-display); color: var(--forest); text-decoration: none; }
.brand img { display: block; max-height: 8rem; width: auto; } /* runder Schul-Stempel: braucht Platz, damit der Text im Kreis lesbar bleibt */
@media (max-width: 74rem) { .brand img { max-height: 4.5rem; } } /* Media-Queries rechnen rem mit 16 px (nicht mit unserer 18-px-Basis): 74rem = 1184 px, so breit braucht das 7-Punkte-Menü */
.primary-nav { margin-left: auto; padding-right: max(var(--gutter), calc((100vw - var(--wrap)) / 2)); }
.menu { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.menu li { position: relative; }
.primary-nav a { display: block; padding: .8rem 1rem; color: #fff; font-weight: 700; text-decoration: none; }
.primary-nav a:hover { background: rgba(255, 255, 255, .14); }
.primary-nav :is(.current-menu-item, .current-menu-ancestor, .current_page_item) > a { box-shadow: inset 0 -4px var(--gold); }
.sub-menu { display: none; position: absolute; left: 0; top: 100%; z-index: 20; min-width: 16rem; margin: 0; padding: .5rem; list-style: none; background: #fff; box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .2); }
.primary-nav .sub-menu a { color: var(--forest); }
.primary-nav .sub-menu a:hover { background: var(--mist); }
.menu > li:last-child > .sub-menu { left: auto; right: 0; }
.menu li:hover > .sub-menu, .menu li:focus-within > .sub-menu { display: block; }
.nav-toggle { display: none; }

@media (max-width: 74rem) {
	.site-header__inner { flex-wrap: wrap; }
	.brand { padding-right: 3rem; }
	.nav-toggle { display: inline-flex; align-items: center; min-height: 44px; margin: 0 var(--gutter) 0 auto; padding: .5rem 1.25rem; border: 0; border-radius: .5rem; background: var(--gold); color: var(--ink); font: 700 1rem var(--font-body); cursor: pointer; }
	.primary-nav { display: none; width: 100%; padding: .5rem var(--gutter) 1rem; }
	.primary-nav.is-open { display: block; }
	.menu { flex-direction: column; }
	.sub-menu, .menu > li:last-child > .sub-menu { display: block; position: static; padding: 0 0 0 1rem; background: transparent; box-shadow: none; }
	.primary-nav .sub-menu a { color: #fff; }
}

/* ---------- Titelbereich (Seiten ohne Elementor, Beiträge, Archiv) ---------- */
.page-hero { margin-bottom: 2.5rem; padding: clamp(2rem, 6vw, 4rem) 0 clamp(3rem, 8vw, 5.5rem); background: var(--mist); clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%); }
.page-hero h1 { margin: 0; }
.page-hero__meta { margin: 0 0 .5rem; color: var(--muted); font-weight: 700; }
.entry { padding-bottom: 3rem; }

/* ---------- Inhalt (klassische Seiten, Beiträge, später auch importierte Joomla-Texte) ---------- */
.entry-content { max-width: 48rem; overflow-wrap: break-word; } /* lange URLs (Datenschutz) */
.entry-content::after { content: ""; display: table; clear: both; }
.entry-content img { border-radius: .5rem; }
.entry-image { margin: 0 0 2rem; }
.entry-image img { border-radius: .75rem; }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: .875rem; color: var(--muted); }
:is(.entry-content, .elementor-widget-text-editor) table { width: 100%; border-collapse: collapse; }
:is(.entry-content, .elementor-widget-text-editor) :is(th, td) { padding: .7rem .9rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
:is(.entry-content, .elementor-widget-text-editor) th { background: var(--forest); color: #fff; }
:is(.entry-content, .elementor-widget-text-editor) tbody tr:nth-child(even) { background: var(--mist); }
@media (max-width: 40rem) { :is(.entry-content, .elementor-widget-text-editor) table { display: block; overflow-x: auto; } }

/* ---------- Neuigkeiten-Karten ---------- */
.ls-news { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 1.5rem; }
.ls-card { position: relative; display: flex; flex-direction: column; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: .75rem; transition: border-color .15s, transform .15s; }
.ls-card:hover { border-color: var(--forest); transform: translateY(-2px); }
.ls-card:has(a:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.ls-card img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.ls-card__body { padding: 1rem 1.25rem 1.25rem; }
.ls-card__date { font-size: .875rem; color: var(--muted); font-weight: 700; }
.ls-card__title { margin: .25rem 0 .5rem; font-size: 1.2rem; }
.ls-card__title a { color: var(--forest); text-decoration: none; }
.ls-card__title a::after { content: ""; position: absolute; inset: 0; } /* ganze Karte klickbar */
.ls-card__title a:focus-visible { outline: none; box-shadow: none; }
.ls-card p { margin: 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: 2.5rem; }
.page-numbers { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .85rem; border: 2px solid var(--forest); border-radius: .5rem; font-weight: 700; text-decoration: none; }
.page-numbers.current { background: var(--forest); color: #fff; }
.page-numbers.dots { border-color: transparent; }

/* ---------- Fuß ---------- */
.site-footer { margin-top: 4rem; padding-top: calc(var(--cut) + 2.5rem); background: var(--forest); color: #fff; clip-path: polygon(0 var(--cut), 100% 0, 100% 100%, 0 100%); }
.site-footer a { color: #fff; }
.site-footer :is(.widget-title, h2) { margin-top: 0; color: var(--gold); font-size: 1.2rem; }
.site-footer p { margin-block: 0 .75rem; }
.site-footer__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 2rem; }
.site-footer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1.5rem; margin-top: 2rem; padding-block: 1.25rem 1.5rem; border-top: 1px solid rgba(255, 255, 255, .25); font-size: .9rem; }
.site-footer__bar p { margin: 0; }
.site-footer__bar a { display: inline-block; padding: .6rem .25rem; }

/* ---------- Elementor-Bausteine (die JSON-Vorlagen vergeben nur diese Klassen) ---------- */
.elementor-heading-title { line-height: 1.15; }
.e-con.ls-section { padding: clamp(2rem, 5vw, 4rem) var(--gutter); }
.e-con.ls-section > .e-con-inner { max-width: var(--wrap); }
.e-con.ls-row, .e-con.ls-actions, .e-con.ls-row > .e-con:not(.ls-box) { padding: 0; } /* Elementor gibt jedem Container 10 px Innenabstand – verschachtelt wäre das eingerückt */
.e-con.ls-row { align-items: stretch; }
.e-con.ls-row > .e-con, .e-con.ls-row > .elementor-widget { flex: 1 1 18rem; }
.e-con.ls-tiles .ls-row > .elementor-widget { flex-basis: 13rem; } /* vier Kacheln in einer Reihe */
.e-con.ls-actions { flex-direction: row; flex-wrap: wrap; } /* Button-Reihe: Buttons behalten ihre natürliche Breite */
.e-con.ls-actions > .elementor-widget { flex: 0 0 auto; width: auto; }
.ls-center { text-align: center; }
.e-con.ls-lead-in { max-width: 40rem; }

/* Hero: tiefes Waldgrün, schräger Schnitt, Löwenmähne als Strahlenkranz */
.e-con.ls-hero { position: relative; overflow: hidden; padding-block: clamp(2rem, 5vw, 3.5rem) calc(var(--cut) + clamp(4rem, 7vw, 6rem)); background: var(--forest); color: #fff; --e-global-color-primary: #fff; --e-global-color-text: #fff; clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), 0 100%); }
/* ::after statt ::before: Elementor belegt .e-con::before für Hintergrund-Overlays (content: none) */
.e-con.ls-hero::after { content: ""; position: absolute; z-index: 0; left: auto; bottom: auto; right: -9rem; top: -9rem; width: min(30rem, 70vw); height: auto; aspect-ratio: 1; border-radius: 50%; background: repeating-conic-gradient(var(--gold) 0 5deg, transparent 5deg 10deg); -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%); mask: radial-gradient(circle, transparent 52%, #000 53%); pointer-events: none; }
.ls-hero > .e-con-inner { position: relative; z-index: 1; }
.ls-hero .elementor-heading-title { color: #fff; }
.e-con.e-con.ls-hero > .e-con-inner > .ls-lead { max-width: 34rem; font-size: 1.25rem; } /* Selektor schlägt Elementors `.e-con.e-con > .e-con-inner > .elementor-widget { max-width: 100% }` */
.e-con.e-con.ls-hero > .e-con-inner > .ls-hero__title { max-width: 42rem; } /* Überschrift bricht um, statt unter den Strahlenkranz zu laufen */
.ls-hero .ls-hero__title .elementor-heading-title { font-size: clamp(2.4rem, 6vw, 4.5rem); font-weight: 800; }
@media (max-width: 60rem) { .e-con.ls-hero::after { opacity: .3; } } /* auf schmalen Bildschirmen nur noch Hintergrund-Dekor */
.ls-hero .ls-hero__eyebrow { color: var(--gold); font: 700 1rem var(--font-display); letter-spacing: .06em; text-transform: uppercase; }

/* Hero für Unterseiten: kompakter, hell */
.e-con.ls-hero--page { padding-block: clamp(2rem, 5vw, 3.5rem) calc(var(--cut) + clamp(2.5rem, 6vw, 4rem)); background: var(--mist); color: var(--ink); --e-global-color-primary: var(--forest); --e-global-color-text: var(--ink); }
.e-con.ls-hero--page::after { display: none; }
.ls-hero--page .elementor-heading-title { color: var(--forest); }
.ls-hero--page .ls-lead { font-size: 1.15rem; }

/* Buttons */
body .elementor-widget-button .elementor-button { min-height: 44px; padding: .8rem 1.6rem; border-radius: 999px; background: var(--gold); color: var(--ink); font: 700 1rem var(--font-display); transition: background .15s, color .15s; }
body .elementor-widget-button .elementor-button:hover, body .elementor-widget-button .elementor-button:focus { background: var(--ink); color: #fff; }
body .ls-btn-ghost .elementor-button { background: transparent; color: #fff; box-shadow: inset 0 0 0 2px #fff; }
body .ls-btn-ghost .elementor-button:hover, body .ls-btn-ghost .elementor-button:focus { background: #fff; color: var(--forest); }
body .ls-hero--page .ls-btn-ghost .elementor-button { color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); }
body .ls-hero--page .ls-btn-ghost .elementor-button:hover { background: var(--forest); color: #fff; }

/* Schnellzugriff-Kacheln, schieben sich über den Hero-Schnitt */
.e-con.ls-tiles { position: relative; z-index: 2; margin-top: calc(-1 * (var(--cut) + clamp(3rem, 6vw, 5rem))); padding-block: 0 1rem; }
.ls-tile { position: relative; padding: 1.25rem; background: #fff; border: 1px solid var(--line); border-radius: .75rem; box-shadow: 0 .4rem 1.2rem rgba(20, 69, 47, .1); transition: transform .15s, border-color .15s; }
.ls-tile:hover { transform: translateY(-2px); border-color: var(--forest); }
.ls-tile:has(a:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.ls-tile .elementor-icon { color: var(--forest); font-size: 2rem; }
.ls-tile .elementor-icon-box-title { margin: .6rem 0 .25rem; font: 700 1.2rem/1.2 var(--font-display); }
body .ls-tile .elementor-icon-box-title a { color: var(--forest); text-decoration: none; }
.ls-tile .elementor-icon-box-title a::after { content: ""; position: absolute; inset: 0; }
.ls-tile .elementor-icon-box-title a:focus-visible { outline: none; box-shadow: none; }
.ls-tile .elementor-icon-box-description { margin: 0; color: var(--muted); }

/* Info-Kasten (Sekretariat, Öffnungszeiten …) */
.e-con.ls-box { padding: 1.5rem 1.75rem; background: var(--mist); border-left: 6px solid var(--gold); border-radius: .5rem; }
.ls-box h2, .ls-box h3 { margin-top: 0; font-size: 1.4rem; }
.ls-box :is(p, ul) { margin-block: 0 .75rem; }
.ls-box address { font-style: normal; }

/* Terminliste */
.ls-dates { margin: 0; padding: 0; list-style: none; }
.ls-dates li { display: flex; gap: 1rem; padding-block: .75rem; border-bottom: 1px solid var(--line); }
.ls-dates time { flex: none; min-width: 6.5rem; color: var(--forest); font-weight: 700; }
.ls-table { overflow-x: auto; }
.ls-table caption { padding-bottom: .5rem; text-align: left; font: 700 1.2rem var(--font-display); color: var(--forest); }
