/* =====================================================
/* XOTLIST HEADER — v4.1
/* Single source of truth. Audited & mobile-first.
===================================================== */

/* ── Design tokens ── */
:root {
    --hdr-max:        var(--xot-max);
    --hdr-pad-lg:     2rem;
    --hdr-pad-sm:     1rem;
    --hdr-height:     60px;
    --hdr-height-lg:  72px;
    --hdr-height-xs:  56px;
    --hdr-logo-h:     31px;
    --hdr-logo-h-lg:  43px;
    --hdr-logo-h-scr: 25px;
    --hdr-logo-h-scr-lg: 31px;
    --hdr-accent:     var(--color-accent);
    --hdr-border:     rgba(255,255,255,.07);
    --hdr-text:       rgba(255,255,255,.92);
    --hdr-muted:      rgba(255,255,255,.45);
    --hdr-transition: 0.25s ease;
}

/* ══ WRAPPER ══════════════════════════════════════ */
.site-header {
    background: rgba(13,13,13,.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 9300;
    border-bottom: 1px solid var(--hdr-border);
    box-shadow: none;
    transition: box-shadow var(--hdr-transition);
}
.site-header.scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

/* ══ TOP ROW ══════════════════════════════════════
   Mobile:  [☰] [LOGO — center] [🔍]
/* Desktop: [LOGO — left] ————————— [🔍]
═══════════════════════════════════════════════════ */
.site-header__inner {
    display: flex;
    align-items: center;
    height: var(--hdr-height);
    padding: 0 var(--hdr-pad-sm);
    max-width: var(--hdr-max);
    margin: 0 auto;
    gap: 0.5rem;
    transition: height var(--hdr-transition);
}
.site-header.scrolled .site-header__inner {
    height: calc(var(--hdr-height) - 10px);
}

/* ── Bell — mobile / tablet only (hidden by default, shown ≤1024px) ── */
.site-header__bell {
    flex-shrink: 0;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.85);
    padding: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
/* ── Dark-mode toggle — reuses icon-button sizing ── */
/* Breaking bar */
.xot-breaking-bar{display:flex;align-items:center;gap:.5rem;background:var(--color-accent);padding:.45rem 1rem;font-size:.68rem;font-weight:700;color:#fff;overflow:hidden;white-space:nowrap}
.xot-breaking-bar__dot{width:6px;height:6px;border-radius:50%;background:#fff;flex-shrink:0;animation:xot-pulse 1.5s infinite}
@keyframes xot-pulse{0%,100%{opacity:1}50%{opacity:.3}}
.xot-breaking-bar__label{font-size:.5rem;font-weight:900;text-transform:uppercase;letter-spacing:1.5px;background:rgba(0,0,0,.25);padding:.15rem .5rem;border-radius:3px;flex-shrink:0}
.xot-breaking-bar__text{flex:1;overflow:hidden;text-overflow:ellipsis}
.xot-breaking-bar__close{background:none;border:none;color:rgba(255,255,255,.6);cursor:pointer;font-size:.75rem;padding:.2rem .4rem;flex-shrink:0;font-family:inherit;transition:color .15s}
.xot-breaking-bar__close:hover{color:#fff}

.site-header__dm-toggle {
    flex-shrink: 0;
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.85);
    padding: 6px;
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.site-header__dm-toggle:hover  { background: rgba(255,255,255,.08); color: #fff; }
.site-header__dm-toggle:active { background: #ebebeb; }
.site-header__bell:hover  { background: rgba(255,255,255,.08); color: #fff; }
.site-header__bell:active { background: #ebebeb; }

/* Red dot — shown when unread notifications exist */
.site-header__bell-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--hdr-accent);
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.15);
    display: none;
    animation: bell-dot-in 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards;
}
.site-header__bell-dot.show { display: block; }
@keyframes bell-dot-in {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}
/* Bell wiggle when new content */
@keyframes bell-wiggle {
    0%,100% { transform: rotate(0); }
    15%      { transform: rotate(18deg); }
    30%      { transform: rotate(-16deg); }
    45%      { transform: rotate(12deg); }
    60%      { transform: rotate(-8deg); }
    75%      { transform: rotate(5deg); }
}
.site-header__bell.wiggle svg {
    animation: bell-wiggle 0.7s ease forwards;
}

/* ── Bookmark — mobile only ── */
.site-header__bookmark {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.85);
    padding: 6px;
    display: none; /* shown via JS on single posts only */
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.site-header__bookmark:hover  { background: rgba(255,255,255,.08); }
.site-header__bookmark:active { background: #ebebeb; }
.site-header__bookmark.saved  { color: var(--color-accent); }
/* Pop animation on save */
@keyframes bm-pop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.35); }
    70%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}
.site-header__bookmark.pop { animation: bm-pop 0.35s cubic-bezier(0.34,1.56,0.64,1) forwards; }

/* Desktop: show search; hide bookmark & dark-mode toggle */
.site-header__search-btn--desktop { display: flex; }
@media (max-width: 1024px) {
    .site-header__search-btn--desktop { display: none !important; }
    .site-header__rl-btn { display: none !important; }
    .site-header__bell       { display: flex !important; }
    .site-header__dm-toggle  { display: flex !important; }
}
@media (min-width: 1025px) {
    .site-header__bell       { display: none !important; }
    .site-header__bookmark   { display: none !important; }
    .site-header__dm-toggle  { display: none !important; }
    #xot-dm-toggle           { display: none !important; }
    .xot-notif-sheet         { display: none !important; }
}

/* ── Notification sheet ── */
.xot-notif-sheet {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9990;
    pointer-events: none;
}
.xot-notif-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background 0.25s;
    pointer-events: none;
}
.xot-notif-sheet.open .xot-notif-sheet__backdrop {
    background: rgba(0,0,0,0.35);
    pointer-events: all;
}
.xot-notif-sheet__panel {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: #18181c;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 12px 48px rgba(0,0,0,0.18);
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform 0.28s cubic-bezier(0.16,1,0.3,1);
    pointer-events: all;
    padding-bottom: env(safe-area-inset-bottom, 0);
    will-change: transform;
    -webkit-overflow-scrolling: touch;
}
.xot-notif-sheet.open .xot-notif-sheet__panel {
    transform: translateY(0);
}
.xot-notif-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    position: sticky; top: 0;
    background: #18181c;
    z-index: 1;
}
.xot-notif-sheet__title {
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.3px;
}
.xot-notif-sheet__mark-read {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--hdr-accent);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0.3rem 0;
}
.xot-notif-sheet__close {
    background: rgba(255,255,255,.06);
    border: none;
    border-radius: 50%;
    width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    color: rgba(255,255,255,.55);
    transition: background 0.15s;
}
.xot-notif-sheet__close:hover { background: var(--color-surface-2); }

/* Reading List Sheet — same styling, not hidden on desktop */
.xot-rl-sheet {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9991;
    pointer-events: none;
}
.xot-rl-sheet .xot-notif-sheet__backdrop {
    background: rgba(0,0,0,0);
    transition: background 0.25s;
    pointer-events: none;
}
.xot-rl-sheet.open .xot-notif-sheet__backdrop {
    background: rgba(0,0,0,0.35);
    pointer-events: all;
}
.xot-rl-sheet .xot-notif-sheet__panel {
    transform: translateY(-100%);
}
.xot-rl-sheet.open .xot-notif-sheet__panel {
    transform: translateY(0);
}

/* Notification items */
.xot-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
    position: relative;
}
.xot-notif-item:hover { background: rgba(255,255,255,.04); }
.xot-notif-item:last-child { border-bottom: none; }
.xot-notif-item__img {
    width: 52px; height: 40px;
    border-radius: 5px;
    background: #1c1c1e center/cover no-repeat;
    flex-shrink: 0;
}
.xot-notif-item__body { flex: 1; min-width: 0; }
.xot-notif-item__cat {
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--hdr-accent);
    display: block;
    margin-bottom: 0.15rem;
}
.xot-notif-item__title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.xot-notif-item__time {
    font-size: 0.62rem;
    color: rgba(255,255,255,.55);
    font-weight: 600;
    margin-top: 0.2rem;
    display: block;
}
/* Unread dot */
.xot-notif-item__unread {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--hdr-accent);
    flex-shrink: 0;
    margin-top: 5px;
}
.xot-notif-item.read .xot-notif-item__unread { visibility: hidden; }
/* Empty state */
.xot-notif-empty {
    padding: 2.5rem 1.25rem;
    text-align: center;
    color: rgba(255,255,255,.55);
    font-size: 0.82rem;
    font-weight: 600;
}
.xot-notif-empty svg { margin: 0 auto 0.75rem; display: block; opacity: 0.3; }

/* ── Logo — flex:1 centers it between bell & bookmark on mobile ── */
.site-header__logo {
    flex: 1;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 0;
}
.site-header__logo-img {
    display: block;
    height: var(--hdr-logo-h);
    width: auto;
    max-width: 160px;        /* wider cap — prevents wordmark crop */
    object-fit: contain;
    transition: height var(--hdr-transition);
}
.site-header.scrolled .site-header__logo-img {
    height: var(--hdr-logo-h-scr);
}

/* ── Right slot: search ── */
.site-header__right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.site-header__account-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    position: relative;
    flex-shrink: 0;
    margin-right: 0.25rem;
}
.site-header__account-btn:hover { background: rgba(0,0,0,0.1); color: #000; }
/* Dark header override — used on home.php and dark pages */
.site-header--dark .site-header__account-btn {
    background: rgba(255,255,255,0.07);
    color: rgba(255,255,255,0.7);
}
.site-header--dark .site-header__account-btn:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
}
/* White header account btn — always visible */
.site-header:not(.site-header--dark) .site-header__account-btn {
    background: none;
    color: rgba(255,255,255,.85);
}
.site-header:not(.site-header--dark) .site-header__account-btn:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}
.site-header__account-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--color-gold);
    border: 1.5px solid var(--hdr-bg, #fff);
}
.site-header__search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,.5);
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.site-header__search-btn:hover  { background: rgba(255,255,255,.06); color: #fff; }
.site-header__search-btn:active { background: #ebebeb; }

/* ── Search fullscreen overlay ── */
.site-header__search-form {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 9999;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 5rem 1rem 2rem;
}
.site-header__search-form.open { display: flex; }
.site-header__search-form-row {
    display: flex;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    gap: 0.5rem;
    align-items: center;
}
.site-header__search-form input[type="search"] {
    flex: 1;
    border: 2px solid #111;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
    background: #18181c;
    color: #fff;
    -webkit-appearance: none;
    appearance: none;
}
.site-header__search-form input[type="search"]:focus { border-color: var(--hdr-accent); }
.site-header__search-form button[type="submit"] {
    background: var(--hdr-accent);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: background 0.15s;
}
.site-header__search-form button[type="submit"]:hover { background: #D94068; }
.site-header__search-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    padding: 0.5rem;
    line-height: 1;
}

/* ══ NAV ROW — desktop + homepage only ════════════ */
.site-header__nav {
    display: none;
    overflow-x: auto;
    scrollbar-width: none;
    border-top: 1px solid var(--hdr-border);
    background: #18181c;
}
.site-header__nav::-webkit-scrollbar { display: none; }
.site-header__nav__inner {
    display: flex;
    align-items: center;
    max-width: var(--hdr-max);
    margin: 0 auto;
    /* offset link h-padding so first link text = logo left edge */
    padding: 0 calc(var(--hdr-pad-lg) - 0.9rem);
}
.site-header__nav a {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--hdr-muted);
    text-decoration: none;
    padding: 0.65rem 0.9rem;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.site-header__nav a:hover       { color: var(--hdr-accent); }
.site-header__nav a.current-cat { color: var(--hdr-accent); border-bottom-color: var(--hdr-accent); }
.site-header__premium-link { color: var(--color-gold) !important; font-weight: 800 !important; }
.site-header__premium-link:hover { color: #ffdb6b !important; }

/* ══ DESKTOP 1025px+ ══════════════════════════════ */
@media (min-width: 1025px) {
    .site-header__inner {
        height: 64px;
        padding: 0 2rem;
        max-width: var(--xot-max);
        margin: 0 auto;
        display: flex;
        align-items: center;
        gap: 0;
    }
    .site-header.scrolled .site-header__inner { height: 54px; }
    /* Logo: left, fixed width */
    .site-header__logo {
        flex: 0 0 auto;
        justify-content: flex-start;
        margin-right: 0;
    }
    .site-header__logo-img {
        height: 42px;
        max-width: 200px;
    }
    .site-header.scrolled .site-header__logo-img { height: 36px; }
    /* Nav: takes all remaining space, centers its links */
    .site-header__nav {
        flex: 1;
        display: flex !important;
        align-items: center;
        justify-content: center;
        overflow-x: auto;
        scrollbar-width: none;
        background: transparent;
        border: none;
        height: 100%;
    }
    .site-header__nav::-webkit-scrollbar { display: none; }
    .site-header__nav a {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--hdr-muted);
        padding: 0 0.85rem;
        white-space: nowrap;
        height: 64px;
        display: flex;
        align-items: center;
        border-bottom: 2px solid transparent;
        transition: color 0.15s, border-color 0.15s;
        text-decoration: none;
    }
    .site-header.scrolled .site-header__nav a { height: 54px; }
    .site-header__nav a:hover { color: var(--hdr-accent); }
    .site-header__nav a.current-cat { color: var(--hdr-accent); border-bottom-color: var(--hdr-accent); }
    /* Search: right, fixed width */
    .site-header__right {
        flex: 0 0 auto;
        display: flex;
        align-items: center;
    }
    /* Hide mobile-only elements on desktop */
}

/* ══ MOBILE / TABLET 1024px and below ════════════ */
@media (max-width: 1024px) {
    .site-header__nav    { display: none !important; }
    .site-header__inner  { height: var(--hdr-height); }
}

/* ══ SMALL PHONES 480px and below ════════════════ */
@media (max-width: 480px) {
    .site-header__inner {
        height: var(--hdr-height-xs);
        padding: 0 0.75rem;
    }
    .site-header.scrolled .site-header__inner {
        height: calc(var(--hdr-height-xs) - 6px);
    }
    .site-header__logo-img {
        height: var(--hdr-logo-h);     /* same as default — don't shrink further */
        max-width: 150px;
    }
    .site-header.scrolled .site-header__logo-img {
        height: 28px;
    }
    .site-header__bell,
    .site-header__bookmark {
        width: 36px;
        height: 36px;
    }
}

/* Score pill lives in the profile/account page — not the header */
.xot-score-pill { display: none !important; }

/* ══ SINGLE POST — explicit light defaults ════════ */
.single-wrap           { background: rgba(13,13,13,.92); }
.single-title          { color: #111111; }
.single-meta           { color: rgba(255,255,255,.55); border-bottom-color: rgba(255,255,255,.15); }
.single-content        { color: #1a1a1a; }
.single-content h2,
.single-content h3,
.single-content h4     { color: #111111; }
.author-bio            { background: var(--color-surface); border-color: #e8e8e8; }
.author-bio__name      { color: #111111; }
.author-bio__desc      { color: rgba(255,255,255,.55); }
.related-posts         { background: var(--color-surface); }
.related-card          { background: rgba(13,13,13,.92); border-color: #e8e8e8; }
.related-card__title   { color: #111111; }
.back-link             { color: rgba(255,255,255,.55); }
.xot-skip-link{position:absolute;left:-9999px;top:-9999px;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.xot-skip-link:focus{position:fixed;left:1rem;top:1rem;width:auto;height:auto;overflow:visible;clip:auto;white-space:normal;background:var(--color-surface);color:#000;font-size:.8rem;font-weight:700;padding:.5rem 1rem;border-radius:6px;z-index:9999;text-decoration:none;outline:2px solid #000}
