/* 
  Influencer News - Main Stylesheet 
  Mobile-first approach
*/

/* =========================================
   1. VARIABLES & RESET
   ========================================= */
/* Google Fonts */
/* Google Fonts are now loaded in HTML */

:root {
    /* Colors - Clean & Structured (Modern SaaS) */
    --primary-red: #e50914;
    --primary-hover: #b2070f;
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --bg-light: #f4f4f4;
    --text-dark: #ffffff;
    --text-gray: #a3a3a3;
    --text-light: #ffffff;
    --border-color: #333333;

    /* ── Theme tokens (dark defaults) ── */
    --site-bg:       #111111;
    --card-bg:       #111111;
    --card-border:   #222222;
    --card-meta-bg:  #111111;
    --card-img-bg:   #1a1a1a;
    --text-primary:  #f0f0f0;
    --text-secondary:#888888;
    --tab-text:      #888888;
    --tab-hover:     #ffffff;
    --tab-active:    #ffffff;
    --footer-bg:     #0d0d0d;
    --footer-text:   #aaaaaa;
    --trending-bg:   #1a1a1a;
    --trending-text: #cccccc;
    --search-bg:     rgba(255,255,255,0.08);
    --search-border: rgba(255,255,255,0.15);
    --search-text:   #fff;

    /* Typography */
    --font-heading: "Inter", -apple-system, sans-serif;
    --font-body: "Inter", "Roboto", sans-serif;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Shadows */
    --shadow-card: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-hover: 0 10px 15px -3px rgba(0,0,0,0.1);

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--site-bg);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Arabic Font Support */
[lang="ar"] {
    font-family: "Cairo", sans-serif;
}

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

ul {
    list-style: none;
}

/* =========================================
   2. UTILITIES
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 14px;
    transition: var(--transition-fast);
}

.btn-primary {
    background-color: var(--primary-red);
    color: var(--text-light);
}

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

.category-badge {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    background-color: var(--primary-red);
    color: var(--text-light);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* Error Toast */
.error-toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: #d32f2f;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    transition: bottom 0.3s ease;
    font-weight: 600;
}

.error-toast.show {
    bottom: 24px;
}

.error-toast span:first-child {
    font-size: 24px;
}

/* =========================================
   3. HEADER
   ========================================= */
.main-header {
    background-color: var(--card-bg);
    box-shadow: none;
    position: relative;
    width: 100%;
    z-index: 100;
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--card-border);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.header-container {
    max-width: 1400px; /* Wider for pro news look */
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

/* --- Left Section --- */
.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
}

.social-icons {
    display: flex;
    gap: 8px;
}

.social-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #ffffff;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition-fast);
}

.social-btn:hover {
    background-color: var(--primary-red);
    color: #fff;
}

/* --- Center Section --- */
.brand-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: -1px;
    line-height: 0.9;
    text-align: center;
    text-transform: uppercase;
}

/* --- Right Section --- */
.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex: 1;
    justify-content: flex-end;
}

.header-search {
    width: 200px;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    font-size: 12px;
}

.search-wrapper input {
    width: 100%;
    padding: 8px 8px 8px 32px;
    border: 1px solid var(--search-border);
    background-color: var(--search-bg);
    color: var(--search-text);
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition-fast);
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary-red);
    background-color: var(--search-bg);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Buttons Polish */
.btn-outline-white {
    border: 1px solid #444;
    color: #fff;
    background: transparent;
}

.btn-outline-white:hover {
    border-color: #fff;
}

.btn-white {
    background: #fff;
    color: #000;
}

.btn-white:hover {
    background: #e0e0e0;
}

.btn-text {
    background: none;
    border: none;
    color: #fff;
    padding: 0 5px;
}

.btn-text:hover {
    color: var(--primary-red);
}

/* Mobile Tweaks */
@media (max-width: 900px) {
    .desktop-only {
        display: none !important;
    }

    .header-container {
        height: 60px;
    }

    .brand-title {
        font-size: 20px;
    }

    .header-left, .header-right {
        flex: 0 0 auto;
    }
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero-section {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.hero-card {
    position: relative;
    display: block; /* Essential for <a> tag */
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid #000; /* Sharp border */
    /* box-shadow: var(--shadow-card); Removed soft shadow */
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 1;
    text-decoration: none;
}

.hero-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px #000; /* Hard shadow on hover */
}

.hero-image-wrapper {
    position: relative;
    width: 100%;
    /* Removed max-height constraint to allow Tall/Fullscreen styles */
    height: auto;
    overflow: hidden;
    display: block;
    background: #000;
}

.hero-image {
    width: 100%;
    height: auto; /* Allow image to push the wrapper height */
    min-height: 0; /* Remove min-height constraint on image */
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    display: block;
}

.hero-card:hover .hero-image {
    transform: scale(1.05);
}

/* --- Hero Styles --- */
/* Default (Standard) */
.hero-style-standard .hero-image-wrapper {
    height: 40vh;
    background: #000;
}
.hero-style-standard .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Compact */
.hero-style-compact .hero-image-wrapper {
    height: 40vh; /* Increased to 40vh per request */
}
.hero-style-compact .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Cinematic */
.hero-style-cinematic .hero-image-wrapper {
    height: 30vh; /* Reduced from 50vh */
}
.hero-style-cinematic .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tall */
.hero-style-tall .hero-image-wrapper {
    height: 60vh; /* Reduced from 80vh */
}
.hero-style-tall .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fullscreen */
.hero-style-fullscreen .hero-image-wrapper {
    height: 90vh; /* Reduced from 100vh */
}
.hero-style-fullscreen .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Contain */
.hero-style-contain .hero-image-wrapper {
    height: 60vh;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-style-contain .hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Natural */
.hero-style-natural .hero-image-wrapper {
    height: auto; /* Let it grow */
    min-height: 40vh; /* Minimum height to avoid collapse */
}
.hero-style-natural .hero-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Portrait Focus (Top Aligned) */
.hero-style-focus .hero-image-wrapper {
    height: 50vh; /* Good medium height */
    background: #000;
}
.hero-style-focus .hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top 20%; /* Focus on faces/top part */
}

/* News Blur (TV Style) */
.hero-style-news-blur .hero-image-wrapper {
    height: 50vh;
    background-color: #000;
    /* Background Image is set via inline style in JS */
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}

/* Darken the background image for better contrast */
.hero-style-news-blur .hero-image-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* Dark overlay */
    backdrop-filter: blur(20px); /* Blur effect */
    z-index: 1;
}

.hero-style-news-blur .hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2; /* Sit above the blur */
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5)); /* Pop out */
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-lg);
    color: var(--text-light);
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 900; /* Black weight */
    margin-bottom: var(--spacing-sm);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
    line-height: 1.1;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.meta-bar {
    display: flex;
    gap: var(--spacing-md);
    font-size: 12px;
    opacity: 0.9;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* =========================================
   SQUARE OPTIONS (Contained + Blur BG)
   ========================================= */

/* Square Tiny (20vh) */
.hero-style-square-tiny .hero-image-wrapper {
    height: 20vh;
    background-color: #000;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}
.hero-style-square-tiny .hero-image-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    z-index: 1;
}
.hero-style-square-tiny .hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.5));
}

/* Square Small (40vh) */
.hero-style-square-small .hero-image-wrapper {
    height: 40vh;
    background-color: #000;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}
.hero-style-square-small .hero-image-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    z-index: 1;
}
.hero-style-square-small .hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}

/* Square Medium (60vh) */
.hero-style-square-medium .hero-image-wrapper {
    height: 60vh;
    background-color: #000;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}
.hero-style-square-medium .hero-image-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    z-index: 1;
}
.hero-style-square-medium .hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.5));
}

/* Square Big (85vh) */
.hero-style-square-big .hero-image-wrapper {
    height: 85vh;
    background-color: #000;
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}
.hero-style-square-big .hero-image-wrapper::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    z-index: 1;
}
.hero-style-square-big .hero-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.5));
}

/* =========================================
   5. NEWS GRID
   ========================================= */
.news-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile default */
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.news-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border-bottom: 2px solid #f0f0f0; /* Minimal divider style */
    /* box-shadow: var(--shadow-card); */
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    border: 1px solid transparent; /* Prepare for hover */
}

.news-card:hover {
    transform: translateY(-2px);
    /* box-shadow: var(--shadow-hover); */
    border: 1px solid #000;
    box-shadow: 3px 3px 0px #000;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

/* Square cards get 1:1 ratio */
.news-card.card-square .card-image-wrapper {
    aspect-ratio: 1/1;
}

.news-card.card-square .card-image-wrapper img {
    object-fit: contain;
    background: #000;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.card-content {
    padding: var(--spacing-md);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
    color: var(--text-dark);

    /* Ellipsis for 3 lines - show more context */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content .meta-bar {
    color: var(--text-gray);
    margin-top: auto;
}

/* =========================================
   6. LOADER & FOOTER
   ========================================= */
.loader-container {
    text-align: center;
    padding: var(--spacing-xl);
    display: none; /* Hidden by default */
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-sm);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.main-footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    margin-top: var(--spacing-xl);
}

.footer-links {
    margin-top: var(--spacing-md);
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
}

.footer-links a:hover {
    color: var(--primary-red);
    text-decoration: underline;
}

/* =========================================
   7. MEDIA QUERIES (Mobile First Overrides)
   ========================================= */

/* Mobile Touch Targets & Inputs */
@media (max-width: 768px) {
    /* Ensure all interactive elements are at least 44px */
    button,
    a.button,
    input[type="submit"],
    .nav-item,
    .comment-action {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile-friendly form inputs */
    input,
    textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Improve card tap targets */
    .news-card {
        min-height: 140px;
    }

    /* Better infinite scroll trigger */
    #loading-sentinel {
        height: 30px;
        margin: 20px 0;
    }
}

/* Tablet & Up (>= 768px) */
@media (min-width: 768px) {
    .brand-title {
        font-size: 32px;
    }

    .hero-title {
        font-size: 32px;
    }

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

/* Desktop & Up (>= 1200px) */
@media (min-width: 1200px) {
    .header-top {
        padding: var(--spacing-md) 0;
    }

    .social-icons {
        flex-direction: row;
        gap: var(--spacing-md);
    }

    .header-actions {
        flex-direction: row;
    }

    .news-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero-content {
        width: 70%; /* Don't stretch text too wide on large screens */
    }
}

/* =========================================
   8. MOBILE NAVIGATION
   ========================================= */

/* Hamburger Menu (mobile only) */
.hamburger-menu {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.hamburger-menu span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--primary-red);
    transition: 0.3s;
}

.hamburger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.hamburger-menu.active span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border-top: 2px solid var(--primary-red);
    transform: translate3d(0, -110%, 0);
    transition: transform 0.3s ease;
    visibility: hidden;
}

.mobile-nav.active {
    transform: translate3d(0, 0, 0);
    visibility: visible;
}

.mobile-nav ul {
    list-style: none;
    padding: 20px;
    margin: 0;
}

.mobile-nav ul li {
    margin-bottom: 0;
    border-bottom: 1px solid #333;
}

.mobile-nav ul li:last-child {
    border-bottom: none;
}

.mobile-nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    display: block;
    padding: 16px;
    transition: background 0.3s;
    font-weight: 600;
}

.mobile-nav ul li a:hover {
    background: rgba(229, 9, 20, 0.2);
    color: var(--primary-red);
}

/* Show hamburger on mobile */
@media (max-width: 768px) {
    .hamburger-menu {
        display: flex;
    }

    .header-actions {
        display: none;
    }

    /* Hide desktop nav on mobile */
    .main-nav {
        display: none;
    }

    .header-top {
        padding: var(--spacing-sm);
    }
}

/* =========================================
   9. TRENDING BAR
   ========================================= */
.trending-bar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center; /* Centered */
    gap: 16px;
    padding: 0 var(--spacing-md);
    height: 38px;
    overflow: hidden;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background 0.25s ease;
}

.trending-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-red);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.trending-track {
    display: flex;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    flex: unset; /* Don't stretch */
    max-width: 1000px; /* Limit width */
}

/* ... existing scrollbar styles ... */
.trending-track::-webkit-scrollbar {
    display: none;
}

.trending-item {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
    flex-shrink: 0;
}

.trending-item:hover {
    color: var(--text-primary);
}

.trending-sep {
    color: var(--card-border);
    font-size: 10px;
    flex-shrink: 0;
}

/* =========================================
   10. CATEGORY TABS
   ========================================= */
.category-tabs {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    display: flex;
    justify-content: center; /* Centered */
    gap: 4px;
    padding: 0 var(--spacing-md);
    overflow-x: auto;
    scrollbar-width: none;
    transition: background 0.25s ease;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab {
    display: inline-block;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--tab-text);
    text-decoration: none;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.category-tab:hover {
    color: #fff;
}

.category-tab.active {
    color: #fff;
    border-bottom-color: var(--tab-color, var(--primary-red));
}

/* =========================================
   11. FEED SECTION & CARDS
   ========================================= */
.feed-section {
    padding: var(--spacing-lg) 0;
}

.posts-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* ── Big Card ── */
.big-card {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.big-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.big-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.big-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #1a1a1a;
}

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

.big-card:hover .big-card-img {
    transform: scale(1.04);
}

.big-card-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%
    );
}

.big-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: var(--spacing-lg);
}

.big-card-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    line-height: 1.25;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    margin-top: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.big-card-meta {
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--card-meta-bg);
}

.big-card-excerpt {
    font-size: 14px;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Small Card ── */
.small-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.small-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.small-card-link {
    display: flex;
    gap: var(--spacing-md);
    text-decoration: none;
    color: inherit;
    align-items: stretch;
}

.small-card-thumb {
    width: 140px;
    min-width: 140px;
    height: 100px;
    overflow: hidden;
    background: var(--card-img-bg);
    flex-shrink: 0;
    object-fit: cover;
}

.small-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.small-card:hover .small-card-thumb img {
    transform: scale(1.06);
}

.small-card-body {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.small-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Timestamp above title in small cards */
.small-card-time {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Category Badge ── */
/* Category Badge Base */
.related-card {
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color, #e5e7eb) !important;
    transition: all 0.3s ease;
    background: var(--card-bg, #fff) !important;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08) !important;
    height: 100%;
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15) !important;
    border-color: var(--primary-red) !important;
}

.related-card-img {
    height: 180px;
    background: #f0f0f0;
    overflow: hidden;
    position: relative;
}

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

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

.related-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.related-card-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-primary);
}

.related-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: auto;
}

/* ── Card Footer ── */
.card-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: auto;
    flex-wrap: wrap;
}

.card-author, .card-time, .card-comments {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ── Skeleton Loaders ── */
.big-card-skeleton {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.small-card-skeleton {
    width: 100%;
    height: 100px;
    border-radius: var(--radius-md);
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ── Error / Empty States ── */
.error-msg, .empty-msg {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    font-size: 15px;
    background: var(--card-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin: 40px auto;
    max-width: 600px;
}

.error-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin: 40px auto;
    max-width: 600px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.error-message h2 {
    color: var(--primary-red);
    font-size: 24px;
    margin-bottom: 16px;
    font-weight: 800;
    text-transform: uppercase;
}

.error-message p {
    color: var(--text-secondary);
    margin-bottom: 24px;
    font-size: 16px;
}

.error-msg {
    color: var(--primary-red);
}

/* ── Loader Container ── */
.loader-container {
    display: none;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-xl);
    gap: 8px;
    color: #666;
    font-size: 14px;
}

/* =========================================
   12. RESPONSIVE — FEED
   ========================================= */
@media (min-width: 768px) {
    .big-card-title {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    /* small-card stays horizontal at ALL mobile sizes — thumb stays 140×100px */
    .big-card-title {
        font-size: 18px;
    }
}

/* =========================================
   13. DARK / LIGHT MODE
   ========================================= */

/* ── Light mode: flip ALL theme tokens in one place ── */
body.light-mode {
    --site-bg:        #f2f2f2;
    --card-bg:        #ffffff;
    --card-border:    #e0e0e0;
    --card-meta-bg:   #f8f8f8;
    --card-img-bg:    #e8e8e8;
    --text-primary:   #111111;
    --text-secondary: #666666;
    --tab-text:       #555555;
    --tab-hover:      #111111;
    --tab-active:     #111111;
    --footer-bg:      #111111;
    --footer-text:    #aaaaaa;
    --trending-bg:    #e8e8e8;
    --trending-text:  #333333;
    --search-bg:      rgba(0,0,0,0.06);
    --search-border:  rgba(0,0,0,0.15);
    --search-text:    #111111;
}

/* ── Header ── */
body.light-mode .main-header {
    background-color: #ffffff;
    border-bottom-color: #e0e0e0;
}
body.light-mode .brand-title { color: #111; }
body.light-mode .social-btn  { color: #333; background: rgba(0,0,0,0.06); }

/* Header buttons visibility fix */
.btn-adaptive {
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    background: transparent;
}
.btn-adaptive:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

body.light-mode .btn-adaptive {
    border-color: #333;
    color: #333;
    font-weight: 700;
}
body.light-mode .btn-adaptive:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

body.light-mode .btn-outline-white {
    border-color: #333;
    color: #333;
}
body.light-mode .btn-outline-white:hover {
    background: #333;
    color: #fff;
}
/* Ensure primary button remains visible */
body.light-mode .btn-primary {
    background-color: var(--primary-red);
    color: #fff !important;
}

/* ── Search ── */
body.light-mode .search-wrapper input {
    background: var(--search-bg);
    color: var(--search-text);
    border-color: var(--search-border);
}
body.light-mode .search-icon { color: #555; }

/* ── Trending bar ── */
body.light-mode .trending-bar {
    background: var(--trending-bg);
    border-bottom-color: #ddd;
}
body.light-mode .trending-item { color: var(--trending-text); }
body.light-mode .trending-label { color: #e50914; }

/* ── Category tabs ── */
body.light-mode .category-tabs {
    background: #fff;
    border-bottom-color: #ddd;
}
body.light-mode .category-tab       { color: var(--tab-text); }
body.light-mode .category-tab:hover { color: var(--tab-hover); }
body.light-mode .category-tab.active { color: var(--tab-active); }

/* ── Big card title (overlaid on image — keep white) ── */
body.light-mode .big-card-title { color: #fff; }

/* ── Footer ── */
body.light-mode .main-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
}

/* ── Mobile nav ── */
body.light-mode .mobile-nav { background: #fff; }
body.light-mode .mobile-nav ul li a { color: #111; }

/* ── Theme toggle button ── */
.theme-toggle-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.4);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
    flex-shrink: 0;
}
.theme-toggle-btn:hover {
    border-color: #fff;
    background: rgba(255,255,255,0.1);
}
body.light-mode .theme-toggle-btn {
    border-color: rgba(0,0,0,0.25);
    color: #333;
}
body.light-mode .theme-toggle-btn:hover {
    border-color: #333;
    background: rgba(0,0,0,0.06);
}
