/* ==========================================================================
   Blog (2026): article template, components and index
   Uses the tokens from theme-2026.css.
   ========================================================================== */

.bp-main {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 24px 0;
    box-sizing: border-box;
}

.bp-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 0;
    color: var(--t-subtle);
    font-size: 0.875rem;
}

.bp-crumbs a { color: var(--t-muted); text-decoration: none; }
.bp-crumbs a:hover { color: var(--t-primary-bright); }
.bp-crumbs [aria-current] { color: var(--t-text); }

/* --------------------------------------------------------------------------
   Article layout: a comfortable reading column
   -------------------------------------------------------------------------- */

.bp-article {
    max-width: 720px;
    margin: 0 auto;
}

.bp-header { padding: 32px 0 8px; }

.bp-tag {
    display: inline-block;
    margin: 0 0 14px;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--t-border-strong);
    background: var(--t-primary-soft);
    color: var(--t-primary-bright);
    font-family: var(--t-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.bp-title {
    margin: 0 0 14px !important;
    text-align: left !important;
    font-size: clamp(2rem, 5vw, 3rem) !important;
    font-weight: 700 !important;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--t-text);
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
}

.bp-dek {
    margin: 0 0 16px;
    color: var(--t-muted);
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    line-height: 1.55;
}

.bp-meta {
    margin: 0;
    color: var(--t-subtle);
    font-size: 0.875rem;
}

.bp-hero-image {
    margin: 24px 0 0;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--t-border);
    background: #0b1712;
}

.bp-hero-image img { display: block; width: 100%; height: auto; }

/* Key takeaways */
.bp-takeaways {
    margin: 28px 0 0;
    padding: 20px 24px;
    border-radius: 20px;
    border: 1px solid var(--t-border-strong);
    background:
        radial-gradient(30rem 10rem at 0% 0%, rgba(16, 185, 129, 0.14), transparent 70%),
        var(--t-surface);
}

.bp-takeaways h2 {
    margin: 0 0 10px !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--t-primary-bright) !important;
    text-align: left !important;
}

.bp-takeaways ul { margin: 0; padding-left: 1.2rem; }
.bp-takeaways li { margin: 6px 0; color: var(--t-text); line-height: 1.55; }

/* Table of contents */
.bp-toc {
    margin: 20px 0 0;
    padding: 18px 22px;
    border-radius: 18px;
    border: 1px solid var(--t-border);
    background: rgba(0, 0, 0, 0.2);
}

.bp-toc-title {
    margin: 0 0 8px;
    color: var(--t-muted);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.bp-toc ol { margin: 0; padding-left: 1.2rem; columns: 2 16rem; column-gap: 28px; }
.bp-toc li { margin: 0 0 6px; break-inside: avoid; }
.bp-toc a { color: var(--t-primary-bright); text-decoration: none; }
.bp-toc a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Article body typography
   -------------------------------------------------------------------------- */

.bp-body {
    margin-top: 32px;
    color: #d6e5df;
    font-size: 1.0625rem;
    line-height: 1.75;
}

.bp-body section + section { margin-top: 8px; }

.bp-body h2 {
    margin: 44px 0 14px !important;
    scroll-margin-top: 90px;
    text-align: left !important;
    font-size: clamp(1.375rem, 3vw, 1.75rem) !important;
    font-weight: 700 !important;
    line-height: 1.25;
    color: var(--t-text) !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
}

.bp-body h3 {
    margin: 28px 0 10px !important;
    font-size: 1.1875rem !important;
    font-weight: 600 !important;
    color: var(--t-text) !important;
    text-align: left !important;
}

.bp-body p { margin: 0 0 16px; }
.bp-body ul, .bp-body ol { margin: 0 0 18px; padding-left: 1.4rem; }
.bp-body li { margin: 6px 0; }
.bp-body strong { color: #fff; font-weight: 600; }
.bp-body a { color: var(--t-primary-bright); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(52, 211, 153, 0.45); }
.bp-body a:hover { text-decoration-color: currentColor; }

.bp-body blockquote {
    margin: 24px 0;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--t-primary-bright);
    color: var(--t-text);
    font-size: 1.125rem;
}

/* Callouts */
.callout {
    margin: 22px 0;
    padding: 16px 20px;
    border-radius: 16px;
    border: 1px solid var(--t-border);
    background: var(--t-primary-soft);
}

.callout > :last-child { margin-bottom: 0; }
.callout strong:first-child { color: var(--t-primary-bright); }
.callout-warn { background: var(--t-gold-soft); border-color: rgba(251, 191, 36, 0.3); }
.callout-warn strong:first-child { color: var(--t-gold); }

/* Checklist */
.checklist { list-style: none; padding-left: 0 !important; }
.checklist li { position: relative; padding-left: 30px; }
.checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 16px;
    height: 16px;
    border-radius: 5px;
    background: var(--t-primary-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
    border: 1px solid var(--t-border-strong);
}

/* Stat row */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--t-border);
    background: var(--t-surface);
}

.stat-value { font-family: var(--t-mono); font-size: 1.5rem; font-weight: 600; color: var(--t-primary-bright); line-height: 1.2; }
.stat-label { color: var(--t-muted); font-size: 0.875rem; line-height: 1.4; }

/* Data tables */
.table-wrap { overflow-x: auto; margin: 22px 0; border-radius: 16px; border: 1px solid var(--t-border); -webkit-overflow-scrolling: touch; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.45;
}

.data-table th,
.data-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.data-table thead th {
    background: var(--t-surface-solid);
    color: var(--t-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.data-table tbody tr:last-child td,
.data-table tbody tr:last-child th { border-bottom: 0; }
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--t-mono); font-variant-numeric: tabular-nums; }
.data-table caption { caption-side: bottom; padding: 10px 14px; color: var(--t-subtle); font-size: 0.8125rem; text-align: left; }

/* Figures */
.bp-body figure { margin: 24px 0; }
.bp-body figcaption { margin-top: 8px; color: var(--t-subtle); font-size: 0.875rem; }

/* --------------------------------------------------------------------------
   FAQ, sources, CTA, related
   -------------------------------------------------------------------------- */

.bp-faq,
.bp-sources { margin-top: 48px; }

.bp-faq h2,
.bp-sources h2,
.bp-related h2 {
    margin: 0 0 14px !important;
    text-align: left !important;
    font-size: 1.375rem !important;
    font-weight: 700 !important;
    color: var(--t-text) !important;
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
}

.bp-faq-item {
    margin-bottom: 10px;
    border-radius: 16px;
    border: 1px solid var(--t-border);
    background: var(--t-surface);
}

.bp-faq-item[open] { border-color: var(--t-border-strong); }

.bp-faq-item summary {
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 54px;
    padding: 12px 20px;
    color: var(--t-text);
    font-weight: 500;
    cursor: pointer;
}

.bp-faq-item summary::-webkit-details-marker { display: none; }
.bp-faq-item summary::after { content: '+'; font-family: var(--t-mono); color: var(--t-primary-bright); font-size: 1.25rem; }
.bp-faq-item[open] summary::after { content: '–'; }
.bp-faq-item p { margin: 0; padding: 0 20px 18px; color: var(--t-muted); line-height: 1.65; }

.bp-sources ol { margin: 0; padding-left: 1.3rem; color: var(--t-muted); font-size: 0.9375rem; }
.bp-sources li { margin: 6px 0; }
.bp-sources a { color: var(--t-muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255, 255, 255, 0.2); word-break: break-word; }
.bp-sources a:hover { color: var(--t-primary-bright); }

.bp-cta {
    margin: 48px 0 0;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--t-border-strong);
    background:
        radial-gradient(30rem 10rem at 100% 0%, rgba(16, 185, 129, 0.16), transparent 70%),
        var(--t-surface);
}

.bp-cta p { margin: 0 0 8px; color: var(--t-muted); }
.bp-cta-title { color: var(--t-text) !important; font-size: 1.25rem; font-weight: 700; }
.bp-cta-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 12px 0 0 !important; }
.bp-cta-links a { color: var(--t-primary-bright); font-weight: 600; text-decoration: none; }
.bp-cta-links a:hover { text-decoration: underline; }

.bp-related { margin-top: 72px; }

/* Cards (related + index) */
.bp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.bp-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid var(--t-border);
    background: var(--t-surface);
    text-decoration: none;
    transition: border-color 150ms ease, transform 150ms var(--t-ease);
}

.bp-card:hover { border-color: var(--t-border-strong); transform: translateY(-2px); }
.bp-card img { display: block; width: 100%; height: 170px; object-fit: cover; background: #0b1712; }
.bp-card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.bp-card .bp-tag { align-self: flex-start; margin: 0; }
.bp-card-title { margin: 0 !important; font-size: 1.125rem !important; font-weight: 600 !important; line-height: 1.3; color: var(--t-text) !important; text-align: left !important; }
.bp-card-text { color: var(--t-muted); font-size: 0.9375rem; line-height: 1.5; }
.bp-card-meta { margin-top: auto; padding-top: 6px; color: var(--t-subtle); font-size: 0.8125rem; }

/* Blog index */
.bp-index-head { max-width: 720px; padding: 32px 0 8px; }

.bp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 28px; }

.bp-chip {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--t-border);
    background: transparent;
    color: var(--t-muted);
    font: 500 0.9375rem var(--t-sans);
    cursor: pointer;
}

.bp-chip:hover { color: var(--t-text); border-color: var(--t-border-strong); }
.bp-chip[aria-pressed='true'] { background: var(--t-primary-bright); border-color: var(--t-primary-bright); color: #022c22; }

.bp-card[hidden] { display: none; }

/* Footprint calculator (used by the calculator guide) */
.fp-calc {
    margin: 28px 0;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--t-border-strong);
    background: var(--t-surface);
}

/* --- Footprint calculator: form, results, bars and tips
       (markup in tools/blog/content/carbon-footprint-calculator-guide.html,
       logic in /blog/js/footprint-calculator.js) --- */
.fp-form { display: grid; gap: 18px; }

.fp-group {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px 18px;
}

.fp-group legend {
    padding: 0;
    margin-bottom: 10px;
    color: var(--t-primary-bright);
    font: 600 0.8125rem var(--t-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.fp-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fp-field[hidden] { display: none; }
.fp-field label { color: var(--t-text); font-size: 0.9375rem; font-weight: 500; line-height: 1.35; }
.fp-hint { color: var(--t-subtle); font-size: 0.8125rem; line-height: 1.4; }

.fp-calc input,
.fp-calc select {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--t-border-strong);
    border-radius: var(--t-radius-sm);
    background: var(--t-surface-solid);
    color: var(--t-text);
    font: 400 1rem var(--t-sans);
    color-scheme: dark;
}

.fp-calc input[type='number'] { font-family: var(--t-mono); font-variant-numeric: tabular-nums; }
.fp-calc select option { background: var(--t-surface-solid); color: var(--t-text); }

.fp-calc input:focus-visible,
.fp-calc select:focus-visible {
    outline: 2px solid var(--t-primary-bright);
    outline-offset: 2px;
    border-color: var(--t-primary-bright);
}

.fp-combo { display: flex; gap: 8px; }
.fp-combo input { flex: 1 1 auto; min-width: 0; }
.fp-combo select { flex: 0 0 96px; width: 96px; }

.fp-results {
    margin-top: 24px;
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--t-border);
    background: var(--t-surface-raised);
}

.fp-results p { margin: 0; }
.fp-total-label { color: var(--t-muted); font-size: 0.875rem; }
.fp-results .fp-total { margin: 4px 0 10px; line-height: 1.1; }
.fp-total #fpTotal { color: var(--t-primary-bright); font: 600 clamp(2.25rem, 7vw, 3rem) var(--t-mono); font-variant-numeric: tabular-nums; }
.fp-unit { color: var(--t-muted); font-size: 1rem; }
.fp-compare { color: var(--t-text); font-size: 0.9375rem; line-height: 1.5; }
.fp-results .fp-compare + .fp-compare { margin-top: 4px; }

.bp-body .fp-bars { list-style: none; margin: 20px 0; padding: 0; display: grid; gap: 12px; }
.bp-body .fp-bar-row { margin: 0; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; }
.fp-bar-label { color: var(--t-text); font-size: 0.9375rem; }
.fp-bar-value { color: var(--t-muted); font: 500 0.875rem var(--t-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fp-bar-track { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--t-primary-soft); overflow: hidden; }
.fp-bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--t-primary-bright); transition: width 200ms var(--t-ease); }

.fp-tips-title { color: var(--t-text); font-weight: 600; }
.bp-body .fp-tips { margin: 8px 0 14px; padding-left: 1.3rem; }
.bp-body .fp-tips li { margin: 6px 0; color: #d6e5df; font-size: 0.9375rem; line-height: 1.55; }
.fp-note { color: var(--t-subtle); font-size: 0.8125rem; line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
    .fp-bar-fill { transition: none; }
}

@media (max-width: 600px) {
    .fp-group { grid-template-columns: 1fr; }
    .fp-results { padding: 16px; }
}
/* --- end footprint calculator --- */

@media (max-width: 600px) {
    .bp-main { padding: 16px 16px 0; }
    .bp-header { padding-top: 20px; }
    .bp-takeaways, .bp-toc, .bp-cta, .fp-calc { padding: 18px; border-radius: 18px; }
    .bp-body { font-size: 1rem; }
    .bp-card img { height: 150px; }
}

/* Calculator: total that stays in view while you fill in the form */
.fp-calc { scroll-margin-top: 88px; }
.fp-sticky { display: none; }
.fp-ready .fp-sticky {
    position: sticky;
    bottom: 12px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 14px;
    border: 1px solid var(--t-border-strong);
    background: rgba(6, 16, 12, 0.94);
    box-shadow: 0 12px 32px -8px rgba(0, 0, 0, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.fp-sticky-label { color: var(--t-muted); font-size: 0.875rem; white-space: nowrap; }
.fp-sticky-total { color: var(--t-primary-bright); font: 600 1.0625rem var(--t-mono); white-space: nowrap; }
.fp-sticky-link { margin-left: auto; color: var(--t-text); font-size: 0.875rem; text-decoration: none; white-space: nowrap; }
.fp-sticky-link:hover { color: var(--t-primary-bright); }
.fp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 18px 0 14px; }
.fp-reset {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid var(--t-border);
    background: transparent;
    color: var(--t-muted);
    font: 500 0.9375rem var(--t-sans);
    cursor: pointer;
}
.fp-reset:hover { color: var(--t-text); border-color: var(--t-border-strong); }
.fp-calc input:disabled, .fp-calc select:disabled { opacity: 0.45; cursor: not-allowed; }
.fp-results { scroll-margin-top: 88px; }

/* Keep factor values on one line in tables */
.data-table td.num { white-space: nowrap; }

/* Legacy styles.css centres h3 with flexbox; article headings are left-aligned */
.bp-body h3 { display: block !important; text-align: left !important; }
/* Fieldsets default to min-content width; let long select options shrink instead of widening the page */
.fp-group { min-width: 0; }
.fp-calc select, .fp-calc input { max-width: 100%; min-width: 0; }
.fp-combo { min-width: 0; }
.fp-combo input { flex: 1 1 auto; }
.fp-form { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .fp-group { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 360px) { .fp-sticky-label { display: none; } .fp-sticky { gap: 8px; padding: 10px 12px; } }
