/* ════════════════════════════════════════════════════════════════════
   magazine_index.css — Magazine homepage / category page styles
   ────────────────────────────────────────────────────────────────────
   Loaded ALONGSIDE main style.css and category.css.
   - main style.css  → tokens, .breadcrumb-nav, .pagination, .visually-hidden
   - category.css    → .cat-magazine-* (the article card system)
   - this file       → hero, categories chips, posts grid wrapper,
                       per-card meta row (date), empty state
   ════════════════════════════════════════════════════════════════════ */


/* ════════════════════════════════════════════════════════════════════
   1. HERO — Compact text-only with subtle gradient
   ════════════════════════════════════════════════════════════════════ */
.mag-hero {
    position: relative;
    padding: 50px 0 56px;
    background:
        radial-gradient(ellipse 800px 400px at 50% 0%, var(--primary-50) 0%, transparent 60%),
        linear-gradient(180deg, #fff 0%, var(--bg-section) 100%);
    overflow: hidden;
    isolation: isolate;
}

/* Decorative icons — magazine themed */
.mag-hero-deco {
    position: absolute;
    color: var(--primary);
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
}
.mag-hero-deco-1 {
    top: 20%;
    right: 8%;
    font-size: 8rem;
    transform: rotate(-12deg);
}
.mag-hero-deco-2 {
    bottom: 18%;
    left: 10%;
    font-size: 7rem;
    transform: rotate(15deg);
}

.mag-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.mag-hero-title {
    font-family: var(--font-secondary);
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 900;
    color: var(--gray-900);
    line-height: 1.2;
    margin: 0 0 12px;
    letter-spacing: -0.5px;
}

.mag-hero-desc {
    font-size: clamp(0.95rem, 1.3vw, 1.05rem);
    line-height: 1.7;
    color: var(--gray-600);
    max-width: 640px;
    margin: 0 auto;
}


/* ════════════════════════════════════════════════════════════════════
   2. CATEGORIES CHIP ROW — horizontal scrollable on mobile
   ════════════════════════════════════════════════════════════════════ */
.mag-cats-row {
    padding: 20px 0 0;
    background: var(--bg-section);
}
.mag-cats-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.mag-cat-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-full);
    background: #fff;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.mag-cat-chip:hover {
    background: var(--primary-50);
    border-color: var(--primary-100);
    color: var(--primary-dark);
    transform: translateY(-1px);
}
.mag-cat-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px rgba(29, 111, 164, 0.22);
}
.mag-cat-chip i {
    font-size: 0.95rem;
}
.mag-cat-chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 8px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    color: var(--gray-700);
    font-size: 0.72rem;
    font-weight: 700;
}
.mag-cat-chip:hover .mag-cat-chip-count {
    background: var(--primary-100);
    color: var(--primary-dark);
}
.mag-cat-chip.active .mag-cat-chip-count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}


/* ════════════════════════════════════════════════════════════════════
   3. POSTS GRID — full width (no sidebar on this page)
   ════════════════════════════════════════════════════════════════════ */
.mag-posts {
    padding: 32px 0 60px;
    background: var(--bg-section);
}

.mag-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 22px;
}

/* Per-card additions (most card styles inherited from .cat-magazine-card in category.css).
   We add a meta row at the bottom with date + CTA aligned. */
.mag-post-card .cat-magazine-card-body {
    /* Keep the body flex so meta row sticks to bottom */
    display: flex;
    flex-direction: column;
}

.mag-post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px dashed var(--gray-200);
}
.mag-post-card-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78rem;
    color: var(--gray-500);
    font-weight: 500;
}
.mag-post-card-date i {
    font-size: 0.95rem;
    color: var(--primary);
}
/* The CTA inside the meta row no longer needs top margin since it's inline */
.mag-post-card-meta .cat-magazine-card-cta {
    margin-top: 0;
}


/* ════════════════════════════════════════════════════════════════════
   4. EMPTY STATE — when no posts in category
   ════════════════════════════════════════════════════════════════════ */
.mag-empty {
    text-align: center;
    padding: 60px 24px;
    background: #fff;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius-lg);
}
.mag-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-50), var(--earth-cream));
    color: var(--primary);
    font-size: 2.2rem;
    margin: 0 auto 18px;
}
.mag-empty-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--gray-900);
    margin: 0 0 8px;
}
.mag-empty-subtitle {
    font-size: 0.95rem;
    color: var(--gray-500);
    margin: 0 0 22px;
}
.mag-empty-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: var(--radius-full);
    background: var(--primary-50);
    border: 1px solid var(--primary-100);
    color: var(--primary-dark);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all var(--transition-fast);
}
.mag-empty-back:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}


/* ════════════════════════════════════════════════════════════════════
   5. RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .mag-hero {
        padding: 36px 0 40px;
    }
    .mag-hero-deco {
        font-size: 5rem !important;
    }

    .mag-cats-row {
        padding-top: 16px;
    }
    .mag-cats-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        scroll-snap-type: x mandatory;
        padding: 4px 16px;
        margin: 0 -16px;
        scrollbar-width: none;
    }
    .mag-cats-list::-webkit-scrollbar {
        display: none;
    }
    .mag-cat-chip {
        scroll-snap-align: start;
        flex-shrink: 0;
    }

    .mag-posts {
        padding: 24px 0 50px;
    }
    .mag-posts-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}


/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .mag-cat-chip:hover {
        transform: none;
    }
}
