/**
 * Blog Archive — editorial listing layout
 * @package SwitchAndSave_EPOS
 */

/* ── Font + base ─────────────────────────────────────────── */
.ba-page,
.ba-page *,
.ba-page *::before,
.ba-page *::after {
    box-sizing: border-box;
    font-family: var(--font-sans, 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif);
}

.ba-page {
    color: #0f172a;
    background: #f8fafc;
}

.ba-page a { text-decoration: none; }
.ba-page img { max-width: 100%; height: auto; display: block; }

/* ── Page hero ───────────────────────────────────────────── */
.ba-hero {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 2.75rem 0 0;
}

.ba-hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.ba-hero-kicker {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #2563eb;
    margin-bottom: 0.6rem;
}

.ba-hero-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #0f172a;
    margin: 0 0 0.65rem;
}

.ba-hero-sub {
    font-size: 1rem;
    color: #64748b;
    max-width: 480px;
    margin: 0 auto 2rem;
    line-height: 1.65;
}

/* ── Category description (below pagination) ─────────────── */
.ba-cat-desc {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 2.5rem 1.5rem;
}
.ba-cat-desc-inner {
    max-width: 760px;
    margin: 0 auto;
}
.ba-cat-desc-heading {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    margin: 0 0 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.ba-cat-desc-heading::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.ba-cat-desc-body {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.8;
}
.ba-cat-desc-body p { margin: 0 0 0.9rem; }
.ba-cat-desc-body p:last-child { margin-bottom: 0; }
.ba-cat-desc-body ul,
.ba-cat-desc-body ol {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0.5rem 0 0.9rem;
}
.ba-cat-desc-body ul { list-style: none; padding: 0; }
.ba-cat-desc-body ul li {
    padding-left: 1.3rem;
    position: relative;
}
.ba-cat-desc-body ul li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.63em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #2563eb;
    flex-shrink: 0;
}
.ba-cat-desc-body ol { list-style: decimal; padding-left: 1.3rem; }
.ba-cat-desc-body strong { font-weight: 700; color: #0f172a; }
.ba-cat-desc-body a { color: #2563eb; text-decoration: underline; text-underline-offset: 2px; }

/* ── Category filter pills ───────────────────────────────── */
.ba-cats-wrap {
    position: relative;
    padding: 0 1.5rem;
}

.ba-cats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 0 1.5rem;
}

.ba-cat-link {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 1.1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid #e2e8f0;
    background: #fff;
    color: #475569;
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    white-space: nowrap;
    line-height: 1.4;
}
.ba-cat-link:hover {
    background: #eff6ff;
    color: #2563eb;
    border-color: #bfdbfe;
    box-shadow: 0 2px 8px rgba(37,99,235,.12);
}
.ba-cat-link--active {
    background: #2563eb !important;
    color: #fff !important;
    border-color: #2563eb !important;
    box-shadow: 0 2px 10px rgba(37,99,235,.25);
}

/* ── Main container ──────────────────────────────────────── */
.ba-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ── No posts ────────────────────────────────────────────── */
.ba-empty {
    text-align: center;
    padding: 5rem 0;
    color: #94a3b8;
}
.ba-empty p { font-size: 1rem; color: #64748b; margin-top: 1rem; }

/* ── Category badge ──────────────────────────────────────── */
.ba-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    flex-shrink: 0;
    transition: opacity .15s;
    text-decoration: none;
}
.ba-badge:hover { opacity: .82; }

.ba-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* ── Featured (hero) article ─────────────────────────────── */
.ba-featured {
    display: grid;
    grid-template-columns: 55% 45%;
    min-height: 380px;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(15,23,42,.04), 0 12px 36px rgba(15,23,42,.09);
    margin-bottom: 2.5rem;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
}
.ba-featured:hover {
    box-shadow: 0 4px 8px rgba(15,23,42,.06), 0 20px 52px rgba(15,23,42,.14);
    transform: translateY(-2px);
}

/* Image fills its column fully via absolute positioning */
.ba-featured-img {
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
}
.ba-featured-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.ba-featured:hover .ba-featured-img img { transform: scale(1.04); }

.ba-featured-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.85rem;
    padding: 2.25rem 2rem;
    border-left: 1px solid #f1f5f9;
}

.ba-feat-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #2563eb;
}

.ba-featured-title {
    font-size: clamp(1.25rem, 2.4vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: #0f172a;
    margin: 0;
    transition: color .15s;
}
.ba-featured:hover .ba-featured-title { color: #2563eb; }

.ba-featured-excerpt {
    font-size: 0.925rem;
    line-height: 1.7;
    color: #64748b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ba-featured-meta {
    display: flex;
    align-items: center;
    gap: 0.35rem 0.75rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: #94a3b8;
}
.ba-featured-meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.ba-featured-meta-dot { font-size: 0.85rem; color: #cbd5e1; }

.ba-featured-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #2563eb;
    margin-top: 0.25rem;
    transition: gap .15s;
}
.ba-featured:hover .ba-featured-cta { gap: 0.65rem; }

/* ── Section heading ─────────────────────────────────────── */
.ba-section-title {
    font-size: 1rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.01em;
    margin: 0 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.ba-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Card grid ───────────────────────────────────────────── */
.ba-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

/* ── Article card ────────────────────────────────────────── */
.ba-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    color: inherit;
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}
.ba-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 32px rgba(15,23,42,.11);
}

.ba-card-img {
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}
.ba-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.ba-card:hover .ba-card-img img { transform: scale(1.05); }

.ba-card-img-badge {
    position: absolute;
    top: 9px;
    left: 9px;
}

.ba-no-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
}

.ba-card-body {
    padding: 1rem 1.1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.ba-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    color: #0f172a;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .15s;
}
.ba-card:hover .ba-card-title { color: #2563eb; }

.ba-card-excerpt {
    font-size: 0.82rem;
    line-height: 1.6;
    color: #64748b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ba-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px solid #f1f5f9;
}

.ba-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.72rem;
    color: #94a3b8;
}
.ba-card-meta span { display: inline-flex; align-items: center; gap: 0.25rem; }

.ba-card-read {
    font-size: 0.76rem;
    font-weight: 700;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

/* ── Pagination ──────────────────────────────────────────── */
.ba-pagination {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

.ba-pagination ul.page-numbers {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.ba-pagination ul.page-numbers li > * {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 0.75rem;
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    font-family: inherit;
    transition: background .15s, border-color .15s, color .15s;
}
.ba-pagination ul.page-numbers li > a:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
}
.ba-pagination ul.page-numbers li > .current {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.ba-pagination ul.page-numbers li > .dots {
    border: none;
    background: none;
    color: #94a3b8;
    cursor: default;
}
.ba-pagination ul.page-numbers li > .prev,
.ba-pagination ul.page-numbers li > .next {
    gap: 0.3rem;
    padding: 0 1rem;
    font-size: 1rem;
    font-weight: 700;
    color: #2563eb;
    border-color: #bfdbfe;
    background: #eff6ff;
}
.ba-pagination ul.page-numbers li > .prev:hover,
.ba-pagination ul.page-numbers li > .next:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}
.ba-pag-arrow {
    font-size: 1.1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* ── CTA strip ───────────────────────────────────────────── */
.ba-cta {
    background: linear-gradient(135deg, #004a8d 0%, #1d4ed8 100%);
    padding: 3rem 1.5rem;
    text-align: center;
}
.ba-cta-inner { max-width: 540px; margin: 0 auto; }

.ba-cta-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 0.5rem;
    line-height: 1.25;
}
.ba-cta-sub {
    font-size: 0.95rem;
    color: rgba(255,255,255,.82);
    margin: 0 0 1.5rem;
    line-height: 1.6;
}
.ba-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: #fff;
    color: #004a8d;
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 10px;
    text-decoration: none;
    transition: transform .18s, box-shadow .18s;
    box-shadow: 0 4px 18px rgba(0,0,0,.18);
}
.ba-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(0,0,0,.26);
    color: #004a8d;
}

/* ── Responsive ──────────────────────────────────────────── */

/* Large tablet – 2-col card grid */
@media (max-width: 1024px) {
    .ba-grid { grid-template-columns: repeat(2, 1fr); }
    .ba-main { padding: 2rem 1.25rem 3.5rem; }
}

/* Tablet portrait – stack featured card */
@media (max-width: 860px) {
    .ba-featured {
        grid-template-columns: 1fr;
        min-height: unset;
    }
    .ba-featured-img {
        height: 260px;
        position: relative;
    }
    .ba-featured-img img {
        position: absolute;
        inset: 0;
    }
    .ba-featured-body {
        padding: 1.5rem;
        border-left: none;
        border-top: 1px solid #f1f5f9;
    }
    .ba-featured-title { font-size: 1.3rem; }
    .ba-featured-excerpt { -webkit-line-clamp: 4; }
}

/* Large phone */
@media (max-width: 640px) {
    .ba-hero { padding: 1.75rem 0 0; }
    .ba-hero-inner { padding: 0 1rem; }
    .ba-hero-title { font-size: clamp(1.6rem, 6vw, 2rem); }
    .ba-hero-sub { font-size: 0.9rem; margin-bottom: 1.25rem; }

    /* Category pills: smaller + wrap on mobile */
    .ba-cats-wrap { padding: 0 1rem; }
    .ba-cats { gap: 0.4rem; padding: 0.25rem 0 1.25rem; justify-content: flex-start; }
    .ba-cat-link { font-size: 0.76rem; padding: 0.35rem 0.85rem; }

    .ba-main { padding: 1.5rem 1rem 3rem; }
    /* 2-col card grid on large phones */
    .ba-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }

    .ba-featured { margin-bottom: 1.5rem; }
    .ba-featured-img { height: 200px; }
    .ba-featured-body { padding: 1.25rem; gap: 0.6rem; }
    .ba-featured-title { font-size: 1.2rem; }
    .ba-featured-excerpt { -webkit-line-clamp: 3; }
    .ba-featured-cta { font-size: 0.82rem; }

    .ba-section-title { font-size: 0.9rem; }

    /* CTA strip */
    .ba-cta { padding: 2rem 1rem; }
    .ba-cta-btn { width: 100%; justify-content: center; }

    /* Category description */
    .ba-cat-desc { padding: 2rem 1rem; }
    .ba-cat-desc-heading { font-size: 0.95rem; }
    .ba-cat-desc-body { font-size: 0.9rem; }
}

/* Small phone – 1-col card grid */
@media (max-width: 480px) {
    .ba-hero-title { font-size: clamp(1.4rem, 7.5vw, 1.75rem); }
    .ba-hero-sub { font-size: 0.875rem; }

    .ba-grid { grid-template-columns: 1fr; gap: 0.9rem; }

    .ba-featured-img { height: 180px; }
    .ba-featured-body { padding: 1.1rem; gap: 0.5rem; }
    .ba-featured-title { font-size: 1.1rem; }

    .ba-pagination ul.page-numbers li > * {
        min-width: 34px;
        height: 34px;
        font-size: 0.8rem;
        padding: 0 0.5rem;
    }
    .ba-pagination ul.page-numbers li > .prev,
    .ba-pagination ul.page-numbers li > .next { padding: 0 0.7rem; }

    .ba-card-title { font-size: 0.9rem; }
    .ba-card-excerpt { font-size: 0.8rem; }
}

/* Ultra-small */
@media (max-width: 360px) {
    .ba-hero-inner { padding: 0 0.75rem; }
    .ba-cats-wrap { padding: 0 0.75rem; }
    .ba-cats { gap: 0.3rem; padding-bottom: 1rem; }
    .ba-cat-link { font-size: 0.72rem; padding: 0.3rem 0.7rem; }
    .ba-main { padding: 1.25rem 0.75rem 2.5rem; }
    .ba-featured-img { height: 160px; }
    .ba-cta { padding: 1.75rem 0.75rem; }
    .ba-hero-title { font-size: 1.35rem; }
    .ba-cat-desc { padding: 1.75rem 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    .ba-card, .ba-featured, .ba-cta-btn { transition: none; }
    .ba-card-img img, .ba-featured-img img { transition: none; }
}
