/* ============================================================
   style.css — Kanzlei Prütz & Weber
   ============================================================
   Aufbau der Datei:
   1. Variablen (Farben, Abstände)
   2. Grundlagen (Reset, Typografie)
   3. Bausteine (Kopf, Navigation, Fuß)
   4. Seitenteile (Hero, Kacheln, Formular)
   5. Mobil-Anpassungen ganz unten
   ============================================================ */


/* ---------- 1. Variablen ----------------------------------
   :root ist das <html>-Element. Variablen, die hier stehen,
   gelten überall. Farbe ändern? Nur hier, nicht an 40 Stellen.
   Verwendung später mit var(--tinte)
   ---------------------------------------------------------- */
:root {
    --tinte:        #16202b;   /* fast schwarz, mit Blaustich */
    --schiefer:     #37505f;   /* gedämpftes Blaugrau */
    --messing:      #a9863f;   /* Akzentfarbe, wie Kanzleischild */
    --messing-hell: #c9a95f;
    --papier:       #fbfaf8;   /* Hintergrund */
    --papier-tief:  #f0eeea;   /* abgesetzte Flächen */
    --linie:        #dedad3;
    --grau:         #5f6b73;   /* Fließtext gedämpft */

    --breite:  1120px;   /* maximale Inhaltsbreite */
    --radius:  4px;      /* bewusst klein — wirkt seriöser als runde Ecken */
}


/* ---------- 2. Grundlagen -------------------------------- */

/* Der Reset: Browser bringen eigene Abstände mit, die überall
   leicht anders sind. Die räumen wir erst mal weg. */
* {
    margin: 0;
    padding: 0;
    /* border-box = Padding und Border zählen zur Breite dazu.
       Ohne das wird ein Element mit width:100% + padding zu breit. */
    box-sizing: border-box;
}

html {
    /* Sprünge zu #ankern laufen sanft statt ruckartig */
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: var(--tinte);
    background: var(--papier);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Source Serif 4', Georgia, serif;
    line-height: 1.2;
    font-weight: 600;
    /* Verhindert, dass eine Überschrift mit einem einzelnen Wort endet */
    text-wrap: balance;
}

h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.2rem; }

/* clamp(min, wunsch, max) skaliert die Schrift mit der Fensterbreite.
   Spart uns viele Media Queries. */

p { color: var(--grau); }

a { color: var(--tinte); }

/* Fokus sichtbar machen — wichtig für Tastaturnutzer.
   :focus-visible greift nur bei Tastatur, nicht bei Mausklick. */
:where(a, button, input, textarea, select):focus-visible {
    outline: 2px solid var(--messing);
    outline-offset: 3px;
}

/* Zentrierter Container mit Innenabstand */
.wrap {
    max-width: var(--breite);
    margin-inline: auto;
    padding-inline: 24px;
}

/* Text nur für Screenreader, optisch unsichtbar.
   NICHT display:none nehmen — das würde ihn auch vorlesen-technisch entfernen. */
.visuell-versteckt {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.skip-link {
    position: absolute;
    left: -9999px;
    background: var(--tinte);
    color: #fff;
    padding: 12px 20px;
    z-index: 100;
}
.skip-link:focus {
    left: 12px;
    top: 12px;
}


/* ---------- 3. Kopf, Navigation, Fuß ---------------------- */

.topbar {
    background: var(--tinte);
    color: #cfd6dc;
    font-size: 14px;
}
.topbar__inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-block: 8px;
}
.topbar__tel {
    color: var(--messing-hell);
    text-decoration: none;
    font-weight: 500;
}
.topbar__tel:hover { text-decoration: underline; }

.kopf {
    background: var(--papier);
    border-bottom: 1px solid var(--linie);
    position: sticky;   /* bleibt beim Scrollen oben kleben */
    top: 0;
    z-index: 50;
}
.kopf__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-block: 18px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}
/* Das Paragraphenzeichen ist das Erkennungsmerkmal der Seite.
   Es taucht im Logo, als Trenner und bei den Rechtsgebieten auf. */
.logo__zeichen {
    font-family: 'Source Serif 4', serif;
    font-size: 34px;
    line-height: 1;
    color: var(--messing);
}
.logo__text strong {
    display: block;
    font-family: 'Source Serif 4', serif;
    font-size: 20px;
    font-weight: 600;
}
.logo__text small {
    display: block;
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--grau);
}

.nav__liste {
    display: flex;
    gap: 28px;
    list-style: none;
}
.nav__link {
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    padding-block: 6px;
    border-bottom: 2px solid transparent;
    transition: border-color .2s, color .2s;
}
.nav__link:hover { border-bottom-color: var(--linie); }
.nav__link--aktiv {
    border-bottom-color: var(--messing);
    color: var(--messing);
}

.nav-schalter {
    display: none;   /* nur auf dem Handy sichtbar, siehe unten */
    background: none;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    width: 46px; height: 42px;
    cursor: pointer;
    position: relative;
}
/* Die drei Striche: einer als echtes Element, zwei per ::before/::after */
.nav-schalter__balken,
.nav-schalter__balken::before,
.nav-schalter__balken::after {
    position: absolute;
    left: 12px;
    width: 20px; height: 2px;
    background: var(--tinte);
}
.nav-schalter__balken { top: 20px; }
.nav-schalter__balken::before { content: ''; top: -6px; left: 0; }
.nav-schalter__balken::after  { content: ''; top:  6px; left: 0; }

.fuss {
    background: var(--tinte);
    color: #b9c3cb;
    margin-top: 80px;
    padding-top: 56px;
    font-size: 15px;
}
.fuss__inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 36px;
    padding-bottom: 40px;
}
.fuss__titel {
    font-size: 13px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--messing-hell);
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
}
.fuss p { color: #b9c3cb; }
.fuss a { color: #fff; text-decoration: none; }
.fuss a:hover { text-decoration: underline; }
.fuss__unten {
    border-top: 1px solid rgba(255,255,255,.12);
    padding-block: 20px;
    color: #7d8993;
}


/* ---------- 4. Seitenteile -------------------------------- */

/* Der Hero-Bereich auf der Startseite */
.hero {
    background: var(--papier-tief);
    border-bottom: 1px solid var(--linie);
    padding-block: clamp(56px, 9vw, 104px);
}
.hero__inner { max-width: 760px; }
.hero__auge {           /* "Eyebrow" — die kleine Zeile über der Überschrift */
    font-size: 13px;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--messing);
    font-weight: 600;
    margin-bottom: 16px;
}
.hero h1 { margin-bottom: 20px; }
.hero__text {
    font-size: 19px;
    max-width: 60ch;   /* ca. 60 Zeichen pro Zeile — angenehmste Lesebreite */
}

.knopfreihe {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 32px;
}
.knopf {
    display: inline-block;
    padding: 14px 26px;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: 1px solid var(--tinte);
    transition: background .2s, color .2s;
}
.knopf--voll {
    background: var(--tinte);
    color: #fff;
}
.knopf--voll:hover { background: var(--schiefer); border-color: var(--schiefer); }
.knopf--leer:hover { background: var(--tinte); color: #fff; }

.abschnitt { padding-block: 72px; }
.abschnitt--getoent { background: var(--papier-tief); }

.abschnitt__kopf {
    max-width: 60ch;
    margin-bottom: 40px;
}
.abschnitt__kopf h2 { margin-bottom: 12px; }

/* Kachelraster für die Rechtsgebiete.
   auto-fit + minmax = die Spaltenzahl passt sich selbst an.
   Kein Media Query nötig. */
.kacheln {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 1px;
    background: var(--linie);   /* der Spalt zwischen den Kacheln wird zur Linie */
    border: 1px solid var(--linie);
}
.kachel {
    background: var(--papier);
    padding: 30px 26px;
    text-decoration: none;
    display: block;
    transition: background .2s;
}
.kachel:hover { background: #fff; }
.kachel__zeichen {
    font-family: 'Source Serif 4', serif;
    color: var(--messing);
    font-size: 22px;
    line-height: 1;
}
.kachel h3 { margin: 10px 0 8px; }
.kachel p { font-size: 15px; margin: 0; }

/* Einzelnes Rechtsgebiet auf der Detailseite */
.gebiet {
    border-top: 1px solid var(--linie);
    padding-block: 34px;
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 20px;
    /* scroll-margin sorgt dafür, dass beim Sprung zum Anker
       der klebende Kopf den Titel nicht verdeckt */
    scroll-margin-top: 110px;
}
.gebiet__zeichen {
    font-family: 'Source Serif 4', serif;
    font-size: 30px;
    color: var(--messing);
    line-height: 1;
}
.gebiet p { max-width: 62ch; }

/* Text-Seiten (Über uns, Impressum) */
.text { max-width: 68ch; }
.text h2 { margin: 40px 0 14px; }
.text p  { margin-bottom: 16px; }
.text ul { margin: 0 0 16px 22px; color: var(--grau); }
.text li { margin-bottom: 6px; }

/* Zwei Spalten: Inhalt links, Infobox rechts */
.spalten {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 56px;
    align-items: start;
}
.infobox {
    background: var(--papier-tief);
    border-left: 3px solid var(--messing);
    padding: 26px;
    border-radius: var(--radius);
    font-size: 15px;
}
.infobox h3 { margin-bottom: 12px; }
.infobox p { margin-bottom: 10px; }


/* ---------- Formular -------------------------------------- */

.feld { margin-bottom: 20px; }

.feld label {
    display: block;
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 6px;
}
.feld__hinweis {
    font-weight: 400;
    color: var(--grau);
    font-size: 13px;
}

.feld input,
.feld textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
    font: inherit;          /* sonst nutzen Formularfelder eine andere Schrift */
    background: #fff;
    color: var(--tinte);
}
.feld input:focus,
.feld textarea:focus { border-color: var(--messing); }

.feld textarea { min-height: 170px; resize: vertical; }

/* Feld mit Fehler rot umranden */
.feld--fehler input,
.feld--fehler textarea { border-color: #b3261e; }

.feld__fehler {
    color: #b3261e;
    font-size: 14px;
    margin-top: 6px;
}

/* Checkbox liegt neben dem Text statt darüber */
.feld--check {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: start;
}
.feld--check input { width: 18px; height: 18px; margin-top: 4px; }
.feld--check label { font-weight: 400; font-size: 14px; }

/* Honeypot: eine Falle für Spam-Bots.
   Menschen sehen das Feld nicht, Bots füllen es aus.
   Ist es ausgefüllt -> Spam. */
.honig {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.meldung {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin-bottom: 28px;
    font-size: 15px;
}
.meldung--gut {
    background: #e8f2ea;
    border-left: 3px solid #2e6b41;
}
.meldung--schlecht {
    background: #fbeceb;
    border-left: 3px solid #b3261e;
}

/* Karte für die Anfahrt */
.karte {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--linie);
    border-radius: var(--radius);
}
.karte-platzhalter {
    display: grid;
    place-items: center;
    background: var(--papier-tief);
    text-align: center;
    padding: 30px;
}


/* ---------- 5. Mobil -------------------------------------- */

/* Alles unter 860px Fensterbreite: Handy und kleines Tablet */
@media (max-width: 860px) {

    .spalten { grid-template-columns: 1fr; gap: 36px; }

    .nav-schalter { display: block; }

    /* Menü zuklappen: Höhe 0 und unsichtbar */
    .nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--papier);
        border-bottom: 1px solid var(--linie);
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    /* Diese Klasse setzt JavaScript beim Klick auf den Button */
    .nav--offen { max-height: 420px; }

    .nav__liste {
        flex-direction: column;
        gap: 0;
        padding: 8px 24px 20px;
    }
    .nav__link {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid var(--linie);
    }
    .nav__link--aktiv { border-bottom-color: var(--messing); }

    .kopf__inner { position: relative; }
}

/* Nutzer, die in den Systemeinstellungen weniger Animation
   eingestellt haben, bekommen keine Übergänge.
   Gehört zur Barrierefreiheit dazu. */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
