/* ============================================================
   Top-bar view — owner request 2026-10-21
   Phones in BOTH orientations and tablets (up to 1199px wide, or any
   screen up to 500px high) get a compact top bar on every page: logo
   and a menu button; the menu holds every page and, at its top, the
   language switch. Larger screens: unchanged.
   The footer two-column list applies to narrow phones only (≤ 600px).
   The homepage's own sizing rules live in index.html.
   ============================================================ */

.mbar, .mpanel { display: none; }

@media (max-width: 1199px), (max-height: 500px) {
    /* ---------- top bar ---------- */
    body { padding-top: 56px; }
    .mbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        /* fixed, not sticky: sticky could be scrolled off the top on iPhone
           Safari while the menu was open, hiding the close button (owner) */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 90;
        height: 56px;
        padding: 0 0.5rem 0 1rem;
        background: rgba(13, 40, 24, 0.94);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(240, 230, 208, 0.1);
    }
    .mbar-logo { display: flex; align-items: center; }
    .mbar-logo img { height: 26px; width: auto; display: block; }
    .mbar-right { display: flex; align-items: center; gap: 0.25rem; }
    .mpanel-lang { display: flex; justify-content: flex-end; padding: 0.75rem 0 0.25rem; }
    .mpanel .lang-toggle {
        position: static !important;
        box-shadow: none;
    }
    .mbar-menu {
        appearance: none;
        background: transparent;
        border: 0;
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 10px;
    }
    .mbar-burger { position: relative; width: 22px; height: 16px; display: block; }
    .mbar-burger span {
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        border-radius: 2px;
        background: #f0e6d0;
        transition: transform 0.2s, opacity 0.2s, top 0.2s;
    }
    .mbar-burger span:nth-child(1) { top: 0; }
    .mbar-burger span:nth-child(2) { top: 7px; }
    .mbar-burger span:nth-child(3) { top: 14px; }
    .mbar-menu[aria-expanded="true"] .mbar-burger span:nth-child(1) { top: 7px; transform: rotate(45deg); }
    .mbar-menu[aria-expanded="true"] .mbar-burger span:nth-child(2) { opacity: 0; }
    .mbar-menu[aria-expanded="true"] .mbar-burger span:nth-child(3) { top: 7px; transform: rotate(-45deg); }

    /* ---------- menu panel ---------- */
    .mpanel:not([hidden]) {
        display: block;
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 89;
        overflow-y: auto;
        padding: 0.5rem 1rem 2rem;
        background: #081a10;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    }
    /* no page scroll-lock (it moved the page on iPhone); the panel covers the
       page and keeps its own scrolling to itself */
    .mpanel { overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
    .mpanel-h {
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: #d97706;
        margin: 1.1rem 0 0.25rem;
    }
    .mpanel ul { list-style: none; margin: 0; padding: 0; }
    .mpanel li a {
        display: flex;
        align-items: center;
        min-height: 48px;
        font-size: 1rem;
        color: #f0e6d0;
        text-decoration: none;
        border-bottom: 1px solid rgba(240, 230, 208, 0.08);
    }
    .mpanel li a[aria-current="page"] { color: #fb923c; font-weight: 600; }

    /* ---------- subpages: the bar carries the logo ---------- */
    .page-header { padding: 0.9rem 1rem 0.8rem !important; }
    .page-header .page-logo { display: none; }
    .page-header-inner { gap: 0; }
    /* the old floating switch is now inside the bar; the preview stripe on
       news mockups no longer needs room for it */
    .mock-banner { padding-right: 1rem !important; text-align: center !important; }

}

/* tablets / landscape phones: the bar's logo and the breadcrumb sit on the
   page frame's left edge (same 24px gutter / 960px frame as the content) */
@media (min-width: 601px) and (max-width: 1199px), (min-width: 601px) and (max-height: 500px) {
    .mbar { padding-left: max(1.5rem, calc((100% - 960px) / 2)); padding-right: max(1rem, calc((100% - 960px) / 2 - 0.5rem)); }
    .page-header { padding: 0.9rem 1.5rem 0.8rem !important; }
    .mpanel:not([hidden]) { padding-left: max(1.5rem, calc((100% - 960px) / 2)); padding-right: max(1.5rem, calc((100% - 960px) / 2)); }
}

@media (max-width: 600px) {
    /* ---------- footer: links as a two-column list with tap-sized rows ---------- */
    .footer-links-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0;
        width: 100%;
        max-width: 360px;
        text-align: left;
    }
    .footer-links-row a,
    .footer-links-row span a {
        display: flex;
        align-items: center;
        min-height: 44px;
        font-size: 0.85rem;
        padding: 0 0.25rem;
    }
}

/* ============================================================
   Desktop navigation — owner request 2026-11-24
   1200px and wider (and taller than 500px). Same structure as the
   phone menu: Pikaro · Doppelkopf · Skat, three cells of EQUAL width;
   Pikaro and Doppelkopf open a list of their pages. Flat — no capsule,
   no rounded frame: letter-spaced labels, an orange line under the cell
   you are in. On subpages it sits INSIDE the page header, right of the
   breadcrumb and logo; on the homepage (no header) it lies over the top
   of the first section, on the same right edge. Built by mobile-nav.js
   from the SAME link list as the phone menu.
   ============================================================ */
.dnav { display: none; }

@media (min-width: 1200px) and (min-height: 501px) {
    /* subpage header: breadcrumb + logo on the left, navigation on the right */
    .page-header-inner.has-dnav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 2.5rem;
        row-gap: 0.85rem;
        align-items: center;
    }
    .page-header-inner.has-dnav > .crumbs { grid-column: 1; grid-row: 1; max-width: 400px; justify-self: start; }
    .page-header-inner.has-dnav > .page-logo { grid-column: 1; grid-row: 2; justify-self: start; }
    .page-header-inner.has-dnav > .dnav { grid-column: 2; grid-row: 1 / span 2; align-self: end; }

    .dnav {
        display: block;
        position: relative;
        z-index: 40;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    }
    /* homepage: over the top of the first section, on the subpages' right edge */
    .dnav.dnav-over {
        position: absolute;
        top: 1.75rem;
        left: 0;
        right: 0;
        padding: 0 1.5rem;
    }
    body:has(> .dnav-over) { position: relative; }
    .dnav.dnav-over .dnav-list { max-width: 960px; margin: 0 auto; justify-content: end; }

    .dnav ul { list-style: none; margin: 0; padding: 0; }
    .dnav-list { display: grid; grid-template-columns: repeat(3, 150px); }
    .dnav-list > li { position: relative; }
    .dnav-top {
        appearance: none;
        background: transparent;
        border: 0;
        border-radius: 0;
        cursor: pointer;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        width: 100%;
        height: 46px;
        padding: 0;
        font: inherit;
        font-size: 0.8rem;
        font-weight: 700;
        letter-spacing: 0.14em;
        text-transform: uppercase;
        color: #d9cfb8;
        text-decoration: none;
        transition: color 0.2s;
    }
    /* the line under a cell: grows from the middle on hover, stays where you are */
    .dnav-top::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 2px;
        background: #f08a1c;
        transform: scaleX(0);
        transition: transform 0.25s ease;
    }
    .dnav-top:hover,
    .dnav-has-menu:hover > .dnav-top,
    .dnav-drop[aria-expanded="true"] { color: #faf4e8; }
    .dnav-top:hover::after,
    .dnav-has-menu:hover > .dnav-top::after,
    .dnav-drop[aria-expanded="true"]::after,
    .dnav-top[aria-current="page"]::after,
    .dnav-top.dnav-here::after { transform: scaleX(1); }
    .dnav-top[aria-current="page"],
    .dnav-top.dnav-here { color: #fb923c; }
    .dnav a:focus-visible,
    .dnav-top:focus-visible { outline: 2px solid #fb923c; outline-offset: 2px; }
    .dnav-caret {
        width: 6px;
        height: 6px;
        border-right: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: translateY(-2px) rotate(45deg);
        transition: transform 0.2s;
    }
    .dnav-drop[aria-expanded="true"] .dnav-caret,
    .dnav-has-menu:hover .dnav-caret { transform: translateY(2px) rotate(225deg); }

    /* the list under a cell: a flat, square panel hanging from the orange line;
       opens on hover, on click and on keyboard focus */
    .dnav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        min-width: 100%;
        padding: 0.5rem 0 !important;
        background: #0a2014;
        border: 1px solid rgba(240, 230, 208, 0.12);
        border-top: 0;
        box-shadow: 0 22px 48px rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-4px);
        transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    }
    .dnav-has-menu:hover > .dnav-menu,
    .dnav-drop[aria-expanded="true"] + .dnav-menu { opacity: 1; visibility: visible; transform: none; }
    .dnav-menu a {
        display: flex;
        align-items: center;
        min-height: 42px;
        padding: 0 1.25rem;
        border-left: 2px solid transparent;
        font-size: 0.92rem;
        font-weight: 500;
        color: #f0e6d0;
        text-decoration: none;
        white-space: nowrap;
        transition: background 0.15s, color 0.15s, border-color 0.15s, padding-left 0.15s;
    }
    .dnav-menu a:hover { background: rgba(240, 230, 208, 0.07); color: #faf4e8; border-left-color: #f08a1c; padding-left: 1.5rem; }
    .dnav-menu a[aria-current="page"] { color: #fb923c; font-weight: 600; border-left-color: #f08a1c; }
}
