/* Site-Fixes 10.11.2026 (Mike / iPhone): Textlinks, Überschriften-Umbruch, kompakte Stadt-Hero-Kästen.
   Wird zentral über includes/footer.php eingebunden. Desktop-Optik der Startseite bleibt unverändert. */

/* 3) Textlinks in Markenbraun statt Browser-Blau. Buttons, Footer und Nav behalten eigene Farben. */
p a:not(.btn):not([class*="btn"]):not(.cta-call):not(.cta-mail):not(.mobile-cta-btn),
li a:not(.btn):not([class*="btn"]):not(.cta-call):not(.cta-mail):not(.mobile-cta-btn) {
    color: #8B4513;
    text-decoration: underline;
    text-decoration-color: rgba(139, 69, 19, 0.45);
    text-underline-offset: 0.18em;
}
p a:not(.btn):not([class*="btn"]):not(.cta-call):not(.cta-mail):not(.mobile-cta-btn):hover,
p a:not(.btn):not([class*="btn"]):not(.cta-call):not(.cta-mail):not(.mobile-cta-btn):focus,
li a:not(.btn):not([class*="btn"]):not(.cta-call):not(.cta-mail):not(.mobile-cta-btn):hover,
li a:not(.btn):not([class*="btn"]):not(.cta-call):not(.cta-mail):not(.mobile-cta-btn):focus {
    color: #6B3410;
}

/* Lange URL-Texte (z. B. Datenschutz) sollen umbrechen statt die Seite zu spreizen */
a, p, li, td, th {
    overflow-wrap: anywhere;
    word-wrap: break-word;
}

/* 2) Überschriften sollen auf schmalen Displays nicht aus dem Bild laufen */
h1, h2, h3, h4 {
    overflow-wrap: anywhere;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    max-width: 100%;
    box-sizing: border-box;
}
.section-header h2 {
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .section-header h2 {
        display: block;
        font-size: clamp(1.3rem, 6.2vw, 2rem) !important;
        line-height: 1.25;
        overflow-wrap: anywhere;
        hyphens: auto;
        -webkit-hyphens: auto;
        padding-left: 0.4rem;
        padding-right: 0.4rem;
    }
    h1 {
        overflow-wrap: anywhere;
        hyphens: auto;
        -webkit-hyphens: auto;
    }

    /* Cookie-Richtlinie u. a.: Tabelle darf die Seite nicht horizontal aufweiten */
    table {
        width: 100% !important;
        max-width: 100%;
        table-layout: fixed;
    }
    th, td {
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }
}

/* 1b) Stadtseiten: Hero-Kasten kompakter und ans untere Bildende, damit das Stadtbild sichtbar bleibt */
@media (max-width: 768px) {
    body.stadt-gesamtredaktion .hero {
        align-items: flex-end !important;
        justify-content: center !important;
        background-position: center 28% !important;
        padding-bottom: calc(16px + 72px) !important;
        min-height: 72vh;
    }
    body.stadt-gesamtredaktion .hero-content {
        padding: 18px 16px !important;
        margin: 12px 12px 0 !important;
    }
    body.stadt-gesamtredaktion .hero h1 {
        font-size: clamp(1.35rem, 6.2vw, 1.85rem) !important;
        margin-bottom: 10px !important;
        overflow-wrap: anywhere;
        hyphens: auto;
    }
    body.stadt-gesamtredaktion .hero-content > p:not(.highlight) {
        font-size: 0.92rem !important;
        line-height: 1.45 !important;
        margin-bottom: 14px !important;
    }
    body.stadt-gesamtredaktion .hero-content > div[style*="margin-top"] {
        margin-top: 14px !important;
        padding-top: 12px !important;
        gap: 12px !important;
    }
}

/* 4) Horizontal-Overflow 320/360: Header „Beratung“, 350px-Küchenkarten, Stadtlisten
      Desktop unverändert (minmax fällt erst unter die Mindestbreite auf 100% zurück). */
.kitchen-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(350px, 100%), 1fr)) !important;
}
.kitchen-card,
.kitchen-img,
.kitchen-body {
    max-width: 100%;
    min-width: 0;
}
.stadt-liste {
    grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)) !important;
}
.stadt-liste > *,
.stadt-liste a {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 576px) {
    .header-inner {
        flex-wrap: wrap;
        gap: 8px 10px;
        max-width: 100%;
    }
    .nav-cta {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-width: 100%;
    }
    .nav-cta .btn,
    .nav-cta .btn-outline,
    .nav-cta a {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        max-width: 100%;
        box-sizing: border-box;
        white-space: normal;
    }
    .logo {
        max-width: 100%;
    }
}

/* Nachtschicht 11.11.2026: Platz unter dem Seitenende für die schwebende Mobil-Kontaktleiste.
   Nur Abstand (padding-bottom), nur wo die Leiste sichtbar ist (bis 768px). Texte, Buttons, Farben unverändert.
   Gemessen: Leiste Stadt/Mallorca 72px (unter 340px Breite zweizeilig 97px),
   Startseite 64px (unter 360px Breite 81px) plus iPhone-Sicherheitsbereich. */
@media (max-width: 768px) {
    body.stadt-gesamtredaktion,
    body.mallorca-seite {
        padding-bottom: 76px;
    }
    html body.has-start-cta {
        padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }
}
@media (max-width: 349px) {
    body.stadt-gesamtredaktion,
    body.mallorca-seite {
        padding-bottom: 100px;
    }
}
@media (max-width: 359px) {
    html body.has-start-cta {
        padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }
}
