/* ============================================================
   Public blog front-end. The host site's chrome wraps this, so there is no header/footer here.
   Two navigation layouts, chosen per-site in dwblogconsole/settings and applied as a shell modifier
   class by _BlogLayout.cshtml:
     .blog-shell--bottom   → full-width bar of dropdown "pills" beneath the post list
     .blog-shell--sidebar  → sticky accordion rail to the right of the post list
   One markup (Views/Shared/Components/BlogNav/Default.cshtml) drives both; the CSS below arranges it.
   Desktop layout rules live in @media (min-width:901px); everything collapses to one column + a
   "Blog menu" toggle in @media (max-width:900px).
   ============================================================ */

:root { --ink: #1a2230; --muted: #5b6472; --line: #e7e9ee; --surface: #f6f8fb; --accent: #0b5fff; /* Hover colour. Overridden by the theme "secondary" setting; when only "primary" is set it auto-derives a
       darker shade of the accent. First line is the fallback for browsers without color-mix (hover == accent). */ --accent-hover: var(--accent); --accent-hover: color-mix(in srgb, var(--accent) 85%, #000); --radius: 12px; }

* { box-sizing: border-box; }
body { margin: 0; font-family: "Lato", sans-serif; font-weight: 400; font-style: normal; color: #546d7f;  background: #fff; }
.blog-main a { color: var(--accent); text-decoration: none; }
.blog-main a:hover { color: var(--accent-hover); }

p a { text-decoration: none; }

.main-blog-container {font-size: 1rem;}

/* ---------- Content ---------- */
.wrap { max-width: 760px; margin: 0 auto; }
/* Listing pages (grid or list) use the full content width; the 760 reading cap stays for the single post. */
.blog-main .wrap:has(.posts) { max-width: none; }
.blog-main { padding: 32px 0; }
/* We borrow the host's #content id so its scroll-compact header JS runs; neutralise the host CSS that also targets
   #content (min-height / position / z-index:999) so it can't reshape the blog layout or sit over the nav dropdowns. */
.blog-main#content { position: static; z-index: auto; min-height: 0; }
h1 { line-height: 1.2; margin: 0 0 8px; font-size: 2rem; }
.intro { color: var(--muted); margin: 0 0 28px; font-size: 1.1rem; }
.meta { color: var(--muted); font-size: .9rem; }
/* Links in the meta line (e.g. the author archive link) use the theme colours; higher specificity than a bare `a`
   so the host CSS bundle can't recolour them. */
.meta a { color: var(--accent); }
.meta a:hover { color: var(--accent-hover); }
/* ---------- Featured posts (home page 1 only): hero blocks above the list ---------- */
.featured { display: flex; flex-direction: column; gap: 22px; margin-bottom: 36px; width: 100% !important; }
.featured-card { display: flex; gap: 32px; align-items: stretch; min-height: 340px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 16px 38px rgba(16, 26, 48, .14); transition: box-shadow .15s ease, transform .15s ease; }
.featured-card:hover { box-shadow: 0 22px 50px rgba(16, 26, 48, .19); transform: translateY(-2px); }
.featured-card-image { flex: 0 0 46%; display: block; overflow: hidden; background: var(--surface); }
.featured-card-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.featured-card-image-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #eef2f7, #dfe6ef); }
.featured-card-body { flex: 1 1 auto; display: flex; flex-direction: column; padding: 34px 38px 34px 4px; }
.featured-flag { align-self: flex-start; margin-bottom: 12px; padding: 3px 10px; background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.featured-card-body h2 { margin: 4px 0 10px; font-size: 2.1rem; line-height: 1.15; }
.featured-card-body h2 a { color: var(--ink); }
.featured-card-body h2 a:hover { color: var(--accent-hover); text-decoration: none; }
.featured-card .card-excerpt { color: #37414f; }
.featured-card .card-excerpt > :first-child { margin-top: 0; }
.featured-card .card-readmore { margin-top: auto; padding-top: 12px; font-weight: 600; }

@media (max-width: 720px) {
    .featured-card { flex-direction: column; min-height: 0; }
    .featured-card-image { flex-basis: auto; aspect-ratio: 16 / 9; }
    .featured-card-body { padding: 20px 22px 24px; }
}

/* ---------- Post cards (shared by list + grid) ---------- */
.card-image { display: block; overflow: hidden; background: var(--surface); border-radius: 10px; }
.card-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-image-ph { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #eef2f7, #dfe6ef); }
.card h2 { margin: 0 0 6px; font-size: 1.3rem; line-height: 1.25; }
.card h2 a { color: var(--accent); }
.card h2 a:hover { color: var(--accent-hover); text-decoration: none; }
.card .meta { margin-bottom: 8px; }
.card-excerpt { color: #37414f; }
.card-excerpt > :first-child { margin-top: 0; }
.card-excerpt > :last-child { margin-bottom: 0; }
.card-excerpt img { max-width: 100%; height: auto; border-radius: 8px; }
.card-readmore { display: inline-block; margin-top: 10px; font-weight: 600; font-size: .9rem; }

/* List: image left, text right (stacks on narrow screens) */
.posts--list { display: flex; flex-direction: column; }
.posts--list .card { display: flex; gap: 24px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.posts--list .card:first-child { padding-top: 6px; }
.posts--list .card-image { flex: 0 0 240px; aspect-ratio: 16 / 10; align-self: flex-start; }

/* Grid: image-forward tiles (excerpt + read-more hidden — image + title + meta only) */
.posts--grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }

@media (max-width: 1200px) {
    .posts--grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .posts--grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
    .posts--grid { grid-template-columns: 1fr; }
}

.posts--grid .card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.posts--grid .card:hover { box-shadow: 0 12px 28px rgba(16, 26, 48, .12); transform: translateY(-2px); }
.posts--grid .card-image { aspect-ratio: 16 / 10; border-radius: 0; }
.posts--grid .card-body { padding: 15px 16px 18px; }
.posts--grid .card h2 { font-size: 1.2rem; }
.posts--grid .card-excerpt, .posts--grid .card-readmore { display: none; }

/* Excerpt: each post rendered article-style, cut at <!--more--> (whole post when there's no marker), with a
   prominent Read More. Single full-width column; no separate thumbnail — images flow inside the body, exactly
   as they do on the full post page (.post .body). */
.posts--excerpt { display: flex; flex-direction: column; max-width: 760px; }
.posts--excerpt .card { display: block; padding: 40px 0; border-bottom: 1px solid var(--line); }
.posts--excerpt .card:first-child { padding-top: 6px; }
.posts--excerpt .card-image, .posts--excerpt .card-image-ph { display: none; }
.posts--excerpt .card h2 { font-size: 1.9rem; line-height: 1.2; margin-bottom: 8px; }
.posts--excerpt .card h2 a { color: var(--ink); }
.posts--excerpt .card h2 a:hover { color: var(--accent-hover); }
/* Body reads like the full article: same base type/line-height, spaced paragraphs, responsive media. */
.posts--excerpt .card-excerpt { margin-top: 18px; color: var(--ink); font-size: 1rem; line-height: 1.6; }
.posts--excerpt .card-excerpt img { max-width: 100%; height: auto; border-radius: 8px; }
.posts--excerpt .card-excerpt iframe { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; }
.posts--excerpt .card-readmore { display: inline-flex; align-items: center; margin-top: 18px; padding: 9px 18px; background: var(--accent); color: #fff; border-radius: 6px; font-size: .9rem; font-weight: 600; }
.posts--excerpt .card-readmore:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

/* Alternating: list-style rows, but the image and text swap sides on every other row (zig-zag / feature
   rows). Larger, balanced image so the alternation reads clearly. Stacks to one column on narrow screens. */
.posts--alternating { display: flex; flex-direction: column; }
.posts--alternating .card { display: flex; gap: 36px; align-items: center; padding: 34px 0; border-bottom: 1px solid var(--line); }
.posts--alternating .card:first-child { padding-top: 6px; }
.posts--alternating .card-image { flex: 0 0 42%; aspect-ratio: 16 / 10; align-self: center; }
.posts--alternating .card:nth-child(even) { flex-direction: row-reverse; }

@media (max-width: 640px) {
    .posts--list .card { flex-direction: column; gap: 14px; }
    .posts--list .card-image { flex-basis: auto; width: 100%; }
    /* Stack image-on-top on phones; ignore the desktop zig-zag so every row reads the same way. */
    .posts--alternating .card,
    .posts--alternating .card:nth-child(even) { flex-direction: column; gap: 14px; align-items: stretch; }
    .posts--alternating .card-image { flex-basis: auto; width: 100%; }
}

/* Masonry: Pinterest-style tiles packed into CSS columns (no JS). Same tile look as the grid, but the excerpt
   stays visible and images keep their natural height, so cards vary in height and pack tightly. Note: CSS
   columns fill each column top-to-bottom then move across (as Pinterest does), so reading order runs down a
   column, not left-to-right by recency. */
.posts--masonry { column-count: 4; column-gap: 26px; }
.posts--masonry .card { display: inline-block; width: 100%; margin: 0 0 26px; break-inside: avoid; -webkit-column-break-inside: avoid; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.posts--masonry .card:hover { box-shadow: 0 12px 28px rgba(16, 26, 48, .12); transform: translateY(-2px); }
.posts--masonry .card-image { display: block; border-radius: 0; }
.posts--masonry .card-image img { height: auto; }                        /* natural height -> variable tiles */
.posts--masonry .card-image-ph { height: auto; aspect-ratio: 16 / 10; }  /* imageless posts still get a tile */
.posts--masonry .card-body { padding: 15px 16px 18px; }
.posts--masonry .card h2 { font-size: 1.2rem; }
.posts--masonry .card-excerpt { font-size: .92rem; }

@media (max-width: 1200px) { .posts--masonry { column-count: 3; } }
@media (max-width: 900px)  { .posts--masonry { column-count: 2; } }
@media (max-width: 500px)  { .posts--masonry { column-count: 1; } }

/* Magazine / featured-first: the first post is a full-width hero (big image + visible excerpt), the rest are
   compact grid tiles beneath it. Pure CSS via :first-child — no special markup. On the home page this sits
   below any IsFeatured hero(s); on taxonomy/search/archive pages the first post simply becomes the lead. */
.posts--magazine { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
/* Secondary items: image-forward tiles (same as grid — excerpt hidden). */
.posts--magazine .card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; transition: box-shadow .15s ease, transform .15s ease; }
.posts--magazine .card:hover { box-shadow: 0 12px 28px rgba(16, 26, 48, .12); transform: translateY(-2px); }
.posts--magazine .card-image { aspect-ratio: 16 / 10; border-radius: 0; }
.posts--magazine .card-body { padding: 15px 16px 18px; }
.posts--magazine .card h2 { font-size: 1.2rem; }
.posts--magazine .card-excerpt, .posts--magazine .card-readmore { display: none; }
/* Lead item: spans every column; image beside larger text with the excerpt shown. */
.posts--magazine .card:first-child { grid-column: 1 / -1; flex-direction: row; align-items: stretch; min-height: 320px; }
.posts--magazine .card:first-child .card-image { flex: 0 0 55%; aspect-ratio: auto; }
.posts--magazine .card:first-child .card-body { flex: 1 1 auto; justify-content: center; padding: 30px 34px; }
.posts--magazine .card:first-child h2 { font-size: 2rem; line-height: 1.15; }
.posts--magazine .card:first-child .card-excerpt { display: block; margin-top: 6px; }
.posts--magazine .card:first-child .card-readmore { display: inline-block; margin-top: 14px; }

@media (max-width: 900px) { .posts--magazine { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) {
    .posts--magazine { grid-template-columns: 1fr; }
    .posts--magazine .card:first-child { flex-direction: column; min-height: 0; }
    .posts--magazine .card:first-child .card-image { flex-basis: auto; aspect-ratio: 16 / 9; }
    .posts--magazine .card:first-child .card-body { padding: 20px 20px 24px; }
}

/* Overlay tiles: a grid of poster-style tiles with the title + meta laid over the image behind a dark gradient
   scrim (excerpt hidden). Pure CSS — the existing .card-image and .card-body are absolutely stacked inside the
   tile. Imageless posts get a dark gradient tile so the white text stays legible. */
.posts--overlay { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.posts--overlay .card { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--ink); }
.posts--overlay .card-image { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; }
.posts--overlay .card-image img { width: 100%; height: 100%; transition: transform .3s ease; }
.posts--overlay .card:hover .card-image img { transform: scale(1.05); }
.posts--overlay .card-image-ph { background: linear-gradient(135deg, #3a4553, #1a2230); }
/* Scrim + text pinned to the bottom, over the image. */
.posts--overlay .card-body { position: absolute; inset: auto 0 0 0; z-index: 1; padding: 18px 16px 16px; background: linear-gradient(to top, rgba(10, 15, 25, .82) 20%, rgba(10, 15, 25, 0)); color: #fff; }
.posts--overlay .card-body .meta, .posts--overlay .card-body .meta a { color: rgba(255, 255, 255, .85); }
.posts--overlay .card h2 { font-size: 1.25rem; }
.posts--overlay .card h2 a { color: #fff; }
.posts--overlay .card h2 a:hover { color: #fff; text-decoration: underline; }
.posts--overlay .card-excerpt, .posts--overlay .card-readmore { display: none; }

@media (max-width: 1200px) { .posts--overlay { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .posts--overlay { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .posts--overlay { grid-template-columns: 1fr; } }

/* Compact / headlines: dense, Reddit-style rows — a small thumbnail, the title, and a one-line meta (date +
   author), no excerpt. Ideal for archives and high-volume blogs. Pure CSS: the title is forced onto its own
   line and the two meta blocks flow side by side beneath it via flex ordering (no markup change). */
.posts--compact { display: flex; flex-direction: column; }
.posts--compact .card { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.posts--compact .card-image { flex: 0 0 64px; width: 64px; height: 64px; aspect-ratio: auto; border-radius: 8px; align-self: center; }
.posts--compact .card-image-ph { background: linear-gradient(135deg, #eef2f7, #dfe6ef); }
.posts--compact .card-body { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 12px; min-width: 0; padding: 0; }
.posts--compact .card-body > h2 { order: 0; flex: 0 0 100%; font-size: 1.05rem; margin: 0 0 3px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.posts--compact .card-body > .meta { order: 1; margin: 0; }
.posts--compact .card-excerpt, .posts--compact .card-readmore { display: none; }

@media (max-width: 500px) {
    .posts--compact .card-image { flex-basis: 52px; width: 52px; height: 52px; }
}

/* ---------- Single-post header ---------- */
/* Featured image to the LEFT of the title/meta. When Post.cshtml renders no .post-hero (no featured image set),
   the flex row has a single child and .post-headings simply fills the width — reads like a normal heading block.
   Mirrors the sibling ATW blog's image-left header, scaled to this template's 760px reading column. */
.post-head { display: flex; align-items: center; gap: 28px; }
.post-hero { flex: 0 0 42%; display: none;}
.post-hero img { display: block; width: 100%; height: auto; border-radius: var(--radius); object-fit: cover; }
.post-headings { flex: 1 1 0; min-width: 0; }
.post-headings h1 { margin: 0 0 10px; color: #07345a; font-size: 40px;}
article.post h2 {font-size: 30px;}
/* Below the nav breakpoint the header stacks: image on top, then the title/meta full-width. */
@media (max-width: 900px) {
    .post-head { flex-direction: column; align-items: stretch; gap: 16px; }
    .post-hero { flex: 0 0 auto; }
}


article.post .body { margin-top: 24px; line-height: 1.6; }
article.post .body img { max-width: 100%; height: auto; border-radius: 8px; }
/* Responsive video/embed: cap the width AND preserve a 16:9 box so YouTube/Vimeo iframes (which carry
   fixed width/height attributes) never overflow a phone screen or get squished. CSS beats the inline
   width/height presentational attributes, so this fixes already-rendered posts too. */
article.post .body iframe { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; }
/* Legacy "blogbutton" affordance: authors add class="blogbutton" to a link to render it as a call-to-action
   button (the class is whitelisted through the save-time sanitiser in PostRenderer). Theme-aware — uses the
   site's --accent / --accent-hover so it matches each cloned site's colours. */
a.blogbutton { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 18px; margin: 15px 0 0; background: var(--accent); color: #fff; font-weight: 600; border: 0; border-radius: 3px; text-decoration: none; transition: background-color .15s ease; }
a.blogbutton:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }
.taxo { margin-top: 28px; }
.taxo a { display: inline-block; margin: 0 8px 8px 0; padding: 4px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; color: var(--muted); }
.taxo a:hover { text-decoration: none; border-color: var(--accent-hover); color: var(--accent-hover); }
.pager { background-color: transparent !important; display: flex; justify-content: space-between; align-items: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); border-bottom: none; }
.preview { background: #fff8e1; border: 1px solid #ffe08a; padding: 12px 16px; border-radius: 8px; margin-bottom: 24px; }

/* Admin-only "Edit Post" affordance at the foot of an article (only rendered for signed-in admins). */
.admin-edit { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); }
.admin-edit a { display: inline-block; padding: 8px 18px; background: var(--accent); color: #fff; border-radius: 6px; font-size: .9rem; font-weight: 500; }
.admin-edit a:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

/* ---------- Shell ---------- */
/* Content width container. Renamed from the host site's `.container` (so it can't clash with the referenced host
   CSS) but reproduces that container's effective responsive widths, so the blog content lines up with the
   header/footer container edges. Effective ladder from the host bundle:
   <768 full · 768–991 750 · 992–1340 1200 · 1341–1670 1500 · ≥1671 1640 (15px gutters throughout). */
.blog-container { width: 100%; margin: 0 auto; padding: 0 15px; }

@media (min-width: 768px) {
    .blog-container { max-width: 750px; }
}

@media (min-width: 992px) {
    .blog-container { max-width: 1200px; }
}

@media (min-width: 1341px) {
    .blog-container { max-width: 1500px; }
}

@media (min-width: 1671px) {
    .blog-container { max-width: 1640px; }
}

/* ---------- Full-width heading banner (listing pages, above the shell) ---------- */
.blog-banner { border-bottom: 1px solid var(--line); }
/* Width/centering come from .blog-container (added in markup); keep only the banner's vertical padding here. */
.blog-banner-inner { padding-top: 32px; padding-bottom: 24px; }
.blog-banner-inner h1 { margin: 0; }
.blog-banner-inner .intro { margin: 8px 0 0; }
/* Author archive: avatar beside the heading/bio. */
.author-head { display: flex; align-items: center; gap: 18px; }
.author-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; border: 1px solid var(--line); }
.author-head-text h1 { margin: 0; }

/* ---------- Nav: shared bits ---------- */
.blognav { display: block; }
/* <blognav> is a custom element (inline by default); the old <nav> got this for free */
.blognav-toggle { display: none; }
/* mobile only */
/* Off-canvas drawer backdrop — hidden in every layout except the open drawer (see .blog-shell--drawer). */
.blognav-scrim { display: none; }
.blognav-widget-body { display: none; }
.blognav-widget.is-open > .blognav-widget-body { display: block; }
.blognav-widget-body ul { list-style: none; margin: 0; padding: 0; }
.blognav-widget-body a { display: block; padding: 6px 8px; border-radius: 8px; color: var(--ink); font-size: .95rem; }
.blognav-widget-body a:hover { background: var(--surface); color: var(--accent-hover); text-decoration: none; }
.blognav-count { color: var(--muted); font-size: .8rem; }
.blognav-archive > li > a { font-weight: 600; }
.blognav-archive ul { margin: 2px 0 10px 12px; }
.blognav-chev { display: inline-block; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .18s ease; }
.blognav-widget.is-open .blognav-chev { transform: rotate(-135deg); }
.blognav-search { display: flex; gap: 6px; }
.blognav-search input[type=search] { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.blognav-search button { padding: 8px 14px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.blognav-search button:hover { background: var(--accent-hover); }
.blognav-widget--meta a { color: var(--muted); font-size: .9rem; }

/* Top bar: same pill styling as the bottom bar (shares .blog-shell--bottom), but the nav sits ABOVE the
   content at every width; the desktop block below flips its spacing/border to sit under the bar. */
.blog-shell--top { display: flex; flex-direction: column; }
.blog-shell--top .blognav { order: -1; }

/* ============================================================
   Desktop layouts
   ============================================================ */
@media (min-width: 901px) {

    /* ---------- Bottom bar ---------- */
    .blog-shell--bottom .blognav { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); margin-bottom: 30px;}
    .blog-shell--bottom .blognav-body { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
    .blog-shell--bottom .blognav-widget { position: relative; }
    .blog-shell--bottom .blognav-widget-head { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 600; font-size: .95rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; cursor: pointer; }
    .blog-shell--bottom .blognav-widget-head:hover { border-color: var(--accent-hover); color: var(--accent-hover); }
    .blog-shell--bottom .blognav-widget.is-open > .blognav-widget-body { display: block; position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 230px; max-height: 340px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 14px 32px rgba(16, 26, 48, .16); padding: 8px; }
    .blog-shell--bottom .blognav-widget--search { margin-left: auto; min-width: 240px; }
    .blog-shell--bottom .blognav-widget--meta { display: flex; align-items: center; gap: 14px; }

    /* ---------- Right sidebar ---------- */
    .blog-shell--sidebar { display: flex; align-items: flex-start; gap: 44px; }
    .blog-shell--sidebar .blog-main { flex: 1 1 auto; min-width: 0; }
    .blog-shell--sidebar .blog-main .wrap { max-width: none; margin: 0; }
    /* content fills the wider left column */
    /* The column stretches to the full row height so its left border runs the whole height of the shell... */
    .blog-shell--sidebar .blognav { flex: 0 0 300px; align-self: stretch; padding-left: 28px; border-left: 1px solid var(--line); }
    /* ...while the widgets themselves stay sticky as the post list scrolls. */
    .blog-shell--sidebar .blognav-body { position: sticky; top: 115px; }
    .blog-shell--sidebar .blognav-widget { border-bottom: 1px solid var(--line); }
    .blog-shell--sidebar .blognav-widget:last-child { border-bottom: none; }
    .blog-shell--sidebar .blognav-widget-head { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink); background: none; border: 0; padding: 14px 0; cursor: pointer; text-align: left; }
    .blog-shell--sidebar .blognav-chev { color: var(--muted); }
    .blog-shell--sidebar .blognav-widget-body { padding-bottom: 14px; }
    .blog-shell--sidebar .blognav-widget--search,
    .blog-shell--sidebar .blognav-widget--meta { padding: 16px 0; }
    .blog-shell--sidebar .blognav-widget--meta { display: flex; flex-wrap: wrap; gap: 14px; }
    .blog-shell--sidebar .blognav-widget--imagelinks { padding: 16px 0; }

    /* ---------- Left sidebar (mirror of right — shares .blog-shell--sidebar, just flips the side) ---------- */
    .blog-shell--sidebar-left { flex-direction: row-reverse; }
    .blog-shell--sidebar-left .blognav { padding-left: 0; padding-right: 28px; border-left: 0; border-right: 1px solid var(--line); }

    /* ---------- Top bar (mirror of bottom — shares .blog-shell--bottom pills, sits above the content) ---------- */
    /* margin-top spaces the bar from whatever sits above it (the page banner on listing pages, or the host
       site header on the single post page); margin-bottom + border-bottom separate it from the content below. */
    .blog-shell--top .blognav { margin-top: 28px; margin-bottom: 28px; padding-top: 0; padding-bottom: 18px; border-top: 0; border-bottom: 1px solid var(--line); }

    /* ---------- Category chips (bar variant of the top bar) ----------
       The Categories widget takes its own full-width row and renders as an always-visible, horizontally
       scrollable strip of pills (its header hidden, its dropdown body flattened inline). The remaining widgets
       (Recent/Archives/Search/Meta) wrap to the line below as the usual dropdown pills. */
    .blog-shell--chips .blognav-widget--categories { flex-basis: 100%; }
    .blog-shell--chips .blognav-widget--categories > .blognav-widget-head { display: none; }
    .blog-shell--chips .blognav-widget--categories > .blognav-widget-body { display: block; position: static; padding: 0; background: none; border: 0; box-shadow: none; max-height: none; overflow: visible; }
    .blog-shell--chips .blognav-widget--categories ul { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
    .blog-shell--chips .blognav-widget--categories li { flex: 0 0 auto; }
    .blog-shell--chips .blognav-widget--categories li a { display: inline-flex; align-items: center; white-space: nowrap; padding: 6px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font-size: .9rem; color: var(--ink); }
    .blog-shell--chips .blognav-widget--categories li a:hover { background: var(--surface); border-color: var(--accent-hover); color: var(--accent-hover); }
    .blog-shell--chips .blognav-widget--categories .blognav-count { display: none; }
}

/* Advert image links beneath the sidebar accordions (rendered in vertical-rail layouts only). */
.blognav-widget--imagelinks { display: flex; flex-direction: column; gap: 16px; }
.blognav-imagelink img { display: block; width: 100%; height: auto; border-radius: 8px; }
.blognav-imagelink-title { display: block; margin-bottom: 6px; font-weight: 600; color: var(--accent); }
.blognav-imagelink-title:hover { color: var(--accent-hover); text-decoration: none; }

/* ============================================================
   Mobile — both layouts collapse to one column behind a "Blog menu" toggle,
   with the widgets as simple accordions.
   ============================================================ */
@media (max-width: 900px) {
    .blog-shell--sidebar { display: block; }
    .blog-banner-inner { padding-top: 24px; padding-bottom: 20px; }

    .blognav { margin-top: 24px; }
    .blognav-toggle { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; cursor: pointer; }
    .blognav-body { display: none; margin-top: 10px; }
    .blognav.is-open .blognav-body { display: block; }

    .blognav-widget { border-bottom: 1px solid var(--line); }
    .blognav-widget-head { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink); background: none; border: 0; padding: 14px 0; cursor: pointer; text-align: left; }
    .blognav-widget--search, .blognav-widget--meta { padding: 14px 0; }
    .blognav-widget--meta { display: flex; flex-wrap: wrap; gap: 14px; }
}

/* ============================================================
   Off-canvas drawer (all widths) — the nav is hidden behind a "Menu" button; its body is a fixed panel that
   slides in from the right over a scrim. It's a vertical rail, so widgets are accordions and adverts are shown.
   Closed via the Menu button, the scrim, or Escape (see _BlogLayout's nav JS).
   ============================================================ */
.blog-shell--drawer { display: flex; flex-direction: column; }
/* margin-top spaces the Menu button from whatever sits above it (the page banner on listing pages, or the
   host site header on the single post page), matching the top bar's gap. */
.blog-shell--drawer .blognav { display: flex; order: -1; margin: 28px 0 8px; }
.blog-shell--drawer .blognav-toggle { display: inline-flex; align-items: center; gap: 8px; width: auto; margin-left: auto; font: inherit; font-weight: 600; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; cursor: pointer; }
.blog-shell--drawer .blognav-toggle:hover { border-color: var(--accent-hover); color: var(--accent-hover); }
/* The panel: fixed, off to the right until open; visibility keeps its links out of the tab order when closed. */
.blog-shell--drawer .blognav-body { display: block; position: fixed; top: 0; right: 0; z-index: 1000; width: 320px; max-width: 85vw; height: 100vh; overflow-y: auto; margin: 0; padding: 20px 22px; background: #fff; border-left: 1px solid var(--line); box-shadow: -14px 0 34px rgba(16, 26, 48, .18); transform: translateX(100%); visibility: hidden; transition: transform .25s ease, visibility .25s ease; will-change: transform; }
.blog-shell--drawer .blognav.is-open .blognav-body { transform: translateX(0); visibility: visible; }
.blog-shell--drawer .blognav-scrim { display: block; position: fixed; inset: 0; z-index: 999; background: rgba(10, 15, 25, .45); opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease; }
.blog-shell--drawer .blognav.is-open .blognav-scrim { opacity: 1; visibility: visible; }
/* Accordion widgets inside the panel (same look as the sidebar / mobile). */
.blog-shell--drawer .blognav-widget { border-bottom: 1px solid var(--line); }
.blog-shell--drawer .blognav-widget:last-child { border-bottom: none; }
.blog-shell--drawer .blognav-widget-head { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; font: inherit; font-weight: 600; font-size: 1rem; color: var(--ink); background: none; border: 0; padding: 14px 0; cursor: pointer; text-align: left; }
.blog-shell--drawer .blognav-widget--search, .blog-shell--drawer .blognav-widget--meta, .blog-shell--drawer .blognav-widget--imagelinks { padding: 14px 0; }
.blog-shell--drawer .blognav-widget--meta { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---- Related posts (single post page) ---- */
/* The curated block reuses the settings-driven .posts--{layout} styling and the _PostCard partial, so it looks
   like the site's listings. This scope only adds the separating rule + heading and caps the grid/masonry column
   count so a short curated set (typically 2–4) doesn't stretch across the full 4-column listing grid. */
.post .related { margin-top: 44px; padding-top: 24px; border-top: 1px solid var(--line); }
.post .related > h2 { margin: 0 0 20px; font-size: 1.5rem; }
.post .related .posts--grid { grid-template-columns: repeat(3, 1fr); }
.post .related .posts--masonry { column-count: 3; }
@media (max-width: 900px) {
    .post .related .posts--grid { grid-template-columns: repeat(2, 1fr); }
    .post .related .posts--masonry { column-count: 2; }
}
@media (max-width: 560px) {
    .post .related .posts--grid { grid-template-columns: 1fr; }
    .post .related .posts--masonry { column-count: 1; }
}
