@import url('https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;600;700;800&family=Inter:wght@400;500;600;700&family=Noto+Sans+Malayalam:wght@400;600;700&family=Noto+Serif+Malayalam:wght@400;700&display=swap');

:root {
    /* Colors */
    --surface-base: #fcf9f8;
    --surface-white: #ffffff;
    --surface-subtle: #F4F4F4;
    --surface-container-low: #f6f3f2;
    --text-main: #1b1c1c;
    --text-muted: #44474d;
    --border-muted: #E2E8F0;

    --brand-primary: #1a2b48;
    /* Deep Navy */
    --brand-primary-dark: #031632;
    /* Ultra Dark Navy */
    --brand-secondary: #bc0000;
    /* Breaking/Live Red */

    /* Typography */
    --font-headlines: 'Hanken Grotesk', 'Noto Serif Malayalam', Georgia, serif;
    --font-body: 'Inter', 'Noto Sans Malayalam', sans-serif;

    /* Shapes */
    --radius-soft: 0.25rem;
    /* 4px */
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
}

/* Dark Mode Overrides */
body.dark-mode {
    --surface-base: #121212;
    --surface-white: #1b1c1c;
    --surface-subtle: #303030;
    --surface-container-low: #202020;
    --text-main: #f3f0ef;
    --text-muted: #c5c6ce;
    --border-muted: #44474d;

    --brand-primary: #b6c7eb;
    --brand-primary-dark: #d7e2ff;
    --brand-secondary: #FF0000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--surface-base);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-secondary);
}

.container {
    max-width: 1280px;
    /* Aligned to 12-column fixed grid desktop max width */
    margin: 0 auto;
    padding: 0 2rem;
    /* 32px side margin */
    background-color: var(--surface-white);
}

/* --- TOP SECTION & NAVIGATION --- */
.top-section {
    background-color: var(--surface-white);
    border-bottom: 1px solid var(--border-muted);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-muted);
}

.logo-area {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.date-time {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.ad-placeholder-top {
    width: 728px;
    height: 90px;
    background-color: var(--surface-subtle);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* High-Contrast Category Ribbon */
.nav-menu {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    background-color: var(--brand-primary);
    padding: 0;
    margin: 0;
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-menu li {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-menu li:last-child {
    border-right: none;
}

.nav-menu li a {
    display: block;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: #ffffff;
    padding: 12px 20px;
    text-transform: uppercase;
    transition: background-color 0.2s;
}

.nav-menu li a:hover,
.nav-menu li.active a {
    background-color: var(--brand-primary-dark);
    color: #ffffff;
}

/* --- SECTION HEADINGS --- */
.section-heading {
    font-family: var(--font-headlines);
    font-size: 24px;
    font-weight: 700;
    color: var(--brand-primary-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--brand-secondary);
    display: block;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.section-container {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-muted);
}

/* --- EDITORIAL NEWS GRID --- */
.main-news-grid {
    display: grid;
    grid-template-columns: 8fr 4fr;
    /* 8-column vs 4-column lane split */
    gap: 1.5rem;
    /* Gutter specification */
}

/* Hero Main Highlight */
.hero-article {
    display: flex;
    flex-direction: column;
}

.hero-article figure,
.hero-article img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-soft);
    /* 4px radius */
    background-color: var(--surface-subtle);
}

.hero-article h2 {
    font-family: var(--font-headlines);
    font-size: 32px;
    font-weight: 800;
    line-height: 40px;
    letter-spacing: -0.02em;
    margin: 1rem 0;
}

.hero-article p {
    font-family: var(--font-body);
    font-size: 16px;
    color: var(--text-muted);
    line-height: 24px;
}

/* Side Column Snippets */
.side-articles {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.side-article {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--border-muted);
    padding-bottom: 1rem;
}

.side-article:last-child {
    border-bottom: none;
}

.side-article img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--radius-soft);
    background-color: var(--surface-subtle);
}

.side-article h3 {
    font-family: var(--font-headlines);
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
}

/* --- LIST VIEW (Latest / Kuwait News) --- */
.news-list {
    list-style: none;
    padding: 0;
}

.news-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-muted);
    position: relative;
    padding-left: 15px;
}

.news-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20px;
    width: 6px;
    height: 6px;
    background-color: var(--brand-secondary);
    /* Custom Red Bullet points */
    border-radius: 50%;
}

.news-list li:last-child {
    border-bottom: none;
}

.news-list li a {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
}

/* --- EDITOR'S CHOICE SECTION --- */
.editors-choice-bg {
    background-color: var(--surface-subtle);
    padding: 2.5rem 2rem;
    margin: 2rem -2rem;
    /* Bleeds perfectly across layout */
}

.editors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.editor-card {
    background: var(--surface-white);
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-soft);
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.editor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.editor-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.editor-card-content {
    padding: 1rem;
}

.editor-card h3 {
    font-family: var(--font-headlines);
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
}

/* --- CATEGORIES MATRIX --- */
.category-section-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.category-card {
    border-top: 2px solid var(--brand-primary);
    padding-top: 1rem;
}

.category-card h3 {
    font-family: var(--font-headlines);
    font-size: 20px;
    font-weight: 700;
    margin: 0.75rem 0;
}

.category-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-soft);
}

/* --- ARTICLE VIEW DETAILS (danil.html) --- */
.article-title {
    font-family: var(--font-headlines);
    font-size: 42px;
    font-weight: 800;
    line-height: 52px;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}

.article-meta {
    font-family: var(--font-body);
    font-size: 14px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-muted);
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.article-body {
    font-family: var(--font-body);
    font-size: 18px;
    line-height: 28px;
    max-width: 800px;
    margin: 0 auto;
}

.article-body p {
    margin-bottom: 1.5rem;
}

/* --- RESPONSIVE DROPDOWN 'MORE' MENU --- */
.nav-menu li.more-dropdown {
    position: relative;
    display: none;
}

.nav-menu li.more-dropdown .dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    background-color: var(--brand-primary);
    min-width: 200px;
    box-shadow: 0px 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    list-style: none;
}

.nav-menu li.more-dropdown .dropdown-content li {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-menu li.more-dropdown .dropdown-content li a {
    padding: 12px 20px;
    text-align: left;
}

.nav-menu li.more-dropdown.open .dropdown-content {
    display: block !important;
}

/* --- FOOTER STRUCTURE --- */
.bottom-section {
    background-color: var(--brand-primary-dark);
    color: #ffffff;
    padding: 4rem 2rem 2rem 2rem;
    /* Section gap consistency */
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    max-width: 1280px;
    margin: 0 auto;
}

.footer-column h4 {
    font-family: var(--font-headlines);
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.25rem;
    color: #ffffff;
    border-bottom: 2px solid var(--brand-secondary);
    padding-bottom: 8px;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: var(--surface-container-low);
    font-size: 14px;
}

.footer-column ul li a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.copyright {
    text-align: center;
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: var(--text-muted);
}

/* --- TYPOGRAPHY TOKENS --- */
.display-lg { font-family: var(--font-headlines); font-size: 48px; font-weight: 800; line-height: 56px; letter-spacing: -0.02em; }
.headline-lg { font-family: var(--font-headlines); font-size: 32px; font-weight: 700; line-height: 40px; }
.headline-lg-mobile { font-family: var(--font-headlines); font-size: 24px; font-weight: 700; line-height: 32px; }
.headline-md { font-family: var(--font-headlines); font-size: 24px; font-weight: 600; line-height: 32px; }
.headline-sm { font-family: var(--font-headlines); font-size: 20px; font-weight: 600; line-height: 28px; }
.body-lg { font-family: var(--font-body); font-size: 18px; font-weight: 400; line-height: 28px; }
.body-md { font-family: var(--font-body); font-size: 16px; font-weight: 400; line-height: 24px; }
.label-md { font-family: var(--font-body); font-size: 14px; font-weight: 600; line-height: 20px; }

/* --- COMPONENTS --- */
.tag-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: var(--radius-soft);
    background-color: var(--brand-primary);
    color: var(--surface-white);
    text-transform: uppercase;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    margin-bottom: 8px;
}
.tag-chip.red {
    background-color: var(--brand-secondary);
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: var(--radius-soft);
    font-family: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-primary {
    background-color: var(--brand-primary);
    color: var(--surface-white);
    border: 1px solid var(--brand-primary);
}
.btn-primary:hover {
    background-color: var(--brand-primary-dark);
}
.btn-secondary {
    background-color: transparent;
    color: var(--brand-primary);
    border: 1px solid var(--brand-primary);
}
.btn-secondary:hover {
    background-color: var(--surface-subtle);
}

.search-input {
    border: 1px solid var(--border-muted);
    border-radius: var(--radius-soft);
    padding: 8px 12px;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s ease;
}
.search-input:focus {
    border-color: var(--brand-primary);
}

/* --- DARK MODE TOGGLE --- */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: var(--surface-subtle);
    border: 1px solid var(--border-muted);
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: background-color 0.4s, border-color 0.4s;
}

.slider.round {
    border-radius: 24px;
}

.slider:before {
    background-color: var(--text-muted);
    bottom: 2px;
    content: "";
    height: 18px;
    left: 2px;
    position: absolute;
    transition: transform 0.4s, background-color 0.4s;
    width: 18px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--brand-primary);
    border-color: var(--brand-primary);
}

input:checked + .slider:before {
    transform: translateX(24px);
    background-color: #ffffff;
}

.theme-switch-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    user-select: none;
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .main-news-grid {
        grid-template-columns: 6fr 4fr;
    }

    .editors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        /* Mobile fluid rules */
    }

    .main-news-grid,
    .category-section-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-article h2 {
        font-size: 24px;
        /* headline-lg-mobile match */
        line-height: 32px;
    }

    .ad-placeholder-top {
        display: none;
        /* Hide wide desktop banners on mobile */
    }

    /* Responsive navigation override rules */
    .nav-menu {
        flex-wrap: nowrap !important;
    }

    .nav-menu>li:nth-child(n+4):not(.more-dropdown) {
        display: none !important;
    }

    .nav-menu li.more-dropdown {
        display: block !important;
        margin-left: auto;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }
}