/* =========================================================
   HC Empor Rostock – globales Layout (Header, Navigation, Footer)
   Wird von header.php geladen und gilt auf allen Seiten.
   Farben aus style.css: #083A57, #0a4b6d, #FEC90B, #e6b508, #F2F2F2, #c3d7e3
   ========================================================= */

:root {
    --hce-navy: #083A57;
    --hce-navy-2: #0a4b6d;
    --hce-yellow: #FEC90B;
    --hce-yellow-2: #e6b508;
    --hce-bg: #F2F2F2;
    --hce-white: #ffffff;
    --hce-soft: #c3d7e3;
    --hce-muted: rgba(8, 58, 87, .62);
    --hce-line: rgba(8, 58, 87, .12);
    --hce-display: 'Mohave', 'Arial Narrow', 'Roboto Condensed', sans-serif;
    --hce-body: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --hce-max: 1192px;
    --hce-gutter: 24px;
    --hce-radius: 10px;
    --hce-tabbar-h: 76px;
}

/* Grundregeln (wie in style.css) – hier noch einmal, damit die Seiten nicht davon abhängen.
   Ohne sie gibt es weiße Ränder und alles wird breiter als der Bildschirm. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; max-width: 100%; }
body { margin: 0; font-family: var(--hce-body); -webkit-text-size-adjust: 100%; }
img, video, iframe { max-width: 100%; }

/* style.css setzt overflow-x: hidden auf html/body – das verhindert position: sticky */
html, body { overflow-x: clip; }

/* Neue Seiten: Footer reicht immer bis zum unteren Rand (kein Streifen unter kurzen Seiten) */
body.hce-home,
body.hce-subpage { display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
body.hce-home > main,
body.hce-subpage > main { flex: 1 0 auto; }
html.hce-lock, html.hce-lock body { overflow: hidden; }

.hce-container {
    width: 100%;
    max-width: var(--hce-max);
    margin: 0 auto;
    padding-inline: var(--hce-gutter);
}

/* Platzhalter-Fläche mit Streifen (wenn kein Bild vorhanden ist) */
.hce-ph {
    background-color: var(--hce-navy);
    background-image:
        radial-gradient(ellipse at 75% 70%, rgba(254, 201, 11, .18), transparent 55%),
        repeating-linear-gradient(115deg, rgba(255, 255, 255, .035) 0 38px, transparent 38px 76px);
}

/* ---------- Gelbe Leiste "Nächstes Spiel" (Desktop) ---------- */
.hce-topbar {
    background: var(--hce-yellow);
    color: var(--hce-navy);
}
.hce-topbar__inner {
    display: flex;
    align-items: center;
    gap: 20px;
    min-height: 46px;
}
.hce-badge {
    background: var(--hce-navy);
    color: var(--hce-yellow);
    font: 800 11px/1 var(--hce-body);
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 3px;
    white-space: nowrap;
}
.hce-topbar__match {
    font: 700 21px/1 var(--hce-display);
    letter-spacing: .03em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hce-topbar__meta {
    font: 600 14px/1.2 var(--hce-body);
    white-space: nowrap;
}
.hce-topbar__link {
    margin-left: auto;
    font: 800 14px/1 var(--hce-body);
    color: var(--hce-navy);
    text-decoration: none;
    padding-bottom: 3px;
    border-bottom: 2px solid var(--hce-navy);
    white-space: nowrap;
}
.hce-topbar__link:hover { border-bottom-color: transparent; }

/* ---------- Header ---------- */
.hce-header {
    position: sticky;
    top: env(safe-area-inset-top, 0px);
    z-index: 900;
    background: var(--hce-navy);
    color: var(--hce-white);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
.hce-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 76px;
}
.hce-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--hce-white);
    text-decoration: none;
    flex-shrink: 0;
}
.hce-brand img {
    width: 44px;
    height: 44px;
    object-fit: contain;
}
.hce-brand__full {
    font: 800 15px/1 var(--hce-body);
    letter-spacing: .05em;
    text-transform: uppercase;
}
.hce-brand__short { display: none; }

.hce-nav { margin-left: auto; }
.hce-nav__list {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}
.hce-nav__item { position: relative; }
.hce-nav__link {
    display: block;
    padding: 12px 14px;
    background: none;
    border: 0;
    color: var(--hce-white);
    font: 600 15px/1 var(--hce-body);
    text-decoration: none;
    cursor: pointer;
    border-radius: 6px;
    transition: color .2s;
}
.hce-nav__link:hover,
.hce-nav__item--sub:hover > .hce-nav__link,
.hce-nav__link[aria-expanded="true"] { color: var(--hce-yellow); }
.hce-nav__link:focus-visible,
.hce-pill:focus-visible,
.hce-nav__sub a:focus-visible {
    outline: 2px solid var(--hce-yellow);
    outline-offset: 2px;
}

.hce-nav__sub {
    position: absolute;
    top: 100%;
    left: 50%;
    min-width: 220px;
    list-style: none;
    background: var(--hce-navy);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 8px);
    transition: opacity .2s, transform .2s, visibility .2s;
}
.hce-nav__sub li + li { border-top: 1px solid var(--hce-navy-2); }
.hce-nav__sub a {
    display: block;
    padding: 12px 20px;
    color: var(--hce-bg);
    font: 500 15px/1.2 var(--hce-body);
    text-decoration: none;
    white-space: nowrap;
}
.hce-nav__sub a:hover { color: var(--hce-yellow); }
.hce-nav__item--sub:hover > .hce-nav__sub,
.hce-nav__item--sub:focus-within > .hce-nav__sub,
.hce-nav__link[aria-expanded="true"] + .hce-nav__sub {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

.hce-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--hce-yellow);
    color: var(--hce-navy);
    font: 800 16px/1 var(--hce-body);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .2s, transform .2s;
}
.hce-pill:hover { background: var(--hce-yellow-2); }
.hce-pill--block { display: flex; width: 100%; min-height: 52px; }

/* ---------- Wappen (Logo oder Initialen) ---------- */
.hce-crest {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--hce-white);
    border: 3px solid #e4e4e4;
    overflow: hidden;
    flex-shrink: 0;
}
.hce-crest--us { border-color: var(--hce-yellow); }
.hce-crest img {
    width: 78%;
    height: 78%;
    object-fit: contain;
}
.hce-crest span {
    font: 800 15px/1 var(--hce-body);
    color: #9a9a9a;
    letter-spacing: .02em;
}
.hce-crest--us span { color: var(--hce-navy); }

/* ---------- "Nächstes Spiel"-Banner (nur Mobil, Startseite) ---------- */
.hce-matchbar { display: none; }

/* ---------- Bottom-Navigation + Menü (nur Mobil) ---------- */
.hce-tabbar { display: none; }
.hce-drawer[hidden] { display: none; }

/* ---------- Footer ---------- */
.hce-footer {
    background: var(--hce-navy);
    color: var(--hce-soft);
    margin-top: 64px;
}
/* Schriftzug mit Linien links und rechts trennt den Footer vom Inhalt */
.hce-footer__title {
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 36px;
}
.hce-footer__title::before,
.hce-footer__title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, .15);
}
.hce-footer__title span {
    font: 700 26px/1 var(--hce-display);
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hce-white);
}
.hce-sponsors {
    overflow: hidden;
    padding: 32px 0 28px;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.hce-sponsors__track {
    display: flex;
    gap: 16px;
    width: max-content;
    animation: hce-marquee 90s linear infinite;
}
.hce-sponsors:focus-within .hce-sponsors__track { animation-play-state: paused; }
.hce-sponsors__item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 80px;
    padding: 12px 20px;
    background: var(--hce-white);
    border-radius: var(--hce-radius);
    flex-shrink: 0;
    transition: transform .25s, box-shadow .25s;
}
.hce-sponsors__item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .25);
}
.hce-sponsors__item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
@keyframes hce-marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(calc(-50% - 8px)); }
}

.hce-footer__bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    padding-block: 22px;
    border-top: 1px solid var(--hce-navy-2);
    font: 400 14px/1.5 var(--hce-body);
}
.hce-footer__bottom p { font: inherit; color: var(--hce-soft); }
.hce-footer a {
    color: var(--hce-white);
    text-decoration: none;
}
.hce-footer__bottom a:hover { color: var(--hce-yellow); }
.hce-footer__social {
    display: flex;
    gap: 20px;
    list-style: none;
}
.hce-footer__social a { font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
    .hce-sponsors__track { animation-duration: 120s; }
    .hce-nav__sub, .hce-drawer__panel { transition: none; }
}

/* =========================================================
   Tablet + Mobil
   ========================================================= */
@media (max-width: 992px) {
    :root { --hce-gutter: 16px; }

    body { padding-bottom: calc(var(--hce-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
    /* Unter der weißen Leiste darf kein Dunkelblau durchscheinen */
    html, body.hce-home, body.hce-subpage { background: var(--hce-white); }

    .hce-topbar,
    .hce-nav { display: none; }

    .hce-header__inner { min-height: 64px; justify-content: space-between; }
    .hce-brand { gap: 14px; }
    .hce-brand img { width: 40px; height: 40px; }
    .hce-brand__full { display: none; }
    .hce-brand__short {
        display: inline;
        font: 700 30px/1 var(--hce-display);
        letter-spacing: .08em;
        text-transform: uppercase;
        padding-top: 3px;
    }

    /* Nächstes Spiel (Startseite) */
    .hce-matchbar {
        display: flex;
        align-items: center;
        gap: 14px;
        padding: 18px var(--hce-gutter);
        background: var(--hce-yellow);
        color: var(--hce-navy);
        text-decoration: none;
    }
    .hce-matchbar__crests { display: flex; flex-shrink: 0; }
    .hce-matchbar__crests .hce-crest {
        width: 50px;
        height: 50px;
        border: 3px solid var(--hce-navy);
    }
    .hce-matchbar__crests .hce-crest + .hce-crest {
        margin-left: -14px;
        border-color: var(--hce-bg);
    }
    .hce-matchbar__crests .hce-crest span { font-size: 12px; }
    .hce-matchbar__text {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
        flex: 1;
    }
    .hce-matchbar__text small {
        font: 800 11px/1 var(--hce-body);
        letter-spacing: .14em;
        text-transform: uppercase;
    }
    .hce-matchbar__text strong {
        font: 700 24px/1 var(--hce-display);
        letter-spacing: .02em;
        text-transform: uppercase;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .hce-matchbar__text span {
        font: 600 13px/1.2 var(--hce-body);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .hce-matchbar__go {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        border-radius: 50%;
        background: var(--hce-navy);
        flex-shrink: 0;
    }
    .hce-matchbar__go svg {
        width: 22px;
        height: 22px;
        fill: none;
        stroke: var(--hce-yellow);
        stroke-width: 2.6;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    /* Bottom-Navigation */
    .hce-tabbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 950;
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        align-items: end;
        height: calc(var(--hce-tabbar-h) + env(safe-area-inset-bottom, 0px));
        padding: 0 4px env(safe-area-inset-bottom, 0px);
        background: var(--hce-white);
        border-top: 1px solid var(--hce-line);
        box-shadow: 0 -6px 20px rgba(8, 58, 87, .06);
    }
    .hce-tabbar > a,
    .hce-tabbar > button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-end;
        gap: 5px;
        height: 100%;
        padding-bottom: 12px;
        background: none;
        border: 0;
        color: rgba(8, 58, 87, .5);
        font: 700 12px/1 var(--hce-body);
        text-decoration: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
    }
    .hce-tabbar > a span,
    .hce-tabbar > button span { font: inherit; }
    .hce-tabbar svg {
        width: 26px;
        height: 26px;
        fill: none;
        stroke: currentColor;
        stroke-width: 1.9;
        stroke-linecap: round;
        stroke-linejoin: round;
    }
    .hce-tabbar .is-active,
    .hce-tabbar__menu[aria-expanded="true"] { color: var(--hce-navy); }

    .hce-tabbar__ticket { color: var(--hce-navy) !important; position: relative; }
    .hce-tabbar__fab {
        position: absolute;
        top: -22px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        width: 58px;
        height: 58px;
        border-radius: 50%;
        background: var(--hce-yellow);
        box-shadow: 0 0 0 5px var(--hce-white), 0 6px 16px rgba(8, 58, 87, .2);
    }
    .hce-tabbar__fab svg { stroke: var(--hce-navy); stroke-width: 2.2; }

    /* Menü */
    .hce-drawer {
        position: fixed;
        inset: 0;
        z-index: 1000;
    }
    .hce-drawer__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(8, 58, 87, .55);
        opacity: 0;
        transition: opacity .25s;
    }
    .hce-drawer__panel {
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        width: min(380px, 88vw);
        padding: calc(16px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
        background: var(--hce-navy);
        color: var(--hce-white);
        transform: translateX(100%);
        transition: transform .25s ease;
    }
    .hce-drawer.is-open .hce-drawer__backdrop { opacity: 1; }
    .hce-drawer.is-open .hce-drawer__panel { transform: none; }

    .hce-drawer__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--hce-navy-2);
    }
    .hce-drawer__head span {
        font: 700 30px/1 var(--hce-display);
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .hce-drawer__close {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: 0;
        color: var(--hce-white);
        cursor: pointer;
    }
    .hce-drawer__close svg {
        width: 26px;
        height: 26px;
        fill: none;
        stroke: currentColor;
        stroke-width: 2;
        stroke-linecap: round;
    }
    .hce-drawer__body {
        flex: 1;
        overflow-y: auto;
        padding: 8px 0 20px;
    }
    .hce-drawer__link,
    .hce-drawer__group summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 54px;
        color: var(--hce-white);
        font: 600 18px/1.2 var(--hce-body);
        text-decoration: none;
        border-bottom: 1px solid var(--hce-navy-2);
        cursor: pointer;
        list-style: none;
    }
    .hce-drawer__group summary::-webkit-details-marker { display: none; }
    .hce-drawer__group summary::after {
        content: '';
        width: 9px;
        height: 9px;
        border-right: 2px solid var(--hce-yellow);
        border-bottom: 2px solid var(--hce-yellow);
        flex-shrink: 0;
        margin: 0 8px 0 12px;   /* gedrehter Pfeil ragt sonst über den Rand und wird abgeschnitten */
        transform: rotate(45deg) translateY(-3px);
        transition: transform .2s;
    }
    .hce-drawer__group[open] summary::after { transform: rotate(-135deg) translateY(-3px); }
    .hce-drawer__group[open] summary { color: var(--hce-yellow); }
    .hce-drawer__group ul {
        list-style: none;
        padding: 4px 0 10px 12px;
        border-bottom: 1px solid var(--hce-navy-2);
    }
    .hce-drawer__group a {
        display: block;
        padding: 11px 0;
        color: var(--hce-bg);
        font: 500 16px/1.2 var(--hce-body);
        text-decoration: none;
    }
    .hce-drawer__group a:hover,
    .hce-drawer__link:hover { color: var(--hce-yellow); }

    /* Footer */
    .hce-footer { margin-top: 48px; }
    .hce-sponsors { padding: 24px 0 20px; }
    .hce-sponsors__item { width: 150px; height: 64px; padding: 10px 14px; }
    .hce-footer__bottom {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding-block: 18px 22px;
    }
}

@media (max-width: 380px) {
    .hce-brand__short { font-size: 26px; }
    .hce-pill { padding: 0 18px; font-size: 15px; }
    .hce-matchbar__text strong { font-size: 21px; }
}

/* ---------- Cookie-Hinweis (eigenständig, unabhängig von style.css) ---------- */
.cookie-overlay { display: none; position: fixed; inset: 0; z-index: 9999; background: rgba(5, 30, 45, .55); }
.cookie-overlay.active { display: block; }
.cookie-banner {
    display: none;
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 10000;
    width: min(520px, calc(100% - 32px));
    padding: 24px;
    border-radius: 20px;
    background: var(--hce-navy);
    border: 2px solid var(--hce-yellow);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
    color: var(--hce-white);
    text-align: center;
}
.cookie-banner.active { display: block; }
.cookie-banner .cookie-text h3 { margin: 0 0 10px; font: 700 22px/1.2 var(--hce-body); color: var(--hce-yellow); }
.cookie-banner .cookie-text p { margin: 0 0 10px; font: 400 14px/1.5 var(--hce-body); color: var(--hce-bg); }
.cookie-banner .cookie-text a { color: var(--hce-yellow); font-weight: 600; }
.cookie-banner .cookie-buttons { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 14px; }
.cookie-banner .cookie-btn {
    flex: 1 1 160px;
    min-height: 46px;
    border-radius: 999px;
    font: 700 15px/1 var(--hce-body);
    cursor: pointer;
}
.cookie-banner .cookie-btn.accept { background: var(--hce-yellow); color: var(--hce-navy); border: 0; }
.cookie-banner .cookie-btn.reject { background: transparent; color: var(--hce-white); border: 2px solid var(--hce-white); }
@media (max-width: 992px) {
    .cookie-banner { bottom: calc(var(--hce-tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); }
}
