/* ── Global Scroll Fix ────────────────────────────────────────────────────── */
html, body {
    overflow-x: hidden !important;
}

/* Ensure content is visible */
.content-section.is-visible {
    opacity: 1 !important;
    transform: none !important;
}

/* ── Modal Scroll Fix ─────────────────────────────────────────────────────── */
#articleModal .modal-body {
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

/* ── News Hero Banner ─────────────────────────────────────────────────────── */
.news-hero {
    position: relative;
    min-height: 42vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* Break out of Bootstrap container – same technique as #hero */
    margin-left:  calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    padding: 6rem max(2rem, calc((100vw - 1200px) / 2 + 2rem)) 4rem;
}

/* Background image layer */
.news-hero-bg {
    position: absolute;
    inset: 0;
    background-image: url('../img/8.webp');
    background-size: cover;
    background-position: center 30%;
    filter: brightness(.22) saturate(.7);
    z-index: 0;
}

/* Scanline + bottom fade overlay */
.news-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(112,207,248,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(112,207,248,.035) 1px, transparent 1px),
        radial-gradient(ellipse at top right, rgba(4,118,181,.12), transparent 55%),
        linear-gradient(to bottom, transparent 45%, var(--bg) 100%);
    background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
    z-index: 1;
    pointer-events: none;
}

.news-hero-content {
    position: relative;
    z-index: 3;
    max-width: 680px;
}

.news-hero-title {
    font-family: var(--display);
    font-weight: 700;
    font-size: clamp(2.6rem, 7vw, 5.5rem);
    line-height: .95;
    letter-spacing: -.04em;
    color: #fff;
    margin: 0 0 1.5rem;
    text-shadow: 0 0 80px rgba(4,118,181,.25);
}
.news-hero-title .line-1 {
    display: block;
    opacity: 0;
    transform: translateX(-24px);
    animation: title-slide-x .65s cubic-bezier(.22,1,.36,1) .25s both;
    margin-bottom: .14em;
}
.news-hero-title .line-2 {
    display: block;
    font-size: .44em;
    font-weight: 400;
    color: var(--muted);
    letter-spacing: -.01em;
    opacity: 0;
    transform: translateY(12px);
    animation: title-slide-y .6s cubic-bezier(.22,1,.36,1) .75s both;
}
.news-hero-title em {
    font-style: normal;
    color: var(--cyan);
}

.news-hero-lead {
    font-size: 1rem;
    color: var(--muted);
    line-height: 1.75;
    max-width: 520px;
    opacity: 0;
    animation: fade-up .5s .85s ease both;
}

/* ── Category Filter ──────────────────────────────────────────────────────── */
.news-filter-btn {
    font-family: var(--mono);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    padding: .3rem .85rem;
    border-radius: 2px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s;
}
.news-filter-btn:hover {
    background: rgba(112,207,248,.06);
    border-color: var(--line-2);
    color: var(--text);
}
.news-filter-btn.active {
    background: rgba(4,118,181,.15);
    border-color: var(--accent);
    color: var(--cyan);
}

/* ── Article Cards ────────────────────────────────────────────────────────── */
.news-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.news-card:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 10px 30px rgba(4,118,181,.13);
    transform: translateY(-4px);
}

.news-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    flex-shrink: 0;
}
.news-card-img-placeholder {
    width: 100%;
    height: 160px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--line-2);
    font-size: 2.2rem;
    flex-shrink: 0;
}

.news-card-body {
    padding: 1.1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: .35rem;
}

.news-category-badge {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 2px;
    font-family: var(--mono);
    font-size: .66rem;
    font-weight: 600;
    letter-spacing: .09em;
    text-transform: uppercase;
    background: rgba(4,118,181,.12);
    color: var(--cyan);
    border: 1px solid rgba(4,118,181,.28);
    align-self: flex-start;
}

.news-card-title {
    font-family: var(--display);
    font-size: .975rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-summary {
    font-size: .845rem;
    color: var(--muted);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.news-card-meta {
    font-family: var(--mono);
    font-size: .7rem;
    letter-spacing: .04em;
    color: var(--dim);
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    padding-top: .5rem;
    border-top: 1px solid var(--line);
    margin-top: auto;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.news-empty-state {
    text-align: center;
    padding: 5rem 1rem;
    color: var(--dim);
    font-family: var(--mono);
    font-size: .85rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.news-empty-state i {
    font-size: 2.8rem;
    display: block;
    margin-bottom: 1rem;
    color: var(--line-2);
}

/* ── Article Detail Modal ─────────────────────────────────────────────────── */
.news-modal-cover {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 4px 4px 0 0;
}

/* Markdown content inside modal */
.news-md-content { color: var(--muted); line-height: 1.8; font-size: .95rem; }
.news-md-content h1,
.news-md-content h2,
.news-md-content h3,
.news-md-content h4 {
    font-family: var(--display);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.02em;
    margin-top: 1.75rem;
    margin-bottom: .6rem;
}
.news-md-content h2 { font-size: 1.35rem; }
.news-md-content h3 { font-size: 1.1rem; }
.news-md-content p  { margin-bottom: 1rem; }
.news-md-content a  { color: var(--cyan); text-decoration: none; }
.news-md-content a:hover { text-decoration: underline; }
.news-md-content code {
    font-family: var(--mono);
    background: rgba(112,207,248,.08);
    color: var(--cyan);
    padding: .15rem .4rem;
    border-radius: 2px;
    font-size: .875em;
}
.news-md-content pre {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1rem 0;
}
.news-md-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text);
    font-size: .875rem;
}
.news-md-content blockquote {
    border-left: 3px solid var(--accent);
    padding: .5rem 0 .5rem 1.1rem;
    color: var(--dim);
    margin: 1rem 0;
    font-style: italic;
}
.news-md-content ul,
.news-md-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.news-md-content li { margin-bottom: .3rem; }
.news-md-content img {
    max-width: 100%;
    border-radius: 4px;
    border: 1px solid var(--line);
    margin: .5rem 0;
}
.news-md-content hr {
    border-color: var(--line);
    margin: 1.5rem 0;
}
.news-md-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: .875rem;
}
.news-md-content th,
.news-md-content td {
    padding: .5rem .75rem;
    border: 1px solid var(--line);
    text-align: left;
}
.news-md-content th {
    background: var(--surface-2);
    color: var(--text);
    font-family: var(--mono);
    font-size: .75rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ── Settings Switch ──────────────────────────────────────────────────────── */
.custom-switch .form-check-input {
    width: 2.8rem;
    height: 1.4rem;
    background-color: rgba(255,255,255,0.05);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.custom-switch .form-check-input:checked {
    background-color: var(--accent);
    border-color: var(--cyan);
}
.custom-switch .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(4,118,181, 0.25);
    border-color: var(--cyan);
}
