/* Article body typography and reusable content blocks.

   Article bodies are pasted into CKEditor (Source mode) as plain HTML using
   the fr-* class names below. All colours come from Bootstrap's theme
   variables so every block follows the light/dark toggle automatically. */

/* ---------- Paragraphs and headings ---------- */

.article-content > p {
    text-indent: 1.5em;
    margin-bottom: 1.1em;
}

/* Justify only where lines are long enough to avoid wide word gaps */
@media (min-width: 768px) {
    .article-content > p {
        text-align: justify;
        /* No auto hyphenation: articles avoid hyphens by style rule */
        hyphens: manual;
    }
}

.article-content > h2,
.article-content > h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 2rem 0 0.75rem;
}

/* ---------- Key numbers strip ---------- */

.fr-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
    margin: 0 0 2rem;
}

.fr-stat {
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
}

.fr-stat strong {
    display: block;
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--bs-primary);
}

.fr-stat span {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

/* Phones: one compact row per stat instead of a 2 + 1 wrap */
@media (max-width: 575.98px) {
    .fr-stats {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .fr-stat {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.75rem 1rem;
        text-align: left;
    }

    .fr-stat strong {
        flex: 0 0 4.5rem;
        font-size: 1.5rem;
    }

    .fr-stat span {
        margin-top: 0;
    }
}

/* ---------- Pull quote ---------- */

.fr-pullquote {
    margin: 2rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 4px solid var(--bs-primary);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.45;
}

.fr-pullquote p {
    margin: 0;
    text-indent: 0;
}

/* ---------- Action box ---------- */

.fr-action {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--bs-primary-bg-subtle);
    border: 1px solid var(--bs-primary-border-subtle);
    border-radius: 0.75rem;
}

.fr-action h2,
.fr-action h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--bs-primary-text-emphasis);
}

.fr-action p:last-child,
.fr-action ul:last-child {
    margin-bottom: 0;
}

/* ---------- Chart (a plain table, turned into bars by article-body.js) ---------- */

table.fr-chart {
    width: 100%;
    margin: 2rem 0;
    border-collapse: collapse;
}

table.fr-chart caption {
    caption-side: top;
    font-weight: 700;
    color: var(--bs-body-color);
}

table.fr-chart th,
table.fr-chart td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.fr-bars {
    margin: 2rem 0;
}

.fr-bars-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.fr-bar-row {
    display: grid;
    grid-template-columns: minmax(90px, 35%) 1fr;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.fr-bar-track {
    background: var(--bs-tertiary-bg);
    border-radius: 0.35rem;
    overflow: hidden;
}

.fr-bar-fill {
    min-width: 2.5rem;
    padding: 0.2rem 0.5rem;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 0.35rem;
    width: 0;
    transition: width 0.8s ease;
}

/* ---------- Jargon tooltips ---------- */

/* Plain `abbr`, not abbr[title]: Bootstrap's Tooltip moves the title into
   data-bs-original-title once initialised */
.article-content abbr {
    text-decoration: underline dotted;
    text-underline-offset: 3px;
    cursor: help;
}

/* ---------- Collapsible references ---------- */

.fr-references {
    margin: 2.5rem 0 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.fr-references summary {
    font-weight: 700;
    cursor: pointer;
}

.fr-references p {
    margin: 0.75rem 0 0;
    text-indent: 0;
    text-align: left;
}

/* ---------- Reader poll (rendered by the template, not pasted) ---------- */

.fr-poll {
    margin: 2.5rem 0;
    padding: 1.25rem 1.5rem;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0.75rem;
}

.fr-poll-question {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.fr-poll-option {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 0.5rem;
}

.fr-poll-result {
    margin-bottom: 0.6rem;
}

.fr-poll-result-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.95rem;
}

.fr-poll-result.is-mine .fr-poll-result-label {
    font-weight: 700;
}

.fr-poll-result .progress {
    height: 0.6rem;
}

.fr-poll-total {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

/* ---------- Key takeaways (Article.key_takeaways, above the body) ---------- */

.fr-takeaways {
    margin: 1.5rem 0 0;
    padding: 1rem 1.25rem;
    background: var(--bs-tertiary-bg);
    border-left: 4px solid var(--bs-primary);
    border-radius: 0.5rem;
}

.fr-takeaways-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.fr-takeaways ul {
    margin: 0;
    padding-left: 1.25rem;
}

.fr-takeaways li + li {
    margin-top: 0.35rem;
}

/* ---------- Pull quote share buttons (added by article-body.js) ---------- */

.fr-quote-share {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.fr-quote-share .btn {
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
}

/* ---------- Newsletter box after the article ---------- */

.fr-newsletter {
    margin: 2.5rem 0 0;
    padding: 1.25rem 1.5rem;
    background: var(--bs-primary-bg-subtle);
    border: 1px solid var(--bs-primary-border-subtle);
    border-radius: 0.75rem;
}

.fr-newsletter-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.fr-newsletter-text {
    margin: 0.35rem 0 0.9rem;
    color: var(--bs-secondary-color);
}

/* style.css gives .newsletter-form its own background and padding */
.fr-newsletter .newsletter-form {
    background: none;
    padding: 0;
    max-width: 460px;
}

/* ---------- Related articles ---------- */

.fr-related {
    margin-top: 2.5rem;
}

.fr-related .card-img-top {
    height: 140px;
}
