/* NNC mobile safety fixes. The homepage hero and news data keep their original rules. */
@media (max-width: 767px) {
    html,
    body {
        overflow-x: hidden;
    }

    main {
        padding-bottom: 86px;
    }

    /* Keep the fixed navigation readable and prevent cards showing through it. */
    body .mobile-bottom-nav {
        background: #ffffff !important;
        border: 1px solid #e2e8f0 !important;
        border-bottom: 0 !important;
        border-radius: 18px 18px 0 0 !important;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, .13) !important;
        min-height: 68px !important;
        opacity: 1 !important;
        padding-bottom: max(7px, env(safe-area-inset-bottom)) !important;
        z-index: 1100 !important;
    }

    body .mobile-bottom-nav a,
    body .mobile-bottom-nav button {
        background: #ffffff !important;
        color: #64748b !important;
    }

    body .mobile-bottom-nav .active,
    body .mobile-bottom-nav a:hover,
    body .mobile-bottom-nav button:hover {
        color: var(--brand) !important;
    }

    /* On mobile, keep all hero copy below the image instead of over it. */
    body .ncc-hero {
        margin: 14px 0 22px !important;
    }

    body .hero-main {
        background: var(--surface) !important;
        border-radius: 16px !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, .12) !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body .hero-main::after {
        display: none !important;
    }

    body .hero-main__link {
        display: block !important;
        inset: auto !important;
        line-height: 0 !important;
        position: static !important;
    }

    body .hero-main img {
        aspect-ratio: 16 / 9 !important;
        display: block !important;
        height: auto !important;
        object-fit: cover !important;
        position: static !important;
        width: 100% !important;
    }

    body .hero-main-overlay {
        background: var(--surface) !important;
        color: var(--navy) !important;
        display: block !important;
        inset: auto !important;
        max-width: none !important;
        padding: 16px !important;
        position: static !important;
        width: auto !important;
    }

    [data-theme="dark"] body .hero-main-overlay {
        background: var(--surface) !important;
        color: var(--text) !important;
    }

    body .hero-main .category {
        border-radius: 999px !important;
        display: inline-flex !important;
        font-size: 10px !important;
        margin: 0 0 9px !important;
        padding: 5px 9px !important;
    }

    body .hero-main h1 {
        color: var(--navy) !important;
        display: -webkit-box !important;
        font-size: clamp(24px, 7.3vw, 34px) !important;
        line-height: 1.08 !important;
        margin: 0 0 9px !important;
        max-height: 3.24em !important;
        overflow: hidden !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
    }

    [data-theme="dark"] body .hero-main h1 {
        color: var(--text) !important;
    }

    body .hero-main p {
        color: var(--muted) !important;
        display: -webkit-box !important;
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin: 0 !important;
        max-height: 4.5em !important;
        overflow: hidden !important;
        -webkit-box-orient: vertical !important;
        -webkit-line-clamp: 3 !important;
    }

    body .hero-meta-panel {
        border-top: 1px solid var(--border) !important;
        margin-top: 12px !important;
        padding-top: 11px !important;
    }

    body .hero-news-meta {
        color: var(--muted) !important;
        display: flex !important;
        flex-wrap: wrap !important;
        font-size: 11px !important;
        gap: 7px 12px !important;
    }

    body .hero-news-meta i {
        color: var(--brand) !important;
    }

    body .hero-actions {
        display: grid !important;
        gap: 8px !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, .72fr) !important;
        margin-top: 12px !important;
    }

    body .read-btn,
    body .share-btn {
        justify-content: center !important;
        min-height: 42px !important;
        padding: 8px 10px !important;
        width: 100% !important;
    }
}

@media (max-width: 420px) {
    body .hero-actions {
        grid-template-columns: 1fr !important;
    }
}

/* Desktop hero: show a clean image first, then reveal the story on hover/focus. */
@media (min-width: 768px) {
    body .hero-main::after {
        opacity: 0 !important;
        transition: opacity .28s ease !important;
    }

    body .hero-main-overlay {
        opacity: 0 !important;
        transform: translateY(14px) !important;
        transition: opacity .28s ease, transform .28s ease, visibility .28s ease !important;
        visibility: hidden !important;
    }

    body .hero-main:hover::after,
    body .hero-main:focus-within::after {
        opacity: 1 !important;
    }

    body .hero-main:hover .hero-main-overlay,
    body .hero-main:focus-within .hero-main-overlay {
        opacity: 1 !important;
        transform: translateY(0) !important;
        visibility: visible !important;
    }
}

/* Use the official NNC mark at a controlled size on every viewport. */
body .brand-logo-image {
    background: #ffffff;
    border-radius: 6px;
    display: block;
    height: 52px;
    object-fit: contain;
    padding: 3px 7px;
    width: 148px;
}

.footer-social a[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .42;
    pointer-events: none;
}

/* Mobile header and ticker spacing. */
@media (max-width: 767px) {
    body .site-header {
        position: relative !important;
        z-index: 20 !important;
    }

    body .header-content {
        align-items: center !important;
        gap: 10px !important;
        min-height: 76px !important;
        padding-bottom: 10px !important;
        padding-top: 10px !important;
    }

    body .brand {
        align-items: flex-start !important;
        flex: 1 1 auto !important;
        justify-content: flex-start !important;
        min-width: 0 !important;
        text-align: left !important;
    }

    body .brand-logo-image {
        background: #ffffff !important;
        border-radius: 6px !important;
        display: block !important;
        height: 44px !important;
        object-fit: contain !important;
        padding: 3px 6px !important;
        width: 126px !important;
    }

    body .header-actions {
        align-items: center !important;
        display: flex !important;
        flex: 0 0 auto !important;
        gap: 7px !important;
    }

    body .mobile-search-toggle,
    body .theme-toggle,
    body .menu-btn {
        flex: 0 0 42px !important;
        height: 42px !important;
        width: 42px !important;
    }

    body .breaking-wrapper {
        min-height: 44px !important;
    }

    body .breaking-title {
        font-size: 12px !important;
        letter-spacing: .035em !important;
        min-width: 138px !important;
        padding-left: 13px !important;
        padding-right: 13px !important;
    }

    body .breaking-track {
        animation-duration: 180s !important;
        gap: 28px !important;
    }

    body .breaking-track a,
    body .breaking-track span {
        font-size: 13px !important;
    }
}
}
