/* ══════════════════════════════════════════════════════════════════
   CONTENT CARDS / SECTION HEADERS / BLOG GRID
══════════════════════════════════════════════════════════════════ */

.section-label {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 8px;
    font-size: var(--fs-xs);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-color);
    background: var(--bg-primary);
    border-left: 3px solid var(--accent-teal);
    padding: 6px 14px 6px 12px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 0;
}

.section-label.gold {
    border-left-color: var(--accent-color);
}

.section-label--dark {
    background: var(--primary-color);
    color: #fff;
    border-left: none;
    border-radius: var(--radius-sm);
    padding: 6px 16px;
}

.section-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    margin-bottom: 14px;
}

.section-header > a {
    display: flex;
    align-items: center;
    padding: 0 0 0 14px;
    white-space: nowrap;
}

.section-header a {
    font-size: var(--fs-xs);
    color: var(--accent-teal);
    font-weight: 600;
    transition: var(--transition-fast);
}

.section-header a:hover {
    color: var(--accent-teal-light);
}

.blog-shell {
    padding-top: 20px;
    padding-bottom: 0;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.post-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.home-section--grid .post-card {
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    grid-template-areas:
        'thumb title'
        'thumb topmeta'
        'excerpt excerpt'
        'footer footer';
    column-gap: 16px;
    row-gap: 0;
    padding: 16px;
}

.post-card-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.home-shell .post-card-thumb {
    aspect-ratio: auto;
    height: var(--hp-tile-thumb-h, 161px);
    min-height: var(--hp-tile-thumb-h, 161px);
    max-height: 200px;
}

.home-section--grid .post-card-thumb,
.home-section--grid .post-card-thumb--placeholder {
    grid-area: thumb;
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    height: 81px;
    min-height: 81px;
    max-height: 81px;
    border-radius: calc(var(--radius) - 2px);
}

.home-section--grid .post-card-thumb img {
    width: 108px;
    height: 81px;
}

.home-section--grid .post-card-badge {
    display: none;
}

.post-card-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-thumb--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    color: var(--text-light);
}

.home-shell .post-card-thumb--placeholder {
    min-height: var(--hp-tile-thumb-h, 161px);
}

.post-card-thumb__icon {
    font-size: 2.2rem;
    line-height: 1;
}

.post-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--accent-teal);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .03em;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.post-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 14px 16px 15px;
}

.home-section--grid .post-card-body {
    display: contents;
}

.post-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 8px;
    color: var(--text-primary);
    font-family: var(--font-brand);
}

.home-section--grid .post-card-title {
    grid-area: title;
    align-self: end;
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

.post-card-top-meta {
    display: none;
}

.home-section--grid .post-card-top-meta {
    grid-area: topmeta;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin: 0;
}

.home-section--grid .post-card-top-meta__read {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

.post-card-title a {
    color: inherit;
    text-decoration: none;
}

.post-card-title a:hover {
    color: var(--accent-teal);
}

.post-card-excerpt {
    font-size: var(--fs-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.home-section--grid .post-card-excerpt {
    grid-area: excerpt;
    margin-top: 14px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
    padding-top: 14px;
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.home-section--grid .post-card-meta {
    grid-area: footer;
    margin-top: 14px;
    padding-top: 0;
}

.post-card-meta__left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap;
}

.post-card-meta .cat {
    color: var(--accent-teal);
    font-weight: 700;
}

.post-card-meta__more {
    flex-shrink: 0;
    color: var(--accent-teal);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.post-card-meta__more-label--mobile {
    display: none;
}

.post-card-meta__more:hover {
    color: var(--accent-teal-light);
}

.article-list--framed {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.content-section {
    margin-bottom: var(--spacing-sections, 40px);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 28px 0 0;
    flex-wrap: wrap;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: var(--fs-sm);
    color: var(--text-muted);
    background: var(--bg-primary);
    transition: var(--transition-fast);
    font-weight: 500;
}

.page-link:hover {
    border-color: var(--accent-teal);
    color: var(--accent-teal);
    background: #f0fafa;
}

.page-link.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-link.dots {
    border: none;
    background: transparent;
    cursor: default;
    color: var(--text-light);
}

.pagination--spaced {
    margin-top: 24px;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state__icon {
    font-size: 3rem;
    margin: 0 0 1rem;
}

.empty-state__text {
    color: var(--text-muted);
    max-width: 400px;
    margin: .5rem auto 1.5rem;
}

.empty-state__action {
    margin-top: 1rem;
}

body.dark-mode .post-card {
    background: var(--bg-dark-3);
    border-color: var(--border-dark);
}

body.dark-mode .post-card:hover {
    background: #1e2d3d;
}

body.dark-mode .section-label {
    background: var(--bg-dark-2);
    color: var(--text-primary);
    border-left-color: var(--accent-teal-light);
}

body.dark-mode .section-label.gold {
    border-left-color: var(--accent-color);
}

body.dark-mode .home-section--grid .post-card-top-meta,
body.dark-mode .home-section--grid .post-card-top-meta__read,
body.dark-mode .post-card-meta,
body.dark-mode .page-link,
body.dark-mode .empty-state__text {
    color: var(--text-secondary);
}

body.dark-mode .post-card-meta__more,
body.dark-mode .section-header a {
    color: var(--accent-teal-light);
}

body.dark-mode .post-card-meta__more:hover,
body.dark-mode .section-header a:hover {
    color: #7dd3c7;
}

body.dark-mode .page-link {
    background: var(--bg-dark-2);
    border-color: var(--border-dark);
    color: var(--text-primary);
}

body.dark-mode .page-link.dots {
    background: transparent;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-card,
    .home-section--grid .post-card {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        height: 195px;
        min-height: 195px;
        max-height: 195px;
        padding: 0;
    }

    .post-card-thumb,
    .post-card-thumb--placeholder,
    .home-section--grid .post-card-thumb,
    .home-section--grid .post-card-thumb--placeholder {
        display: flex;
        align-items: stretch;
        flex: 0 0 96px;
        width: 96px;
        min-width: 96px;
        aspect-ratio: auto;
        height: 195px;
        min-height: 195px;
        max-height: 195px;
        overflow: hidden;
    }

    .home-shell .post-card-thumb,
    .home-shell .post-card-thumb--placeholder {
        height: 195px;
        min-height: 195px;
        max-height: 195px;
    }

    .post-card-thumb img {
        width: 100% !important;
        height: 100% !important;
        min-height: 195px;
        max-height: 195px;
        object-position: center top;
    }

    .post-card-badge {
        display: none;
    }

    .post-card-body,
    .home-section--grid .post-card-body {
        display: flex;
        flex-direction: column;
        padding: 11px 13px 11px;
    }

    .post-card-title,
    .home-section--grid .post-card-title {
        order: 1;
        margin-bottom: 5px;
        font-size: .98rem;
    }

    .home-section--grid .post-card-top-meta {
        order: 2;
        display: flex;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 5px 9px;
        margin-top: 0;
        margin-bottom: 0;
        padding-top: 0;
        font-size: var(--fs-xs);
        color: var(--text-muted);
    }

    .post-card-excerpt,
    .home-section--grid .post-card-excerpt {
        order: 3;
        margin-top: 7px;
    }

    .post-card-meta,
    .home-section--grid .post-card-meta {
        order: 4;
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 10px;
        margin-top: auto;
        margin-bottom: 0;
        padding-top: 0;
        padding-right: 0;
    }

    .post-card-meta__left,
    .home-section--grid .post-card-meta__left {
        display: inline-flex;
        align-items: flex-end;
        gap: 5px 9px;
        min-width: 0;
        flex: 1 1 auto;
    }

    .post-card-meta__more,
    .home-section--grid .post-card-meta__more {
        order: 99;
        display: inline-flex;
        width: auto;
        justify-content: flex-end;
        margin-top: 0;
        margin-left: auto;
        position: static;
        flex: 0 0 auto;
    }

    .post-card-meta__more-label--desktop {
        display: none;
    }

    .post-card-meta__more-label--mobile {
        display: inline;
    }
}

@media (max-width: 480px) {
    .post-card-thumb,
    .post-card-thumb--placeholder,
    .home-section--grid .post-card-thumb,
    .home-section--grid .post-card-thumb--placeholder {
        display: flex;
        align-items: stretch;
        flex-basis: 80px;
        width: 80px;
        min-width: 80px;
        height: 195px;
        min-height: 195px;
        max-height: 195px;
        overflow: hidden;
    }

    .home-shell .post-card-thumb,
    .home-shell .post-card-thumb--placeholder {
        height: 195px;
        min-height: 195px;
        max-height: 195px;
    }

    .post-card-body,
    .home-section--grid .post-card-body {
        padding: 10px 12px 10px;
    }

    .post-card-title,
    .home-section--grid .post-card-title {
        font-size: .92rem;
    }

    .home-section--grid .post-card-top-meta {
        gap: 4px 8px;
        font-size: .74rem;
    }

    .post-card-meta,
    .home-section--grid .post-card-meta {
        gap: 8px;
        font-size: .74rem;
        padding-right: 0;
    }

    .post-card-meta__more,
    .home-section--grid .post-card-meta__more {
        position: static;
    }
}
