/* ============================================================
   ClariMoney Blog — Category page styles (blog-category.css)
   Scope: ONLY .cat-hero--v2 / .cat-toolbar / .cat-search /
   .cat-empty / .cat-pagination / .cat-featured — every selector
   here is namespaced so it cannot leak onto the homepage, search
   page, or article page. Load AFTER blog.css. Reuses existing
   tokens (--primary, --gradient-primary, --card-radius,
   --shadow-*, --accent, --neutral-*) — no new tokens invented.
   ============================================================ */

/* ── 1. Hero (reduced height, ~40% shorter than .cat-hero) ──── */
.cat-hero--v2 {
    position: relative;
    background: var(--gradient-primary);
    color: #fff;
    padding: 0 16px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
    margin-bottom: 40px;
}
@media (min-width: 640px) {
    .cat-hero--v2 { min-height: 250px; padding: 0 24px; margin-bottom: 48px; }
}

/* Subtle radial gradient glow, matches homepage hero language */
.cat-hero--v2::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 90% at 50% 20%, rgba(255,255,255,.10) 0%, rgba(255,255,255,0) 65%);
    pointer-events: none;
    z-index: -1;
}

/* Optional faint finance pattern — pure CSS, 5% opacity, decorative only */
.cat-hero--v2::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .05;
    background-image:
        radial-gradient(circle, #fff 2px, transparent 2.5px),
        linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px);
    background-size: 42px 42px, 84px 84px;
    background-position: 0 0, 0 0;
    pointer-events: none;
    z-index: -1;
}

.cat-hero--v2-inner {
    position: relative;
    z-index: 1;
    max-width: 650px;
    margin: 0 auto;
    padding: 28px 0;
}

.cat-hero--v2-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    margin-bottom: .9rem;
    transition: transform .3s ease, background .3s ease;
}
.cat-hero--v2-icon svg { width: 30px; height: 30px; }
.cat-hero--v2:hover .cat-hero--v2-icon {
    transform: scale(1.06);
    background: rgba(255,255,255,.18);
}

.cat-hero--v2-title {
    font-size: clamp(1.6rem, 4vw, 2.35rem);
    font-weight: 700;
    letter-spacing: -.03em;
    line-height: 1.15;
    margin-bottom: .55rem;
}

.cat-hero--v2-sub {
    font-size: clamp(.92rem, 1.6vw, 1.02rem);
    color: rgba(255,255,255,.82);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

.cat-hero--v2-count {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    margin-top: 1rem;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(255,255,255,.72);
}
.cat-hero--v2-count::before {
    content: "";
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--accent-light);
}

/* ── 2. Toolbar (chips + search) ─────────────────────────────── */
.cat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--neutral-200);
}

.cat-toolbar-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.cat-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--neutral-200);
    background: var(--white);
    color: var(--neutral-700);
    font-size: .85rem;
    font-weight: 600;
    padding: .5rem 1.1rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background .3s ease, border-color .3s ease, color .3s ease, transform .3s ease;
    white-space: nowrap;
}
.cat-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}
.cat-chip.is-active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}

/* ── 3. Search box ────────────────────────────────────────────── */
.cat-search {
    position: relative;
    width: 280px;
    max-width: 100%;
    flex-shrink: 0;
}
.cat-search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neutral-500);
    pointer-events: none;
    display: flex;
    transition: color .3s ease;
}
.cat-search-icon svg { width: 17px; height: 17px; }

.cat-search-input {
    width: 100%;
    height: 46px;
    padding: 0 1rem 0 42px;
    border: 2px solid var(--neutral-200);
    border-radius: 999px;
    font-size: .9rem;
    background: var(--white);
    color: var(--neutral-900);
    outline: none;
    box-shadow: var(--shadow-sm);
    transition: border-color .3s ease, box-shadow .3s ease;
}
.cat-search-input::placeholder { color: var(--neutral-500); }
.cat-search-input:hover { border-color: var(--neutral-300); }

/* Override blog.css's global input:focus-visible rule (3px square
   outline + 4px radius) which otherwise draws a rectangle on top
   of this pill-shaped input. Higher specificity + later in source
   order than that global rule, so this wins reliably. */
.cat-search-input:focus,
.cat-search-input:focus-visible {
    outline: none;
    border-color: var(--primary);
    border-radius: 999px;
    box-shadow: 0 0 0 4px rgba(30,74,122,.16);
}
.cat-search-input:focus + .cat-search-icon,
.cat-search:focus-within .cat-search-icon {
    color: var(--primary);
}

/* -webkit search inputs (Chrome/Safari) sometimes render their own
   native decorations/rounding that can conflict with border-radius —
   normalize to plain text-input behavior so our pill shape always wins. */
.cat-search-input {
    -webkit-appearance: none;
    appearance: none;
}
.cat-search-input::-webkit-search-decoration,
.cat-search-input::-webkit-search-cancel-button,
.cat-search-input::-webkit-search-results-button,
.cat-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
}

@media (max-width: 640px) {
    .cat-toolbar { flex-direction: column; align-items: stretch; }
    .cat-toolbar-chips { justify-content: flex-start; }
    .cat-search { width: 100%; }
}

/* ── 4. Grid spacing (28px gap per spec, layout unchanged) ────── */
.cat-articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
}
@media (min-width: 640px) {
    .cat-articles-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
    .cat-articles-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── 5. Featured card wrapper (reuses .article-card--featured,
        just widens it into a banner layout on desktop) ───────── */
.cat-featured {
    margin-bottom: 2.5rem;
}
.cat-featured .article-card {
    transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
@media (min-width: 780px) {
    .cat-featured .article-card {
        flex-direction: row;
        min-height: 260px;
    }
    .cat-featured .article-card-thumb {
        width: 46%;
        aspect-ratio: auto;
        flex-shrink: 0;
    }
    .cat-featured .article-card-body {
        padding: 2rem 2.25rem;
        justify-content: center;
    }
    .cat-featured .article-card-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    .cat-featured .article-card-excerpt {
        font-size: .95rem;
        -webkit-line-clamp: 3;
    }
}
.cat-featured-label {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--accent);
    margin-bottom: 1rem;
}
.cat-featured-label::before {
    content: "";
    width: 16px; height: 2px;
    background: var(--accent);
    display: inline-block;
}

/* ── 6. Empty state ───────────────────────────────────────────── */
.cat-empty {
    text-align: center;
    padding: 4rem 1.5rem;
    background: var(--neutral-100);
    border-radius: 24px;
}
.cat-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    margin-bottom: 1.5rem;
}
.cat-empty-icon svg { width: 30px; height: 30px; }
.cat-empty h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: .6rem;
}
.cat-empty p {
    max-width: 380px;
    margin: 0 auto;
    color: var(--neutral-700);
    line-height: 1.6;
    font-size: .95rem;
}

/* ── 7. Pagination ───────────────────────────────────────────── */
.cat-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    margin: 3rem 0 1rem;
    flex-wrap: wrap;
}
.cat-page-btn {
    min-width: 42px;
    height: 42px;
    padding: 0 .9rem;
    border-radius: 999px;
    border: 2px solid var(--neutral-200);
    background: var(--white);
    color: var(--neutral-700);
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .3s ease, background .3s ease, color .3s ease, transform .3s ease;
}
.cat-page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}
.cat-page-btn.is-active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}
.cat-page-btn.is-disabled {
    opacity: .4;
    pointer-events: none;
}
.cat-page-btn--nav { padding: 0 1.25rem; }

@media (max-width: 400px) {
    .cat-hero--v2 { min-height: 200px; }
    .cat-hero--v2-title { font-size: 1.5rem; }
}

/* ============================================================
   Tag page (reuses .cat-hero--v2 hero + .cat-empty + grid gap
   patterns above, so any future hero/spacing change made for
   category pages stays visually in sync here automatically)
   ============================================================ */

/* Hero icon variant for tag pages (no per-tag color/icon exists,
   so this is a plain generic circle — same size/position as the
   category hero icon for visual consistency). */
.tag-hero-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    margin-bottom: .9rem;
    font-size: 1.3rem;
    color: #fff;
}

/* "All tags" cloud — same pill language as .cat-chip on the
   category toolbar (border, radius, hover lift, active = filled). */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.tag-cloud-pill {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    border: 1px solid var(--neutral-200);
    background: var(--white);
    color: var(--neutral-700);
    font-size: .85rem;
    font-weight: 600;
    padding: .5rem 1.1rem;
    border-radius: 999px;
    text-decoration: none;
    transition: background .3s ease, border-color .3s ease, color .3s ease, transform .3s ease;
    white-space: nowrap;
}
.tag-cloud-pill:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}
.tag-cloud-pill.is-active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: #fff;
}
.tag-cloud-pill-count { opacity: .65; font-weight: 500; }

.tag-cloud-section {
    margin-top: 3rem;
    padding-top: 2.25rem;
    border-top: 1px solid var(--neutral-200);
}
.tag-cloud-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 1.25rem;
}