/* ── Horizontal cinematic feed — index view only ───────────────── */

#nf-bg,
.nf-feed-wrapper,
#nf-hero,
#nf-pagination-wrapper { display: none; }

body:has(#nf-bg) {
    --nf-feed-height: 220px;
    @media (height <= 600px) { --nf-feed-height: 160px; }
    @media (height <= 450px) { --nf-feed-height: 120px; }
    --nf-radius: 0px;
}

body:has(#nf-bg) #nf-bg,
body:has(#nf-bg) .nf-feed-wrapper.active,
body:has(#nf-bg) #nf-hero,
body:has(#nf-bg) #nf-pagination-wrapper { display: flex; }

/* background */
#nf-bg {
    position: fixed;
    inset: 0;
    z-index: 1;
    background-image: var(--nf-hero);
    background-position: center;
    background-size: cover;
    filter: grayscale(0.4);
    opacity: 1;
    transition: background-image 0.5s ease;
    pointer-events: none;
}

/* hero panel — fills viewport above feed strip */
#nf-hero {
    position: fixed;
    top: 130px;
    left: 0;
    right: 0;
    bottom: var(--nf-feed-height);
    z-index: 5;
    display: flex;
    align-items: flex-start;
    pointer-events: none;
}

#nf-hero-link {
    display: block;
    width: 100%;
    text-decoration: none;
    color: hsla(var(--White), 1);
    pointer-events: all;
    padding: 30px 40px;
    @media (width <= 768px) { padding: 20px; }
}

.nf-hero-inner {
    display: flex;
    align-items: flex-start;
    gap: 24px;
    max-width: 860px;
    background: hsla(var(--ColorBrandDark), 0.6);
    backdrop-filter: blur(15px);
    padding: 20px;
    border: 1px solid hsla(var(--White), 0.5);
}

.nf-hero-number {
    font-size: 80px;
    line-height: 1;
    font-weight: var(--FontWeightBold, 700);
    color: transparent;
    -webkit-text-stroke: 2px hsla(var(--White), 0.45);
    text-stroke: 2px hsla(var(--White), 0.45);
    flex-shrink: 0;
    width: 82px;
    @media (width <= 768px)  { display: none; }
}

.nf-hero-data {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.nf-hero-date {
    display: block;
    font-size: var(--FontSizeSM);
    opacity: 0.6;
}

.nf-hero-title {
    font-size: clamp(1.3rem, 3vw, 2.2rem);
    font-weight: var(--FontWeightBold, 700);
    margin: 0;
    line-height: 1.2;
    text-shadow: 0 2px 16px rgba(0,0,0,0.7);
}

.nf-hero-author {
    font-size: var(--FontSizeSM);
    font-weight: var(--FontWeightLight);
    opacity: 0.75;
}

.nf-hero-summary {
    font-size: var(--FontSizeBase);
    font-weight: var(--FontWeightLight);
    opacity: 0.85;
    margin: 2px 0 4px;
    line-height: 1.5;
    max-width: 580px;
}

/* feed strip */
.nf-feed-wrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--nf-feed-height);
    z-index: 10;
}

/* scroll arrow buttons */
.nf-scroll-btn {
    display: none;
    position: absolute;
    top: calc(50% - 22px);
    z-index: 12;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: hsla(var(--ColorBrandDark), 0.85);
    color: hsla(var(--White), 1);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s;
    pointer-events: all;
}
.nf-scroll-btn:hover { background: hsla(var(--ColorBrand), 0.9); }
.nf-scroll-btn .material-symbols-outlined { font-size: 28px; }
.nf-scroll-btn.nf-scroll-left  { left: 8px; }
.nf-scroll-btn.nf-scroll-right { right: 18px; }
.nf-feed-wrapper.active .nf-scroll-btn { display: flex; }

.nf-feed {
    display: flex;
    flex-flow: row nowrap;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    list-style: none;
    margin: 0;
    padding: 0 200px 0 60px;
    scroll-padding-left: 60px;
    gap: 0;
    /* fade right edge to hint at more cards */
    -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
    mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

.nf-feed::-webkit-scrollbar { display: none; }

.nf-card-item {
    flex-shrink: 0;
    width: calc(100vw / 5);
    @media (width <= 1400px) { width: calc(100vw / 4); }
    @media (width <= 992px)  { width: calc(100vw / 3); }
    @media (width <= 768px)  { width: calc(100vw / 2); }
    @media (width <= 480px)  { width: 100vw; }
    height: var(--nf-feed-height);
    box-sizing: border-box;
    padding: 0 6px;
    @media (width <= 768px) { padding: 0; }
}

.nf-card-item a {
    display: block;
    height: 100%;
    text-decoration: none;
}

.nf-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    height: calc(var(--nf-feed-height) - 10px);
    @media (width <= 768px) { height: var(--nf-feed-height); }
    border-radius: var(--nf-radius);
    overflow: hidden;
    padding: 10px 12px 10px 68px;
    background-color: hsla(var(--ColorBrandDark), 1);
    color: hsla(var(--White), 1);
    cursor: pointer;
    transition: background-color 0.25s ease;
    filter: drop-shadow(4px 4px 8px hsla(var(--ColorBrand), 0.12));
}

.nf-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), var(--nf-card-image);
    background-position: center;
    background-size: cover;
    filter: grayscale(1) blur(3px);
    opacity: 1;
    transition: filter 0.35s ease;
    z-index: 0;
}

.nf-card-item:hover .nf-card { background-color: hsla(var(--ColorBrand), 0.3); }
.nf-card-item:hover .nf-card::before { filter: grayscale(1) blur(0px); }

.nf-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    background: linear-gradient(0deg, rgba(0,0,0,0.25), rgba(255,255,255,0.15)) border-box;
    mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

.nf-card-number {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    line-height: 1;
    color: transparent;
    -webkit-text-stroke: 2px hsla(var(--White), 0.5);
    text-stroke: 2px hsla(var(--White), 0.5);
    border-right: 2px solid hsla(var(--White), 0.25);
    z-index: 2;
}

.nf-card-body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.nf-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--FontSizeSM);
    font-weight: var(--FontWeightNormal);
    line-height: 1.3;
}

.nf-card-date {
    display: block;
    font-size: var(--FontSizeXS, 11px);
    opacity: 0.6;
}

/* category pill */
.nf-cat-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 0;
    background: hsla(var(--White), 0.15);
    font-size: var(--FontSizeXS, 11px);
    font-weight: var(--FontWeightNormal);
    color: hsla(var(--White), 1);
}

/* category tab pagination */
#nf-pagination-wrapper {
    position: fixed;
    bottom: calc(var(--nf-feed-height) + 10px);
    left: 20px;
    z-index: 11;
    justify-content: flex-start;
    pointer-events: none;
}

#nf-pagination-menu-scroll {
    overflow-x: auto;
    max-width: calc(100vw - 40px);
    width: max-content;
    scrollbar-width: none;
    background: hsla(var(--ColorBrandDark), 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 0;
    pointer-events: all;
}
#nf-pagination-menu-scroll::-webkit-scrollbar { display: none; }

#nf-pagination-menu {
    list-style: none;
    margin: 0;
    padding: 6px 12px;
    display: flex;
    flex-direction: row;
    gap: 4px;
    color: hsla(var(--White), 1);
    overflow: visible;
    white-space: nowrap;
}

.nf-cat-tab {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 14px;
    border-radius: 0;
    cursor: pointer;
    font-size: var(--FontSizeSM);
    font-weight: var(--FontWeightNormal);
    color: hsla(var(--White), 1);
    opacity: 0.55;
    transition: opacity 0.2s, background 0.2s;
    white-space: nowrap;
    user-select: none;
}

.nf-cat-tab:hover  { opacity: 0.9; }
.nf-cat-tab.active { background: hsla(var(--ColorBrand), 0.3); opacity: 1; }
.nf-cat-tab.child-active { background: hsla(var(--ColorBrand), 0.15); opacity: 1; }

.nf-tab-caret { font-size: 16px; }

/* drop-up sub-category menu */
.nf-dropup {
    position: fixed;
    background: hsla(var(--ColorBrandDark), 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0;
    list-style: none;
    margin: 0;
    padding: 6px 4px;
    min-width: 160px;
    z-index: 50;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(8px);
    transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
}
.nf-dropup.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.nf-dropup-item {
    padding: 7px 14px;
    border-radius: 0;
    cursor: pointer;
    font-size: var(--FontSizeSM);
    color: hsla(var(--White), 1);
    opacity: 0.7;
    transition: opacity 0.15s, background 0.15s;
    user-select: none;
}
.nf-dropup-item:hover  { opacity: 1; background: hsla(var(--ColorBrand), 0.3); }
.nf-dropup-item.active { opacity: 1; background: hsla(var(--ColorBrand), 0.45); }

/* feed strip — fade + slide-up when activated */
@keyframes nf-feed-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
body:has(#nf-bg) .nf-feed-wrapper.active {
    animation: nf-feed-in 0.35s ease forwards;
}

/* give main content room for fixed feed strip */
body:has(#nf-bg) #main-content {
    padding-bottom: var(--nf-feed-height);
    min-height: 100vh;
}

/* footer must surface above fixed hero + feed when scrolled to */
body:has(#nf-bg) footer {
    position: relative;
    z-index: 20;
}

/* ── Article modal ──────────────────────────────────────────────── */
#nf-modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: hsla(var(--Black), 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    overflow-y: auto;
    overscroll-behavior: contain;
}
#nf-modal-backdrop.open { display: block; }

#nf-modal {
    position: relative;
    width: 90%;
    margin: 60px auto 80px;
    background-color: hsla(var(--ColorBrandDark), 1);
    background-size: 100% auto;
    background-position: left top;
    background-repeat: no-repeat;
    border-radius: 0;
    overflow: hidden;
    @media (width <= 900px) { width: 100%; margin: 0; border-radius: 0; min-height: 100vh; }
}
#nf-modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        hsla(var(--Black), 0.05) 0%,
        hsla(var(--Black), 0.55) 30%,
        hsla(var(--ColorBrandDark), 0.92) 55%,
        hsla(var(--ColorBrandDark), 1) 70%);
    pointer-events: none;
    z-index: 0;
}

#nf-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: hsla(var(--White), 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
#nf-modal-close:hover { color: hsla(var(--ColorBrand), 1); }

#nf-modal-body {
    position: relative;
    z-index: 1;
    padding: 350px 40px 60px;
    color: hsla(var(--White), 0.9);
    @media (width <= 600px) { padding: 280px 20px 48px; }
}
#nf-modal-body *:not(img) {
    color: hsla(var(--White), 0.88);
    background-color: transparent !important;
}
#nf-modal-body h1, #nf-modal-body h2, #nf-modal-body h3 { color: hsla(var(--White), 1); }
#nf-modal-body a { color: hsla(var(--White), 0.7); text-decoration: underline; }
#nf-modal-body .theme-text-muted { color: hsla(var(--White), 0.55) !important; }
#nf-modal-body .news-breadcrumb  { display: none; }
#nf-modal-body .news-category-link { color: hsla(var(--White), 0.7) !important; }
#nf-modal-body img { border-radius: 0; }
/* Override full-page layout negative margin on article */
#nf-modal-body article.news-article { margin-top: 0 !important; }

#nf-modal-loading {
    display: none;
    padding: 80px;
    text-align: center;
    color: hsla(var(--White), 0.5);
}
#nf-modal-backdrop.loading #nf-modal-body    { display: none; }
#nf-modal-backdrop.loading #nf-modal-loading { display: block; }

/* share bar */
.nf-share-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 16px 0 8px;
    border-top: 1px solid hsla(var(--White), 0.12);
    margin-top: 24px;
}
.nf-share-label {
    font-size: var(--FontSizeSM);
    color: hsla(var(--White), 0.45);
    margin-right: 4px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.nf-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid hsla(var(--White), 0.2);
    border-radius: 0;
    background: hsla(var(--White), 0.05);
    color: hsla(var(--White), 0.7);
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    padding: 0;
    /* reset button styles */
    -webkit-appearance: none;
    appearance: none;
}
.nf-share-btn:hover {
    background: hsla(var(--ColorBrand), 0.25);
    border-color: hsla(var(--ColorBrand), 0.6);
    color: hsla(var(--White), 1);
}
.nf-share-btn.copied {
    background: hsla(var(--ColorBrand), 0.35);
    border-color: hsla(var(--ColorBrand), 0.8);
    color: hsla(var(--White), 1);
}
