/* ============================================================================
   Datei:        styles.css
   Pfad:         /assets/css/styles.css   (Public-Domain)
   Projekt:      Verkehrstherapie Münsterland
   Beschreibung: Vollständiges responsives Layout (Mobile First) im
                 blauen Farbschema. Klassisches CSS-Hover-Dropdown:
                 Submenü erscheint beim Hover, verschwindet wieder.
                 Auf Mobil per Tap (focus-within / open-Klasse).
   ========================================================================== */

:root {
    --c-blue-dark:   #2a5a82;
    --c-blue:        #3a7aa8;
    --c-blue-light:  #5fa8d3;
    --c-cyan:        #3a8fc2;
    --c-marine:      #0f3a63;
    --c-bg:          #ffffff;
    --c-bg-soft:     #f4f8fb;
    --c-text:        #1a2a3a;
    --c-muted:       #5a6a7a;
    --c-border:      #c2cdd6;
    --c-mark:        #fff59d;

    --r-radius:      6px;
    --r-radius-lg:   10px;

    --shadow-sm:     0 2px 6px rgba(15,58,99,.08);
    --shadow-md:     0 6px 20px rgba(15,58,99,.15);
    --shadow-nav:    0 8px 16px rgba(15,58,99,.18);

    --maxw:          1240px;
    --gap:           20px;

    --font-base:     Verdana, "DejaVu Sans", system-ui, -apple-system,
                     "Segoe UI", Tahoma, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font-base);
    font-size: 15px;
    line-height: 1.55;
    color: var(--c-text);
    background: #2a5a82 url('/assets/img/bg-traffic.jpg') center top fixed no-repeat;
    background-size: cover;
    min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-blue); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }
button { cursor: pointer; font: inherit; }
ul { padding-left: 20px; }
mark { background: var(--c-mark); padding: 0 2px; }

.visually-hidden {
    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: -9999px; top: 0;
    background: var(--c-blue-dark); color: #fff;
    padding: 8px 14px; z-index: 9999;
}
.skip-link:focus { left: 8px; top: 8px; }

.page-frame {
    max-width: var(--maxw);
    margin: 0 auto;
    background: var(--c-bg);
    box-shadow: var(--shadow-md);
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
}

/* ---------- Site-Header ------------------------------------------------- */
.site-header {
    position: relative;
    background: linear-gradient(90deg, var(--c-blue-dark) 0%, var(--c-cyan) 60%, var(--c-blue-light) 100%);
    color: #fff;
    padding: 22px 24px 22px 160px;
    min-height: 130px;
    overflow: hidden;
}
.site-header::before {
    content: "";
    position: absolute; left: 30%; top: 0; bottom: 0; width: 30%;
    background: linear-gradient(110deg, transparent 40%, rgba(255,255,255,.18) 50%, transparent 60%);
    pointer-events: none;
}
.site-portrait {
    position: absolute;
    left: 18px; top: 14px;
    width: 120px; height: 120px;
    border-radius: 4px;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    background: #ddd;
}
.site-titles { position: relative; z-index: 1; }
.site-title {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    font-style: italic;
    letter-spacing: .3px;
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.site-subtitle {
    margin: 4px 0 0;
    font-size: 16px;
    font-weight: 400;
    opacity: .95;
}

/* ---------- Top-Navigation --------------------------------------------- */
.site-nav {
    position: relative;
    background: var(--c-blue);
    border-bottom: 1px solid rgba(255,255,255,.2);
    z-index: 50;
}
.nav-toggle {
    display: none;
    background: transparent; border: 0;
    padding: 14px 18px;
    color: #fff;
}
.nav-toggle span {
    display: block; width: 24px; height: 3px;
    background: #fff; margin: 4px 0; border-radius: 2px;
}
.topnav {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}
.topnav > li {
    list-style: none;
    position: relative;        /* Anker für absolutes Submenü */
}
.topnav > li > a {
    display: block;
    color: #fff;
    padding: 14px 22px;
    font-size: 15px;
    text-decoration: none;
    transition: background .15s;
    word-break: break-word;
    hyphens: auto;
}
.topnav > li > a:hover,
.topnav > li > a:focus { background: var(--c-blue-dark); text-decoration: none; }
.topnav > li.is-active > a { background: var(--c-blue-dark); font-weight: 700; }

/* ---------- Submenü: standardmäßig versteckt ---------------------------- */
.subnav {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Subnav direkt unter Top-Eintrag: schwebendes Panel, NUR bei Hover/Fokus */
.topnav > li.has-children > .subnav {
    display: none;
    position: absolute;
    left: 50%;
    top: 100%;
    transform: translateX(-50%) translateY(0);
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-top: 0;
    box-shadow: var(--shadow-nav);
    padding: 6px 0;
    z-index: 60;
    flex-direction: column;
}

/* Anzeigen bei Hover, Fokus innerhalb (Tab-Navigation) oder erzwungenem Open */
.topnav > li.has-children:hover           > .subnav,
.topnav > li.has-children:focus-within    > .subnav,
.topnav > li.has-children.is-open         > .subnav {
    display: flex;
    animation: subnavFade .15s ease-out;
}
@keyframes subnavFade {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.subnav > li {
    list-style: none;
    position: relative;
}
.subnav > li > a {
    display: block;
    padding: 9px 18px;
    color: var(--c-blue-dark);
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.subnav > li > a:hover,
.subnav > li > a:focus {
    background: var(--c-bg-soft);
    text-decoration: none;
}
.subnav > li.is-active > a {
    color: var(--c-blue-dark);
    font-weight: 700;
    background: #d6e6f1;
}

/* Dritte Ebene: rechts neben dem Eltern-Eintrag aufklappen */
.subnav .subnav {
    display: none;
    position: absolute;
    left: 100%;
    top: -7px;
    transform: none;
    min-width: 220px;
    background: #fff;
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-nav);
    padding: 6px 0;
}
.subnav > li.has-children:hover        > .subnav,
.subnav > li.has-children:focus-within > .subnav,
.subnav > li.has-children.is-open      > .subnav {
    display: flex;
    flex-direction: column;
}

/* Pfeil-Hinweis bei Items mit Untermenüs */
.topnav > li.has-children > a::after {
    content: "▾";
    font-size: 10px;
    margin-left: 6px;
    opacity: .8;
}
.subnav > li.has-children > a::after {
    content: "▸";
    font-size: 10px;
    margin-left: 6px;
    opacity: .6;
    float: right;
}

/* ---------- Page-Body --------------------------------------------------- */
.page-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap);
    padding: 24px;
    position: relative;
    z-index: 1;
}
@media (min-width: 860px) {
    .page-body {
        grid-template-columns: 1fr 240px;
    }
}

/* ---------- Content ----------------------------------------------------- */
.content { min-width: 0; }
.page-header { margin-bottom: 14px; }
.page-title {
    color: var(--c-blue);
    font-size: 22px;
    margin: 0 0 6px;
}
.page-content { font-size: 15px; line-height: 1.6; }
.page-content h1,
.page-content h2,
.page-content h3 { color: var(--c-blue-dark); margin-top: 1.2em; }
.page-content h1.page-title-blue,
.page-content .page-title-blue { color: var(--c-blue); font-size: 28px; text-align: center; }
.page-content .subtitle,
.page-content .byline,
.page-content .claim { text-align: center; }
.page-content .locations { text-align: center; font-size: 26px; }
.page-content p { margin: 0 0 1em; }
.page-content ul,
.page-content ol { margin: 0 0 1em 1.2em; padding: 0; }
.page-content table {
    border-collapse: collapse; width: 100%; margin: 1em 0;
}
.page-content th, .page-content td {
    border: 1px solid var(--c-border);
    padding: 6px 10px; text-align: left;
}
.page-content blockquote {
    border-left: 4px solid var(--c-blue-light);
    margin: 1em 0; padding: .4em 1em;
    background: var(--c-bg-soft); color: var(--c-muted);
}

.page-content img.alignleft   { float: left;  margin: 5px 5px 5px 0; max-width: 50%; height: auto; }
.page-content img.alignright  { float: right; margin: 5px 0 5px 5px; max-width: 50%; height: auto; }
.page-content img.aligncenter { display: block; margin: 5px auto; }
.page-content figure          { margin: 1em 0; }
.page-content figure.alignleft  { float: left;  margin: 5px 5px 5px 0; }
.page-content figure.alignright { float: right; margin: 5px 0 5px 5px; }
.page-content figcaption        { font-size: 13px; color: var(--c-muted); margin-top: 4px; }
.page-content::after { content: ""; display: block; clear: both; }

/* ---------- Sidebar ----------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: 14px; }
.sidebar-box {
    background: #fff;
    border: 1px solid var(--c-blue);
    border-radius: var(--r-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.sidebar-title {
    margin: 0;
    background: var(--c-blue);
    color: #fff;
    padding: 8px 14px;
    font-size: 16px;
    text-align: center;
}
.sidebar-box > p,
.sidebar-box > ul,
.sidebar-box > .contact-label { padding: 0 14px; }
.sidebar-box > p:first-of-type { padding-top: 10px; }
.sidebar-box > ul:last-of-type,
.sidebar-box > p:last-of-type  { padding-bottom: 12px; }

.sidebar-search { border-color: var(--c-blue); padding: 10px; }
.sidebar-search form {
    display: flex; gap: 6px;
}
.sidebar-search input[type="search"] {
    flex: 1; min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--c-border);
    border-radius: 4px; font: inherit;
    background: var(--c-bg-soft);
}
.sidebar-search input[type="search"]:focus {
    outline: none; border-color: var(--c-blue); background: #fff;
}
.sidebar-search button {
    background: var(--c-blue); color: #fff;
    border: 0; border-radius: 4px;
    padding: 0 12px; font-size: 18px;
}
.sidebar-search button:hover { background: var(--c-blue-dark); }

.contact-list {
    list-style: none; margin: 4px 0 0; padding: 0 14px;
    word-break: break-word; hyphens: auto;
}
.contact-list li { margin: 2px 0; }
.contact-label   { margin: 8px 0 2px; }

.sidebar-legal {
    text-align: center;
    padding: 10px;
}
.sidebar-legal a {
    font-weight: 700;
    color: var(--c-blue-dark);
}

/* ---------- Suche-Ergebnisse ------------------------------------------- */
.search-form-inline {
    display: flex; gap: 8px; margin: 0 0 16px;
}
.search-form-inline input[type="search"] {
    flex: 1; padding: 8px 10px;
    border: 1px solid var(--c-border); border-radius: 4px;
}
.search-form-inline button {
    background: var(--c-blue); color: #fff; border: 0;
    padding: 0 16px; border-radius: 4px;
}
.search-meta { color: var(--c-muted); margin: 0 0 12px; }
.search-results { list-style: none; padding: 0; margin: 0; }
.search-results li {
    padding: 10px 0;
    border-bottom: 1px solid var(--c-border);
}
.search-results li:last-child { border-bottom: 0; }
.search-title { font-weight: 700; font-size: 16px; }
.search-snippet { margin: 4px 0 0; color: var(--c-muted); }

/* ---------- Footer ------------------------------------------------------ */
.site-footer {
    background: var(--c-blue);
    color: #fff;
    padding: 18px 24px;
    text-align: center;
}
.footer-links {
    list-style: none; padding: 0; margin: 0;
    display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 18px;
}
.footer-links a { color: #fff; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-links li + li::before { content: "|"; margin-right: 18px; opacity: .6; }

/* ---------- Lightbox ---------------------------------------------------- */
.lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000;
    padding: 20px;
}
.lightbox[hidden] { display: none; }
.lightbox-inner {
    position: relative;
    width: 100%; max-width: 980px;
    height: 90vh;
    background: #fff;
    border-radius: var(--r-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.lightbox-frame {
    width: 100%; height: 100%;
    border: 0; display: block;
}
.lightbox-close {
    position: absolute; top: 8px; right: 12px;
    background: rgba(0,0,0,.55); color: #fff;
    border: 0; border-radius: 50%;
    width: 36px; height: 36px;
    font-size: 22px; line-height: 36px;
    text-align: center;
}
.lightbox-close:hover { background: rgba(0,0,0,.8); }

/* ---------- Responsive Breakpoints ------------------------------------- */
@media (max-width: 859px) {
    .site-header {
        padding: 16px 16px 16px 110px;
        min-height: 100px;
    }
    .site-portrait { width: 80px; height: 80px; left: 14px; top: 12px; }
    .site-title    { font-size: 24px; }
    .site-subtitle { font-size: 14px; }
    .page-body     { padding: 16px; }
    .nav-toggle    { display: block; }
    .topnav-wrap   { display: none; }
    .topnav-wrap.is-open { display: block; }
    .topnav        { flex-direction: column; }
    .topnav > li > a { padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.15); }

    /* Submenü mobil: inline ausgeklappt nur bei Tap (.is-open) */
    .topnav > li.has-children > .subnav {
        position: static;
        transform: none;
        min-width: 0;
        background: rgba(0,0,0,.12);
        border: 0;
        box-shadow: none;
        padding: 0;
        animation: none;
    }
    .topnav > li.has-children:hover        > .subnav,
    .topnav > li.has-children:focus-within > .subnav { display: none; }
    .topnav > li.has-children.is-open      > .subnav { display: flex; }
    .subnav > li > a {
        color: #fff;
        padding: 10px 18px 10px 36px;
        border-bottom: 1px solid rgba(255,255,255,.1);
        white-space: normal;
    }
    .subnav > li > a:hover,
    .subnav > li > a:focus { background: rgba(0,0,0,.2); }
    .subnav > li.is-active > a { background: rgba(0,0,0,.25); }
    .subnav .subnav {
        position: static;
        transform: none;
        background: rgba(0,0,0,.18);
        border: 0;
        box-shadow: none;
        padding: 0;
    }
    .subnav .subnav > li > a {
        padding-left: 54px;
        font-size: 13px;
    }
}
@media (max-width: 480px) {
    body          { font-size: 14px; }
    .site-header  { padding-left: 16px; }
    .site-portrait { display: none; }
    .site-title    { font-size: 22px; }
    .footer-links li + li::before { display: none; }
}

/* ---------- Print ------------------------------------------------------- */
@media print {
    body { background: #fff; }
    .site-nav, .sidebar, .site-footer, .lightbox, .nav-toggle { display: none !important; }
    .page-frame { box-shadow: none; max-width: none; }
    a { color: #000; text-decoration: underline; }
}