/* ============================================================
   Blog — archive (home.php) + single.php
   Uses global design tokens from assets/css/global.css
   ============================================================ */

/* ---------- Blog hero (archive top) ---------- */
.lre-blog-hero {
    position: relative;
    isolation: isolate;
    background: var(--lre-color-cream);
    color: var(--lre-color-ink);
    padding: clamp(48px, 7vw, 96px) var(--lre-gutter);
    padding-top: calc(var(--lre-header-h) + clamp(24px, 3vw, 48px));
    text-align: center;
    overflow: hidden;
}

.lre-blog-hero__media,
.lre-blog-hero__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.lre-blog-hero__media {
    object-fit: cover;
    z-index: -2;
}

.lre-blog-hero__overlay {
    z-index: -1;
    background: rgba(17, 23, 26, 0.42);
}

.lre-blog-hero--has-image {
    color: #ffffff;
}

.lre-blog-hero--has-image .lre-blog-hero__title,
.lre-blog-hero--has-image .lre-blog-hero__lead {
    color: #ffffff;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.28);
}

.lre-blog-hero__inner {
    max-width: 820px;
    margin: 0 auto;
}

.lre-blog-hero__title {
    margin: 0;
    font-family: var(--lre-font-serif);
    font-weight: 500;
    font-size: clamp(36px, 4vw, 60px);
    line-height: 1.05;
    color: var(--lre-color-ink);
}

.lre-blog-hero__lead {
    max-width: 640px;
    margin: 22px auto 0;
    font-family: var(--lre-font-serif);
    font-weight: 400;
    font-size: clamp(16px, 1.15vw, 19px);
    line-height: 1.6;
    color: var(--lre-color-ink-muted);
}

/* ---------- Category filter bar ---------- */
.lre-blog-filters {
    border-bottom: 1px solid rgba(31, 26, 20, 0.1);
    background: #ffffff;
}

.lre-blog-filters__inner {
    max-width: var(--lre-container);
    margin: 0 auto;
    padding: 18px var(--lre-gutter);
    overflow-x: auto;
}

.lre-blog-filters__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 4px;
}

.lre-blog-filters__link {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--lre-font-sans);
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.02em;
    color: var(--lre-color-ink);
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
}

.lre-blog-filters__link:hover,
.lre-blog-filters__link:focus-visible {
    border-color: rgba(31, 26, 20, 0.15);
    outline: none;
}

.lre-blog-filters__link.is-active {
    background: var(--lre-color-ink);
    color: #ffffff;
    border-color: var(--lre-color-ink);
}

/* ---------- Blog grid wrapper ---------- */
.lre-blog {
    padding: clamp(48px, 6vw, 88px) var(--lre-gutter) clamp(64px, 7vw, 112px);
    background: #ffffff;
}

.lre-blog__inner {
    max-width: var(--lre-container);
    margin: 0 auto;
}

.lre-blog__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 56px 40px;
}

/* ---------- Post card ---------- */
.lre-post-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
}

.lre-post-card__media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    margin-bottom: 22px;
    background: var(--lre-color-cream);
}

.lre-post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.lre-post-card__image--placeholder {
    display: block;
    background: linear-gradient(135deg, var(--lre-color-cream) 0%, var(--lre-color-taupe) 100%);
}

.lre-post-card:hover .lre-post-card__image,
.lre-post-card:focus-within .lre-post-card__image {
    transform: scale(1.04);
}

.lre-post-card__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lre-post-card__meta {
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-family: var(--lre-font-sans);
    font-weight: 400;
    font-size: 12px;
    letter-spacing: 0.04em;
    color: var(--lre-color-ink-muted);
}

.lre-post-card__category {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--lre-color-taupe-dark);
}

.lre-post-card__meta-sep {
    opacity: 0.5;
}

.lre-post-card__title {
    margin: 0;
    font-family: var(--lre-font-serif);
    font-weight: 500;
    font-size: clamp(20px, 1.5vw, 24px);
    line-height: 1.25;
    color: var(--lre-color-ink);
}

.lre-post-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.lre-post-card__title a::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}

.lre-post-card__title a:hover,
.lre-post-card__title a:focus-visible {
    color: var(--lre-color-taupe-dark);
    outline: none;
}

.lre-post-card__title a:focus-visible::before {
    outline: 2px solid var(--lre-color-taupe-dark);
    outline-offset: 4px;
}

.lre-post-card__excerpt {
    margin: 0;
    font-family: var(--lre-font-sans);
    font-weight: 400;
    font-size: 15px;
    line-height: 1.6;
    color: rgba(31, 26, 20, 0.78);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lre-post-card__more {
    margin-top: 4px;
    font-family: var(--lre-font-sans);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--lre-color-ink);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lre-post-card__more-arrow {
    transition: transform 0.25s ease;
}

.lre-post-card:hover .lre-post-card__more-arrow,
.lre-post-card:focus-within .lre-post-card__more-arrow {
    transform: translateX(4px);
}

/* Featured (first) post — full-width hero card */
.lre-post-card--featured {
    grid-column: 1 / -1;
    flex-direction: row;
    gap: clamp(28px, 4vw, 64px);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(31, 26, 20, 0.1);
    margin-bottom: 8px;
}

.lre-post-card--featured .lre-post-card__media {
    flex: 1 1 0;
    aspect-ratio: 16 / 10;
    margin-bottom: 0;
}

.lre-post-card--featured .lre-post-card__body {
    flex: 1 1 0;
    justify-content: center;
    gap: 18px;
}

.lre-post-card--featured .lre-post-card__title {
    font-size: clamp(28px, 2.6vw, 40px);
    line-height: 1.1;
}

.lre-post-card--featured .lre-post-card__excerpt {
    font-size: 16px;
    -webkit-line-clamp: 4;
}

/* ---------- Pagination ---------- */
.lre-blog__pagination {
    margin-top: 64px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--lre-font-sans);
    font-size: 14px;
}

.lre-blog__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(31, 26, 20, 0.15);
    color: var(--lre-color-ink);
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lre-blog__pagination .page-numbers.current {
    background: var(--lre-color-ink);
    color: #ffffff;
    border-color: var(--lre-color-ink);
}

.lre-blog__pagination .page-numbers:not(.current):not(.dots):hover,
.lre-blog__pagination .page-numbers:not(.current):not(.dots):focus-visible {
    background: var(--lre-color-taupe);
    color: #ffffff;
    border-color: var(--lre-color-taupe);
    outline: none;
}

.lre-blog__empty {
    margin: 0;
    text-align: center;
    font-family: var(--lre-font-sans);
    font-size: 16px;
    color: var(--lre-color-ink-muted);
}

/* ============================================================
   Single post
   ============================================================ */

.lre-post {
    background: #ffffff;
    color: var(--lre-color-ink);
}

.lre-post__hero {
    position: relative;
    min-height: 460px;
    overflow: hidden;
    isolation: isolate;
    display: grid;
    place-items: end center;
    padding: clamp(48px, 8vw, 96px) var(--lre-gutter);
    margin-bottom: clamp(48px, 6vw, 80px);
    background: var(--lre-color-taupe);
    color: #ffffff;
    text-align: center;
}

.lre-post__hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.lre-post__hero-overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(17, 23, 26, 0.25) 0%, rgba(17, 23, 26, 0.55) 100%);
}

.lre-post__hero-content {
    width: min(100%, 820px);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.32);
}

.lre-post__hero-category {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    font-family: var(--lre-font-sans);
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #ffffff;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lre-post__hero-category:hover,
.lre-post__hero-category:focus-visible {
    background: var(--lre-color-taupe);
    border-color: var(--lre-color-taupe);
    color: #ffffff;
    outline: none;
}

.lre-post__hero-title {
    margin: 24px 0 0;
    font-family: var(--lre-font-serif);
    font-weight: 500;
    font-size: clamp(36px, 4vw, 60px);
    line-height: 1.05;
    color: #ffffff;
}

.lre-post__hero-meta {
    margin: 22px 0 0;
    font-family: var(--lre-font-sans);
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.92);
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lre-post__hero-meta-sep {
    opacity: 0.6;
}

.lre-post__container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 var(--lre-gutter) clamp(64px, 7vw, 112px);
}

.lre-post__lead {
    margin: 0 auto 36px;
    font-family: var(--lre-font-serif);
    font-weight: 400;
    font-size: clamp(20px, 1.6vw, 24px);
    line-height: 1.55;
    color: var(--lre-color-ink);
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(31, 26, 20, 0.12);
}

.lre-post__body {
    margin: 0 auto;
    font-family: var(--lre-font-serif);
    font-weight: 400;
    font-size: clamp(16px, 1.1vw, 18px);
    line-height: 1.75;
    color: var(--lre-color-ink);
}

.lre-post__body > * + * {
    margin-top: 1.3em;
}

.lre-post__body p {
    margin: 0;
}

.lre-post__body h2 {
    margin: 1.8em 0 0.6em;
    font-family: var(--lre-font-serif);
    font-weight: 500;
    font-size: clamp(24px, 2vw, 30px);
    line-height: 1.2;
}

.lre-post__body h3 {
    margin: 1.6em 0 0.5em;
    font-family: var(--lre-font-serif);
    font-weight: 500;
    font-size: clamp(20px, 1.5vw, 24px);
    line-height: 1.25;
}

.lre-post__body a {
    color: var(--lre-color-taupe-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease;
}

.lre-post__body a:hover {
    opacity: 0.75;
}

.lre-post__body blockquote {
    margin: 1.6em 0;
    padding: 4px 0 4px 24px;
    border-left: 3px solid var(--lre-color-taupe);
    font-style: italic;
    color: var(--lre-color-ink-muted);
}

.lre-post__body ul,
.lre-post__body ol {
    margin: 0;
    padding-left: 1.5em;
}

.lre-post__body li + li {
    margin-top: 0.4em;
}

.lre-post__body img,
.lre-post__body figure {
    border-radius: 4px;
    overflow: hidden;
}

.lre-post__body figure {
    margin: 1.6em 0;
}

.lre-post__body figcaption {
    margin-top: 10px;
    font-family: var(--lre-font-sans);
    font-size: 13px;
    color: var(--lre-color-ink-muted);
    text-align: center;
}

.lre-post__pagelinks {
    margin-top: 32px;
    font-family: var(--lre-font-sans);
    font-size: 14px;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.lre-post__pagelinks span {
    font-weight: 700;
}

/* ---------- Related posts ---------- */
.lre-post-related {
    background: var(--lre-color-cream);
    padding: clamp(56px, 6vw, 96px) var(--lre-gutter);
}

.lre-post-related__inner {
    max-width: var(--lre-container);
    margin: 0 auto;
}

.lre-post-related__title {
    margin: 0 0 36px;
    text-align: center;
    font-family: var(--lre-font-serif);
    font-weight: 500;
    font-size: clamp(28px, 2.5vw, 40px);
    color: var(--lre-color-ink);
}

.lre-post-related__grid {
    display: grid;
    grid-template-columns: repeat(var(--lre-related-count, 3), 1fr);
    gap: 40px 32px;
    max-width: calc(var(--lre-related-count, 3) * (var(--lre-container) / 3));
    margin-inline: auto;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .lre-blog__grid {
        gap: 48px 32px;
    }
}

@media (max-width: 960px) {
    .lre-blog__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 24px;
    }

    .lre-post-related__grid {
        grid-template-columns: repeat(min(var(--lre-related-count, 3), 2), 1fr);
        gap: 40px 24px;
        max-width: calc(min(var(--lre-related-count, 3), 2) * (var(--lre-container) / 3));
    }

    .lre-post-card--featured {
        grid-column: 1 / -1;
        flex-direction: column;
        gap: 22px;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .lre-post-card--featured .lre-post-card__media {
        flex: 0 0 auto;
        aspect-ratio: 16 / 10;
    }

    .lre-post-card--featured .lre-post-card__title {
        font-size: clamp(24px, 4.5vw, 32px);
    }

    .lre-post__hero {
        min-height: 380px;
    }
}

@media (max-width: 640px) {
    .lre-blog__grid,
    .lre-post-related__grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .lre-post__hero {
        min-height: 320px;
        padding: 48px var(--lre-gutter);
    }
}
