/* Blog — shared shell.

   Everything the index, the category listing and the article all need: the
   design tokens, the breadcrumb, the icon sizing and the type scale. It used to
   live in article.css, which is why the category page rendered its breadcrumb
   as a bare unstyled list — that sheet is only loaded on an article.

   Loaded BEFORE article.css / listing.css so a page-specific rule still wins.
*/

/* .blog-products-bar and #blog-products-modal carry the tokens too: both are
   chrome rendered at the end of <body>, OUTSIDE .blog-redesign, and the second
   is a <dialog> — custom properties inherit down the DOM tree, not from the top
   layer it is painted in. Without this the mini card's add-to-cart resolved
   `background: var(--vd-primary)` to nothing and came out transparent with
   white text: an invisible button, exactly the failure the comment below
   describes. Listed here rather than redeclared, so the values live once. */
.blog-redesign,
.blog-products-bar,
#blog-products-modal {
    --navy: #1c1c1c;
    --navy-light: #2a2a2a;
    --green: #00d4aa;
    --green-dark: #00b894;
    --orange: #ff6b35;
    --orange-light: #ff8c5a;
    --white: #ffffff;
    --gray-light: #f0f2f5;

    /* Text, borrowed wholesale from the video page (videos/css/video.css:25-27)
       so an article and a video read as the same site. The blog had its own
       lighter scale; the secondary tone in particular was #8892a4, a blue-grey
       that only reaches 3.1:1 on white and so fails WCAG AA for body copy. The
       three below are 7.2:1, 13.3:1 and 15.9:1. */
    --gray: #515862;      /* meta, captions, anything secondary */
    --text-body: #2b3038; /* prose: paragraphs, list items, quotes */
    --text-dark: #15181c; /* headings */

    /* The mini product card is shared with the Fiche Vidéo and styles itself
       from --vd-*, which video.css declares on `.vd`. A blog page has no such
       ancestor, so every one of these resolved to nothing and the card lost its
       border, its thumbnail background and its add-to-cart colour outright — an
       invalid var() kills the whole declaration, it does not fall back.
       Same values as videos/css/video.css:25-36. */
    --vd-ink: #15181c;
    --vd-muted: #515862;
    --vd-line: #e4e7ea;
    --vd-bg-soft: #f3f6f4;
    --vd-primary: #ec7330;
    --vd-primary-dark: #d9601f;
    --vd-shadow: 0 6px 24px rgba(20, 30, 25, 0.10);

    /* The reading size, same token and same value the video pages use. One
       size for every prose block, so the editorial voice does not change
       between a paragraph, a list item and a quote. */
    --vd-read: 17px;
}

/* --- Breadcrumb, meta and share, now that core/css/blog.css is gone ---------
   The legacy sheet is what made the trail a centred grey box that wrapped onto
   two lines. These rules replace what it provided, on the mockup's shapes. */

.article-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* The trail wraps as soon as an article has a long title, and the hero it
       sits in is centred. Left to its default the wrapped lines aligned left
       inside a centred block, so a two-line trail looked broken rather than
       wrapped: measured at 320 on both lines against a hero centred on 720. */
    justify-content: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* The separator is drawn, not written: a ">" between two <li> would be read
   aloud as content and would land in the name a crawler extracts. */
.article-breadcrumb li + li::before {
    content: "›";
    color: rgba(0, 0, 0, 0.25);
}

.article-breadcrumb a {
    text-decoration: none;
}

.article-breadcrumb li:last-child a {
    color: var(--text-dark);
    pointer-events: none;
}

/* On a phone the trail is cut to ONE crumb: the level immediately above.
   `‹ Mouches` on an article, `‹ Articles vidéo` on a category listing.

   This is the pattern NN/G recommends — "consider shortening the breadcrumb
   trail to include only the last level(s)" — and it answers the three things at
   once that the full trail and the bare removal each got wrong. The full trail
   wrapped onto two lines and cost 68px, which NN/G names as the mobile failure
   mode. Removing it outright took the only way back up to the category with it.
   One crumb wraps nothing and still goes up.

   nth-last-child(2), not a fixed position: the trail is two crumbs deep on the
   blog home, three on a listing and four on an article, so "the one before the
   current page" is the only way to say "the parent" for all three.

   The separator flips to a back chevron for the same reason it exists at all —
   it is drawn, never written, so it stays out of what a screen reader reads and
   out of the name a crawler extracts.

   The other crumbs are hidden, not removed: the <nav> and its ListItems stay in
   the DOM, so the BreadcrumbList is unchanged for a crawler and for an LLM,
   which both read the markup rather than the pixels. */
@media (max-width: 768px) {
    .blog-redesign .article-breadcrumb li {
        display: none;
    }

    .blog-redesign .article-breadcrumb li:nth-last-child(2) {
        display: inline-flex;
    }

    .blog-redesign .article-breadcrumb li:nth-last-child(2)::before {
        content: "‹";
        color: inherit;
    }

    /* NN/G puts the floor for a tap target at 1cm — about 38px. The crumb was
       a line of text with nothing around it. */
    .blog-redesign .article-breadcrumb li:nth-last-child(2) a {
        display: inline-flex;
        align-items: center;
        min-height: 38px;
        padding-right: 8px;
    }
}

/* The icons are sized in em so they follow the text they sit next to. */
.article-hero-meta .vd-icon,
.article-author .vd-icon {
    width: 1em;
    height: 1em;
    flex-shrink: 0;
}

.share-btn .vd-icon {
    width: 1.05em;
    height: 1.05em;
}

.article-content .figcaption,
.article-content figcaption {
    display: block;
}

/* --- Typography, surfaces and icons -----------------------------------------
   Aligned on the redesign tokens rather than on the mockup's own font stack:
   core/redesign/css/tokens.css already self-hosts Inter and Poppins and
   base.html loads it on every page. The mockup pulls the same two families from
   fonts.googleapis, which the audit measured at 900 ms of render-blocking —
   re-importing that link was explicitly what lot 1 said not to do. */

.blog-redesign {
    font-family: var(--font-body, 'Inter', system-ui, sans-serif);
    /* The inherited default, so anything the sheets below don't colour lands on
       the ink rather than on the browser's black — same as the video wrapper. */
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
}

.blog-redesign h1,
.blog-redesign h2,
.blog-redesign h3,
.blog-redesign h4,
.article-hero h1,
.blog-card-title {
    font-family: var(--font-heading, 'Poppins', 'Inter', system-ui, sans-serif);
}

/* No grey panels: the sidebar blocks, the author card and the summary sit on
   the page rather than in tinted boxes, and a hairline carries the separation
   instead. */
.sidebar-toc,
.sidebar-share,
.sidebar-related,
.article-author,
.article-info-box {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* The hero KEEPS the mockup's tint: it is what separates the breadcrumb, the
   title, the byline and the reading time from the article body below. The
   panels that were dropped are the sidebar blocks and the author card, which
   the tint only cluttered. */
.article-hero {
    background: var(--gray-light);
}

.article-cover {
    background: transparent;
}

/* The fade the mockup draws under the scrollable summary was a gradient to the
   panel's grey; with no panel it would smear a grey band over the page. */
.toc-scroll-hint,
.toc-links-wrapper::after {
    background: none;
}

/* Icons take the colour of the text they sit next to and nothing else — no
   accent, which is what `currentColor` already gives once no rule overrides it.
   The hero byline is the one exception, and it is the mockup's: article.css
   gives those three the orange. */
.article-breadcrumb .vd-icon,
.sidebar-toc .vd-icon,
.sidebar-share .vd-icon {
    color: inherit;
    fill: none;
    stroke: currentColor;
}

/* The two social glyphs are solid shapes, not strokes. */
.share-btn .vd-icon {
    fill: currentColor;
    stroke: none;
}

/* The trail centres inside a centred hero and left-aligns inside the article's,
   so it follows its container rather than deciding for itself. */
.blog-hero .article-breadcrumb ol {
    justify-content: center;
}

/* The sticky sidebar needs html/body NOT to be scroll containers.

   The theme sets `overflow-x: hidden` on both, and the spec makes a box with
   one axis hidden compute the other to `auto` — so body becomes the scrolling
   box, and `position: sticky` inside it scrolls away with the page instead of
   pinning to the viewport. Measured: after 1200px of scroll the sidebar's
   viewport top went from 236 to -135.

   `clip` prevents exactly the same horizontal overflow without creating a
   scroll container, so sticky works and nothing else moves. Scoped to the blog
   sheets, which are the only pages loading this file. */
html,
body {
    overflow-x: clip;
}
