/* =========================================================
   THETEJBLOGS 2.0 — PERFORMANCE OPTIMIZED STYLESHEET (blogs.css)
   - Uniform 460px Banner Height (Zero Resize Glitch)
   - Mobile-Friendly Adaptive Layout (Spacious, Not Squished)
   - GPU-Isolated Non-Blocking Tape Ticker (Zero Scroll Lag)
   - Native Glass Cards with Completely Disabled Hover Jumps
========================================================= */

/* =========================================================
   01. PAGE BASE & TYPOGRAPHY CORE
========================================================= */
.blogs-page {
    position: relative;
    z-index: 1;
    width: min(calc(100% - 72px), var(--global-max-width, 1380px));
    margin: 0 auto;
    padding-top: 95px;
    contain: layout style;
}

.section-label {
    margin: 0;
    color: var(--global-muted, rgba(241, 240, 233, 0.58));
    font-family: "Manrope", sans-serif;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.banner-headline,
.month-top-section h2,
.library-header-row h2,
.categories-header h2 {
    margin: 12px 0 0;
    color: var(--global-text, #f1f0e9);
    font-family: "Manrope", sans-serif;
    font-weight: 400;
    letter-spacing: -0.055em;
    line-height: 1.05;
}

.month-top-section h2,
.library-header-row h2,
.categories-header h2 {
    font-size: clamp(38px, 4.4vw, 64px);
}

.banner-headline em,
.month-top-section h2 em,
.library-header-row h2 em,
.categories-header h2 em {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 400;
    color: rgba(241, 240, 233, 0.44);
    letter-spacing: -0.01em;
    margin-left: 2px;
}

/* =========================================================
   02. COMPACT HERO BANNER (STRICT 460PX UNIFORM HEIGHT)
========================================================= */
.banner-slider-section {
    position: relative;
    margin-bottom: 65px;
    contain: layout style;
}

/* 460px height lock guarantees identical size across all slides */
.banner-slider-viewport {
    position: relative;
    width: 100%;
    height: 460px;
    border-radius: 18px;
    overflow: hidden;
    background: rgba(7, 16, 20, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateZ(0);
}

.banner-slider-track {
    display: flex;
    width: 100%;
    height: 100%;
    will-change: transform;
}

.banner-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 460px;
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    box-sizing: border-box;
    overflow: hidden;
}

.banner-media-side {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.banner-glow-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 35%, rgba(7, 16, 20, 0.95) 100%);
    pointer-events: none;
}

.banner-copy-side {
    height: 100%;
    padding: 44px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
}

.banner-meta-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    font-family: "Manrope", sans-serif;
    font-size: 10px;
    font-weight: 700;
}

.trending-rocket-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.45);
    border-radius: 999px;
    color: #fca5a5;
    letter-spacing: 0.16em;
    font-size: 8.5px;
}

.rocket-icon {
    font-size: 11px;
}

.banner-time {
    color: var(--global-faint, rgba(241, 240, 233, 0.38));
    letter-spacing: 0.14em;
}

.banner-headline {
    font-size: clamp(28px, 3vw, 40px);
    margin: 0 0 14px;
    line-height: 1.15;
}

.banner-abstract {
    font-size: 14px;
    line-height: 1.7;
    font-family: "DM Sans", sans-serif;
    color: var(--global-muted, rgba(241, 240, 233, 0.65));
    margin: 0 0 28px;
    max-width: 520px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.banner-nav-bar {
    position: absolute;
    bottom: 24px;
    right: 48px;
    display: flex;
    gap: 7px;
    z-index: 10;
}

.banner-dot {
    width: 24px;
    height: 3px;
    background: rgba(255, 255, 255, 0.22);
    border: none;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.25s ease, width 0.25s ease;
}

.banner-dot.active {
    background: var(--global-accent, #b9d6c7);
    width: 40px;
}

/* =========================================================
   03. TOP ARTICLES OF THIS MONTH (STATIC & STABLE)
========================================================= */
.month-top-section {
    padding-bottom: 75px;
}

.featured-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 28px;
}

.month-card {
    display: flex;
    flex-direction: column;
    background: rgba(8, 16, 21, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    overflow: hidden;
    transform: translateZ(0);
    transition: border-color 0.2s ease;
}

.month-card:hover {
    border-color: rgba(185, 214, 199, 0.4);
}

.month-series-card {
    border-color: rgba(56, 189, 248, 0.25);
}

.month-media-box {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #04090c;
    overflow: hidden;
}

.month-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

.month-tag-pill {
    position: absolute;
    bottom: 10px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(3, 7, 18, 0.85);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: "Manrope", sans-serif;
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.pill-category { color: var(--global-accent, #b9d6c7); }
.pill-time { color: var(--global-faint, rgba(241, 240, 233, 0.5)); }

.month-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.month-title {
    font-family: "Manrope", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.32;
    letter-spacing: -0.025em;
    color: var(--global-text, #f1f0e9);
    margin: 0 0 10px;
}

.month-desc {
    font-family: "DM Sans", sans-serif;
    font-size: 13px;
    line-height: 1.62;
    color: var(--global-muted, rgba(241, 240, 233, 0.58));
    margin: 0 0 20px;
    flex-grow: 1;
}

.month-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-family: "Manrope", sans-serif;
    font-size: 10px;
    font-weight: 700;
    color: var(--global-accent, #b9d6c7);
}

/* =========================================================
   04. TRANSLUCENT TAPE TICKER (FROSTED GLASS EFFECT)
========================================================= */
.tape-ticker {
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    overflow: hidden;
    padding: 28px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(7, 16, 20, 0.55); /* Translucent background */
    margin-bottom: 85px;
    contain: paint layout; /* GPU compositor isolation */
    transform: translateZ(0);
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: tapeSlide 30s linear infinite;
    will-change: transform;
}

.ticker-group {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-right: 40px;
    white-space: nowrap;
    font-family: "Manrope", sans-serif;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: 0.24em;
    color: rgba(241, 240, 233, 0.42);
    text-transform: uppercase;
}

.ticker-dot {
    font-style: normal;
    color: var(--global-accent, #b9d6c7);
    font-size: 20px;
    line-height: 0;
}

@keyframes tapeSlide {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-50%, 0, 0); }
}

/* =========================================================
   05. THE LIBRARY ARTICLES (HORIZONTAL SLIDER)
========================================================= */
.articles-library-section {
    padding-bottom: 85px;
}

.library-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 30px;
}

.library-slider-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-arrow {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--global-text, #f1f0e9);
    cursor: pointer;
    font-size: 16px;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.slider-arrow:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--global-accent, #b9d6c7);
}

.slider-counter {
    font-family: "Manrope", sans-serif;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--global-muted, rgba(241, 240, 233, 0.48));
    min-width: 50px;
    text-align: center;
}

.library-track-wrapper {
    overflow: hidden;
}

.library-cards-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
}

.library-cards-track::-webkit-scrollbar {
    display: none;
}

/* 100% Native Transparent Glass (Completely static on hover) */
.glass-article-card {
    flex: 0 0 calc((100% - 32px) / 3);
    scroll-snap-align: start;
    min-height: 280px;
    padding: 26px 22px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 12px;
    transition: background 0.2s ease;
}

.glass-article-card:hover {
    background: rgba(255, 255, 255, 0.07);
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-family: "Manrope", sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.meta-cat { color: var(--global-accent, #b9d6c7); }
.meta-date { color: var(--global-faint, rgba(241, 240, 233, 0.34)); }

.card-content h3 {
    font-family: "Manrope", sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.32;
    letter-spacing: -0.025em;
    color: var(--global-text, #f1f0e9);
    margin: 16px 0 10px;
}

.card-content p {
    font-family: "DM Sans", sans-serif;
    font-size: 12.5px;
    line-height: 1.62;
    color: var(--global-muted, rgba(241, 240, 233, 0.48));
    margin: 0;
}

.card-read {
    display: flex;
    justify-content: space-between;
    padding-top: 16px;
    font-family: "Manrope", sans-serif;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.14em;
    color: var(--global-faint, rgba(241, 240, 233, 0.36));
}

/* =========================================================
   06. TOPIC CATEGORIES GRID
========================================================= */
.topic-categories-section {
    padding: 70px 0 90px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.categories-header {
    margin-bottom: 30px;
}

.topic-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.015);
}

.topic-cell {
    min-height: 60px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: var(--global-text, #f1f0e9);
    transition: background 0.15s ease, color 0.15s ease;
}

.topic-cell:nth-child(4n) { border-right: 0; }
.topic-cell:nth-last-child(-n+4) { border-bottom: 0; }
.topic-cell:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--global-accent, #b9d6c7);
}

.cell-arrow {
    color: var(--global-faint, rgba(241, 240, 233, 0.34));
    font-size: 12px;
}

/* =========================================================
   07. RESPONSIVE HOOKS
========================================================= */
@media (max-width: 950px) {
    .blogs-page { width: min(calc(100% - 36px), var(--global-max-width, 1380px)); }
    .banner-slide { grid-template-columns: 1fr; height: 440px; }
    .banner-slider-viewport { height: 440px; }
    .banner-media-side { min-height: 240px; }
    .banner-glow-overlay { background: linear-gradient(180deg, transparent 40%, rgba(7, 16, 20, 0.95) 100%); }
    .banner-copy-side { padding: 28px 24px; }
    .featured-articles-grid { grid-template-columns: 1fr 1fr; }
    .glass-article-card { flex-basis: calc((100% - 16px) / 2); }
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
    .topic-cell:nth-child(4n) { border-right: 1px solid rgba(255, 255, 255, 0.08); }
    .topic-cell:nth-child(2n) { border-right: 0; }
}

@media (max-width: 650px) {
    .blogs-page { width: calc(100% - 28px); padding-top: 75px; }

    /* Mobile Friendly Banner: Clean stacked proportions, zero cramped sizing */
    .banner-slider-viewport {
        height: 480px;
    }
    .banner-slide {
        grid-template-columns: 1fr;
        grid-template-rows: 200px 1fr;
        height: 480px;
    }
    .banner-media-side {
        height: 200px;
        min-height: 200px;
    }
    .banner-copy-side {
        padding: 24px 20px;
        justify-content: flex-start;
    }
    .trending-rocket-badge {
        padding: 4px 9px;
        font-size: 8px;
    }
    .banner-headline {
        font-size: clamp(20px, 5.5vw, 24px);
        margin: 0 0 8px;
        line-height: 1.2;
    }
    .banner-abstract {
        font-size: 12px;
        line-height: 1.55;
        margin-bottom: 18px;
        -webkit-line-clamp: 3;
    }
    .banner-cta-row .primary-button {
        min-height: 38px;
        padding: 0 16px;
        font-size: 10px;
    }
    .banner-nav-bar {
        right: 20px;
        bottom: 16px;
    }

    .featured-articles-grid {
        grid-template-columns: 1fr;
    }

    /* Library cards stay purely horizontal */
    .glass-article-card {
        flex: 0 0 85%;
        min-height: 260px;
    }

    /* 4 Left, 4 Right symmetric grid */
    .topic-grid {
        grid-template-columns: 1fr 1fr;
    }
    .topic-cell {
        min-height: 54px;
        padding: 0 14px;
        font-size: 10.5px;
    }
    .topic-cell:nth-child(2n) {
        border-right: 0;
    }
    .topic-cell:nth-last-child(-n+2) {
        border-bottom: 0;
    }

    .tape-ticker {
        padding: 20px 0;
        margin-bottom: 60px;
    }
    .ticker-group {
        font-size: 13px;
        gap: 24px;
        padding-right: 24px;
    }
}
/* =========================================================
   PURE TEXT MINIMAL END MESSAGE (NO BOX / NO BORDER / NO CARD)
   ========================================================= */
.blogs-end-message-wrap {
    width: 100%;
    padding: 70px 20px 90px;
    text-align: center;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Initial Resting Hidden State (No Background / No Border) */
.blogs-end-message-content {
    max-width: 680px;
    margin: 0 auto;
    opacity: 0;
    transform: scale(0.85) translateY(28px);
    filter: blur(10px);
    transition: 
        opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.9s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.9s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform, filter;
}

/* Ultra-Smooth Pop & De-blur Trigger */
.blogs-end-message-content.is-visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0px);
}

.end-kicker {
    display: block;
    font-family: "Manrope", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: var(--global-accent, #b9d6c7);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.end-text {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(24px, 3.2vw, 36px);
    font-weight: 700;
    letter-spacing: -0.035em;
    color: var(--global-text, #f1f0e9);
    line-height: 1.25;
}

.end-text em {
    font-family: "Playfair Display", serif;
    font-style: italic;
    font-weight: 400;
    color: rgba(241, 240, 233, 0.45);
}

@media (max-width: 600px) {
    .blogs-end-message-wrap {
        padding: 50px 16px 70px;
    }
}