/* ====================================================
   MOBILE.CSS – Verbesserungen nur für Smartphones (< 768 px)
   Wird NACH styles.css eingebunden. Ab 768 px greift keine einzige
   Regel aus dieser Datei: Die Desktop-Ansicht bleibt unverändert.
   Farben, Schriften, Hintergründe und der Gesamtlook bleiben erhalten.
   ==================================================== */

/* Hilfselement (von mobile.js eingefügt) – am Desktop unsichtbar */
.mob-space, .mob-call { display: none; }

@media (max-width: 767px) {

    :root { --hdr: 58px; }

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

    html, body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;               /* kein seitliches Wackeln mehr */
        -webkit-text-size-adjust: 100%;
    }
    body { font-size: 17px; }

    #outer-container {
        height: auto;
        padding-top: var(--hdr);          /* Platz für die feste Kopfzeile */
    }

    #main-content {
        height: auto;
        margin: 0 18px;
    }

    /* ---------- Kopfzeile: Logo + Name + Menü-Knopf statt Vollbild-Logo ---------- */

    #left-sidebar {
        position: fixed;
        top: 0; left: 0; right: 0;
        z-index: 1000;
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
        box-shadow: 0 2px 8px rgba(0,0,0,.35);
    }

    #left-sidebar .logo {
        flex: 1 1 auto;
        min-width: 0;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        align-content: center;
        column-gap: 10px;
        padding: 7px 12px;
        text-align: left;
        height: var(--hdr);
    }
    #left-sidebar .logo img {
        grid-column: 1; grid-row: 1 / span 2;
        align-self: center;
        height: 44px; width: auto; max-width: none;
        margin: 0;
    }
    #left-sidebar .logo h2 {
        grid-column: 2; grid-row: 1;
        align-self: end;
        margin: 0; font-size: 18px; line-height: 1.15; text-shadow: 0 1px 3px rgba(0,0,0,.35);   /* "Michael Holzhüter" in einer Zeile */
    }
    #left-sidebar .logo h2 br { display: none; }
    #left-sidebar .logo h2 .mob-space { display: inline-block; width: .28em; }
    #left-sidebar .logo h4 {
        grid-column: 2; grid-row: 2;
        align-self: start;
        margin: 1px 0 0; font-size: 13px; line-height: 1.1; text-shadow: 0 1px 3px rgba(0,0,0,.35);
        font-family: 'open_sanslight', sans-serif; letter-spacing: .02em;
    }

    #left-sidebar #mobile-menu-icon {
        flex: 0 0 var(--hdr);
        width: var(--hdr); height: var(--hdr);
        line-height: var(--hdr);
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    /* Raster-Symbol (glyphicon-th) → bekanntes Burger-Symbol, gleiche Farbe/Hintergründe */
    #left-sidebar #mobile-menu-icon span.glyphicon {
        position: relative; width: 24px; height: var(--hdr);
        margin: 0 auto; font-size: 0; line-height: 0;
    }
    #left-sidebar #mobile-menu-icon span.glyphicon::before {
        content: ""; position: absolute; left: 0; top: 50%;
        width: 24px; height: 3px; margin-top: -1.5px; border-radius: 2px;
        background: currentColor;
        box-shadow: 0 -8px 0 currentColor, 0 8px 0 currentColor;
        transition: all .25s;
    }
    #left-sidebar #mobile-menu-icon.active span.glyphicon::before {   /* geöffnet: X */
        box-shadow: none; transform: rotate(45deg);
    }
    #left-sidebar #mobile-menu-icon.active span.glyphicon::after {
        content: ""; position: absolute; left: 0; top: 50%;
        width: 24px; height: 3px; margin-top: -1.5px; border-radius: 2px;
        background: currentColor; transform: rotate(-45deg);
    }

    /* Menü als Ausklappliste unter der Kopfzeile */
    #left-sidebar #main-menu {
        flex: 0 0 100%;
        max-height: calc(100vh - var(--hdr));
        max-height: calc(100dvh - var(--hdr));
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 18px; line-height: 1.2;
        background: rgba(194,215,143,1);
        border-top: 1px solid rgba(0,0,0,.12);
    }
    #left-sidebar #main-menu > li:not(.menu-item) { display: none; }   /* leerer Abstandshalter */
    #left-sidebar #main-menu > li.menu-item > a {
        font-family: 'open_sansregular', sans-serif;      /* kräftiger als „light": Weiß auf Hellgrün besser lesbar */
        text-shadow: 0 1px 3px rgba(0,0,0,.4);
        padding: 15px 20px;
        min-height: 52px;
        display: flex; align-items: center; justify-content: center;
        border-bottom: 1px solid rgba(0,0,0,.08);
        -webkit-tap-highlight-color: rgba(0,0,0,.15);
    }
    #left-sidebar #main-menu > li.menu-item:last-child > a { border-bottom: 0; }

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

    /* Beim Antippen eines Menüpunkts landet die Überschrift UNTER der Kopfzeile,
       nicht dahinter (die Sprung-Logik scrollt auf offset().top des Abschnitts). */
    #main-content .section-wrapper {
        padding-top: var(--hdr);
        margin-top: calc(-1 * var(--hdr));
        pointer-events: none;
    }
    #main-content .section-wrapper > * { pointer-events: auto; }

    #main-content .section-wrapper .content-wrapper {
        padding: 30px 0 72px;
        background-size: 30% auto;
    }
    #main-content .section-wrapper:first-of-type .content-wrapper { padding-top: 22px; }
    #main-content .section-wrapper:last-of-type  .content-wrapper { padding-bottom: 28px; }

    /* ---------- Überschriften & Text ---------- */

    h1, h2, h3, h4, h5, h6 {
        -webkit-hyphens: auto; hyphens: auto;
        overflow-wrap: break-word; word-wrap: break-word;
    }
    h1 { font-size: clamp(1.45em, 7.6vw, 2em); line-height: 1.12; }
    h2 { font-size: clamp(1.35em, 6.4vw, 1.75em); }

    #main-content p, #main-content li {
        -webkit-hyphens: auto; hyphens: auto;
        overflow-wrap: break-word;
        line-height: 1.5;
    }
    /* lange Fließtexte linksbündig (besser lesbar), Überschriften/Buttons bleiben zentriert */
    #anzeige p, #home p, #praxis p { text-align: left; }

    /* Telefonnummern & Uhrzeiten nicht mitten im Wert umbrechen */
    a[href^="tel:"], .nowrap { white-space: nowrap; }
    #notdienst strong, #kontakt .contact-details { -webkit-hyphens: manual; hyphens: manual; }

    /* Anruf-Knöpfe (von mobile.js eingefügt) */
    .mob-call { display: block; margin: 1.1em 0 .4em; text-align: center; }
    .mob-call a.btn { display: inline-block !important; margin: 0 auto !important; }

    /* ---------- Buttons / Antippflächen (mind. ~46 px) ---------- */

    #main-content .btn-sm, #main-content .btn-lg, #main-content .btn-xs {
        font-size: 16px;
        padding: 12px 26px;
        min-height: 46px;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    #main-content p > a.btn {                    /* zentriert, auch bei linksbündigem Text */
        display: table; margin-left: auto; margin-right: auto;
    }
    #main-content .grid p > a.btn { margin-left: 0; }

    /* ---------- „Gesund beginnt im Mund": Icon links, Text rechts ---------- */

    #main-content .grid { font-size: 1em; }
    #main-content .grid .grid-item .item-content img.pull-left {
        float: left !important;
        width: 76px; max-width: 76px; height: auto !important;
        margin: 4px 16px 6px 0;
    }
    #main-content .grid .text-content {
        padding-left: 0; overflow: hidden;       /* Text bleibt neben dem Icon */
    }
    #main-content .grid h5 { font-size: 1.12em; margin: .15em 0 .45em; line-height: 1.2; }
    #main-content .grid p  { text-align: left; }

    /* ---------- Leistungen (Karussell) ---------- */

    #main-content .carousel { display: flex; flex-direction: column; }
    #main-content .carousel .carousel-inner { order: 1; width: 100%; margin-left: 0; margin-right: 0; }
    #main-content .carousel .icon { width: min(240px, 70%); }
    #main-content .carousel *.title { font-size: clamp(1.35em, 6.6vw, 1.9em); -webkit-hyphens: auto; hyphens: auto; }
    #main-content .carousel .item p { text-align: left; }

    /* Pfeile: klar tippbare Knöpfe auf Höhe des Bildes statt Randstreifen über dem Text */
    #main-content .carousel .carousel-control {
        top: 62px; bottom: auto;
        width: 44px; height: 44px;
        border-radius: 50%;
        background-color: rgba(0,0,0,.45);
        background-position: center !important;
        background-size: 18px auto;
        opacity: .9; filter: none;
        z-index: 5;
    }
    #main-content .carousel .carousel-control.left  { left: 0; }
    #main-content .carousel .carousel-control.right { right: 0; }

    /* Punkte-Anzeige (zeigt: es gibt 9 Leistungen, Position sichtbar) */
    #main-content .carousel .carousel-indicators.title-indicators {
        order: 2; position: static;
        display: flex; flex-wrap: wrap; justify-content: center;
        opacity: 1; filter: none;
        margin: 6px 0 0; padding: 0;
    }
    #main-content .carousel .carousel-indicators.title-indicators li,
    #main-content .carousel .carousel-indicators.title-indicators li.active {
        width: 12px; height: 12px; margin: 8px 7px; padding: 0;
        font-size: 0; line-height: 0; text-indent: -9999px; overflow: hidden;
        border: 0; border-radius: 50%;
        background: rgba(255,255,255,.35);
        opacity: 1;
    }
    #main-content .carousel .carousel-indicators.title-indicators li.active { background: #fff; }

    /* ---------- Sprechzeiten / Kontakt / Karte ---------- */

    #main-content .list-group, #main-content .list-unstyled { padding-left: 0; }
    #oeffnungszeiten li { margin-bottom: .55em; }

    #main-content .contact-details { font-size: 1em; }
    #kontakt a:not(.btn), #notdienst a[href^="tel:"] { position: relative; }
    #kontakt a:not(.btn)::after, #notdienst a[href^="tel:"]::after {   /* größere Tippfläche, ohne das Layout zu verändern */
        content: ""; position: absolute; top: -12px; bottom: -12px; left: -8px; right: -8px;
    }
    #kontakt .contact-details p { margin: .6em 0; }
    #kontakt iframe { height: 280px; }
    #kontakt small { display: block; margin-top: 4px; }

    /* ---------- Fußbereich: feste Farbbalken (120 px!) → normal am Seitenende ---------- */

    #footer { padding: 0; background: none; font-size: 16px; }
    #footer > div[style] {
        position: static !important;
        width: 100% !important;
    }
    #footer > .footer-text-line {
        height: auto !important;
        min-height: 60px;
        padding: 8px 10px !important;
        display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    }
    #footer > .footer-text-line a {
        display: inline-block;
        padding: 12px 10px;
        font-size: 16px;
    }

    /* „Nach oben"-Knopf: gut sichtbar & tippbar, nur wenn aktiv klickbar */
    #go-to-top {
        right: 12px; bottom: 12px; left: auto;
        width: 46px; height: 46px;
        border-radius: 50%;
        background: rgba(78,80,79,.92);
        pointer-events: none;
    }
    #go-to-top.active { opacity: .9; pointer-events: auto; }
    #go-to-top .icon {
        display: block; top: 0;
        width: 46px; height: 46px; line-height: 46px;
        font-size: 16px;
    }

    /* ---------- Popup (Weiterlesen…, Impressum, Datenschutz) ---------- */

    .modal .modal-dialog { margin: 8px; }
    .modal .modal-content { background-color: rgba(98,120,64,.97); }   /* Kontrast Weiß auf Grün ≈ 4,9:1 statt ≈ 2,5:1 */
    .modal .modal-content .modal-body {
        padding: 6px 18px 26px;
        text-align: left;
        font-size: 17px; line-height: 1.5;
        -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word;
    }
    .modal .modal-body h1, .modal .modal-body h2, .modal .modal-body h3 {
        font-size: 1.45em; text-align: left;
    }
    .modal .modal-body img.pull-right, .modal .modal-body img.pull-left {
        max-width: 55%;
    }
    /* Schließen-Knopf bleibt beim Scrollen langer Texte sichtbar */
    .modal .close {
        position: sticky; top: 0; right: auto;
        display: block; float: none;
        margin: 0 0 0 auto;
        width: 46px; height: 46px; line-height: 46px; font-size: 34px;
        opacity: .95;
        background: rgba(98,120,64,.97);
        z-index: 100;
    }
}
