/* SphereNexus v1.5 — premium cut-shape header and live updates bar. */
:root {
    --sn-logo-desktop-width: 215px;
    --sn-logo-mobile-width: 165px;
}

.site-header--cut {
    position: relative;
    z-index: 120;
    background: #f7fafb;
    font-family: var(--sn-font-ui);
}

/* Live updates ticker */
.live-update-bar {
    position: relative;
    z-index: 3;
    color: #dce9f1;
    background:
        linear-gradient(90deg, rgba(10, 143, 139, .18), transparent 34%),
        #071b31;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.live-update-bar__inner {
    min-height: 42px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
}

.live-update-badge {
    position: relative;
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 19px 7px 13px;
    color: #fff;
    background: linear-gradient(135deg, #0d9a95, #08746f);
    clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%, 6px 50%);
    font-size:10px;
    font-weight: 600;
    letter-spacing: .11em;
    text-transform: uppercase;
    white-space: nowrap;
}

.live-update-badge__pulse {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255,255,255,.6);
    animation: snLivePulse 1.9s infinite;
}

@keyframes snLivePulse {
    0% { box-shadow: 0 0 0 0 rgba(255,255,255,.55); }
    70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
    100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

.live-update-viewport {
    position: relative;
    min-width: 0;
    height: 24px;
    overflow: hidden;
}

.live-update-list {
    position: relative;
    height: 100%;
}

.live-update-item {
    position: absolute;
    inset: 0;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    color: #e7f0f5;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .32s ease, transform .32s ease, visibility .32s ease;
    white-space: nowrap;
}

.live-update-item.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.live-update-item:hover { color: #fff; }
.live-update-item__category {
    flex: 0 0 auto;
    color: #4ed0c9;
    font-size:9px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.live-update-item__category::after {
    content: "";
    display: inline-block;
    width: 3px;
    height: 3px;
    margin-left: 9px;
    vertical-align: middle;
    border-radius: 50%;
    background: rgba(255,255,255,.42);
}
.live-update-item__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size:11px;
    font-weight: 600;
    letter-spacing: .005em;
}
.live-update-item__time {
    flex: 0 0 auto;
    color: #8fa7b6;
    font-size:9px;
    font-weight: 600;
}

.live-update-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}
.live-update-controls button {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #d9e8ee;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 7px 10px 7px 10px;
    transition: .2s ease;
}
.live-update-controls button:hover {
    color: #fff;
    background: #0d8f8b;
    border-color: #0d8f8b;
}
.live-update-controls svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.live-update-meta {
    display: flex;
    align-items: center;
    gap: 13px;
    padding-left: 14px;
    border-left: 1px solid rgba(255,255,255,.12);
    white-space: nowrap;
}
.live-update-meta,
.live-update-meta a {
    color: #aebfca;
    font-size:9px;
    font-weight: 600;
}
.live-update-meta a { position: relative; }
.live-update-meta a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -3px;
    height: 1px;
    background: #48c7c0;
    transition: right .2s ease;
}
.live-update-meta a:hover { color: #fff; }
.live-update-meta a:hover::after { right: 0; }

/* Cut-shape header shell */
.site-header--cut .main-header {
    position: relative;
    padding: 12px 0 17px;
    background: linear-gradient(180deg, #f7fafb 0%, #fff 100%);
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
}
.site-header--cut .main-header__frame { position: relative; }
.site-header--cut .main-header__shell {
    position: relative;
    isolation: isolate;
    box-shadow: 0 13px 25px rgba(7,27,49,.055);
}
.site-header--cut .main-header__shell::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: #fff;
    border: 1px solid #dfe8ee;
    clip-path: polygon(0 0, calc(100% - 25px) 0, 100% 25px, 100% 100%, 25px 100%, 0 calc(100% - 25px));
}
.site-header--cut .main-header__shell::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -4px;
    right: 25px;
    width: 92px;
    height: 6px;
    background: linear-gradient(90deg, #0d8f8b, #32bbb4);
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}
.site-header--cut .main-header__inner {
    min-height: 76px;
    grid-template-columns: minmax(var(--sn-logo-desktop-width), var(--sn-logo-desktop-width)) minmax(0, 1fr) auto;
    gap: clamp(20px, 2.1vw, 34px);
    padding: 0 23px;
}
.site-header--cut .branding-wrap {
    width: var(--sn-logo-desktop-width);
    min-width: 0;
}
.site-header--cut .custom-logo-link,
.site-header--cut .custom-logo {
    width: 100%;
    max-width: var(--sn-logo-desktop-width) !important;
    max-height: 58px;
    object-fit: contain;
    object-position: left center;
}
.site-header--cut .site-brand { max-width: var(--sn-logo-desktop-width); }
.site-header--cut .primary-menu { gap: clamp(18px, 1.7vw, 29px); }
.site-header--cut .primary-menu > li > a {
    padding: 28px 0 25px;
    font-size:min(var(--sn-nav-size), 12px);
    font-weight: 600;
    letter-spacing: .01em;
    text-transform: none;
}
.site-header--cut .primary-menu > li > a::after { bottom: 19px; }
.site-header--cut .header-actions { gap: 8px; }
.site-header--cut .search-toggle,
.site-header--cut .mobile-menu-toggle {
    border-radius: 8px 13px 8px 13px;
    background: #f9fbfc;
}
.site-header--cut .header-subscribe {
    min-height: 42px;
    border-radius: 7px 15px 7px 15px;
}

.site-header--cut .main-header.is-sticky {
    padding: 7px 0 10px;
    background: rgba(247,250,251,.96);
    box-shadow: 0 10px 30px rgba(7,27,49,.08);
    backdrop-filter: blur(18px);
}
.site-header--cut .main-header.is-sticky .main-header__inner { min-height: 64px; }
.site-header--cut .main-header.is-sticky .custom-logo { max-height: 48px; }

/* Search panel matches the cut header */
.site-header--cut .header-search {
    top: calc(100% - 8px);
    border: 1px solid #dfe8ee;
    border-top: 0;
    border-radius: 0 0 9px 22px;
    background: rgba(255,255,255,.99);
}

@media (max-width: 1180px) {
    .live-update-meta .live-update-date { display: none; }
    .site-header--cut .main-header__inner {
        grid-template-columns: minmax(var(--sn-logo-desktop-width), var(--sn-logo-desktop-width)) minmax(0, 1fr) auto;
        gap: 16px;
        padding-inline: 19px;
    }
    .site-header--cut .primary-menu { gap: 16px; }
}

@media (max-width: 1080px) {
    .site-header--cut .main-header { padding: 9px 0 13px; }
    .site-header--cut .main-header__inner {
        min-height: 68px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0 18px;
    }
    .site-header--cut .branding-wrap { width: var(--sn-logo-mobile-width); }
    .site-header--cut .custom-logo-link,
    .site-header--cut .custom-logo,
    .site-header--cut .site-brand { max-width: var(--sn-logo-mobile-width) !important; }
    .site-header--cut .primary-navigation {
        border-radius: 0;
    }
    .nav-drawer__brand .custom-logo-link,
    .nav-drawer__brand .custom-logo { max-width: var(--sn-logo-mobile-width) !important; }
}

@media (max-width: 820px) {
    .live-update-bar__inner {
        min-height: 39px;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 9px;
    }
    .live-update-meta { display: none; }
    .live-update-badge {
        min-height: 27px;
        padding: 6px 15px 6px 10px;
        font-size:8px;
        letter-spacing: .08em;
    }
    .live-update-badge__pulse { width: 6px; height: 6px; }
    .live-update-item__category,
    .live-update-item__time { display: none; }
    .live-update-item__title { font-size:10px; }
    .live-update-controls button:first-child { display: none; }
    .live-update-controls button { width: 25px; height: 25px; }
}

@media (max-width: 520px) {
    .live-update-bar__inner {
        width: min(calc(100% - 20px), var(--sn-container));
        min-height: 37px;
        gap: 7px;
    }
    .live-update-badge {
        width: 33px;
        justify-content: center;
        padding: 6px 10px 6px 7px;
    }
    .live-update-badge span:last-child { display: none; }
    .live-update-item__title { font-size:9.5px; font-weight: 600; }
    .site-header--cut .main-header { padding: 7px 0 10px; }
    .site-header--cut .main-header__shell::before {
        clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
    }
    .site-header--cut .main-header__shell::after {
        right: 18px;
        width: 66px;
    }
    .site-header--cut .main-header__inner {
        min-height: 62px;
        padding: 0 13px;
    }
    .site-header--cut .branding-wrap { width: var(--sn-logo-mobile-width); }
    .site-header--cut .search-toggle,
    .site-header--cut .mobile-menu-toggle { width: 37px; height: 37px; }
}

@media (prefers-reduced-motion: reduce) {
    .live-update-badge__pulse { animation: none; }
    .live-update-item { transition: none; }
}
