/* =========================================================
   Pferdegestützte Therapie Bern – Stylesheet
   Farben: Grün aus dem Logo, Weide, Fuchs
   Schriften: Systemschriften (keine externen Server, schnell)
   ========================================================= */

:root {
  --bg: #F4F6EF;          /* Nebel */
  --surface: #FFFFFF;
  --band: #E7EDDC;        /* Weide hell */
  --ink: #1F2A17;         /* Tanne */
  --ink-soft: #4D5A44;
  --aare: #4A7419;        /* Aare */
  --aare-strong: #3A5C12;
  --aare-tint: #DCE8C8;
  --fuchs: #9A4A20;       /* Fuchs – die Fellfarbe aller drei Pferde */
  --line: #CFD8C2;
  --on-aare: #FFFFFF;
  --footer-bg: #1F2A17;
  --footer-ink: #E1E8D6;
  --footer-link: #B4DA74;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Charter, "Bitstream Charter", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 72rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --r-photo: 18px;
  --r-small: 10px;
  --space-section: clamp(3rem, 7vw, 6rem);

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141A10;
    --surface: #1C2417;
    --band: #1F2919;
    --ink: #E8EEDF;
    --ink-soft: #AEBBA2;
    --aare: #9BCB4F;
    --aare-strong: #B4DA74;
    --aare-tint: #2C3D1E;
    --fuchs: #E59C6E;
    --line: #34432A;
    --on-aare: #141A10;
    --footer-bg: #0E130B;
    --footer-ink: #D9E2CD;
    --footer-link: #B4DA74;
  }
}

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

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--aare); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--aare-strong); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--aare); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 .6em; letter-spacing: -.01em; text-wrap: balance; }
h1 { font-size: clamp(2.2rem, 1.5rem + 2.8vw, 3.7rem); }
h2 { font-size: clamp(1.65rem, 1.3rem + 1.3vw, 2.3rem); }
h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: 0; }

p { margin: 0 0 1em; }
p, li { text-wrap: pretty; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.measure { max-width: 38em; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 10;
  background: var(--aare); color: var(--on-aare); padding: .6rem 1rem; border-radius: var(--r-small);
  font-family: var(--sans); font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

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

.site-header { padding-block: 1.25rem; }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; }

.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-logo { display: block; height: clamp(3.4rem, 2.6rem + 2.4vw, 4.6rem); width: auto; }
.brand-name { display: block; font-size: 1.2rem; line-height: 1.2; }
.brand-sub { display: block; font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); letter-spacing: .01em; }

.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.4rem; }
.main-nav a {
  font-family: var(--sans); font-size: 1rem; font-weight: 500; color: var(--ink);
  text-decoration: none; padding-block: .35rem; border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--aare); }
.main-nav a[aria-current="page"] { color: var(--aare); border-bottom-color: var(--aare); }

@media (max-width: 40rem) {
  .header-inner { flex-direction: column; align-items: flex-start; }
  .main-nav ul { gap: .25rem 1.1rem; }
}

/* ---------- Buttons ---------- */

.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-size: 1rem; font-weight: 600; line-height: 1.2;
  padding: .85em 1.35em; border-radius: 999px; text-decoration: none;
  background: var(--aare); color: var(--on-aare); border: 2px solid var(--aare);
  cursor: pointer;
}
.btn:hover { background: var(--aare-strong); border-color: var(--aare-strong); color: var(--on-aare); }
.btn-ghost { background: transparent; color: var(--aare); }
.btn-ghost:hover { background: var(--aare-tint); color: var(--aare-strong); border-color: var(--aare-strong); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* ---------- Abschnitte ---------- */

.section { padding-block: var(--space-section); }
.band { background: var(--band); }

.page-head { padding-top: clamp(1.5rem, 4vw, 3rem); padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.lead { font-size: clamp(1.2rem, 1.05rem + .5vw, 1.4rem); line-height: 1.55; color: var(--ink-soft); max-width: 34em; }

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

.hero { padding-top: .5rem; }
.hero-photo { margin: 0; }
.hero-photo img {
  width: 100%; max-height: 72vh; object-fit: cover; border-radius: var(--r-photo);
  background: var(--band);
}
.hero-text { display: grid; gap: 1rem 3rem; margin-top: clamp(1.75rem, 4vw, 3rem); }
.hero-text h1 { margin: 0; }
.hero-text .lead { margin-bottom: 0; }
@media (min-width: 56rem) {
  .hero-text { grid-template-columns: 1.1fr 1fr; align-items: end; }
}

/* Das Wortfeld – die Worte der alten Startseite */
.wort-grid { display: grid; gap: 2.5rem; align-items: center; }
.wort-grid figure { margin: 0; }
.wort-grid img { border-radius: var(--r-photo); width: 100%; background: var(--band); }
@media (max-width: 55.99rem) { .wort-grid img { max-height: 26rem; object-fit: cover; } }
@media (min-width: 56rem) {
  .wort-grid { grid-template-columns: 5fr 7fr; gap: 4rem; }
}

.wortfeld {
  list-style: none; margin: 0; padding: 0;
  font-size: clamp(1.5rem, 1rem + 1.9vw, 2.55rem);
  line-height: 1.4; letter-spacing: -.005em;
}
.wortfeld li { display: inline; white-space: nowrap; }
.wortfeld li:not(:last-child)::after { content: "\00a0•"; color: var(--aare); }
.js .wortfeld li { opacity: 0; }
.js .wortfeld.is-visible li { animation: atmen 1.1s ease forwards; animation-delay: calc(var(--i) * 75ms); }
@keyframes atmen { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .js .wortfeld li { opacity: 1; }
  .js .wortfeld.is-visible li { animation: none; }
}

/* Angebote als ruhige Liste */
.angebote { display: grid; gap: 2rem; margin: 2rem 0 0; padding: 0; list-style: none; }
.angebote li { border-top: 2px solid var(--aare); padding-top: 1rem; }
.angebote h3 { margin-bottom: .35em; }
.angebote p { margin: 0; color: var(--ink-soft); }
@media (min-width: 48rem) { .angebote { grid-template-columns: repeat(3, 1fr); } }

/* Gut zu wissen */
.fakten { display: grid; gap: 0 3rem; margin: 2rem 0 0; }
.fakten div { border-top: 1px solid var(--line); padding: 1rem 0; }
.fakten dt { font-family: var(--sans); font-size: .9rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .2rem; }
.fakten dd { margin: 0; }
@media (min-width: 48rem) { .fakten { grid-template-columns: 1fr 1fr; } }

/* Team-Vorschau */
.team-vorschau { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(.6rem, 2vw, 1.5rem); margin: 2rem 0 1.5rem; }
.team-vorschau figure { margin: 0; }
.team-vorschau img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%;
  border-radius: var(--r-photo); background: var(--surface);
}
.team-vorschau figcaption { margin-top: .6rem; font-size: 1.05rem; }
.team-vorschau figcaption span { display: block; font-family: var(--sans); font-size: .85rem; color: var(--ink-soft); }

/* Kontakt-Band */
.kontakt-band .wrap { display: grid; gap: 1.5rem 4rem; }
@media (min-width: 56rem) { .kontakt-band .wrap { grid-template-columns: 1fr 1fr; align-items: center; } }
.kontakt-gross { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); line-height: 1.45; margin: 0; }
.kontakt-gross a { text-decoration: none; color: var(--ink); border-bottom: 2px solid var(--aare); }
.kontakt-gross a:hover { color: var(--aare); }
.kontakt-gross .zeile { display: block; margin-bottom: .35rem; }

/* ---------- Inhaltsseiten mit Seitenmenü ---------- */

.mit-toc { display: grid; gap: 2rem 4rem; margin-bottom: var(--space-section); }
.toc { font-family: var(--sans); font-size: .95rem; }
.toc p { font-weight: 600; color: var(--ink-soft); margin-bottom: .5rem; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: .3rem 0 .3rem 1rem; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; color: var(--ink); }
.toc a:hover { color: var(--aare); border-left-color: var(--aare); }
@media (min-width: 60rem) {
  .mit-toc { grid-template-columns: 14rem minmax(0, 1fr); }
  .toc { position: sticky; top: 2rem; align-self: start; }
}
@media (max-width: 59.99rem) { .toc { display: none; } }

.inhalt > section + section { margin-top: clamp(2.5rem, 5vw, 4rem); }
.inhalt section { scroll-margin-top: 1.5rem; max-width: 40em; }
.inhalt ul { padding-left: 1.2em; }
.inhalt li { margin-bottom: .45em; }
.inhalt li::marker { color: var(--aare); }

.zitat {
  margin: 2rem 0; padding: .25rem 0 .25rem 1.4rem; border-left: 3px solid var(--aare);
  font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); line-height: 1.5;
}
.zitat p:last-of-type { margin-bottom: .6rem; }
.zitat footer { font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); }

.hinweis {
  background: var(--surface); border-radius: var(--r-small); padding: 1rem 1.25rem;
  border-left: 4px solid var(--fuchs); font-size: 1.05rem;
}
.quelle { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); }

/* Wochenplan */
.woche { width: 100%; max-width: 32rem; border-collapse: separate; border-spacing: 4px; font-family: var(--sans); table-layout: fixed; }
.woche caption { text-align: left; font-size: .95rem; color: var(--ink-soft); padding-bottom: .5rem; }
.woche th { font-size: .9rem; font-weight: 600; padding: .3rem; }
.woche thead th { text-align: center; }
.woche thead td { width: 6.5rem; background: none; border: 0; }
.woche tbody th { text-align: left; font-weight: 500; }
.woche td { height: 2.6rem; border-radius: 8px; text-align: center; vertical-align: middle; background: var(--surface); border: 1px solid var(--line); }
.woche td.ja { background: var(--aare); border-color: var(--aare); color: var(--on-aare); }
.woche td svg { width: 1.1rem; height: 1.1rem; display: inline-block; vertical-align: middle; }
@media (max-width: 30rem) { .woche thead td { width: 5.4rem; } .woche tbody th { font-size: .82rem; } }

/* Preise */
.preise { width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 1.05rem; }
.preise th, .preise td { text-align: left; padding: .85rem .5rem .85rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.preise thead th { font-family: var(--sans); font-size: .88rem; font-weight: 600; color: var(--ink-soft); }
.preise td.dauer, .preise td.preis { font-family: var(--sans); white-space: nowrap; font-variant-numeric: tabular-nums; }
.preise td.preis { text-align: right; font-weight: 600; padding-right: 0; }
.preise thead th:last-child { text-align: right; padding-right: 0; }
.preise small { display: block; font-family: var(--sans); font-size: .85rem; color: var(--ink-soft); font-weight: 400; }

/* ---------- Team ---------- */

.person { display: grid; gap: 2rem 4rem; }
.person figure { margin: 0; }
.person img { border-radius: var(--r-photo); width: 100%; max-width: 26rem; background: var(--band); }
@media (min-width: 56rem) { .person { grid-template-columns: 2fr 3fr; } }

.werdegang { list-style: none; margin: 1.25rem 0 0; padding: 0 0 0 1.4rem; border-left: 2px solid var(--line); }
.werdegang li { position: relative; padding-bottom: 1.1rem; }
.werdegang li::before {
  content: ""; position: absolute; left: calc(-1.4rem - 6px); top: .55em;
  width: 10px; height: 10px; border-radius: 50%; background: var(--aare); box-shadow: 0 0 0 4px var(--bg);
}
.werdegang .jahr { display: block; font-family: var(--sans); font-size: .88rem; font-weight: 700; color: var(--aare); letter-spacing: .01em; }

.pferde { display: grid; gap: 3.5rem 4rem; }
@media (min-width: 56rem) { .pferde { grid-template-columns: 1fr 1fr; } }
.pferd figure { margin: 0 0 1.5rem; }
.pferd img { border-radius: var(--r-photo); width: 100%; max-height: 34rem; object-fit: cover; object-position: 50% 30%; background: var(--band); }
.pferd h2, .erinnerung h2 { color: var(--fuchs); }

.steckbrief { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1.25rem; margin: 0 0 1.5rem; font-size: 1.02rem; }
.steckbrief dt { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); padding-top: .15em; }
.steckbrief dd { margin: 0; }

.erinnerung .wrap { display: grid; gap: 2rem 4rem; }
@media (min-width: 56rem) { .erinnerung .wrap { grid-template-columns: 2fr 3fr; } }
.erinnerung figure { margin: 0; }
.erinnerung img { border-radius: var(--r-photo); width: 100%; max-width: 26rem; background: var(--surface); }
.erinnerung figcaption { font-family: var(--sans); font-size: .85rem; color: var(--ink-soft); margin-top: .5rem; }
.nachruf { margin: 2rem 0 0; padding: 1.5rem 1.5rem 1.25rem; background: var(--surface); border-radius: var(--r-small); font-style: italic; }
.nachruf footer { font-style: normal; font-family: var(--sans); font-size: .95rem; color: var(--ink-soft); }
.nachruf .datum { font-style: normal; font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); display: block; margin-bottom: .75rem; }

/* ---------- Bilder ---------- */

.galerie { columns: 2; column-gap: .75rem; }
@media (min-width: 44rem) { .galerie { columns: 3; } }
@media (min-width: 68rem) { .galerie { columns: 4; } }
.galerie a { display: block; margin-bottom: .75rem; break-inside: avoid; border-radius: var(--r-small); overflow: hidden; background: var(--band); }
.galerie img { width: 100%; transition: transform .4s ease; }
.galerie a:hover img { transform: scale(1.03); }
@media (prefers-reduced-motion: reduce) { .galerie img { transition: none; } .galerie a:hover img { transform: none; } }

.lightbox {
  padding: 0; border: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh;
  background: rgba(14, 19, 11, .94); color: #fff;
}
.lightbox::backdrop { background: rgba(14, 19, 11, .94); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: 92vw; max-height: 82vh; width: auto; height: auto; object-fit: contain; border-radius: 6px; }
.lb-btn {
  position: absolute; display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: #fff; border: 0; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, .25); }
.lb-btn svg { width: 1.4rem; height: 1.4rem; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; translate: 0 -50%; }
.lb-next { right: 1rem; top: 50%; translate: 0 -50%; }
.lb-count { position: absolute; bottom: 1.1rem; left: 0; right: 0; text-align: center; font-family: var(--sans); font-size: .9rem; opacity: .8; }
@media (max-width: 40rem) { .lb-prev, .lb-next { top: auto; bottom: .5rem; translate: none; } }

/* ---------- Kontakt ---------- */

.kontakt-grid { display: grid; gap: 3rem 4rem; }
@media (min-width: 56rem) { .kontakt-grid { grid-template-columns: 1fr 1fr; } }
.adresse { font-style: normal; font-size: 1.2rem; line-height: 1.6; margin-bottom: 1.5rem; }
.adresse strong { font-weight: 700; }
.karten-links { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.karten-links .btn { font-size: .95rem; padding: .65em 1.1em; }

.formular { display: grid; gap: 1.1rem; background: var(--surface); padding: clamp(1.25rem, 3vw, 2rem); border-radius: var(--r-photo); }
.formular label { display: block; font-family: var(--sans); font-size: .95rem; font-weight: 600; margin-bottom: .35rem; }
.formular .optional { font-weight: 400; color: var(--ink-soft); }
.formular input, .formular select, .formular textarea {
  width: 100%; font: inherit; font-family: var(--sans); font-size: 1rem; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-small); padding: .75rem .85rem;
}
.formular textarea { min-height: 9rem; resize: vertical; }
.formular input:focus-visible, .formular select:focus-visible, .formular textarea:focus-visible { outline: 3px solid var(--aare); outline-offset: 1px; }
.form-info { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); margin: 0; }
.form-status { font-family: var(--sans); font-size: .95rem; color: var(--aare); margin: 0; min-height: 1.4em; }

/* ---------- Fliesstext-Seiten ---------- */

.prose { max-width: 40em; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2rem; }
.prose ul { padding-left: 1.2em; }
.platzhalter { background: #FFF3B0; color: #3A2F00; padding: 0 .25em; border-radius: 3px; }

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

main { padding-bottom: var(--space-section); }
main.endet-mit-band { padding-bottom: 0; }
.site-footer { background: var(--footer-bg); color: var(--footer-ink); padding-block: 3rem 2.5rem; font-size: 1rem; }
.site-footer a { color: var(--footer-link); }
.footer-grid { display: grid; gap: 2rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr auto; align-items: start; } }
.footer-name { font-size: 1.15rem; margin-bottom: .4rem; }
.site-footer address { font-style: normal; line-height: 1.6; }
.footer-nav { list-style: none; margin: 0; padding: 0; font-family: var(--sans); font-size: .95rem; line-height: 2; }
.footer-label { background: #fff; border-radius: var(--r-small); padding: .5rem; width: 8.5rem; }
.footer-label img { width: 100%; }
.footer-copy { grid-column: 1 / -1; font-family: var(--sans); font-size: .85rem; opacity: .75; margin: 0; padding-top: 1.5rem; border-top: 1px solid rgba(255, 255, 255, .15); }

/* ---------- Druck ---------- */

@media print {
  .site-header nav, .site-footer, .actions, .toc, .formular, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: #000; }
}
