/* ============================================
   Top Header — nav cluster (left) + logo (center)
   ============================================
   Sağ küme (Geri) en solda; logo her zaman tam ortada. Logo mutlak
   konumlanır, böylece sol kümenin genişliği ortalamayı kaydırmaz. */

.top-header {
    position: relative;
    z-index: 50;
    background: var(--color-bg);
    box-shadow: rgb(51 48 48 / 20%) 0px 8px 24px;
}

.top-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    height: 70px;
}

/* ─── Logo (tam ortada) ───────────────────────────────────────────
   `max-width` dar ekranda sol kümenin üstüne binmeyi önler. */
.top-header__logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    min-width: 0;
    max-width: 60%;
    text-decoration: none;
}

/* Explicit `height` (not just max-height) so SVG logos without an
   intrinsic width/height attribute still get sized — otherwise the
   browser renders them at 0×0 and the logo disappears from the bar
   while the DOM element stays present. `width: auto + max-width`
   keeps the aspect ratio + caps very wide wordmarks. */
.top-header__logo-img {
    height: 56px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
}

body.theme-light .top-header__logo-img { filter: none; }
body:not(.theme-light) .top-header__logo-img { filter: brightness(1.1); }

.top-header__logo-text {
    font-family: var(--font-display);
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--color-header-fg, var(--color-text));
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Sol küme (Geri + bağlam) ────────────────────────────────────
   Tek esnek çocuk olarak satırın en soluna yaslanır; logo mutlak
   ortada durduğu için küme genişliği ortalamayı etkilemez. */
.top-header__right {
    order: -1;
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    min-width: 0;
}

/* Outlet name — wraps to 2 lines for long names, right-aligned so it
   reads as the trailing context before the divider/back action. */
.top-header__outlet-name {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--color-header-fg, var(--color-text));
    text-align: right;
    max-width: 50vw;
    /* Two-line clamp guards against "The Club Restaurant" eating the
       whole header on narrow viewports. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* Hairline divider between outlet name and back button.
   Rendered only when BOTH are present (see header.php logic) so the
   cluster reads as "context | action" instead of two unrelated items.
   `color-text-muted` is intentionally bolder than `color-border` —
   the divider needs to actually communicate separation, not whisper
   it. Height matches the back button's tighter footprint. */
.top-header__divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: var(--color-text-muted);
    opacity: 0.35;
    flex-shrink: 0;
}

/* Back button — 36×36 visual footprint with a generous tap area via
   padding (touch-action). Compact so it doesn't crowd a long outlet
   name on narrow viewports; still well within iOS/Android tap-area
   guidelines because the surrounding flex gap adds breathing room.
   Edge-swipe gesture remains the primary back-navigation mechanism. */
.top-header__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 36px;
    border-radius: var(--radius-full);
    color: var(--color-header-fg, var(--color-text));
    transition: background var(--transition-fast), transform 100ms ease;
    flex-shrink: 0;
}

body.theme-light .top-header__back {
    background: rgb(0 0 0 / 0%);
}
body.theme-light .top-header__back:hover,
body.theme-light .top-header__back:active {
    background: rgb(0 0 0 / 5%);
}
body:not(.theme-light) .top-header__back {
    background: var(--color-bg-glass-strong);
}
body:not(.theme-light) .top-header__back:hover,
body:not(.theme-light) .top-header__back:active {
    background: var(--color-bg-glass);
}

.top-header__back:active {
    transform: scale(0.92);
}

/* Labeled variant — shown when there's no outlet caption, so a lone
   chevron isn't the only affordance. Becomes an icon + "Geri" pill. */
.top-header__back--labeled {
    width: auto;
    gap: 5px;
    padding: 0 12px 0 8px;
}
.top-header__back-label {
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}
