/* header-enhance-20260603.css
 * Header improvements: skip-link, search autocomplete, notification bell,
 * touch-aware hints, mid-screen density. Loaded after main.css + header-polish.
 */

/* ----------------------------------------------------------------
 * Skip to content (accessibility)
 * ---------------------------------------------------------------- */
.skip-to-content {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 2000;
    padding: 10px 18px;
    border-radius: 0 0 12px 12px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0,0,0,.4);
    transition: top .2s ease;
}
.skip-to-content:focus,
.skip-to-content:focus-visible {
    top: 0;
    outline: 2px solid rgba(167,139,250,.9);
    outline-offset: 2px;
}
main:focus,
main:focus-visible {
    outline: none;
}

/* ----------------------------------------------------------------
 * Clickable live pill in the brand cluster
 * ---------------------------------------------------------------- */
.header-live-pill--link {
    text-decoration: none;
    cursor: pointer;
    align-self: center;
    margin-left: 10px;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.header-live-pill--link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255,77,79,.28);
}
.header-live-pill--link:focus-visible {
    outline: 2px solid rgba(167,139,250,.85);
    outline-offset: 2px;
}

/* ----------------------------------------------------------------
 * Search autocomplete dropdown
 * ---------------------------------------------------------------- */
.header-search-suggestions {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
    border-radius: 14px;
    border: 1px solid rgba(138,109,233,.22);
    background: linear-gradient(135deg, rgba(19,19,28,.96), rgba(11,11,16,.98));
    padding: 6px;
    box-shadow: 0 18px 48px rgba(0,0,0,.45);
}
.header-search-suggestions[hidden] { display: none; }

.header-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: background .15s ease;
}
.header-suggest-item:hover,
.header-suggest-item.is-active {
    background: rgba(138,109,233,.16);
}
.header-suggest-icon {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(138,109,233,.16);
    color: var(--primary-light, #a78bfa);
    font-size: .85rem;
}
.header-suggest-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}
.header-suggest-title {
    font-size: .9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.header-suggest-type {
    font-size: .72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ----------------------------------------------------------------
 * Notification bell + panel
 * ---------------------------------------------------------------- */
.header-notif {
    position: relative;
    display: inline-flex;
}
.header-notif-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid rgba(138,109,233,.22);
    background: rgba(138,109,233,.1);
    color: var(--text);
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
}
.header-notif-toggle:hover {
    border-color: rgba(138,109,233,.45);
    background: rgba(138,109,233,.18);
    color: #fff;
}
.header-notif-toggle:focus-visible {
    outline: 2px solid rgba(167,139,250,.85);
    outline-offset: 2px;
}
.header-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: linear-gradient(135deg, #ff4d4f, #e0245e);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(224,36,94,.5);
}
.header-notif-badge.is-empty { display: none; }

.header-notif-panel {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    border-radius: 16px;
    border: 1px solid rgba(138,109,233,.24);
    background: linear-gradient(135deg, rgba(19,19,28,.98), rgba(11,11,16,.99));
    box-shadow: 0 24px 60px rgba(0,0,0,.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 1200;
    overflow: hidden;
}
.header-notif.open .header-notif-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(138,109,233,.16);
}
.header-notif-title {
    font-weight: 600;
    font-size: .95rem;
}
.header-notif-readall {
    background: none;
    border: none;
    color: var(--primary-light, #a78bfa);
    font-size: .8rem;
    cursor: pointer;
    padding: 2px 4px;
    font-family: inherit;
}
.header-notif-readall:hover { text-decoration: underline; }
.header-notif-list {
    max-height: 380px;
    overflow-y: auto;
}
.header-notif-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: .88rem;
}
.header-notif-item {
    display: flex;
    gap: 11px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text);
    border-bottom: 1px solid rgba(138,109,233,.08);
    transition: background .15s ease;
}
.header-notif-item:hover { background: rgba(138,109,233,.1); }
.header-notif-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 6px;
    border-radius: 50%;
    background: transparent;
}
.header-notif-item.is-unread .header-notif-dot {
    background: var(--primary, #8a6de9);
    box-shadow: 0 0 8px rgba(138,109,233,.7);
}
.header-notif-item--success .header-notif-dot { background: #4d9f8a; }
.header-notif-item--warning .header-notif-dot { background: #e0a649; }
.header-notif-item--error .header-notif-dot { background: #ff4d4f; }
.header-notif-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}
.header-notif-item-title {
    font-size: .88rem;
    font-weight: 500;
}
.header-notif-item-msg {
    font-size: .8rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.header-notif-time {
    font-size: .72rem;
    color: var(--text-muted);
}
.header-notif-foot {
    display: block;
    padding: 12px 16px;
    text-align: center;
    font-size: .85rem;
    color: var(--primary-light, #a78bfa);
    text-decoration: none;
    border-top: 1px solid rgba(138,109,233,.16);
    transition: background .15s ease;
}
.header-notif-foot:hover { background: rgba(138,109,233,.1); }

/* ----------------------------------------------------------------
 * Hide the "/" keyboard hint where there is no physical keyboard
 * ---------------------------------------------------------------- */
@media (hover: none), (pointer: coarse) {
    .header-action-hint { display: none !important; }
}

/* ----------------------------------------------------------------
 * Reduce density on mid-size screens — drop the decorative nav meta
 * before the nav itself gets cramped.
 * ---------------------------------------------------------------- */
@media (max-width: 1500px) {
    .header-nav-meta { display: none; }
}
@media (max-width: 1320px) {
    .header-action-label { display: none; }
    .header-notif-panel { width: 320px; }
}
