/**
 * Vision Jeunesse Nouvelle — Magazine Newsroom Stylesheet
 * High-end editorial magazine layout with top ticker, hero slider, and masonry view
 */

:root {
    --mag-primary: #0d47a1;
    --mag-navy: #07152d;
    --mag-dark: #0f172a;
    --mag-teal: #00695c;
    --mag-crimson: #e11d48;
    --mag-amber: #f59e0b;
    --mag-border: #e2e8f0;
    --mag-card-bg: #ffffff;
    --mag-muted: #64748b;
    --mag-serif: "Merriweather", Georgia, "Times New Roman", serif;
    --mag-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.magazine-newsroom {
    font-family: var(--mag-sans);
    color: var(--mag-dark);
    background-color: #f8fafc;
    overflow-x: hidden;
}

/* ==========================================================================
   1. TOP BREAKING NEWS TICKER
   ========================================================================== */
.mag-ticker-bar {
    background: #07152d;
    color: #f8fafc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    position: relative;
    z-index: 40;
}

.mag-ticker-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
}

.mag-ticker-badge {
    background: linear-gradient(135deg, #e11d48 0%, #b91c1c 100%);
    color: #ffffff;
    font-size: 0.725rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(225, 29, 72, 0.4);
}

.mag-ticker-badge__pulse {
    width: 7px;
    height: 7px;
    background: #ffffff;
    border-radius: 50%;
    animation: magPulse 1.5s infinite;
}

@keyframes magPulse {
    0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
    70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 6px rgba(255,255,255,0); }
    100% { transform: scale(0.9); opacity: 1; }
}

.mag-ticker-carousel {
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 26px;
}

.mag-ticker-track {
    display: flex;
    flex-direction: column;
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.mag-ticker-item {
    height: 26px;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mag-ticker-link {
    color: #e2e8f0;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mag-ticker-link:hover {
    color: #fef08a;
}

.mag-ticker-time {
    color: #94a3b8;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.mag-ticker-ctrls {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.mag-ticker-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #cbd5e1;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mag-ticker-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ==========================================================================
   2. MAGAZINE MASTHEAD
   ========================================================================== */
.mag-masthead {
    background: #ffffff;
    border-bottom: 2px solid var(--mag-dark);
    padding: 1.25rem 0;
}

.mag-masthead__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--mag-muted);
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.mag-masthead__title-wrap {
    text-align: center;
    padding: 0.5rem 0;
}

.mag-masthead__edition {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mag-primary);
    display: block;
    margin-bottom: 0.25rem;
}

.mag-masthead__title {
    font-family: var(--mag-sans);
    font-weight: 900;
    font-size: clamp(2rem, 4.5vw, 3.2rem);
    letter-spacing: -0.03em;
    color: var(--mag-dark);
    margin: 0;
    line-height: 1.1;
}

.mag-masthead__tagline {
    font-size: 0.95rem;
    color: var(--mag-muted);
    font-style: italic;
    margin-top: 0.35rem;
}

/* ==========================================================================
   3. MAGAZINE HERO SLIDER (LATEST / FEATURED STORIES)
   ========================================================================== */
.mag-hero-slider-section {
    padding: 2.25rem 0;
    background: #ffffff;
    border-bottom: 1px solid var(--mag-border);
}

.mag-slider-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .mag-slider-layout {
        grid-template-columns: 2fr 1fr;
    }
}

/* Main Slide Stage */
.mag-stage {
    position: relative;
    border-radius: 1.25rem;
    overflow: hidden;
    background: var(--mag-navy);
    min-height: 480px;
    height: 100%;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.2);
}

.mag-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, transform 0.6s ease;
    transform: scale(1.02);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 2.5rem;
    color: #ffffff;
    z-index: 1;
}

.mag-slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
    z-index: 2;
}

.mag-slide__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform 6s ease-out;
}

.mag-slide.is-active .mag-slide__bg {
    transform: scale(1.06);
}

.mag-slide__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(7, 21, 45, 0.2) 0%, rgba(7, 21, 45, 0.65) 50%, rgba(7, 21, 45, 0.95) 100%);
    z-index: -1;
}

.mag-slide__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #e11d48;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    width: fit-content;
}

.mag-slide__title {
    font-size: clamp(1.5rem, 2.5vw, 2.2rem);
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;
    margin-bottom: 0.85rem;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.mag-slide__title a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mag-slide__title a:hover {
    color: #fef08a;
}

.mag-slide__excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.25rem;
    max-width: 650px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mag-slide__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.825rem;
    color: rgba(255, 255, 255, 0.75);
}

.mag-slide__author {
    font-weight: 600;
    color: #ffffff;
}

/* Slider Controls */
.mag-stage__nav {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    z-index: 10;
    display: flex;
    gap: 0.5rem;
}

.mag-nav-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.mag-nav-btn:hover {
    background: #ffffff;
    color: var(--mag-dark);
    transform: scale(1.05);
}

/* Sidebar Playlist (Right Side of Slider) */
.mag-playlist {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    height: 100%;
    justify-content: space-between;
}

.mag-playlist-item {
    background: #ffffff;
    border: 1.5px solid var(--mag-border);
    border-radius: 1rem;
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    position: relative;
    overflow: hidden;
}

.mag-playlist-item:hover {
    border-color: #93c5fd;
    background: #f8fafc;
    transform: translateX(4px);
}

.mag-playlist-item.is-active {
    border-color: var(--mag-primary);
    background: #eff6ff;
    box-shadow: 0 4px 15px rgba(13, 71, 161, 0.1);
}

.mag-playlist-item.is-active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--mag-primary);
}

.mag-playlist-thumb {
    width: 64px;
    height: 64px;
    border-radius: 0.65rem;
    object-fit: cover;
    flex-shrink: 0;
}

.mag-playlist-title {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--mag-dark);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mag-playlist-meta {
    font-size: 0.725rem;
    color: var(--mag-muted);
}

/* ==========================================================================
   4. CATEGORY FILTER NAVIGATION & SEARCH
   ========================================================================== */
.mag-filter-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--mag-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
}

.mag-pills {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
}

.mag-pill {
    padding: 0.5rem 1.1rem;
    border-radius: 9999px;
    font-size: 0.825rem;
    font-weight: 600;
    color: #475569;
    background: #f1f5f9;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.mag-pill:hover {
    background: #e2e8f0;
    color: var(--mag-dark);
}

.mag-pill.active {
    background: var(--mag-primary);
    color: #ffffff;
    border-color: var(--mag-primary);
    box-shadow: 0 4px 12px rgba(13, 71, 161, 0.25);
}

.mag-pill-count {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.08);
}

.mag-pill.active .mag-pill-count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

/* Search Box */
.mag-search-input {
    border-radius: 9999px;
    border: 1.5px solid #cbd5e1;
    padding: 0.5rem 1.1rem 0.5rem 2.4rem;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    background-color: #f8fafc;
}

.mag-search-input:focus {
    background-color: #ffffff;
    border-color: var(--mag-primary);
    box-shadow: 0 0 0 3px rgba(13, 71, 161, 0.12);
    outline: none;
}

/* ==========================================================================
   5. MASONRY GRID SYSTEM
   ========================================================================== */
.mag-masonry-section {
    padding: 3.5rem 0;
}

.mag-masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

@media (max-width: 992px) {
    .mag-masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 600px) {
    .mag-masonry-grid {
        column-count: 1;
    }
}

.mag-card {
    break-inside: avoid;
    margin-bottom: 1.5rem;
    background: #ffffff;
    border: 1px solid var(--mag-border);
    border-radius: 1.25rem;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
    position: relative;
    display: flex;
    flex-direction: column;
}

.mag-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 35px -10px rgba(15, 23, 42, 0.12);
    border-color: #93c5fd;
}

.mag-card__img-wrap {
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
}

.mag-card__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.mag-card:hover .mag-card__img {
    transform: scale(1.05);
}

.mag-card__cat-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    color: #ffffff;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2;
}

.mag-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.mag-card__meta-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--mag-muted);
    margin-bottom: 0.65rem;
}

.mag-card__title {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--mag-dark);
    margin-bottom: 0.65rem;
    letter-spacing: -0.01em;
}

.mag-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mag-card__title a:hover {
    color: var(--mag-primary);
}

.mag-card__excerpt {
    font-size: 0.8875rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 1.25rem;
}

.mag-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.85rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.8rem;
    color: var(--mag-muted);
    margin-top: auto;
}

.mag-card__read-link {
    font-weight: 700;
    color: var(--mag-primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: transform 0.2s ease;
}

.mag-card__read-link:hover {
    transform: translateX(3px);
    color: #0b377b;
}

/* Card Variation: Quote / Story Card */
.mag-card--quote {
    background: linear-gradient(135deg, #092047 0%, #0d47a1 100%);
    color: #ffffff;
    border: none;
}

.mag-card--quote .mag-card__body {
    padding: 2rem;
}

.mag-card--quote .mag-card__quote-text {
    font-family: var(--mag-serif);
    font-size: 1.15rem;
    line-height: 1.65;
    font-style: italic;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.mag-card--quote .mag-card__footer {
    border-top-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
}

.mag-card--quote .mag-card__read-link {
    color: #fef08a;
}

/* ==========================================================================
   6. TRENDING SPOTLIGHT ROW
   ========================================================================== */
.mag-trending-section {
    background: #07152d;
    color: #ffffff;
    padding: 4rem 0;
}

.mag-trending-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.mag-trending-num {
    font-size: 2.2rem;
    font-weight: 900;
    line-height: 1;
    color: var(--mag-amber);
    opacity: 0.9;
    font-family: var(--mag-sans);
    flex-shrink: 0;
}

.mag-trending-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 0.35rem;
}

.mag-trending-content a {
    color: #f1f5f9;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mag-trending-content a:hover {
    color: var(--mag-amber);
}

.mag-trending-content small {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* ==========================================================================
   7. NEWSLETTER CARD
   ========================================================================== */
.mag-newsletter-box {
    background: linear-gradient(135deg, #0d47a1 0%, #00695c 100%);
    border-radius: 1.5rem;
    padding: 3rem 2.5rem;
    color: #ffffff;
    box-shadow: 0 20px 40px -10px rgba(13, 71, 161, 0.3);
    position: relative;
    overflow: hidden;
}

.mag-newsletter-box__pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.5px, transparent 1.5px);
    background-size: 24px 24px;
    opacity: 0.5;
}
