@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    --bg-color: #ffffff;
    --text-color: #1a1a2e;
    --text-muted: #64748b;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-bg: #f8fafc;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.85);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --radius-sm: 0.25rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --secondary-bg: #1e293b;
    --border-color: #334155;
    --card-bg: #1e293b;
    --header-bg: rgba(15, 23, 42, 0.85);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6), 0 2px 4px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.8), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.font-serif {
    font-family: 'Lora', serif;
}

/* Layout */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Navbar */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.9);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    gap: 3rem;
    position: relative;
}

.site-header .brand {
    position: fixed;
    left: 1rem;
    top: 0.5rem;
    z-index: 2000;
}

.logo-img {
    height: 60px;
    width: auto;
    object-fit: contain;
}

.logo-card {
    background: white;
    padding: 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    border: 2px solid var(--primary-color);
}

.logo-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.brand-icon {
    font-size: 2.2rem;
}

.brand span {
    color: var(--text-color);
    display: inline-block;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 2.5rem; /* Meningkatkan jarak antar item menu */
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Category Sub-Navbar & Dropdowns */
.category-subnav {
    background: var(--bg-color);
    padding: 0.5rem 0;
    border-top: 1px solid var(--border-color);
    overflow: visible; /* Change from overflow-x: auto to allow dropdowns */
    scrollbar-width: none;
    position: relative;
    z-index: 950;
}

.category-list {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.category-item {
    position: relative;
}

.category-item > a {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.category-item:hover > a {
    background: var(--secondary-bg);
    color: var(--primary-color);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateY(10px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    padding: 0.5rem;
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.category-item:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(5px);
}

.dropdown-menu li a {
    padding: 0.75rem 1.25rem;
    display: block;
    font-size: 0.9rem; /* Increased for readability */
    text-transform: none;
    letter-spacing: normal;
    color: var(--text-color) !important;
}

.dropdown-menu li a:hover {
    background: var(--secondary-bg);
    color: var(--primary-color) !important;
}

.dropdown-indicator {
    font-size: 0.7rem;
    margin-left: 0.2rem;
    transition: var(--transition);
}

.category-item:hover .dropdown-indicator {
    transform: rotate(180deg);
}

/* Breaking News Ticker */
/* Breaking News Ticker Beautified */
.breaking-news-wrapper {
    background: #1e293b;
    height: 38px;
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    z-index: 1; /* Lower z-index so dropdowns go over it */
}

[data-theme="dark"] .breaking-news-wrapper {
    background: #0f172a;
}

.breaking-title {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    color: white;
    padding: 0 1.25rem;
    height: 100%;
    display: flex;
    align-items: center;
    font-weight: 900;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    clip-path: polygon(0 0, 90% 0, 100% 100%, 0% 100%);
}

.ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.ticker-list {
    display: flex;
    align-items: center;
    height: 100%;
    animation: ticker-scroll 30s linear infinite;
    padding-left: 2rem;
}

.ticker-list:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: flex;
    align-items: center;
    padding-right: 3rem;
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 500;
}

.ticker-item a:hover {
    color: var(--primary-color);
}

.ticker-item::before {
    content: '•';
    color: #ef4444;
    margin-right: 1rem;
    font-size: 1.2rem;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--secondary-bg);
    color: var(--primary-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.5rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Mobile Menu Button */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.menu-toggle span {
    width: 2rem;
    height: 0.25rem;
    background: var(--text-color);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Featured Section (Hero) */
.featured-section {
    padding: 3rem 0;
}

.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.featured-card {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    height: 100%;
    min-height: 400px;
    background-color: var(--card-bg);
}

.featured-card.main {
    min-height: 500px;
}

.featured-card.secondary {
    min-height: 240px;
}

.featured-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.featured-card:hover img {
    transform: scale(1.05);
}

.featured-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    color: white;
}

.featured-card.secondary .featured-overlay {
    padding: 1.5rem;
}

.category-badge {
    align-self: flex-start;
    background: linear-gradient(135deg, var(--primary-color), #4f46e5);
    color: white;
    padding: 0.35rem 1rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.2);
}

.featured-overlay h2 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.featured-card.secondary .featured-overlay h2 {
    font-size: 1.25rem;
}

.meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
}

.meta-dark {
    color: var(--text-muted);
}

.author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.author img {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
}

/* Secondary Featured Grid */
.secondary-grid {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 2rem;
}

/* Main Content Grid */
.main-content {
    padding: 2rem 0 5rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.section-title span {
    position: relative;
}

.section-title span::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary-color);
}

/* News Cards */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.news-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -5px rgba(0, 0, 0, 0.04);
    transform: translateY(-8px);
    border-color: transparent;
}

.news-card-img {
    position: relative;
    padding-top: 60%;
    overflow: hidden;
}

.news-card-img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-img img {
    transform: scale(1.05);
}

.news-card-cat {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}


.news-card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-card-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.news-card-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.trending-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.trending-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--border-color);
    line-height: 1;
}

.trending-content h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.trending-content h4 a:hover {
    color: var(--primary-color);
}

.newsletter-box {
    background-color: var(--secondary-bg);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--border-color);
}

.newsletter-box h3 {
    margin-bottom: 0.5rem;
}

.newsletter-box p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-form input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Footer */
.site-footer {
    background-color: #0f172a;
    color: #e2e8f0;
    padding: 5rem 0 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand .brand {
    color: white;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.footer-brand .brand span {
    color: white;
}

.footer-brand p {
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: #1e293b;
    border-radius: 50%;
    color: white;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-widget h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.125rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid #1e293b;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .featured-grid, .main-content {
        grid-template-columns: 1fr;
    }
    .secondary-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
    }
}
@media (max-width: 768px) {
    /* Mobile Menu (Hamburger Content) */
    .nav-links {
        display: none; 
        flex-direction: column;
        position: absolute;
        top: 50px; 
        left: 0;
        right: 0;
        background: var(--card-bg);
        padding: 2rem;
        z-index: 10000;
        box-shadow: var(--shadow-lg);
        border-bottom: 2px solid var(--primary-color);
    }

    .nav-links.active {
        display: flex !important;
    }

    .site-header {
        position: sticky;
        top: 0;
        z-index: 9999;
        background: var(--card-bg) !important;
        box-shadow: var(--shadow-md);
    }

    .navbar {
        height: 50px;
        padding: 0 1rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .site-header .brand {
        display: none !important;
    }

    .menu-toggle {
        display: flex;
        position: relative;
    }

    .nav-actions {
        display: flex;
        position: relative;
    }

    .d-none-mobile {
        display: none !important;
    }

    /* Category Menu + Dropdown Pop-out Fix */
    .category-subnav {
        display: block;
        width: 100%;
        overflow-x: auto;
        overflow-y: visible !important;
        background: var(--bg-color);
        border-top: 1px solid var(--border-color);
        position: relative;
        z-index: 500;
    }

    .category-list {
        display: flex;
        flex-wrap: nowrap;
        padding: 0.5rem 1rem;
        gap: 1.25rem;
        width: max-content;
    }

    /* Dropdown click logic on mobile - Fixed Overlay Approach */
    .category-item.active-dropdown .dropdown-menu {
        display: block !important;
        opacity: 1;
        visibility: visible;
        transform: none;
        position: fixed; /* Fix to viewport to avoid clipping */
        top: 115px; /* Adjust this to sit right below the Topics bar */
        left: 1rem;
        right: 1rem;
        width: calc(100% - 2rem);
        z-index: 999999; 
        background: var(--card-bg);
        border: 2px solid var(--primary-color);
        box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    }

    .dropdown-menu {
        display: none;
    }

    /* Headline Font Size Fix */
    .featured-overlay h2 {
        font-size: 1.25rem !important;
        font-weight: 800;
        line-height: 1.2;
    }

    .featured-card.secondary .featured-overlay h2 {
        font-size: 0.95rem !important; /* Smaller for secondary ones */
    }

    .featured-card.main {
        min-height: 450px !important; 
    }
    
    .featured-card.secondary {
        min-height: 180px !important; /* Compact secondary headlines */
    }

    .secondary-grid, .news-grid, .footer-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Article Content Typography */
.article-content {
    font-size: 1.15rem;
    line-height: 1.9;
    color: var(--text-color);
    font-family: 'Lora', serif;
}

.article-content p {
    margin-bottom: 1.75rem;
}

.article-content blockquote {
    margin: 2.5rem 0;
    padding: 1.5rem 2rem;
    border-left: 5px solid var(--primary-color);
    background: var(--secondary-bg);
    font-style: italic;
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-muted);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.article-content h2, .article-content h3 {
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    color: var(--text-color);
    line-height: 1.3;
}

.article-content ul, .article-content ol {
    margin-bottom: 1.75rem;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.75rem;
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    right: 2rem;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: var(--radius-xl);
    padding: 1.25rem 2rem;
    z-index: 10000;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.2);
    transition: all 0.5s ease;
}

[data-theme="dark"] .cookie-banner {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(255,255,255,0.1);
}

.cookie-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-text {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cookie-text p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.cookie-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.btn-text {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .cookie-banner {
        bottom: 1rem;
        left: 1rem;
        right: 1rem;
        padding: 1.5rem;
    }
    .cookie-content {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
    }
    .cookie-text {
        flex-direction: column;
    }
}

/* Related Posts Grid */
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
    .article-title {
        font-size: 1.5rem !important;
    }
}
