/* ============================================================================
   LGA Blog - I designed this Antigravity Glassmorphism Overhaul 2.0
   ============================================================================ */

/* ROOT THEMES */
:root {
    --primary: #b71c1c;
    --secondary: #d32f2f;
    --accent: #ff5252;
    --glass: rgba(255, 255, 255, 0.03);
    --glass-hover: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: rgba(0, 0, 0, 0.4);
    --bg-base: #000000;
    
    /* I added these for the reading progress bar */
    --progress-height: 4px;
    --progress-color: var(--primary);
    --progress-height: 4px;
    --progress-color: var(--primary);
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --skeleton-shine: rgba(255, 255, 255, 0.1);
}

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

[data-theme="light"] ::selection {
    background-color: var(--primary);
    color: white;
}

* {
    scroll-margin-top: 80px; /* Ensures hash links don't hide under header */
    -webkit-tap-highlight-color: transparent; /* Removes mobile tap flash */
}

/* READING PROGRESS BAR */
#readingProgress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--progress-height);
    background: transparent;
    z-index: 20000;
}

#readingProgressFill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.1s ease-out;
}

/* VIEW TRANSITIONS */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.4s;
}

[data-theme="light"] {
    --primary: #b71c1c;
    --secondary: #d32f2f;
    --accent: #c62828;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-hover: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.08);
    --glass-shadow: rgba(0, 0, 0, 0.05);
    --bg-base: #f8fafc;
    --text-primary: #0f172a;
    --text-muted: #64748b;
    --skeleton-base: rgba(0, 0, 0, 0.05);
    --skeleton-shine: rgba(0, 0, 0, 0.1);
}

html,
body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.2px;
    overflow-x: hidden;
    max-width: 100vw;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
}

/* ANTI-OVERFLOW FIX */
* {
    max-width: 100%;
}

.hero-slide, .main-container, .blog-grid, article {
    overflow-x: hidden !important;
}

/* --------------------------------------------------------------------------
   I removed the background particles per user request to keep it minimal
   -------------------------------------------------------------------------- */

/* --------------------------------------------------------------------------
   I enhanced the Logo Preloader with smoother animations
   -------------------------------------------------------------------------- */
#loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--bg-base);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s, visibility 0.8s;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 60px;
    border-radius: 40px;
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    box-shadow: 0 20px 80px var(--glass-shadow);
    transform: scale(0.9);
    animation: loaderEntrance 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes loaderEntrance {
    to {
        transform: scale(1);
    }
}

.loader-logo {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    /* Squircle logo instead of full circle for modern look */
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    animation: levitateLogo 3s infinite ease-in-out;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--glass-border);
}

@keyframes levitateLogo {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
        box-shadow: 0 30px 50px rgba(0, 0, 0, 0.3);
    }
}

.loader-subtext {
    font-size: 1.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--text-primary), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 4px;
}

.loader-catchphrase {
    color: var(--accent);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   SKELETON PRELOADER (FLUID GLASS)
   -------------------------------------------------------------------------- */
.skeleton {
    background: var(--skeleton-base);
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
    animation: shimmer 1.5s infinite;
}

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

.skeleton-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
}

.skeleton-line {
    background: var(--skeleton-base);
    height: 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-line::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
    animation: shimmer 1.5s infinite;
}

.skeleton-line.category { width: 60px; height: 10px; margin-bottom: 12px; }
.skeleton-line.title { width: 85%; height: 24px; margin-bottom: 12px; }
.skeleton-line.meta { width: 40%; height: 12px; }
.skeleton-img { 
    width: 110px; height: 110px; 
    border-radius: 12px; 
    background: var(--skeleton-base); 
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.skeleton-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, var(--skeleton-shine), transparent);
    animation: shimmer 1.5s infinite;
}

/* --------------------------------------------------------------------------
   FLUID GLASS HORIZONTAL CARDS
   -------------------------------------------------------------------------- */
.blog-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 15px;
        overflow-x: hidden;
        max-width: 100vw;
        box-sizing: border-box;
    }

    main {
        min-width: 0;
        overflow: hidden;
    }

    .blog-grid {
        max-width: 100%;
        overflow-x: hidden;
    }
}

.fluid-glass {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    box-shadow: 0 15px 35px var(--glass-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}

.blog-card.horizontal {
    display: flex;
    flex-direction: row;
    height: 280px;
    cursor: pointer;
}

.blog-card.horizontal:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-image-container {
    width: 40%;
    position: relative;
    overflow: hidden;
}

.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.blog-card.horizontal:hover .card-image-container img {
    transform: scale(1.08) rotate(1deg);
}

.card-content-container {
    width: 60%;
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-content-container h3 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-muted));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-content-container p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content-container .meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
}

/* SKELETON SPECIFIC GRID CLASSES */
.blog-card.skeleton .card-image-container {
    background: var(--skeleton-base);
}

.blog-card.skeleton .skeleton-text {
    height: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    background: var(--skeleton-base);
}

.blog-card.skeleton .skeleton-text.title {
    height: 32px;
    width: 80%;
}

.blog-card.skeleton .skeleton-text.subtitle {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
}

.blog-card.skeleton .skeleton-text.meta {
    height: 16px;
    width: 50%;
    margin-top: auto;
}


/* RESPONSIVE HORIZONTAL CARDS */
@media (max-width: 992px) {
    .blog-card.horizontal {
        flex-direction: column;
        height: auto;
    }

    .card-image-container {
        width: 100%;
        height: 240px;
    }

    .card-content-container {
        width: 100%;
        padding: 24px;
    }
}

/* --------------------------------------------------------------------------
   NAVBAR & SIDEBAR FLUID UPDATES
   -------------------------------------------------------------------------- */
nav {
    background: var(--bg-base) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    border-radius: 0 !important;
    padding: 16px 24px !important;
}

/* --------------------------------------------------------------------------
   APPLE NEWS EDITORIAL LAYOUT
   -------------------------------------------------------------------------- */
.apple-featured {
    cursor: pointer;
    margin-bottom: 32px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #111;
}

.apple-featured:hover {
    transform: scale(1.01);
}

.apple-featured:active {
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   EDITORIAL CAROUSEL (APPLE NEWS STYLE)
   -------------------------------------------------------------------------- */
.carousel-section {
    width: 100%;
    max-width: 100vw;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    display: block;
    height: 600px;
}

@media (max-width: 768px) {
    .carousel-section {
        height: 100vh;
        margin-bottom: 0;
    }

    .carousel-container {
        height: 100% !important;
    }

    .hero-slide {
        height: 100% !important;
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        padding: 40px 20px !important;
    }

    .slide-media {
        position: absolute !important;
        inset: 0 !important;
        height: 100% !important;
        width: 100% !important;
        border-radius: 0 !important;
        margin-bottom: 0 !important;
        z-index: 1;
    }

    .slide-content {
        position: relative;
        z-index: 5;
        width: 100%;
    }

    .slide-title {
        font-size: 2.2rem !important;
        line-height: 1.05 !important;
    }
}

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 10500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.search-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.search-results-list {
    padding: 0 40px;
    width: 100%;
    max-width: 700px;
    max-height: 50vh;
    overflow-y: auto;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-result-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.newsletter-card-modern {
    max-width: 86% !important;
    margin: 60px auto !important;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 32px;
    padding: 80px 40px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .newsletter-card-modern {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
}

.newsletter-card-modern h4 {
    font-size: 2.8rem !important;
    font-weight: 900 !important;
    color: white !important;
    margin-bottom: 16px !important;
    letter-spacing: -1.5px !important;
}

[data-theme="light"] .newsletter-card-modern h4 {
    color: #1a1a1a !important;
}

.newsletter-input-group {
    display: flex;
    gap: 12px;
    max-width: 460px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .newsletter-input-group {
    background: rgba(0, 0, 0, 0.05);
}

.newsletter-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: white;
    font-size: 1rem;
    outline: none;
}

[data-theme="light"] .newsletter-input {
    color: #1a1a1a;
}

.newsletter-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}

.newsletter-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(183, 28, 28, 0.4);
}

/* --------------------------------------------------------------------------
   APPLE STYLE DIVIDER
   -------------------------------------------------------------------------- */
.apple-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 30px 0;
    width: 100%;
}

[data-theme="light"] .apple-divider {
    background: rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   FULL SCREEN READER OVERRIDE
   -------------------------------------------------------------------------- */
.modal-overlay.full-page-reader {
    background: var(--bg-base);
    padding: 0;
    overflow-y: auto;
    z-index: 9999;
    display: block;
}

.post-reader {
    width: 100%;
    min-height: 100vh;
    background: var(--bg-base);
    box-shadow: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    max-width: none;
}

.reader-close {
    position: fixed;
    top: 30px;
    left: 30px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.reader-close:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: translateX(-5px);
}

/* --------------------------------------------------------------------------
   POPULAR WIDGET WITH IMAGES
   -------------------------------------------------------------------------- */
.popular-item {
    display: flex;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.3s;
}

.popular-item:hover {
    opacity: 0.8;
}

.popular-img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
}

.popular-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.popular-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="light"] .popular-title {
    color: #1a1a1a !important;
}

.popular-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(10px);
    border-color: var(--primary);
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-category {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.search-result-title {
    font-weight: 600;
    font-size: 1rem;
    color: white;
}

.search-no-results {
    color: var(--text-muted);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

.search-clear {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    margin-left: 10px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.search-clear:hover {
    opacity: 1;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.carousel-container {
    display: grid;
    grid-template-areas: "stack";
    width: 100%;
    min-height: 480px;
}

.hero-slide {
    grid-area: stack;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 60px 80px;
    cursor: pointer;
}

.hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.slide-media {
    width: 100%;
    height: 320px;
    overflow: hidden;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}

.slide-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.slide-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 10s linear;
}

.slide-media::after {
    content: '';
    position: absolute;
    inset: 0;
    /* Stronger cinematic overlay for superior text contrast */
    background: linear-gradient(to top, 
        rgba(0, 0, 0, 0.98) 0%, 
        rgba(0, 0, 0, 0.7) 35%, 
        rgba(0, 0, 0, 0) 100%);
    z-index: 2;
}

.hero-slide.active .slide-media img {
    transform: scale(1.1);
}

.slide-content {
    position: relative;
    z-index: 5;
    width: 100%;
}

.slide-category {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: slideInUp 0.6s ease-out both;
}

.slide-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    line-height: 0.95;
    margin: 12px 0;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, #ff3d00 0%, #ffea00 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.slide-excerpt {
    font-size: 1.1rem;
    color: #ffffff;
    line-height: 1.4;
    margin-bottom: 24px;
    max-width: 600px;
    font-weight: 500;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.slide-meta {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* CAROUSEL NAV */
.carousel-nav {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: center;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--glass-border);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(183, 28, 28, 0.3);
}

.apple-btn:active {
    transform: scale(0.96);
}

.carousel-dot.active {
    background: var(--primary);
    transform: scale(1.3);
}

.apple-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.apple-list-item:active {
    opacity: 0.6;
}

.apple-list-content {
    flex: 1;
}

.apple-list-img {
    width: 110px;
    height: 110px;
    min-width: 90px;
    /* Prevent squishing on narrow screens */
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.apple-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0;
    width: 100%;
}

/* --------------------------------------------------------------------------
   NEWSLETTER PREMIUM CARD
   -------------------------------------------------------------------------- */
.newsletter-card-modern {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.8), rgba(0, 0, 0, 0.9));
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 60px 40px;
    margin-top: 80px;
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.newsletter-card-modern:hover {
    transform: translateY(-10px) scale(1.01);
    box-shadow: 0 60px 120px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.newsletter-card-modern::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(183, 28, 28, 0.1) 0%, transparent 60%);
    z-index: 0;
    pointer-events: none;
    animation: glowRotate 10s linear infinite;
}

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

.newsletter-card-modern * {
    position: relative;
    z-index: 1;
}

.newsletter-card-modern h4 {
    font-size: 2.5rem !important;
    font-weight: 900 !important;
    color: white !important;
    margin-bottom: 16px !important;
    text-transform: none !important;
    letter-spacing: -2px !important;
    line-height: 0.95 !important;
}

.newsletter-card-modern p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 32px;
}

.bi-envelope-paper-heart {
    display: inline-block;
    animation: iconPulse 2s infinite ease-in-out;
}

@keyframes iconPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        filter: drop-shadow(0 0 8px var(--primary));
    }
}

.newsletter-form-container .apple-btn:hover {
    box-shadow: 0 0 20px rgba(183, 28, 28, 0.6);
    transform: scale(1.05) translateY(-2px);
}

.newsletter-card-modern.success {
    animation: successPulse 0.8s ease-out;
    border-color: #4CAF50 !important;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 30px rgba(76, 175, 80, 0.4);
    }

    100% {
        transform: scale(1);
    }
}

.newsletter-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 14px 20px;
    color: white;
    outline: none;
    transition: all 0.3s;
}

.newsletter-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .newsletter-card-modern {
        padding: 40px 20px;
        margin-top: 40px;
        border-radius: 24px;
    }

    .newsletter-card-modern h4 {
        font-size: 1.8rem !important;
        letter-spacing: -1px !important;
    }

    .newsletter-form-container {
        flex-direction: column;
        gap: 12px;
    }

    .newsletter-form-container .apple-btn {
        width: 100%;
        justify-content: center;
        padding: 16px;
    }
    
    .newsletter-input {
        width: 100%;
        text-align: center;
    }
}

.popular-widget h4 {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 20px;
}

.bi-fire {
    color: #ff5252;
}

/* --------------------------------------------------------------------------
   FIX CATEGORY BADGE PADDING 
   -------------------------------------------------------------------------- */
.category-badge,
.cat-badge {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    background: var(--primary) !important;
    color: white !important;
    padding: 6px 16px !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    height: auto !important;
    width: auto !important;
    display: inline-block !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4) !important;
    z-index: 5 !important;
    line-height: normal !important;
    border: none !important;
}

/* --------------------------------------------------------------------------
   MODAL SHARE BUTTONS SVG HOVER STATES
   -------------------------------------------------------------------------- */
.share-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-btn svg {
    transition: all 0.3s ease;
    fill: currentColor;
    width: 20px;
    height: 20px;
}

.share-btn:hover {
    transform: translateY(-4px) scale(1.1);
}

.share-fb:hover {
    background: rgba(24, 119, 242, 0.1);
    color: #1877F2;
    border-color: #1877F2;
}

.share-tw:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: white;
}

.share-wa:hover {
    background: rgba(37, 211, 102, 0.1);
    color: #25D366;
    border-color: #25D366;
}


/* --------------------------------------------------------------------------
   ARTICLE READER (FULL SCREEN MODAL)
   -------------------------------------------------------------------------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: #000;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    display: block;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay::-webkit-scrollbar {
    display: none;
}

.post-reader {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    background: var(--bg-base);
    color: var(--text-primary);
    position: relative;
    box-sizing: border-box;
    overflow-x: hidden;
}

.reader-close {
    position: sticky;
    top: 30px;
    margin-left: auto;
    margin-right: 30px;
    margin-top: 30px;
    margin-bottom: -74px;
    /* Pull the content back up */
    z-index: 10010;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.reader-close:hover {
    transform: scale(1.1) rotate(90deg);
    background: var(--primary);
}

.reader-hero {
    width: 100%;
    height: 70vh;
    min-height: 420px;
    max-height: 720px;
    position: relative;
    background: #000;
    overflow: hidden;
    flex-shrink: 0;
}

.reader-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

@media (max-width: 600px) {
    .reader-hero {
        height: 55vh;
        min-height: 280px;
    }
}

.reader-vignette {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
            rgba(0, 0, 0, 0.95) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.reader-header-content .post-title {
    color: #ffea00 !important; /* Bright Golden Yellow for high visibility */
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    font-weight: 900;
    line-height: 1.05;
    letter-spacing: -1.5px;
    margin-bottom: 16px;
}

[data-theme="light"] .reader-header-content .post-title {
    color: #fff !important; /* Almost White for light mode contrast */
}

.reader-header-content .post-category {
    color: var(--primary);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    display: inline-block;
}

.reader-header-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 40px 36px;
    z-index: 2;
    box-sizing: border-box;
}

@media (max-width: 600px) {
    .reader-header-content {
        padding: 20px 20px 24px;
    }

    .reader-header-content .post-title {
        font-size: 1.7rem !important;
        letter-spacing: -0.5px !important;
    }
}

.reader-header-content .post-category {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    margin-bottom: 16px;
}

.reader-header-content .post-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    line-height: 1;
    margin: 0 0 24px 0;
    letter-spacing: -2px;
}

.reader-header-content .post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
}

.author-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.reader-body {
    padding: 60px 30px 100px;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    background: var(--bg-base);
}

.reader-main-content {
    font-family: 'Georgia', serif;
    font-size: 1.25rem;
    line-height: 1.7;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.reader-main-content p {
    margin-bottom: 28px;
    opacity: 0.95;
}

.inner-post-media {
    margin: 40px -20px;
    border-radius: 20px;
    overflow: hidden;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    max-width: calc(100% + 40px);
}

.inner-post-media img, 
.inner-post-media video {
    width: 100%;
    display: block;
    height: auto;
    object-fit: cover;
}

@media (min-width: 800px) {
    .inner-post-media {
        margin: 40px 0;
    }
}

.apple-btn {
    background: var(--primary);
    color: white;
    padding: 12px 28px;
    border-radius: 30px;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.apple-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(183, 28, 28, 0.4);
}

.apple-btn.glassy {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.apple-btn.glassy:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.carousel-dots {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: center;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: 0.3s;
}

.carousel-dots .dot.active {
    background: var(--primary);
    width: 30px;
    border-radius: 10px;
}

/* --------------------------------------------------------------------------
   REACTION MODULE (INTERACTIVE)
   -------------------------------------------------------------------------- */
.reaction-module {
    display: flex;
    gap: 12px;
    padding: 24px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    margin: 40px 0;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.reaction-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    user-select: none;
}

.reaction-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px) scale(1.05);
    border-color: var(--primary);
}

.reaction-btn.active {
    background: rgba(183, 28, 28, 0.15);
    border-color: var(--primary);
    color: var(--primary);
}

.reaction-btn span {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* --------------------------------------------------------------------------
   APPLE NEWS EDITORIAL STYLES
   -------------------------------------------------------------------------- */
.reader-main-content {
    font-family: 'Georgia', 'Iowan Old Style', 'Apple News Gothic', serif;
    font-size: 1.25rem;
    line-height: 1.8;
    color: var(--text-primary);
    letter-spacing: -0.1px;
}

.reader-main-content p {
    margin-bottom: 32px;
}

.reader-main-content p:first-of-type::first-letter {
    float: left;
    font-size: 4.8rem;
    line-height: 1;
    padding-top: 4px;
    padding-right: 12px;
    padding-left: 3px;
    font-weight: 900;
    color: var(--primary);
    font-family: 'Inter', sans-serif;
}

.editorial-quote {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 48px 0;
    padding-left: 24px;
    border-left: 6px solid var(--primary);
    color: white;
    font-style: italic;
    letter-spacing: -1px;
}

.reader-footer {
    margin-top: 60px;
    padding: 40px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
}

.share-group {
    display: flex;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
}

.share-label {
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* --------------------------------------------------------------------------
   IOS LIQUID GLASS NAVBAR OVERRIDE
   -------------------------------------------------------------------------- */
nav {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 50px !important;
    padding: 12px 24px !important;
    width: 90% !important;
    max-width: 1200px;
    left: 50% !important;
    transform: translateX(-50%) !important;
    backdrop-filter: blur(40px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(200%) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3) !important;
    position: fixed !important;
    top: 20px !important;
    z-index: 1000 !important;
}

@media (max-width: 600px) {
    nav {
        width: 95% !important;
        padding: 8px 16px !important;
        top: 10px !important;
    }

    .logo img {
        width: 32px !important;
        height: 32px !important;
    }

    .logo span {
        font-size: 0.9rem !important;
    }
}

[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05) !important;
}

.image-caption-overlay {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    color: white;
    padding: 12px 20px;
    border-radius: 14px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 5;
    text-align: center;
}

.reader-hero:hover .image-caption-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   I added these Reading Progress Bar styles
   -------------------------------------------------------------------------- */
.reader-progress-container {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--progress-height);
    background: rgba(255, 255, 255, 0.05);
    z-index: 1000;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    overflow: hidden;
}

.reader-progress-bar {
    height: 100%;
    width: 0%;
    background: var(--progress-color);
    box-shadow: 0 0 10px var(--accent);
    transition: width 0.1s ease-out;
}

/* --------------------------------------------------------------------------
   I added these Print Styles for "Download PDF" functionality
   -------------------------------------------------------------------------- */
@media print {
    /* I hide everything except the reader content */
    body * {
        visibility: hidden;
    }
    
    .post-reader, .post-reader * {
        visibility: visible;
    }

    .post-reader {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        color: black !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        overflow: visible !important;
    }

    .modal-overlay {
        background: white !important;
        position: absolute !important;
    }

    .reader-close, .reader-progress-container, .reader-footer, .share-global-btn, .reader-conversion-section, .related-posts-section {
        display: none !important;
    }

    .reader-hero {
        height: auto !important;
        margin-bottom: 20px !important;
    }

    .reader-image {
        position: relative !important;
        height: 300px !important;
        border-radius: 0 !important;
        display: block !important;
    }

    .reader-header-content {
        position: relative !important;
        padding: 20px 0 !important;
        background: none !important;
        color: black !important;
    }

    .post-title {
        font-size: 28pt !important;
        color: black !important;
    }

    .reader-body {
        padding: 0 !important;
    }

    .reader-main-content {
        font-size: 11pt !important;
        line-height: 1.6 !important;
        color: black !important;
    }
    
    .reader-main-content b, .reader-main-content h1, .reader-main-content h2 {
        color: black !important;
    }

    .inner-post-media {
        break-inside: avoid !important;
        margin: 20px 0 !important;
    }
}

/* --------------------------------------------------------------------------
   I designed these custom scrollbar styles for a seamless glass look
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

/* --------------------------------------------------------------------------
   I created these Scroll-Reveal and Reaction animations
   -------------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reaction-btn {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.reaction-btn:hover {
    transform: scale(1.1) translateY(-5px);
    background: var(--glass-hover);
    border-color: var(--primary);
}

.reaction-btn.active {
    background: var(--primary);
    border-color: var(--accent);
    box-shadow: 0 0 15px rgba(183, 28, 28, 0.4);
}

.reaction-count {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   I added these Slide-in Lead Magnet styles
   -------------------------------------------------------------------------- */
.lead-magnet-slidein {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 340px;
    padding: 24px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--primary);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    z-index: 100000;
    transform: translateX(450px);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lead-magnet-slidein.show {
    transform: translateX(0);
}

.magnet-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

/* --------------------------------------------------------------------------
   SCHOOL UPDATES & NOTIFICATIONS GRID
   -------------------------------------------------------------------------- */
.school-updates-section {
    padding: 80px 0;
    background: linear-gradient(to bottom, transparent, rgba(183, 28, 28, 0.05));
    border-top: 1px solid var(--glass-border);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 40px;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-primary);
}

.section-title i {
    color: var(--primary);
}

.updates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.update-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.update-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    background: var(--glass-hover);
}

.update-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(183, 28, 28, 0.1);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    width: fit-content;
}

.update-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.3;
}

.update-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

.update-card .date {
    margin-top: auto;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* REALTIME TOAST ENHANCEMENT */
.realtime-toast {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5) !important;
    border: 1px solid var(--primary) !important;
}

/* PWA INSTALL PROMPT (Optional custom UI) */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(150px);
    background: var(--bg-base);
    border: 1px solid var(--primary);
    padding: 16px 24px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 999999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-install-banner.show {
    transform: translateX(-50%) translateY(0);
}
 . a p p l e - l i s t - i m g   { 
         b a c k g r o u n d :   r g b a ( 2 5 5 ,   2 5 5 ,   2 5 5 ,   0 . 0 3 ) ; 
         p o s i t i o n :   r e l a t i v e ; 
         o v e r f l o w :   h i d d e n ; 
 } 
 
 . a p p l e - l i s t - i m g : : b e f o r e   { 
         c o n t e n t :   \  
 \ ; 
         p o s i t i o n :   a b s o l u t e ; 
         i n s e t :   0 ; 
         b a c k g r o u n d :   l i n e a r - g r a d i e n t ( 9 0 d e g ,   t r a n s p a r e n t ,   r g b a ( 2 5 5 , 2 5 5 , 2 5 5 , 0 . 0 3 ) ,   t r a n s p a r e n t ) ; 
         a n i m a t i o n :   s k e l e t o n - s w e e p   1 . 5 s   i n f i n i t e ; 
 } 
 
 @ k e y f r a m e s   s k e l e t o n - s w e e p   { 
         0 %   {   t r a n s f o r m :   t r a n s l a t e X ( - 1 0 0 % ) ;   } 
         1 0 0 %   {   t r a n s f o r m :   t r a n s l a t e X ( 1 0 0 % ) ;   } 
 }  
 