/* ═══════════════════════════════════════════════════════════
   PRAYAG PANDITS — BLOG ARCHIVE

   Shop archive pattern reuse (per user feedback):
   - Warm hero, sticky filter chips, card grid, AJAX load more
   Adapted for blog:
   - 3:2 image ratio, author + reading time, featured first post
   - 3-col desktop, 2-col tablet, 2-col mobile (Myntra tested)

   Uses variables from ppn-design-system.css
   ═══════════════════════════════════════════════════════════ */

:root {
    --ba-ease: cubic-bezier(0.32, 0.94, 0.6, 1);
}

/* ═══ HERO ═══ */
.ba-hero {
    padding: 48px 0 40px;
    background: linear-gradient(135deg, #fdf6ee 0%, #f5ede0 100%);
    border-bottom: 1px solid var(--ppn-border);
    text-align: center;
}
.ba-hero__eyebrow {
    font-family: var(--ppn-font-heading);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--ppn-saffron);
    display: block;
    margin-bottom: 10px;
}
.ba-hero__title {
    font-family: var(--ppn-font-body);
    font-size: clamp(1.75rem, 4vw, 2.6rem);
    font-weight: 700;
    color: var(--ppn-charcoal);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
}
.ba-hero__desc {
    font-family: var(--ppn-font-body);
    font-size: 1rem;
    color: var(--ppn-text-muted);
    max-width: 600px;
    margin: 0 auto 14px;
    line-height: 1.6;
}
.ba-hero__count {
    font-family: var(--ppn-font-heading);
    font-size: 0.78rem;
    color: var(--ppn-text-muted);
}

/* ═══ FILTER CHIPS (Shop pattern reuse) ═══ */
.ba-filter-wrap {
    position: sticky;
    top: 0;
    z-index: 90;
    background: rgba(255, 253, 251, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--ppn-border);
}
.ba-filter {
    display: flex;
    gap: 8px;
    padding: 14px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.ba-filter::-webkit-scrollbar { display: none; }

.ba-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--ppn-radius-pill);
    font-family: var(--ppn-font-heading);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ppn-text);
    background: var(--ppn-white);
    border: 1.5px solid var(--ppn-border);
    white-space: nowrap;
    text-decoration: none;
    transition: all 150ms var(--ba-ease);
    flex-shrink: 0;
}
.ba-chip:hover { border-color: var(--ppn-maroon); color: var(--ppn-maroon); }
.ba-chip--active {
    background: var(--ppn-maroon);
    color: #fff;
    border-color: var(--ppn-maroon);
}
.ba-chip__count {
    font-size: 0.62rem;
    opacity: 0.45;
    font-weight: 400;
}
.ba-chip--active .ba-chip__count { opacity: 0.7; }

/* Right-side fade gradient */
.ba-filter-wrap::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 48px;
    background: linear-gradient(to left, rgba(255, 253, 251, 0.95) 30%, transparent);
    pointer-events: none;
    z-index: 2;
}

/* ═══ POSTS GRID ═══ */
.ba-section { padding: 40px 0 48px; }

.ba-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ═══ BLOG CARD ═══ */
.ba-card {
    background: var(--ppn-white);
    border: 1px solid var(--ppn-border);
    border-radius: var(--ppn-radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 150ms var(--ba-ease);
}
.ba-card:hover {
    border-color: var(--ppn-border-hover);
    box-shadow: var(--ppn-shadow-card);
    transform: translateY(-3px);
}

/* Image — 3:2 ratio */
.ba-card__img {
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
}
.ba-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ba-ease);
}
.ba-card:hover .ba-card__img img { transform: scale(1.04); }

/* Body */
.ba-card__body {
    padding: 18px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.ba-card__cat {
    font-family: var(--ppn-font-heading);
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ppn-saffron);
    text-decoration: none;
    margin-bottom: 6px;
    display: inline-block;
    transition: color 150ms var(--ba-ease);
}
.ba-card__cat:hover { color: var(--ppn-saffron-deep); }
.ba-card__title {
    font-family: var(--ppn-font-heading);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ba-card__title a {
    color: var(--ppn-charcoal);
    text-decoration: none;
    transition: color 150ms var(--ba-ease);
}
.ba-card__title a:hover { color: var(--ppn-maroon); }

.ba-card__excerpt {
    font-family: var(--ppn-font-body);
    font-size: 0.88rem;
    color: var(--ppn-text-muted);
    line-height: 1.6;
    margin: 10px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta row */
.ba-card__meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 1px solid var(--ppn-border);
    font-family: var(--ppn-font-heading);
    font-size: 0.72rem;
    color: var(--ppn-text-muted);
}
.ba-card__author { font-weight: 600; color: var(--ppn-charcoal); }
.ba-card__sep { color: var(--ppn-text-light); }

/* ═══ FEATURED FIRST POST (full width) ═══ */
.ba-card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: stretch;
}
.ba-card--featured .ba-card__img {
    width: 50%;
    aspect-ratio: auto;
    flex-shrink: 0;
}
.ba-card--featured .ba-card__body {
    padding: 28px 32px;
    justify-content: center;
}
.ba-card--featured .ba-card__title {
    font-size: 1.35rem;
    -webkit-line-clamp: 3;
    margin-bottom: 0;
}
.ba-card--featured .ba-card__cat {
    font-size: 0.68rem;
}

/* ═══ LOAD MORE ═══ */
.ba-loadmore {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 48px 0 0;
}
.ba-loadmore__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 40px;
    border-radius: var(--ppn-radius-md);
    font-family: var(--ppn-font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    background: var(--ppn-white);
    color: var(--ppn-maroon);
    border: 2px solid var(--ppn-maroon);
    cursor: pointer;
    transition: all 150ms var(--ba-ease);
}
.ba-loadmore__btn:hover {
    background: var(--ppn-maroon);
    color: #fff;
}
.ba-loadmore__spinner { display: inline-flex; align-items: center; }
.ba-loadmore__count {
    font-family: var(--ppn-font-heading);
    font-size: 0.78rem;
    color: var(--ppn-text-muted);
    margin: 0;
}

/* ═══ SOCIAL PROOF STRIP ═══ */
.ba-proof {
    padding: 28px 0;
    border-top: 1px solid var(--ppn-border);
}
.ba-proof__grid {
    display: flex;
    justify-content: space-between;
    padding: 20px 28px;
    background: linear-gradient(135deg, #FFF8F0 0%, #FDF5EC 100%);
    border: 1px solid #F0E0CC;
    border-radius: var(--ppn-radius-lg);
}
.ba-proof__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.ba-proof__stat strong {
    font-family: var(--ppn-font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ppn-maroon);
}
.ba-proof__stat span {
    font-family: var(--ppn-font-heading);
    font-size: 0.68rem;
    color: var(--ppn-text-muted);
    text-align: center;
}

/* ═══ SHIMMER SKELETONS (Shop pattern reuse) ═══ */
.ba-card--skeleton {
    pointer-events: none;
    overflow: hidden;
}
.ba-card--skeleton .ba-card__img {
    background: var(--ppn-bg-cream);
    aspect-ratio: 3 / 2;
}
.ba-skel {
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    background: #f0ebe3;
}
.ba-skel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.5) 40%, rgba(255,255,255,0.75) 50%, rgba(255,255,255,0.5) 60%, transparent 100%);
    animation: baShimmer 1.6s ease-in-out infinite;
}
.ba-skel--d1::after { animation-delay: 0.15s; }
.ba-skel--d2::after { animation-delay: 0.3s; }
@keyframes baShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ═══ EMPTY STATE ═══ */
.ba-empty {
    text-align: center;
    padding: 80px 24px;
}
.ba-empty__icon { margin-bottom: 20px; }
.ba-empty h2 {
    font-family: var(--ppn-font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 8px;
}
.ba-empty p {
    font-family: var(--ppn-font-heading);
    font-size: 0.88rem;
    color: var(--ppn-text-muted);
    margin: 0 0 24px;
}

/* ═══ RESPONSIVE ═══ */

@media (max-width: 1024px) {
    .ba-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
    .ba-card--featured { flex-direction: column; }
    .ba-card--featured .ba-card__img { width: 100%; aspect-ratio: 16/9; }
    .ba-card--featured .ba-card__body { padding: 20px; }
    .ba-card--featured .ba-card__title { font-size: 1.15rem; }
}

@media (max-width: 768px) {
    .ba-hero { padding: 32px 0 28px; }
    .ba-hero__title { font-size: 1.5rem; }
    .ba-section { padding: 24px 0 36px; }
    .ba-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
    .ba-card__body { padding: 14px 16px; }
    .ba-card__title { font-size: 0.88rem; }
    .ba-card__excerpt { display: none; }
    .ba-card--featured .ba-card__excerpt { display: -webkit-box; }
    .ba-chip { padding: 7px 14px; font-size: 0.72rem; }
    .ba-proof__grid { flex-wrap: wrap; gap: 12px; padding: 16px 20px; }
    .ba-proof__stat { width: calc(50% - 6px); }
}

@media (max-width: 480px) {
    /* Keep 2-col on small mobile — Myntra A/B tested */
    .ba-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .ba-card__body { padding: 10px 12px; }
    .ba-card__title { font-size: 0.82rem; }
    .ba-card__meta { font-size: 0.65rem; gap: 4px; }
    .ba-hero__title { font-size: 1.3rem; }
}

@media (max-width: 375px) {
    .ba-grid { gap: 8px; }
    .ba-card__body { padding: 8px 10px; }
}

/* ═══ SCROLL CHEVRON BUTTONS ═══════════════════════════════ */
.ba-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s, transform 0.2s;
    color: var(--ppn-charcoal, #444);
    -webkit-tap-highlight-color: transparent;
}
.ba-scroll-btn:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16), 0 0 0 1px rgba(150, 0, 0, 0.1);
    color: var(--ppn-maroon, #960000);
    transform: translateY(-50%) scale(1.06);
}
.ba-scroll-btn:active { transform: translateY(-50%) scale(0.95); }
.ba-scroll-btn svg { width: 18px; height: 18px; }
.ba-scroll-btn--left { left: 8px; }
.ba-scroll-btn--right { right: 8px; }
@media (min-width: 769px) {
    .ba-scroll-btn { width: 44px; height: 44px; }
    .ba-scroll-btn svg { width: 20px; height: 20px; }
    .ba-scroll-btn--left { left: -22px; }
    .ba-scroll-btn--right { right: -22px; }
}
