/* =========================================================
   BLOG ARTICLE  (src/styles/blog-article.css)
   ---------------------------------------------------------
   The post template rendered by includes/blog-post-template.php.

   ONE COLUMN
   The hero lockup, the body copy, the wide figures, the end cap
   and the comment thread all sit in the same --bp-measure column,
   so a reader's eye follows one left edge from the headline to
   the last reply. Only an inset figure sits narrower, on purpose.

   FOUR VARIANTS, ONE ARTICLE
   The template stamps .bp-article--text | --single | --duo |
   --rich from the number of figures the post supplies. Every
   variant shares this file's measure, type scale, spacing
   rhythm, hero lockup and end matter — only the figure
   choreography changes:

     --text    0 figures. Drop-cap lead and a red rule on each
               h2 so the page keeps a cadence without images to
               break it up.
     --single  1 figure, spanning the measure.
     --duo     2 figures: first wide, second inset and floated.
     --rich    3+ figures alternating wide/inset; two adjacent
               figures render as a 2-up pair instead.

   SIGNATURE
   The short red rule the site puts under every page title
   (.support-head__title::after) is reused here as a reading
   progress bar pinned beneath the nav. Same device, new job:
   on an article, length is information the reader wants.

   Defensive notes: m072224.css sets global
     p, li { line-height: 2.2rem; font-size: 1.2rem;
             letter-spacing: .03rem; color: var(--c3) }
     ol li { list-style: decimal; list-style-position: inside }
     ol    { display: grid; grid-gap: .5rem }
     b, strong { font-weight: 400; letter-spacing: .07rem }
     h1 { font-size: 4rem; font-weight: 200; uppercase }
     a  { color: var(--c4) }
   Class selectors (0,1,0) out-rank all of those (0,0,1 / 0,0,2),
   so each rule below simply restates what it needs.
   ========================================================= */

/* --bp-measure is the text column itself, not a padded box: .bp-body
   adds the 1.5rem gutters back on so the copy lines up with the hero
   title, the wide-figure captions and the comment thread. */
:root {
    --bp-measure: 47rem;
    --bp-gap: clamp(1.15rem, 2vw, 1.5rem);
}

/* ── Reading progress ──────────────────────────────────── */
.bp-progress {
    position: fixed;
    top: var(--nav-h, 3.3rem);
    left: 0;
    z-index: 60;
    width: 100%;
    height: 0.16rem;
    background: rgba(255, 255, 255, 0.05);
    pointer-events: none;
}

.bp-progress__bar {
    display: block;
    width: 100%;
    height: 100%;
    transform: scaleX(var(--bp-progress, 0));
    transform-origin: 0 50%;
    background: linear-gradient(
        90deg,
        var(--theme-accent-deep, #8f0000) 0%,
        var(--theme-accent, #aa0000) 60%,
        #d42828 100%
    );
    will-change: transform;
}

/* ── Hero ──────────────────────────────────────────────── */
.bp-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: clamp(20rem, 52vh, 32rem);
    /* The nav is fixed and the hero image runs full-bleed underneath it, so
       this padding is the only thing keeping the crumbs out from under the
       bar — the nav's own height has to be part of it. Without that the
       clearance is whatever is left over, which on a phone (short hero,
       tall headline) is nothing. */
    padding: calc(var(--nav-h, 3.3rem) + clamp(1.5rem, 5vw, 2.5rem)) 1.5rem
        clamp(1.4rem, 2.8vw, 2rem);
    overflow: hidden;
}

.bp-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.bp-hero__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.bp-hero__scrim {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            180deg,
            rgba(4, 4, 5, 0.55) 0%,
            rgba(4, 4, 5, 0.3) 34%,
            rgba(4, 4, 5, 0.78) 78%,
            #020203 100%
        );
}

.bp-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--bp-measure);
    margin: 0 auto;
}

/* Hero without an image — the gradient backdrop from .support-flow
   already sits behind it, so just reclaim the vertical space. */
.bp-hero:not(:has(.bp-hero__media)) {
    min-height: 0;
    padding-top: calc(var(--nav-h, 3.3rem) + clamp(1rem, 3vw, 1.75rem));
}

/* The crumbs sit on a photograph, so they carry the same shadow the
   title and dek do — muted grey alone disappears into a bright frame. */
.bp-crumbs {
    margin: 0 0 1.1rem;
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--theme-text-main-soft, rgba(255, 255, 255, 0.94));
    text-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.bp-crumbs__link {
    color: var(--theme-text-main-soft, rgba(255, 255, 255, 0.94));
    text-decoration: none;
    transition: color 150ms ease, text-decoration-color 150ms ease;
}

.bp-crumbs__link:hover,
.bp-crumbs__link:focus-visible {
    color: var(--theme-text-strong, #ffffff);
    text-decoration: underline;
    text-decoration-color: rgba(212, 40, 40, 0.8);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.3em;
}

.bp-crumbs__sep {
    margin: 0 0.5rem;
    color: var(--theme-text-muted, #c4c6cc);
}

.bp-crumbs__current {
    color: var(--theme-text-link-accent-hover, #ffb1b1);
}

/* Article headlines are content, not page furniture — so unlike
   .support-head__title they are set in sentence case. */
.bp-hero__title {
    margin: 0;
    font-size: clamp(2rem, 4.4vw, 3.25rem);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: -0.025em;
    text-transform: none;
    text-wrap: balance;
    color: var(--theme-text-strong, #ffffff);
    text-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.bp-hero__dek {
    margin: clamp(0.9rem, 1.8vw, 1.2rem) 0 0;
    max-width: 34rem;
    font-size: clamp(1rem, 1.35vw, 1.14rem);
    font-weight: 300;
    line-height: 1.65;
    letter-spacing: 0.005em;
    color: var(--theme-text-main-soft-2, rgba(255, 255, 255, 0.92));
    text-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.bp-hero__meta {
    margin: clamp(1.1rem, 2.2vw, 1.5rem) 0 0;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--theme-text-muted, #c4c6cc);
}

.bp-hero__author {
    color: var(--theme-text-strong, #ffffff);
}

.bp-hero__dot {
    margin: 0 0.5rem;
    color: var(--theme-text-soft, #989ba3);
}

/* ── Body: the measure ─────────────────────────────────── */
/* The 3rem is the padding below — added back so the copy inside is
   exactly --bp-measure wide and starts on the hero title's left edge. */
.bp-body {
    max-width: calc(var(--bp-measure) + 3rem);
    margin: 0 auto;
    padding: clamp(1.6rem, 3.2vw, 2.4rem) 1.5rem 0;
}

/* ── Body type ─────────────────────────────────────────── */
/* Sizes step up with the measure — a wider column needs a bigger
   glyph to keep the line length inside a readable ~80 characters. */
.bp-lead {
    margin: 0 0 var(--bp-gap);
    font-size: clamp(1.16rem, 1.6vw, 1.3rem);
    font-weight: 300;
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--theme-text-main, #ececef);
}

.bp-p {
    margin: 0 0 var(--bp-gap);
    font-size: 1.1rem;
    font-weight: 300;
    line-height: 1.85;
    letter-spacing: 0.008em;
    color: var(--theme-text-muted, #c4c6cc);
}

.bp-body strong {
    font-weight: 600;
    letter-spacing: inherit;
    color: var(--theme-text-strong, #ffffff);
}

.bp-body em {
    font-style: italic;
    color: inherit;
}

.bp-body a {
    color: var(--theme-text-main, #ececef);
    text-decoration: underline;
    text-decoration-color: rgba(212, 40, 40, 0.7);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    transition: color 150ms ease, text-decoration-color 150ms ease;
}

.bp-body a:hover,
.bp-body a:focus-visible {
    color: #ffffff;
    text-decoration-color: #d42828;
}

.bp-h2 {
    margin: clamp(2.25rem, 4vw, 3rem) 0 1.05rem;
    font-size: clamp(1.38rem, 2.1vw, 1.62rem);
    font-weight: 400;
    line-height: 1.3;
    letter-spacing: -0.005em;
    text-transform: none;
    color: var(--theme-text-strong, #ffffff);
}

.bp-h3 {
    margin: clamp(1.75rem, 3vw, 2.25rem) 0 0.75rem;
    font-size: 1.16rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.01em;
    text-transform: none;
    color: var(--theme-text-strong, #ffffff);
}

/* Text-only posts have no images to set a cadence, so the headings
   carry the site's red rule instead. */
.bp-article--text .bp-h2 {
    position: relative;
    padding-top: 1.25rem;
}

.bp-article--text .bp-h2::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 2.75rem;
    height: 0.18rem;
    border-radius: var(--theme-radius-pill, 999px);
    background: linear-gradient(
        90deg,
        var(--theme-accent, #aa0000) 0%,
        var(--theme-accent-deep, #8f0000) 60%,
        transparent 100%
    );
}

/* The drop cap is reserved for text-only posts — with a figure on the
   page there is already enough happening near the top. */
.bp-article--text .bp-lead::first-letter {
    float: left;
    margin: 0.34rem 0.55rem 0 0;
    font-size: 3.4rem;
    font-weight: 300;
    line-height: 0.82;
    color: var(--theme-text-strong, #ffffff);
}

/* ── Lists ─────────────────────────────────────────────── */
.bp-list {
    display: block;
    margin: 0 0 clamp(1.5rem, 2.6vw, 2rem);
    padding: 0;
    list-style: none;
    counter-reset: bp-counter;
}

.bp-list__item {
    position: relative;
    margin: 0 0 1.4rem;
    padding-left: 2.35rem;
    /* beats `p, li` and `ol li` from m072224.css */
    line-height: 1.85;
    font-size: 1.1rem;
    letter-spacing: 0.008em;
    color: var(--theme-text-muted, #c4c6cc);
    list-style: none;
}

.bp-list__item:last-child {
    margin-bottom: 0;
}

.bp-list--ordered .bp-list__item {
    counter-increment: bp-counter;
}

.bp-list--ordered .bp-list__item::before {
    content: counter(bp-counter);
    position: absolute;
    top: 0.28rem;
    left: 0;
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border: 1px solid var(--theme-border-strong, rgba(255, 255, 255, 0.18));
    border-radius: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.04) 100%);
    color: var(--theme-text-main-soft-2, rgba(255, 255, 255, 0.92));
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
}

.bp-list--bullet .bp-list__item::before {
    content: "";
    position: absolute;
    top: 0.82rem;
    left: 0.42rem;
    width: 0.42rem;
    height: 0.42rem;
    border-radius: 50%;
    background: var(--theme-accent, #aa0000);
}

.bp-list__label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1.08rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.005em;
    color: var(--theme-text-strong, #ffffff);
}

.bp-list__text {
    margin: 0;
    font-size: 1.06rem;
    font-weight: 300;
    line-height: 1.8;
    letter-spacing: 0.008em;
    color: var(--theme-text-muted, #c4c6cc);
}

/* ── Figures ───────────────────────────────────────────── */
.bp-figure {
    margin: clamp(2rem, 3.6vw, 2.75rem) 0;
}

.bp-figure__frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.09));
    border-radius: var(--theme-radius-md, 1rem);
    background: #0b0b0c;
}

/* ── Figure → fullscreen ───────────────────────────────── */
/* Wired by src/js/blog-gallery.js to the shared viewer the model and
   service pages use. The frame is the hit target; the badge is the only
   thing that says so, so it stays visible on touch (where there is no
   hover) and simply brightens on pointer devices. */
.bp-figure__frame[data-bp-lightbox] {
    cursor: zoom-in;
}

.bp-figure__zoom {
    position: absolute;
    right: 0.7rem;
    bottom: 0.7rem;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--theme-radius-pill, 999px);
    background: rgba(10, 10, 11, 0.62);
    backdrop-filter: blur(6px);
    color: var(--theme-text-main-soft, rgba(255, 255, 255, 0.94));
    font-size: 0.72rem;
    opacity: 0.72;
    transition: opacity 160ms ease, background-color 160ms ease, border-color 160ms ease;
    pointer-events: none;
}

.bp-figure__frame[data-bp-lightbox]:hover .bp-figure__zoom,
.bp-figure__frame[data-bp-lightbox]:focus-visible .bp-figure__zoom {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.38);
    background: rgba(10, 10, 11, 0.82);
}

.bp-figure__frame[data-bp-lightbox]:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.7);
    outline-offset: 3px;
}

.bp-figure__frame[data-bp-lightbox] .bp-figure__img {
    transition: transform 320ms ease, opacity 320ms ease;
}

.bp-figure__frame[data-bp-lightbox]:hover .bp-figure__img {
    transform: scale(1.012);
}

@media (prefers-reduced-motion: reduce) {
    .bp-figure__frame[data-bp-lightbox] .bp-figure__img,
    .bp-figure__frame[data-bp-lightbox]:hover .bp-figure__img {
        transition: none;
        transform: none;
    }
}

/* The viewer mount carries no layout of its own. */
.bp-gallery {
    display: contents;
}

/* The fullscreen viewer's own type lives in service-detail-gallery.css —
   the blog, model and service pages all read the same. */

.bp-figure__img {
    width: 100%;
    height: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.bp-figure__caption {
    margin: 0.8rem 0 0;
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.6;
    letter-spacing: 0.012em;
    color: var(--theme-text-soft, #989ba3);
}

/* Wide — the full text column, edge to edge with the copy. */
.bp-figure--wide {
    width: 100%;
}

/* Inset — a narrower figure sitting inside the measure.

   It only floats when a paragraph actually follows it; a float with a
   heading, callout or quote next (all of which clear) would leave the
   figure stranded beside an empty column. Browsers without :has simply
   keep the centred block, which is the safe rendering either way. */
.bp-figure--inset {
    width: 70%;
    margin-inline: auto;
}

.bp-figure--inset:has(+ .bp-p) {
    float: right;
    width: 52%;
    margin: 0.4rem 0 1.5rem 1.85rem;
}

.bp-figure--inset .bp-figure__img {
    aspect-ratio: 4 / 3;
}

/* Pair — two adjacent figures share a row (the --rich variant),
   the row itself spanning the same column as a wide figure. */
.bp-figure-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
    margin: clamp(2rem, 3.6vw, 2.75rem) 0;
}

.bp-figure--pair {
    margin: 0;
}

.bp-figure--pair .bp-figure__img {
    aspect-ratio: 4 / 3;
}

/* A float has to be cleared before the next heading or the end matter. */
.bp-h2,
.bp-h3,
.bp-figure--wide,
.bp-figure-pair,
.bp-callout,
.bp-quote,
.bp-endcap,
.bp-tags,
.bp-updated {
    clear: both;
}

/* ── Quote ─────────────────────────────────────────────── */
.bp-quote {
    margin: clamp(2rem, 3.6vw, 2.75rem) 0;
    padding: 0 0 0 1.5rem;
    border-left: 2px solid var(--theme-accent, #aa0000);
}

.bp-quote__text {
    margin: 0;
    font-size: clamp(1.18rem, 1.7vw, 1.34rem);
    font-weight: 300;
    line-height: 1.62;
    letter-spacing: 0.004em;
    color: var(--theme-text-main, #ececef);
}

.bp-quote__cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--theme-text-soft, #989ba3);
}

/* ── Callout ───────────────────────────────────────────── */
.bp-callout {
    display: flex;
    gap: 1rem;
    margin: clamp(2rem, 3.6vw, 2.75rem) 0;
    padding: 1.35rem 1.5rem;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.09));
    border-radius: var(--theme-radius-md, 1rem);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.bp-callout__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: var(--theme-surface-white-08, rgba(255, 255, 255, 0.08));
    color: var(--theme-text-main-soft-2, rgba(255, 255, 255, 0.92));
    font-size: 0.86rem;
}

.bp-callout__title {
    margin: 0 0 0.35rem;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.45;
    letter-spacing: 0.01em;
    color: var(--theme-text-strong, #ffffff);
}

.bp-callout__text {
    margin: 0;
    font-size: 1.01rem;
    font-weight: 300;
    line-height: 1.72;
    letter-spacing: 0.008em;
    color: var(--theme-text-muted, #c4c6cc);
}

/* ── Inline CTA ────────────────────────────────────────── */
.bp-inline-cta {
    margin: clamp(1.75rem, 3vw, 2.25rem) 0;
    line-height: 1;
}

/* ── End matter ────────────────────────────────────────── */
.bp-updated {
    margin: clamp(2rem, 3.4vw, 2.5rem) 0 0;
    font-size: 0.76rem;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--theme-text-soft, #989ba3);
}

.bp-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 1.5rem 0 0;
    padding: 0;
    list-style: none;
}

.bp-tags__item {
    padding: 0.3rem 0.72rem;
    border: 1px solid var(--theme-border, rgba(255, 255, 255, 0.1));
    border-radius: var(--theme-radius-pill, 999px);
    background: var(--theme-surface-white-04, rgba(255, 255, 255, 0.04));
    color: var(--theme-text-soft, #989ba3);
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    list-style: none;
}

/* ── End cap ───────────────────────────────────────────── */
/* One line and a button, nothing else: a hairline rule across the
   text column's own edges, then air. The sign-off should read as the
   end of the page, not as a second piece of furniture competing with
   the "Keep reading" rail below it. */
/* The gap — not a margin on the button — sets the space above the CTA:
   cta.css loads after this file and its `.tv-cta { margin: 0 }` would win
   any same-specificity margin rule here. */
.bp-endcap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(2.25rem, 4.2vw, 3.1rem);
    max-width: var(--bp-measure);
    margin: clamp(3rem, 6vw, 4.5rem) auto 0;
    padding: clamp(2.25rem, 4.4vw, 3rem) 1.5rem;
    border-top: 1px solid var(--theme-divider, rgba(255, 255, 255, 0.08));
    text-align: center;
}

/* Kept on one line at the measure — the balance is in the spacing,
   so there is nothing for a second line to sit under. */
.bp-endcap__text {
    margin: 0;
    font-size: clamp(1.2rem, 2.1vw, 1.5rem);
    font-weight: 300;
    line-height: 1.4;
    letter-spacing: -0.008em;
    text-wrap: balance;
    color: var(--theme-text-main, #ececef);
}


/* ── 404 ───────────────────────────────────────────────── */
.bp-missing {
    max-width: 34rem;
    margin: 0 auto;
    padding: clamp(4rem, 12vh, 7rem) 1.5rem clamp(5rem, 10vw, 7rem);
    text-align: center;
}

.bp-missing__eyebrow {
    margin: 0 0 0.8rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--theme-text-accent-soft, #f0c7c7);
}

.bp-missing__title {
    margin: 0 0 1rem;
    font-size: clamp(1.7rem, 3.6vw, 2.4rem);
    font-weight: 300;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-transform: none;
    color: var(--theme-text-strong, #ffffff);
}

.bp-missing__text {
    margin: 0;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.008em;
    color: var(--theme-text-muted, #c4c6cc);
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 900px) {
    /* Below this width an inset figure leaves the text in a column too
       narrow to read — everything goes full width. */
    .bp-figure--inset,
    .bp-figure--inset:has(+ .bp-p) {
        float: none;
        width: 100%;
        margin: clamp(2rem, 3.6vw, 2.75rem) 0;
    }

    .bp-figure--inset .bp-figure__img {
        aspect-ratio: 16 / 9;
    }
}

@media (max-width: 640px) {
    /* min-height is what the nav clearance has to survive: the hero is short
       here, so it is stated as the clearance plus the room the lockup needs
       rather than a flat viewport fraction. */
    .bp-hero {
        min-height: calc(var(--nav-h, 3.3rem) + clamp(13rem, 34vh, 17rem));
        padding-inline: 1rem;
    }

    .bp-body {
        padding-inline: 1rem;
    }

    .bp-figure-pair {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .bp-list__item {
        padding-left: 2.1rem;
    }

    .bp-callout {
        padding: 1.15rem 1.2rem;
    }

    .bp-endcap {
        padding-inline: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bp-progress__bar {
        transition: none;
    }
}
