/* ========================================
   BLOG - Editorial / Masonry Layout
   ======================================== */

/* === Page Header === */
.blog-hero {
    padding: 140px 0 56px;
    background-color: #f5f5f5;
    background-image: url('/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: center;
}

.blog-hero .plp-breadcrumb {
    justify-content: center;
}

html[data-theme="dark"] .blog-hero {
    background-color: #0a0a0a;
    background-image: url('/hero_section_darkmode.png');
}

.blog-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--text-3);
    margin-bottom: 22px;
}


.blog-title {
    font-family: var(--font);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 22px;
}

.blog-title em {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -1px;
}

.blog-subtitle {
    font-size: 17px;
    line-height: 1.7;
    color: var(--text-2);
    max-width: 540px;
    margin: 0 auto;
}

/* === Content wrapper === */
.blog-content {
    padding: 40px 0 80px;
    /* Subtle neutral wash, fading to the page colour at the edges, gives the
       frosted-glass tiles something to refract (same idea as the home section). */
    background: linear-gradient(180deg,
        var(--bg) 0%,
        rgba(0, 0, 0, 0.04) 50%,
        var(--bg) 100%);
}

html[data-theme="dark"] .blog-content {
    background: linear-gradient(180deg,
        var(--bg) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        var(--bg) 100%);
}

/* === Sticky frosted filter bar === */
.blog-filters {
    position: sticky;
    top: 64px;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 32px;
    padding: 16px 22px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 100px;
}

.blog-filter-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.blog-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 550;
    color: var(--text-2);
    background: none;
    border: 1px solid transparent;
    padding: 9px 16px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s var(--ease);
}

.blog-filter-tab:hover {
    color: var(--text);
    background: var(--bg-alt);
}

.blog-filter-tab.active {
    background: #3e3e41;
    color: var(--bg);
}

.blog-filter-count {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.5;
}

.blog-filter-tab.active .blog-filter-count {
    opacity: 0.7;
}

.blog-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    border-radius: 100px;
    transition: all 0.25s var(--ease);
    flex-shrink: 0;
}

.blog-search:focus-within {
    background: var(--bg-alt);
}

.blog-search svg {
    color: var(--text-3);
    flex-shrink: 0;
}

.blog-search input {
    font-family: var(--font);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    background: none;
    border: none;
    outline: none;
    width: 160px;
}

.blog-search input::placeholder {
    color: var(--text-3);
}

/* === Featured "cover story" === */
.blog-featured {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    background: var(--bg-alt);
    border-radius: 28px;
    overflow: hidden;
    margin-bottom: 56px;
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.blog-featured:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 70px -28px rgba(0, 0, 0, 0.28);
}

.blog-featured.hidden,
.blog-featured-article.hidden {
    display: none;
}

.blog-featured-image {
    position: relative;
    min-height: 440px;
    overflow: hidden;
}

.blog-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    inset: 0;
    transition: transform 0.6s var(--ease);
}

.blog-featured:hover .blog-featured-image img {
    transform: scale(1.05);
}

.blog-featured-body {
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-featured-body h2 {
    font-family: var(--font-serif);
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 400;
    letter-spacing: -0.5px;
    line-height: 1.12;
    margin-bottom: 18px;
}

.blog-featured-body p {
    font-size: 15px;
    line-height: 1.75;
    color: var(--text-2);
    margin-bottom: 26px;
    max-width: 440px;
}

.blog-featured-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-top: 26px;
}

.blog-featured-link svg {
    transition: transform 0.3s var(--ease);
}

.blog-featured:hover .blog-featured-link svg {
    transform: translate(3px, -3px);
}

/* === Tags (shared) === */
.blog-card-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.blog-card-tags span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text);
    padding: 4px 11px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 100px;
}

/* === Meta (shared) === */
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-3);
}

.blog-author {
    display: flex;
    align-items: center;
    gap: 8px;
}

.blog-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--text);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    overflow: hidden;
}

.blog-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-author span {
    font-weight: 550;
    color: var(--text);
}

.blog-read-time {
    position: relative;
    padding-left: 15px;
}

.blog-read-time::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 3px;
    background: var(--text-3);
    border-radius: 50%;
}

/* === Bento grid (true CSS grid, image-led overlay tiles) === */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 240px;
    grid-auto-flow: row dense;
    gap: 18px;
}

.blog-grid article {
    min-width: 0;
}

.blog-grid article.hidden {
    display: none;
}

/* Tile rhythm - big hero, wide, and tall tiles repeat every 6 */
.blog-grid article:nth-child(6n+1) { grid-column: span 2; grid-row: span 2; }
.blog-grid article:nth-child(6n+2) { grid-column: span 2; }
.blog-grid article:nth-child(6n+5) { grid-row: span 2; }

/* === Card (text tile - no image) === */
.blog-card-image { display: none; }

.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 18px;
    overflow: hidden;
    padding: 26px 26px 24px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
    transform-style: preserve-3d;
    will-change: transform;
}

.blog-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 18px 50px -22px rgba(0, 0, 0, 0.16);
}

.blog-card.hidden {
    display: none;
}

/* Frosted-glass tiles (neutral, app-matching). Shared by the blog listing
   grid and the home Resources section, which reuses this grid. */
.blog-grid article[data-category] .blog-card {
    background: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 10px 34px rgba(31, 38, 135, 0.10);
}

.blog-grid article[data-category] .blog-card:hover {
    background: rgba(255, 255, 255, 0.62);
    border-color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 18px 44px rgba(31, 38, 135, 0.16);
}

.blog-card-body {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card-tags {
    margin-bottom: 18px;
}

.blog-card-body h3 {
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.4px;
    line-height: 1.3;
    color: var(--text);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-body p {
    display: none;
    font-size: 14px;
    line-height: 1.62;
    color: var(--text-2);
    margin-bottom: 18px;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-body .blog-card-meta {
    margin-top: auto;
}

/* Excerpt only on the roomier big / wide / tall tiles */
.blog-grid article:nth-child(6n+1) .blog-card-body p,
.blog-grid article:nth-child(6n+2) .blog-card-body p,
.blog-grid article:nth-child(6n+5) .blog-card-body p {
    display: -webkit-box;
}

/* Big hero tile - serif display headline */
.blog-grid article:nth-child(6n+1) .blog-card-body h3 {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(26px, 2.4vw, 40px);
    letter-spacing: -0.5px;
    line-height: 1.12;
    -webkit-line-clamp: 4;
}

.blog-grid article:nth-child(6n+1) .blog-card-body p {
    max-width: 460px;
    -webkit-line-clamp: 4;
}

/* === Load More === */
.blog-load-more {
    text-align: center;
    margin-top: 56px;
}

.blog-showing {
    font-size: 13px;
    color: var(--text-3);
    margin-top: 16px;
}

/* === Newsletter CTA === */
.blog-newsletter {
    padding: 0 0 80px;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    margin: 24px auto 0;
    max-width: 440px;
}

.newsletter-form input {
    flex: 1;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 450;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 30px;
    padding: 11px 20px;
    outline: none;
    transition: all 0.25s var(--ease);
}

.newsletter-form input:focus {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.04);
}

.newsletter-form input::placeholder {
    color: var(--text-3);
}

/* === Dark theme === */
html[data-theme="dark"] .blog-filters {
    background: rgba(26, 26, 26, 0.72);
}

html[data-theme="dark"] .blog-grid article[data-category] .blog-card {
    background: rgba(45, 45, 52, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .blog-grid article[data-category] .blog-card:hover {
    background: rgba(55, 55, 64, 0.55);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

/* === Responsive === */
@media (max-width: 1024px) {
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .blog-featured {
        grid-template-columns: 1fr;
    }

    .blog-featured-image {
        min-height: 300px;
    }

    .blog-featured-body {
        padding: 36px 32px;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 116px 0 40px;
    }

    .blog-title {
        letter-spacing: -1.5px;
    }

    .blog-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        border-radius: 20px;
        top: 58px;
    }

    .blog-filter-tabs {
        gap: 6px;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 2px;
        flex-wrap: nowrap;
    }

    .blog-filter-tab {
        white-space: nowrap;
        flex-shrink: 0;
        font-size: 12px;
        padding: 8px 14px;
    }

    .blog-search {
        width: 100%;
        border: 1px solid var(--border);
    }

    .blog-search input {
        width: 100%;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 210px;
        gap: 14px;
    }

    /* In 2 columns, the big and wide tiles span the full width */
    .blog-grid article:nth-child(6n+1) { grid-column: span 2; grid-row: span 2; }
    .blog-grid article:nth-child(6n+2) { grid-column: span 2; }
    .blog-grid article:nth-child(6n+5) { grid-row: span 1; }

    .newsletter-form {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .blog-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 240px;
    }

    /* Single column - every tile full width, reset spans */
    .blog-grid article:nth-child(6n+1),
    .blog-grid article:nth-child(6n+2),
    .blog-grid article:nth-child(6n+5) {
        grid-column: auto;
        grid-row: auto;
    }

    .blog-featured-body {
        padding: 28px 22px;
    }

    .blog-card-meta {
        gap: 10px;
        font-size: 12px;
    }
}
