@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&display=swap');

:root {
    --brand-primary: #001F3F;
    --brand-primary-dark: #00152B;
    --brand-secondary: #bc0000;
    --surface-base: #f8f9fa;
    --surface-white: #ffffff;
    --surface-subtle: #f3f4f5;
    --text-main: #191c1d;
    --text-muted: #43474e;
    --border-muted: #E5E7EB;
    
    --font-headlines: 'Hanken Grotesk', sans-serif;
    --font-body: 'Noto Sans', 'Noto Sans Malayalam', sans-serif;
    --font-meta: 'Inter', sans-serif;
    
    --radius-soft: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
}

body.dark-mode {
    --surface-base: #000613;
    --surface-white: #00152B;
    --surface-subtle: #2e3132;
    --text-main: #ffffff;
    --text-muted: #d9dadb;
    --border-muted: #43474e;
}

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

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

a { text-decoration: none; color: inherit; transition: color 0.2s ease; }
a:hover { color: var(--brand-secondary); }

.container { 
    max-width: 1280px; 
    margin: 0 auto; 
    padding: 0 24px; 
    background: transparent; 
}

/* --- Header --- */
.top-section { background-color: var(--surface-white); }
.top-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 16px 24px; 
    border-bottom: 1px solid var(--border-muted); 
    max-width: 1280px;
    margin: 0 auto;
}
.logo-area { display: flex; align-items: center; gap: 24px; }
.logo img { max-height: 60px; }
.date-time { 
    font-family: var(--font-meta); 
    font-size: 14px; 
    color: var(--text-muted); 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
}

/* --- Nav --- */
.nav-menu { 
    display: flex; 
    flex-wrap: wrap;
    background: var(--brand-primary); 
    list-style: none; 
    border-bottom: 2px solid var(--brand-secondary); 
    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; 
    padding: 16px 24px; 
    color: #ffffff; 
    font-family: var(--font-headlines); 
    font-weight: 600; 
    font-size: 16px; 
    text-transform: uppercase; 
    border-bottom: 4px solid transparent; 
}
.nav-menu li a:hover, .nav-menu li.active a { 
    background-color: var(--brand-primary-dark); 
    border-bottom: 4px solid var(--brand-secondary); 
}

/* --- Main layout --- */
.section-container { 
    margin-top: 32px; 
    padding: 0 24px 32px 24px; 
    border-bottom: 1px solid var(--border-muted); 
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
}
.section-heading { 
    font-family: var(--font-headlines); 
    font-size: 32px; 
    font-weight: 800; 
    border-left: 6px solid var(--brand-secondary); 
    padding-left: 12px; 
    margin-bottom: 24px; 
    color: var(--text-main); 
}

/* --- Hero section --- */
.category-hero-container .container { 
    padding: 0; 
    max-width: 800px !important; 
    margin: 0 auto; 
    position: relative; 
}
.category-hero-container figure img { 
    width: 100%; 
    border-radius: var(--radius-lg); 
    aspect-ratio: 16/9; 
    object-fit: cover; 
}
.category-hero-container .bottom-left { 
    background: transparent; 
    padding: 16px 0 8px 0; 
}
.category-hero-container .bottom-left a h1 { 
    color: var(--text-main); 
    font-family: var(--font-headlines); 
    font-size: 32px; 
    font-weight: 800; 
    line-height: 1.2; 
    margin: 0; 
}
.category-hero-container p { 
    font-size: 18px; 
    margin-top: 8px; 
    color: var(--text-muted); 
    line-height: 1.6;
}
.category-hero-container p b { 
    color: var(--brand-secondary); 
}

/* --- Custom list grid (4 columns) --- */
.category-custom-list-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 24px; 
}
.custom-cat-card { 
    background: var(--surface-white); 
    border: 1px solid var(--border-muted); 
    border-radius: var(--radius-md); 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    transition: box-shadow 0.2s ease, transform 0.2s ease; 
}
.custom-cat-card:hover { 
    box-shadow: 0 4px 20px rgba(0, 31, 63, 0.08); 
    transform: translateY(-2px);
}
.custom-cat-img-wrapper figure { margin: 0; }
.custom-cat-img-wrapper img { 
    width: 100%; 
    aspect-ratio: 16/9; 
    object-fit: cover; 
}
.custom-cat-content { 
    padding: 16px; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1; 
}
.custom-cat-title a h1 { 
    font-family: var(--font-headlines); 
    font-size: 18px; 
    font-weight: 700; 
    line-height: 1.4; 
    color: var(--text-main); 
    margin-bottom: 8px; 
}
.custom-cat-desc { 
    font-size: 14px; 
    color: var(--text-muted); 
    line-height: 1.5; 
}
.custom-cat-desc b { 
    color: var(--brand-secondary); 
    font-family: var(--font-meta); 
}

/* --- 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;
    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;
    padding: 0;
}
.nav-menu li.more-dropdown .dropdown-content li {
    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 --- */
.bottom-section { 
    background: var(--brand-primary-dark); 
    color: #ffffff; 
    padding: 64px 24px 32px; 
    margin-top: 64px; 
}
.footer-grid { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 32px; 
    max-width: 1280px; 
    margin: 0 auto; 
}
.footer-column h4 { 
    font-family: var(--font-headlines); 
    font-size: 18px; 
    text-transform: uppercase; 
    border-bottom: 2px solid var(--brand-secondary); 
    padding-bottom: 8px; 
    margin-bottom: 16px; 
    color: #ffffff; 
}
.footer-column ul { list-style: none; padding: 0; }
.footer-column ul li { margin-bottom: 8px; }
.footer-column ul li a { 
    color: #afc8f0; 
    font-family: var(--font-meta); 
    font-size: 14px; 
    transition: color 0.2s; 
}
.footer-column ul li a:hover { color: #ffffff; }
.copyright { 
    text-align: center; 
    margin-top: 64px; 
    padding-top: 24px; 
    border-top: 1px solid rgba(255,255,255,0.1); 
    font-family: var(--font-meta); 
    font-size: 14px; 
    color: #afc8f0; 
}

/* --- Theme switch --- */
.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(--border-muted); 
    bottom: 0; 
    cursor: pointer; 
    left: 0; 
    position: absolute; 
    right: 0; 
    top: 0; 
    transition: .4s; 
    border-radius: 24px; 
}
.slider:before { 
    background-color: #ffffff; 
    bottom: 4px; 
    content: ""; 
    height: 16px; 
    left: 4px; 
    position: absolute; 
    transition: .4s; 
    width: 16px; 
    border-radius: 50%; 
}
input:checked + .slider { background-color: var(--brand-primary); border-color: var(--brand-primary); }
input:checked + .slider:before { transform: translateX(24px); }
.theme-switch-label { font-family: var(--font-meta); font-size: 14px; font-weight: 600; cursor: pointer; color: var(--text-main); }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .category-custom-list-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .category-custom-list-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .top-bar { flex-direction: column; gap: 16px; }
    .category-hero-container .bottom-left a h1 { font-size: 24px; }
    .section-heading { font-size: 24px; }
    
    .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); }
}
