/*
Theme Name: Arboro
Theme URI: https://www.arboro.ch
Author: Kamnusch Scheider
Description: Theme für die Arboro Schule Bern – naturnah, ruhig, im Design des Arboro-Logos. Inhalte werden im Block-Editor gepflegt; Vorlagen für Stufen, Angebote und Team liegen unter „Muster“ → „Arboro“.
Version: 1.3.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: arboro
*/

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

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

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

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

a { text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--wp--preset--color--ocker); outline-offset: 2px; border-radius: 4px; }

.screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
	height: 1px; margin: -1px; overflow: hidden; padding: 0;
	position: absolute !important; width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto; z-index: 1000;
	top: 0.75rem; left: 0.75rem; padding: 0.75rem 1rem;
	background: var(--wp--preset--color--rinde); color: var(--wp--preset--color--papier);
	border-radius: 8px;
}

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site-main { flex: 1; }

.wrap {
	width: 100%;
	max-width: calc(var(--wp--style--global--wide-size) + 2 * clamp(1rem, 4vw, 2rem));
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2rem);
}

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

.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgb(255 255 255 / 0.96);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border-bottom: 2px solid var(--wp--preset--color--moos);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }

.site-header__inner {
	display: flex; align-items: center; gap: 1.5rem;
	min-height: 84px;
}

.site-brand { display: inline-flex; align-items: center; flex-shrink: 0; color: var(--wp--preset--color--rinde); text-decoration: none; }
.site-brand svg, .site-brand img { display: block; height: 66px; width: auto; }
.site-brand:hover { color: var(--wp--preset--color--tinte); }

.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; flex-wrap: wrap; align-items: center; gap: 0.15rem 0.25rem; }
.site-nav li { position: relative; }
.site-nav a {
	display: block; padding: 0.5rem 0.75rem; border-radius: 999px;
	color: var(--wp--preset--color--tinte); text-decoration: none; font-weight: 500;
	font-size: 1.02rem;
}
.site-nav a:hover { background: var(--wp--preset--color--sand); }
.site-nav > ul > .current-menu-item > a,
.site-nav > ul > .current-menu-ancestor > a,
.site-nav > ul > .current_page_item > a,
.site-nav > ul > .current_page_ancestor > a { text-decoration: underline; text-decoration-color: var(--wp--preset--color--moos); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }
.site-nav .sub-menu .current-menu-item > a { background: var(--wp--preset--color--sand); }

/* Untermenü (Desktop) */
.site-nav .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 220px;
	padding: 0.5rem; margin-top: 0.25rem;
	background: var(--wp--preset--color--weiss);
	border-radius: 16px;
	box-shadow: 0 18px 40px -18px rgb(38 42 12 / 0.35), 0 0 0 1px rgb(61 63 25 / 0.08);
	opacity: 0; visibility: hidden; transform: translateY(-4px);
	transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
.site-nav li:hover > .sub-menu,
.site-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub-menu a { border-radius: 10px; font-weight: 600; }
.site-nav .menu-item-has-children > a::after {
	content: ""; display: inline-block; width: 0.4em; height: 0.4em; margin-left: 0.45em;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: translateY(-0.2em) rotate(45deg);
}

/* Sprachumschalter (Polylang) */
.lang-switch { display: flex; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.lang-switch a, .lang-switch span {
	display: inline-grid; place-items: center; min-width: 2.4rem; height: 2.4rem; padding: 0 0.6rem;
	border-radius: 999px; font-weight: 800; font-size: 0.82rem; letter-spacing: 0.06em;
	text-transform: uppercase; text-decoration: none;
	color: var(--wp--preset--color--rinde);
	border: 1.5px solid color-mix(in srgb, var(--wp--preset--color--rinde) 30%, transparent);
}
.lang-switch .current-lang a { background: var(--wp--preset--color--rinde); color: var(--wp--preset--color--papier); border-color: var(--wp--preset--color--rinde); }

.nav-toggle {
	display: none; margin-left: auto;
	align-items: center; gap: 0.5rem;
	padding: 0.55rem 1rem; border-radius: 999px; border: 0;
	background: var(--wp--preset--color--rinde); color: var(--wp--preset--color--papier);
	font: inherit; font-weight: 700; cursor: pointer;
}
.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
	display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
	transition: transform .2s ease;
}
.nav-toggle__bars::before, .nav-toggle__bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-open .nav-toggle__bars { background: transparent; }
.nav-open .nav-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1180px) {
	.site-header__inner { min-height: 72px; flex-wrap: wrap; }
	.site-brand svg, .site-brand img { height: 48px; }
	.nav-toggle { display: inline-flex; }
	.site-header__tools { order: 2; }
	.site-nav {
		order: 3; flex-basis: 100%; margin: 0;
		display: none; padding: 0.5rem 0 1.25rem;
	}
	.nav-open .site-nav { display: block; }
	.site-nav > ul { flex-direction: column; align-items: stretch; gap: 0.15rem; }
	.site-nav a { padding: 0.75rem 1rem; font-size: 1.05rem; }
	.site-nav .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		box-shadow: none; background: transparent; padding: 0 0 0 1rem; margin: 0; min-width: 0;
	}
	.site-nav .menu-item-has-children > a::after { display: none; }
}

/* ---------- Seitenkopf ---------- */

.page-hero {
	position: relative; overflow: hidden;
	padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 2.5rem);
}
.page-hero__ring {
	position: absolute; right: -60px; top: -40px; width: clamp(180px, 28vw, 340px);
	color: var(--wp--preset--color--sand); pointer-events: none; z-index: 0;
}
.page-hero__ring svg { width: 100%; height: auto; display: block; }
.page-hero .wrap {
	position: relative; z-index: 1;
	max-width: calc(var(--wp--style--global--content-size) + 2 * clamp(1rem, 4vw, 2rem));
}
.page-hero--wide .wrap { max-width: calc(var(--wp--style--global--wide-size) + 2 * clamp(1rem, 4vw, 2rem)); }
.page-hero h1 { margin: 0; max-width: 18ch; }
.page-hero__kicker {
	margin: 0 0 0.5rem; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase;
	color: var(--wp--preset--color--moos);
}
.page-hero__kicker a { color: inherit; text-decoration: none; }
.page-hero__kicker a:hover { text-decoration: underline; }

/* ---------- Inhalt ---------- */

.entry-content { padding-bottom: clamp(3rem, 7vw, 5rem); }
.entry-content > *:first-child { margin-top: 0; }

/* Startseite: Abstand zwischen Abschnitten */
.home .entry-content > .alignfull:first-child { margin-bottom: var(--wp--preset--spacing--50); }

/* Karten-Stil für Gruppen */
.wp-block-group.is-style-arboro-karte {
	background: var(--wp--preset--color--weiss);
	border-radius: 22px;
	padding: clamp(1.25rem, 3vw, 1.75rem);
	border: 1px solid #ECE4C8;
	box-shadow: 0 14px 32px -26px rgb(50 51 53 / 0.35);
	height: 100%;
}
.wp-block-group.is-style-arboro-karte > :first-child { margin-top: 0; }
.wp-block-group.is-style-arboro-karte > :last-child { margin-bottom: 0; }
.wp-block-group.is-style-arboro-karte.is-layout-flex > .wp-block-buttons:last-child { margin-top: auto; padding-top: 0.5rem; }

/* Salbei-Fläche mit Jahresring */
.wp-block-group.is-style-arboro-ring {
	position: relative; overflow: hidden;
	background: var(--wp--preset--color--salbei);
	border-radius: 28px;
	padding: clamp(1.75rem, 5vw, 3.25rem);
}
.wp-block-group.is-style-arboro-ring::after {
	content: ""; position: absolute; right: -50px; bottom: -60px; width: 260px; height: 250px;
	background: var(--wp--preset--color--rinde); opacity: 0.08;
	-webkit-mask: var(--arboro-ring) center / contain no-repeat;
	mask: var(--arboro-ring) center / contain no-repeat;
	pointer-events: none;
}
.wp-block-group.is-style-arboro-ring > * { position: relative; z-index: 1; }

/* Abzeichen (z. B. „freie Plätze“) */
.arboro-badge, p.is-style-arboro-badge {
	display: inline-block; margin: 0;
	padding: 0.2rem 0.75rem; border-radius: 999px;
	background: var(--wp--preset--color--ocker); color: var(--wp--preset--color--tinte);
	font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em;
}

/* Info-Liste in Stufen-Karten */
.is-style-arboro-info { list-style: none; padding: 0; margin: 0; }
.is-style-arboro-info li { padding: 0.45rem 0; border-bottom: 1px dashed color-mix(in srgb, var(--wp--preset--color--rinde) 22%, transparent); }
.is-style-arboro-info li:last-child { border-bottom: 0; }

/* Zweitbutton */
/* Hauptknopf gefüllt (Oliv), Zweitknopf nur Rahmen – wie auf der bisherigen Seite */
.wp-block-button:not(.is-style-outline) > .wp-block-button__link {
	background: var(--wp--preset--color--rinde); color: var(--wp--preset--color--weiss); border-color: var(--wp--preset--color--rinde);
}
.wp-block-button:not(.is-style-outline) > .wp-block-button__link:hover { background: var(--wp--preset--color--moos); border-color: var(--wp--preset--color--moos); }
.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent; color: var(--wp--preset--color--tinte); border: 1.5px solid currentColor;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--wp--preset--color--moos); border-color: var(--wp--preset--color--moos); color: var(--wp--preset--color--weiss); }

/* Runde Symbole von Andrea Jäggi */
.wp-block-image.is-style-arboro-symbol { margin-bottom: 0.25rem; }
.wp-block-image.is-style-arboro-symbol img { width: 120px; height: 120px; object-fit: contain; border-radius: 50%; }
.is-style-arboro-karte .wp-block-image.is-style-arboro-symbol img { width: 96px; height: 96px; }
.wp-block-image.is-style-arboro-symbol.aligncenter img { margin-inline: auto; }

/* Illustrations-Band (Banner) */
.wp-block-image.is-style-arboro-banner { margin: 0 !important; }
.wp-block-image.is-style-arboro-banner img { width: 100%; height: clamp(180px, 30vw, 380px); object-fit: cover; border-radius: 0; display: block; }

/* Galerien weicher */
.wp-block-gallery .wp-block-image img { border-radius: 14px; }

/* Tabellen */
.wp-block-table table { border-collapse: collapse; width: 100%; }
.wp-block-table td, .wp-block-table th { border: 0; border-bottom: 1px solid var(--wp--preset--color--salbei); padding: 0.6rem 0.5rem; text-align: left; }
.wp-block-table thead { border-bottom: 2px solid var(--wp--preset--color--rinde); }

/* ---------- Blog ---------- */

.post-grid {
	display: grid; gap: 1.5rem;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
	padding-bottom: clamp(3rem, 7vw, 5rem);
}
.post-card {
	display: flex; flex-direction: column;
	background: var(--wp--preset--color--weiss); border-radius: 22px; overflow: hidden;
	box-shadow: 0 14px 32px -22px rgb(38 42 12 / 0.35);
}
.post-card__img { aspect-ratio: 3 / 2; background: var(--wp--preset--color--sand); }
.post-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__ring { display: grid; place-items: center; height: 100%; color: var(--wp--preset--color--salbei); }
.post-card__ring svg { width: 38%; height: auto; }
.post-card__body { padding: 1.25rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.post-card__meta { font-size: 0.85rem; color: var(--wp--preset--color--moos); font-weight: 700; margin: 0; }
.post-card__title { margin: 0; font-size: 1.35rem; }
.post-card__title a { color: inherit; text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card:hover .post-card__title { text-decoration: underline; text-decoration-thickness: 2px; }
.post-card__excerpt p { margin: 0; }

.entry-meta { color: var(--wp--preset--color--moos); font-weight: 700; margin: 0.75rem 0 0; }

.pagination { display: flex; gap: 0.5rem; justify-content: center; padding-bottom: 4rem; }
.pagination .page-numbers {
	display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem;
	border-radius: 999px; text-decoration: none; font-weight: 700;
	background: var(--wp--preset--color--weiss); color: var(--wp--preset--color--rinde);
}
.pagination .current { background: var(--wp--preset--color--rinde); color: var(--wp--preset--color--papier); }

/* ---------- Fusszeile ---------- */

.site-footer {
	position: relative; overflow: hidden;
	background: var(--wp--preset--color--see);
	color: var(--wp--preset--color--tinte);
	padding-block: clamp(3rem, 6vw, 4.5rem) 1.5rem;
	margin-top: auto;
}
.site-footer::before {
	content: ""; position: absolute; left: -90px; bottom: -120px; width: 420px; height: 400px;
	background: var(--wp--preset--color--weiss); opacity: 0.25;
	-webkit-mask: var(--arboro-ring) center / contain no-repeat;
	mask: var(--arboro-ring) center / contain no-repeat;
	pointer-events: none;
}
.site-footer .wrap { position: relative; }
.site-footer a { color: var(--wp--preset--color--tinte); }
.site-footer h2, .site-footer h3, .site-footer .widget-title {
	color: var(--wp--preset--color--tinte); font-size: 1.15rem; margin: 0 0 0.75rem;
}
.footer-grid {
	display: grid; gap: 2rem 3rem;
	grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr));
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid p { margin: 0 0 0.75rem; }
.footer-brand { color: var(--wp--preset--color--rinde); display: inline-block; margin-bottom: 1rem; }
.footer-brand svg { height: 70px; width: auto; display: block; }
.site-footer .widget { margin-bottom: 1.5rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 0.35rem; }

.footer-bottom {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem;
	margin-top: 2.5rem; padding-top: 1.25rem;
	border-top: 1px solid rgb(50 51 53 / 0.15);
	font-size: 0.88rem;
}
.footer-bottom ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }

/* ---------- 404 ---------- */
.not-found { text-align: center; padding-block: 4rem 6rem; }
.not-found__ring { width: 140px; margin: 0 auto 1.5rem; color: var(--wp--preset--color--moos); }

/* ---------- Formulare ---------- */

.arboro-form {
	background: var(--wp--preset--color--weiss);
	border-radius: 22px;
	padding: clamp(1.25rem, 4vw, 2.25rem);
	box-shadow: 0 1px 0 rgb(61 63 25 / 0.06), 0 14px 32px -22px rgb(38 42 12 / 0.35);
	display: grid; gap: 1.25rem;
	scroll-margin-top: 110px;
}
.arboro-form__feld { display: grid; gap: 0.4rem; }
.arboro-form label, .arboro-form legend { font-weight: 700; color: var(--wp--preset--color--rinde); }
.arboro-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.arboro-form legend { margin-bottom: 0.4rem; padding: 0; }
.arboro-form input[type="text"], .arboro-form input[type="email"], .arboro-form input[type="tel"], .arboro-form textarea {
	width: 100%; font: inherit; color: var(--wp--preset--color--tinte);
	padding: 0.7rem 0.9rem; border-radius: 12px;
	border: 1.5px solid color-mix(in srgb, var(--wp--preset--color--rinde) 25%, transparent);
	background: var(--wp--preset--color--papier);
	transition: border-color .15s, background .15s;
}
.arboro-form textarea { resize: vertical; min-height: 6rem; }
.arboro-form input:focus, .arboro-form textarea:focus { outline: none; border-color: var(--wp--preset--color--rinde); background: var(--wp--preset--color--weiss); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wp--preset--color--ocker) 45%, transparent); }
.arboro-form__check { display: flex; align-items: center; gap: 0.6rem; font-weight: 500 !important; color: var(--wp--preset--color--tinte) !important; cursor: pointer; padding: 0.15rem 0; }
.arboro-form__check input { width: 1.15rem; height: 1.15rem; accent-color: var(--wp--preset--color--rinde); margin: 0; flex-shrink: 0; }
.arboro-form__pflicht { color: #9a3b1a; }
.arboro-form .has-error input, .arboro-form .has-error textarea { border-color: #9a3b1a; }
.arboro-form__hinweis { margin: 0; color: #9a3b1a; font-size: 0.88rem; font-weight: 700; }
.arboro-form__fehler { background: #f6e3da; color: #6e2a12; border-radius: 12px; padding: 0.75rem 1rem; font-weight: 700; }
.arboro-form__datenschutz { margin: 0; font-size: 0.85rem; color: var(--wp--preset--color--moos); }
.arboro-form__honig { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.arboro-form button.wp-block-button__link { border: 0; cursor: pointer; font-family: inherit; }
.arboro-form--danke { background: var(--wp--preset--color--salbei); }
.arboro-form__danke { margin: 0; font-family: var(--wp--preset--font-family--fraunces); font-size: 1.35rem; font-weight: 600; color: var(--wp--preset--color--rinde); }

/* Volle Breite wirklich bis an den Rand */
.entry-content.has-global-padding > .alignfull {
	margin-left: calc(var(--wp--style--root--padding-left, clamp(1rem, 4vw, 2rem)) * -1) !important;
	margin-right: calc(var(--wp--style--root--padding-right, clamp(1rem, 4vw, 2rem)) * -1) !important;
	max-width: none;
}
@media (max-width: 700px) {
	.wp-block-image.is-style-arboro-banner img { height: auto; object-fit: contain; }
}
