/*
  article-body.css
  Page layout (categories | story | right rail) and the text styles for the story itself.
  The story sits in a white card on the faint blue page wash.
  Needs css/base.css.

  Phones and small tablets (under 62rem): story, then categories as chips, then the rail.
  62rem to 75rem: categories left, story right, rail under the story.
  75rem and up: categories | story | rail.
*/

.fm-article {
    display: grid;
    gap: var(--fm-gap);
    padding-bottom: 1.25rem;
    align-items: start;
}

.fm-article__main {
    min-width: 0;
    padding: clamp(1.25rem, 0.6rem + 2.4vw, 2rem);
    border-radius: var(--fm-radius);
    background: #fff;
}

@media (min-width: 62rem) {
    .fm-article {
        grid-template-columns: 13rem minmax(0, 1fr);
        gap: 1.5rem;
    }

    .fm-sidebar {
        grid-column: 1;
        grid-row: 1 / span 2;
        position: sticky;
        top: 1.5rem;
    }
    /* stays in view while the story scrolls */
    .fm-article__main {
        grid-column: 2;
        grid-row: 1;
    }

    .fm-rail {
        grid-column: 2;
        grid-row: 2;
    }
}

@media (min-width: 75rem) {
    .fm-article {
        grid-template-columns: 13rem minmax(0, 1fr) 300px;
    }

    .fm-sidebar {
        grid-row: 1;
    }

    .fm-rail {
        grid-column: 3;
        grid-row: 1;
    }
}

/* ---------- Back link ---------- */
.fm-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    font-size: var(--fm-t-sm);
    font-weight: 600;
    color: var(--fm-muted);
}

    .fm-back::before {
        content: "";
        width: 0.5rem;
        height: 0.5rem;
        border-left: 2px solid currentColor;
        border-bottom: 2px solid currentColor;
        transform: rotate(45deg);
    }

    .fm-back:hover {
        color: var(--fm-blue);
    }

/* ---------- Lede (opening paragraph) ---------- */
/* Same text size and line spacing as the story text (.fm-prose), including any <p> inside the lede */
.fm-lede, .fm-lede p {
    font-size: 1.0625rem;
    line-height: 1.7;
    color: var(--fm-ink);
}

    .fm-lede > * + * {
        margin-top: 1.2rem;
    }

/* ---------- Key facts (optional): washed tiles, coloured numbers ---------- */
.fm-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
    gap: 0.75rem;
    margin-block: 1.5rem;
}

    .fm-facts li {
        padding: 0.9rem 0.9rem 1rem;
        border-radius: var(--fm-radius);
        background: var(--fm-blue-tint);
    }

    .fm-facts strong {
        display: block;
        font-family: var(--fm-serif);
        font-size: 1.5rem;
        font-weight: 600;
        line-height: 1.1;
        letter-spacing: -0.02em;
        color: var(--fm-blue);
    }

    .fm-facts span {
        display: block;
        margin-top: 0.35rem;
        font-size: var(--fm-t-xs);
        line-height: 1.35;
        color: var(--fm-muted);
    }

/* ---------- Story text ---------- */
/* Styled by element so editors never need to add classes */
.fm-prose {
    font-size: 1.0625rem;
    line-height: 1.7;
    margin-top: 1.2rem;
}

    .fm-prose > * + * {
        margin-top: 1.2rem;
    }

    .fm-prose a {
        color: var(--fm-blue);
        text-decoration: underline;
        text-underline-offset: 3px;
    }

        .fm-prose a:hover {
            color: var(--fm-blue-deep);
        }

    .fm-prose h2 {
        margin-top: 1.9rem;
        font-size: clamp(1.35rem, 1.2rem + 0.5vw, 1.6rem);
    }

    .fm-prose h3 {
        margin-top: 1.75rem;
        font-size: 1.2rem;
    }

    .fm-prose ul, .fm-prose ol {
        padding-left: 1.4rem;
    }

    .fm-prose ul {
        list-style: disc;
    }

    .fm-prose ol {
        list-style: decimal;
    }

    .fm-prose li + li {
        margin-top: 0.45rem;
    }

    .fm-prose li::marker {
        color: var(--fm-blue);
    }
    /* Pull quote: coloured accent bar, serif, on a faint wash like BFREPA's */
    .fm-prose blockquote {
        margin-inline: 0;
        padding: 0.9rem 1.25rem 0.9rem 1.4rem;
        border-left: 4px solid var(--fm-blue);
        border-radius: 0 var(--fm-radius) var(--fm-radius) 0;
        background: var(--fm-blue-tint);
        font-family: var(--fm-serif);
        font-size: 1.1875rem;
        line-height: 1.45;
    }

        .fm-prose blockquote p + p {
            margin-top: 1rem;
        }

    .fm-prose figure {
        margin-inline: 0;
    }

        .fm-prose figure img {
            width: 100%;
            border-radius: var(--fm-radius);
        }

    .fm-prose figcaption {
        margin-top: 0.5rem;
        font-size: var(--fm-t-xs);
        color: var(--fm-muted);
    }

/* ---------- Tags ---------- */
.fm-article__tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 0.75rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--fm-rule);
}

    .fm-article__tags p {
        font-size: var(--fm-t-xs);
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--fm-muted);
    }

    .fm-article__tags ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .fm-article__tags a {
        display: block;
        padding: 0.25rem 0.75rem;
        border-radius: 999px;
        background: var(--fm-blue-tint);
        font-size: var(--fm-t-xs);
        font-weight: 600;
        color: var(--fm-blue);
    }

        .fm-article__tags a:hover {
            background: var(--fm-blue);
            color: #fff;
        }
