/* =============================================================
   post.css — Article page styles (BEM)
   Depends on core.css for design tokens, reset, and shared
   components (.button, .link, .section, .site-header, .footer).
   ============================================================= */


/* ── POST WRAPPER ─────────────────────────────────────────────── */
/* Outer vertical padding for the <main> element. */

.post-wrapper {
    padding: var(--space-5) 0;
}

@media (min-width: 640px) {
    .post-wrapper {
        padding: var(--space-6) 0;
    }
}

@media (min-width: 1024px) {
    .post-wrapper {
        padding: var(--space-8) 0;
    }
}


/* ── POST (block) ─────────────────────────────────────────────── */
/* The <article> container. Constrains width and sets the
   vertical rhythm for all child sections. */

.post {
    max-width: var(--max-width-narrow);
    margin: 0 auto;
    padding: 0 var(--pad-x);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}

@media (min-width: 640px) {
    .post {
        gap: var(--space-6);
    }
}


/* ── HEADER ───────────────────────────────────────────────────── */

.post__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-3);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid var(--color-border);
}

.post__publisher {
    width: 48px;
    height: auto;
}

.post__title {
    font-family: var(--font-primary);
    font-size: clamp(2.6rem, 5vw, var(--text-2xl));
    font-weight: var(--weight-bold);
    color: var(--color-secondary);
    letter-spacing: -0.02em;
    line-height: 1.15;
}

/* Optional subtitle / lede line beneath the title */
.post__subtitle {
    font-family: var(--font-secondary);
    font-size: var(--text-lg);
    font-weight: var(--weight-regular);
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Optional meta line (date, read-time, category tag) */
.post__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.6rem;
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}


/* ── SECTION ──────────────────────────────────────────────────── */
/* Each thematic <section> inside the article body. */

.post__section {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}


/* ── HEADINGS ─────────────────────────────────────────────────── */

.post__heading {
    font-family: var(--font-primary);
    font-size: clamp(2rem, 3.5vw, var(--text-xl));
    font-weight: var(--weight-bold);
    color: var(--color-secondary);
    letter-spacing: -0.01em;
    line-height: 1.25;
    padding-left: var(--space-2);
    border-left: 3px solid var(--color-accent);
}

.post__subheading {
    font-family: var(--font-primary);
    font-size: var(--text-lg);
    font-weight: var(--weight-bold);
    color: var(--color-secondary);
    line-height: 1.3;
    margin-top: var(--space-2);
}


/* ── PROSE ─────────────────────────────────────────────────────── */

.post__text {
    font-family: var(--font-secondary);
    font-size: var(--text-md);
    color: var(--color-text);
    line-height: 1.75;
}

.post__text--lead {
    font-size: clamp(1.7rem, 2.5vw, var(--text-lg));
    color: var(--color-text-muted);
    line-height: 1.7;
}

.post__text a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    transition: color 0.15s;
}

.post__text a:hover {
    color: var(--color-accent-hover);
}


/* ── LISTS ─────────────────────────────────────────────────────── */

.post__list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-left: var(--space-3);
    list-style: none;
}

.post__list-item {
    font-family: var(--font-secondary);
    font-size: var(--text-md);
    color: var(--color-text);
    line-height: 1.7;
    position: relative;
    padding-left: var(--space-2);
}

.post__list-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.85em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-accent);
}

/* Ordered-list variant: uses counter instead of dot */
.post__list--ordered {
    counter-reset: post-ol;
}

.post__list--ordered .post__list-item {
    counter-increment: post-ol;
}

.post__list--ordered .post__list-item::before {
    content: counter(post-ol) '.';
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    top: 0;
    font-family: var(--font-secondary);
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    color: var(--color-accent);
}

/* Links inside list items */
.post__list-item a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    transition: color 0.15s;
}

.post__list-item a:hover {
    color: var(--color-accent-hover);
}


/* ── HIGHLIGHT BOX ────────────────────────────────────────────── */
/* A tinted aside for key takeaways / callout paragraphs. */

.post__highlight {
    background-color: var(--color-paper);
    border-left: 3px solid var(--color-accent);
    padding: var(--space-3);
    border-radius: 0 0.4rem 0.4rem 0;
}

.post__highlight .post__text {
    color: var(--color-text);
}


/* ── FAQ ──────────────────────────────────────────────────────── */
/* FAQ block — sits inside a .post__section. */

.post-faq {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.post-faq__item {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border);
}

.post-faq__item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.post-faq__question {
    font-family: var(--font-secondary);
    font-size: var(--text-md);
    font-weight: var(--weight-bold);
    color: var(--color-secondary);
    line-height: 1.4;
}

.post-faq__answer {
    font-family: var(--font-secondary);
    font-size: var(--text-md);
    color: var(--color-text);
    line-height: 1.75;
}

.post-faq__answer a {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 0.2em;
    text-decoration-thickness: 1px;
    transition: color 0.15s;
}

.post-faq__answer a:hover {
    color: var(--color-accent-hover);
}



/* ── DIVIDER ──────────────────────────────────────────────────── */
/* Explicit section break when visual separation is needed
   beyond the gap rhythm (e.g. before a closing CTA). */

.post__divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 0;
}
