/* =============================================================================
   Template Styles — page / archive / single
   Enqueued conditionally via is_page() || is_archive() || is_single().
   ============================================================================= */

/* ── Page template ───────────────────────────────────────────────────────── */
/* Pages are block-driven — no styling needed beyond the base <main> tag.
   Block content handles all visual hierarchy. */

.page {
    width: 100%;
}

/* ── Archive template ────────────────────────────────────────────────────── */

.archive-page {
    width: 100%;
}

.archive-page__inner {
    max-width: 1200px;
}

.archive-page__header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
}

.archive-page__title {
    font-size: clamp( 1.75rem, 4vw, 2.5rem );
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

.archive-page__description {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.75;
    max-width: 640px;
}

.archive-page__description p {
    margin: 0;
}

.archive-page__results {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
    gap: 2rem;
}

.archive-page__pagination {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.archive-page__pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.archive-page__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    color: inherit;
    transition: background-color 0.2s ease;
}

.archive-page__pagination .page-numbers:hover {
    background: rgba( 0, 0, 0, 0.05 );
}

.archive-page__pagination .page-numbers.current {
    background: var( --brand-color-primary, #222 );
    color: #fff;
}

.archive-page__empty {
    text-align: center;
    padding: 4rem 1rem;
    opacity: 0.7;
    font-size: 1.1rem;
}

/* ── Single post template ────────────────────────────────────────────────── */

.single-post {
    width: 100%;
}

.single-post__header {
    padding: 3rem 1.5rem 2rem;
}

.single-post__header-inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

.single-post__category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
    text-decoration: none;
    align-self: center;
}

.single-post__category:hover {
    opacity: 1;
    text-decoration: underline;
}

.single-post__title {
    font-size: clamp( 2rem, 5vw, 3.5rem );
    font-weight: 800;
    line-height: 1.15;
    margin: 0;
    letter-spacing: -0.01em;
}

.single-post__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    opacity: 0.7;
}

.single-post__meta-separator {
    opacity: 0.5;
}

/* ── Featured image ──────────────────────────────────────────────────────── */

.single-post__featured-image {
    max-width: 1200px;
    margin: 0 auto 3rem;
    padding: 0 1.5rem;
}

.single-post__featured-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* ── Post content ────────────────────────────────────────────────────────── */

.single-post__content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    font-size: 1.0625rem;
    line-height: 1.7;
}

.single-post__content > * + * {
    margin-top: 1.25rem;
}

.single-post__content h2 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    line-height: 1.3;
}

.single-post__content h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    line-height: 1.35;
}

/* ── Related posts (skeleton shimmer placeholder for now) ────────────────── */

.single-post__related {
    max-width: 1200px;
    margin: 0 auto 4rem;
    padding: 3rem 1.5rem 0;
    border-top: 1px solid rgba( 0, 0, 0, 0.08 );
}

.single-post__related-title {
    font-size: clamp( 1.25rem, 2.5vw, 1.75rem );
    font-weight: 700;
    margin: 0 0 2rem;
}

.single-post__related-carousel {
    display: grid;
    grid-template-columns: repeat( 4, 1fr );
    gap: 1.5rem;
    padding: 1.5rem;
    border-radius: 8px;
}

.single-post__related-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.single-post__related-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.single-post__related-image svg {
    width: 32px;
    height: 32px;
    opacity: 0.3;
}

.single-post__related-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.single-post__related-body .skeleton {
    height: 0.875rem;
}

.single-post__related-body .skeleton--line-short {
    width: 65%;
}

/* ── Prev / next navigation ──────────────────────────────────────────────── */

.single-post__nav {
    padding: 2rem 1.5rem 4rem;
    border-top: 1px solid rgba( 0, 0, 0, 0.08 );
}

.single-post__nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.single-post__nav-link {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.single-post__nav-link:hover {
    background: rgba( 0, 0, 0, 0.04 );
}

.single-post__nav-link--next {
    text-align: right;
    align-items: flex-end;
}

.single-post__nav-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.65;
    font-weight: 600;
}

.single-post__nav-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media ( max-width: 900px ) {
    .single-post__related-carousel {
        grid-template-columns: repeat( 2, 1fr );
    }
}

@media ( max-width: 600px ) {
    .single-post__related-carousel {
        grid-template-columns: 1fr;
    }

    .single-post__nav-inner {
        grid-template-columns: 1fr;
    }

    .single-post__nav-link--next {
        text-align: left;
        align-items: flex-start;
    }
}
