/* ============================================================================
   Blog — landing page and article
   The listing used to be a bare three-column card grid with 35px headlines that
   fought the page for attention. This layout gives the category one clear lead
   story, keeps the rest to a readable card grid, and moves the reading column on
   article pages to a 68ch measure with a sticky sidebar.
   ========================================================================== */

.blog-shell{padding-bottom:64px}

/* ---------- landing header ---------- */
.blog-head{
  display:flex;align-items:flex-end;justify-content:space-between;gap:28px;flex-wrap:wrap;
  padding:6px 0 26px;border-bottom:1px solid var(--line);
}
.blog-head-main{max-width:640px}
.blog-eyebrow{
  margin:0 0 6px;font-size:11px;letter-spacing:1.8px;text-transform:uppercase;
  color:var(--primary);font-weight:600;
}
.blog-head h1{
  font-size:38px;line-height:1.12;margin:0 0 10px;font-weight:600;
  letter-spacing:-.6px;color:var(--ink-strong);
}
.blog-intro{margin:0;font-size:15px;color:#6f6f6f;line-height:1.6;max-width:56ch}
.blog-head-meta{
  font-size:12px;letter-spacing:1.2px;text-transform:uppercase;color:var(--muted);
  padding-bottom:6px;white-space:nowrap;
}
.blog-head-meta strong{color:var(--ink-strong);font-weight:600;font-size:20px;margin-right:4px;vertical-align:-1px}

/* ---------- category chips ---------- */
.blog-chips{display:flex;flex-wrap:wrap;gap:8px;padding:22px 0 6px}
.chip{
  display:inline-flex;align-items:center;gap:7px;
  padding:7px 14px;border:1px solid var(--line);border-radius:100px;
  font-size:12.5px;font-weight:500;color:var(--ink);background:#fff;
  transition:border-color .18s,background .18s,color .18s;
}
.chip:hover{border-color:var(--primary);color:var(--primary-dark)}
.chip.is-active{background:var(--ink-strong);border-color:var(--ink-strong);color:#fff}
.chip-n{
  font-size:10.5px;font-weight:600;opacity:.6;
  background:rgba(0,0,0,.07);border-radius:100px;padding:1px 6px;line-height:1.5;
}
.chip.is-active .chip-n{background:rgba(255,255,255,.22);opacity:1}
.chip-sm{padding:4px 10px;font-size:11.5px}

/* ---------- lead story ---------- */
.blog-hero{
  display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1fr);gap:0;
  margin:26px 0 44px;background:#fff;border:1px solid var(--line);
  border-radius:8px;overflow:hidden;transition:box-shadow .25s,border-color .25s;
}
.blog-hero:hover{box-shadow:var(--shadow-lg);border-color:#ddd}
/* Product photography arrives square (450x450), so the media box is square too:
   a 16:11 box cropped the packaging off the top and bottom. The image is
   contained, not covered, which keeps the whole box in frame. */
.blog-hero-media{
  display:block;aspect-ratio:1/1;background:var(--bg-soft);overflow:hidden;
  border-right:1px solid var(--line);
}
.blog-hero-media img{width:100%;height:100%;object-fit:cover;transition:transform .4s}
.blog-hero:hover .blog-hero-media img{transform:scale(1.03)}
.blog-hero-body{
  padding:36px 38px;display:flex;flex-direction:column;justify-content:center;gap:12px;
}
.blog-kicker{
  font-size:10.5px;letter-spacing:1.6px;text-transform:uppercase;
  color:var(--primary);font-weight:600;text-decoration:none;
}
.blog-kicker:hover{color:var(--primary-dark)}
.blog-hero-title{margin:0;font-size:27px;line-height:1.22;font-weight:600;letter-spacing:-.3px}
.blog-hero-title a{color:var(--ink-strong);text-decoration:none}
.blog-hero-title a:hover{color:var(--primary-dark)}
.blog-hero-lead{margin:0;font-size:14.5px;color:#6a6a6a;line-height:1.65}
.blog-hero-foot{
  display:flex;align-items:center;gap:9px;flex-wrap:wrap;
  margin-top:6px;font-size:12px;color:var(--muted);
}
.blog-byline{color:var(--ink);font-weight:500}
.blog-dot{opacity:.45}
.btn-blog{
  display:inline-flex;align-items:center;gap:7px;margin-left:auto;
  padding:10px 20px;border:1px solid var(--ink-strong);border-radius:var(--radius);
  font-size:12px;font-weight:600;letter-spacing:.9px;text-transform:uppercase;
  color:var(--ink-strong);background:#fff;text-decoration:none;
  transition:background .18s,color .18s;
}
.btn-blog:hover{background:var(--ink-strong);color:#fff}
.btn-blog-solid{background:var(--primary);border-color:var(--primary);color:#fff}
.btn-blog-solid:hover{background:var(--primary-dark);border-color:var(--primary-dark);color:#fff}

/* ---------- listing + sidebar ---------- */
.blog-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:48px;align-items:start}
.blog-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:32px 28px}
.post-card{display:flex;flex-direction:column;min-width:0}
.post-card-media{
  display:block;aspect-ratio:4/3;background:var(--bg-soft);overflow:hidden;
  border-radius:6px;margin-bottom:14px;
}
.post-card-media img{width:100%;height:100%;object-fit:cover;transition:transform .35s}
.post-card:hover .post-card-media img{transform:scale(1.04)}
/* Imported posts sometimes arrive without a featured image. A labelled tinted
   panel reads as intentional and keeps the grid rhythm; an empty white box reads
   as a broken image. */
.post-card-blank{
  display:grid;place-items:center;width:100%;height:100%;
  background:linear-gradient(135deg,#eef8f7 0%,#f8fbfb 55%,#eef4f4 100%);
  color:var(--primary-dark);font-size:11px;letter-spacing:1.6px;text-transform:uppercase;
}
.post-card-blank::after{content:"DetoxBuy";font-weight:600;opacity:.55}
.post-card-body{display:flex;flex-direction:column;gap:7px}
.post-card-title{margin:0;font-size:18.5px;line-height:1.3;font-weight:600;letter-spacing:-.15px}
.post-card-title a{color:var(--ink-strong);text-decoration:none}
.post-card-title a:hover{color:var(--primary-dark)}
.post-card-text{margin:0;font-size:13.5px;color:#747474;line-height:1.6}
.post-card-foot{
  display:flex;align-items:center;gap:8px;margin-top:2px;
  font-size:11.5px;color:var(--muted);letter-spacing:.2px;
}
.blog-empty{padding:48px 0;color:var(--muted);font-size:14px}

/* ---------- sidebar ---------- */
.blog-side{position:sticky;top:96px;display:flex;flex-direction:column;gap:22px}
/* The sidebar is 320px rather than 300px now that the gap shrank, so the cards
   carry a little more padding and the numbers get a rounder hit area. */
.blog-side-card{border:1px solid var(--line);border-radius:10px;padding:24px 22px;background:#fff}
.blog-side-title{
  margin:0 0 16px;font-size:11px;letter-spacing:1.6px;text-transform:uppercase;
  color:var(--ink-strong);font-weight:600;padding-bottom:12px;border-bottom:1px solid var(--line-soft);
}
.blog-popular{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:16px}
.blog-popular li{display:flex;gap:12px;align-items:flex-start}
.blog-popular-n{
  flex:0 0 auto;width:22px;height:22px;display:grid;place-items:center;
  font-size:10.5px;font-weight:600;color:var(--primary-dark);
  background:var(--primary-soft);border-radius:50%;margin-top:1px;
}
.blog-popular a{
  display:block;font-size:13.5px;line-height:1.42;color:var(--ink);
  text-decoration:none;font-weight:500;
}
.blog-popular a:hover{color:var(--primary-dark)}
.blog-popular-meta{display:block;margin-top:3px;font-size:11px;color:var(--muted)}
.blog-side-cta{background:var(--primary-soft);border-color:#d5eeec}
.blog-side-cta p{margin:0 0 16px;font-size:13px;color:#4e6d6b;line-height:1.6}
.blog-side-cta .btn-blog{margin-left:0;width:100%;justify-content:center}

/* ---------- article ---------- */
/* The reading column takes whatever the grid gives it. It used to be capped at
   760px while the grid column was 1054px wide, so 294px of the content column
   sat empty and the 56px gap made the distance to the sidebar look like 350px.
   The measure is kept readable by the 74ch cap on .article-body instead, which
   is what actually limits line length. */
.article-wrap{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:28px;align-items:start;padding-top:8px}
.article{min-width:0}
.article-head{margin-bottom:26px}
.article-title{
  margin:8px 0 14px;font-size:40px;line-height:1.14;font-weight:600;
  letter-spacing:-.8px;color:var(--ink-strong);
}
.article-lead{
  margin:0 0 22px;font-size:17px;line-height:1.6;color:#5f5f5f;font-weight:300;
  border-left:3px solid var(--primary);padding-left:16px;
}
.article-meta{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding-bottom:22px;border-bottom:1px solid var(--line);
  font-size:12.5px;color:var(--muted);
}
.article-author{display:inline-flex;align-items:center;gap:9px;color:var(--ink);font-weight:500}
.article-avatar{
  width:28px;height:28px;border-radius:50%;display:grid;place-items:center;
  background:var(--primary);color:#fff;font-size:12px;font-weight:600;
}
.article-share{margin-left:auto}
.article-share a{
  font-size:11px;letter-spacing:1.2px;text-transform:uppercase;
  color:var(--muted);text-decoration:none;border-bottom:1px solid var(--line);padding-bottom:2px;
}
.article-share a:hover{color:var(--primary-dark);border-color:var(--primary)}

/* The hero is capped to the prose measure, not the full column. On a wide
   screen the column is 1062px while the text is 74ch (~710px); letting the
   image span the whole column left it floating centred in a band of grey with
   the copy ending far short of it. Matching the two keeps one reading axis. */
/* The figure shrinks to the image instead of stretching to the column.
   A fixed 74ch band around a 3:4 portrait left grey bars either side of the
   photo; fit-content lets the frame hug the picture while the cap keeps a wide
   landscape shot from overflowing the reading measure. */
.article-figure{
  margin:0 0 32px;border-radius:10px;overflow:hidden;background:var(--bg-soft);
  max-width:74ch;font-size:16px;
}
/* The photo keeps its own aspect ratio and never exceeds the reading measure.
   A max-height here was the bug: on a 1024x1024 source the browser first filled
   the 710px width, then clamped the height to 420, leaving a squashed 710x355
   landscape crop of a square picture. Letting the width drive the height defers
   to the image's own ratio, and a portrait shot simply renders narrower. */
.article-hero{
  display:block;width:auto;max-width:100%;height:auto;
  object-fit:cover;
}

/* The reading column: 74ch is the comfortable measure, and the body text is a
   step larger than the storefront so long prose does not strain.
   The cap sits here rather than on .article so the header, the hero image and
   the footer can use the full column while the prose keeps a readable width. */
.article-body{
  font-size:16px;line-height:1.78;color:#3d3d3d;
  max-width:74ch;
}
.article-body > *:first-child{margin-top:0}
.article-body p{margin:0 0 20px}
.article-body h2{
  margin:38px 0 14px;font-size:24px;line-height:1.3;font-weight:600;letter-spacing:-.25px;
  color:var(--ink-strong);scroll-margin-top:90px;
}
.article-body h3{
  margin:30px 0 12px;font-size:19px;line-height:1.35;font-weight:600;color:var(--ink-strong);
  scroll-margin-top:90px;
}
.article-body ul,.article-body ol{margin:0 0 20px;padding-left:22px}
.article-body li{margin-bottom:8px}
.article-body img{border-radius:6px;margin:26px 0}
.article-body a{color:var(--primary-dark);text-decoration:underline;text-underline-offset:2px}
.article-body a:hover{color:var(--primary)}
.article-body blockquote{
  margin:26px 0;padding:18px 22px;background:var(--bg-soft);
  border-left:3px solid var(--primary);font-size:16.5px;color:#4f4f4f;font-style:italic;
}
.article-body blockquote p:last-child{margin-bottom:0}
.article-body table{width:100%;border-collapse:collapse;margin:24px 0;font-size:14px}
.article-body th,.article-body td{border:1px solid var(--line);padding:10px 12px;text-align:left}
.article-body th{background:var(--bg-soft);font-weight:600}

.article-foot{
  display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;
  margin-top:40px;padding-top:24px;border-top:1px solid var(--line);
}
.article-tags{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.article-tags-label{font-size:11px;letter-spacing:1.4px;text-transform:uppercase;color:var(--muted)}

.article-side{position:sticky;top:96px}
.article-side-inner{display:flex;flex-direction:column;gap:22px}

.article-more{margin-top:64px;padding-top:36px;border-top:1px solid var(--line)}
.article-more .blog-grid{grid-template-columns:repeat(3,1fr);gap:28px}

/* ---------- responsive ---------- */
@media (max-width:1100px){
  .blog-layout,.article-wrap{grid-template-columns:minmax(0,1fr);gap:40px}
  .blog-side,.article-side{position:static}
  .article-side-inner{flex-direction:row;flex-wrap:wrap}
  .article-side-inner > *{flex:1 1 300px}
  .blog-side{flex-direction:row;flex-wrap:wrap}
  .blog-side > *{flex:1 1 300px}
}
@media (max-width:900px){
  .blog-hero{grid-template-columns:1fr}
  .blog-hero-media{aspect-ratio:16/9}
  .blog-hero-body{padding:24px}
  .blog-hero-title{font-size:22px}
  .blog-grid{grid-template-columns:repeat(2,1fr);gap:24px 20px}
  .article-more .blog-grid{grid-template-columns:repeat(2,1fr)}
  .article-title{font-size:30px;letter-spacing:-.4px}
  .article-body{font-size:15.5px;line-height:1.72}
  .article-body h2{font-size:21px}
}
@media (max-width:620px){
  .blog-head h1{font-size:29px}
  .blog-head{padding-bottom:18px}
  .blog-intro{font-size:14px}
  .blog-hero{margin:20px 0 32px}
  .blog-hero-body{padding:20px}
  .blog-hero-foot .btn-blog{width:100%;justify-content:center;margin:8px 0 0}
  .blog-grid{grid-template-columns:1fr;gap:26px}
  .article-more .blog-grid{grid-template-columns:1fr}
  .post-card-title{font-size:17px}
  .article-title{font-size:26px;line-height:1.2}
  .article-lead{font-size:15px;padding-left:13px}
  .article-body{font-size:15px;line-height:1.7}
  .article-foot{flex-direction:column;align-items:flex-start;gap:14px}
  .blog-side,.article-side{gap:16px}
}

/* ============================================================================
   Reading ergonomics (mobile-first) and dark mode
   ----------------------------------------------------------------------------
   Google indexes the mobile rendering, so the article body is set at 17px with
   a 1.7 line height on phones: below 16px iOS Safari zooms on focus and readers
   bounce. Interactive targets get a 48px minimum, the size a thumb can hit
   without aiming.
   ========================================================================== */

@media (max-width:620px){
  .article-body{font-size:17px;line-height:1.7;max-width:none}
  .article-body p{margin-bottom:18px}
  .article-body h2{font-size:21px;margin:30px 0 12px}
  .article-body h3{font-size:18px}
  /* Tappable rows: pagination, share buttons and tag chips. */
  .article-body a{padding:2px 0}
  .post-tags a,.share-row a,.pager a,.pager span{min-height:48px;display:inline-flex;align-items:center}
}

@media (prefers-color-scheme: dark){
  :root{
    --bg:#14171a;
    --bg-soft:#1b1f23;
    --ink:#d7dbdf;
    --ink-strong:#f2f5f7;
    --muted:#9aa3ab;
    --line:#2b3137;
    --line-soft:#23282d;
    --primary-soft:#12312f;
  }
  body{background:var(--bg);color:var(--ink)}
  .article-body{color:var(--ink)}
  .article-body h2,.article-body h3,.article-body strong{color:var(--ink-strong)}
  .article-body blockquote{
    background:var(--bg-soft);border-left-color:var(--primary);
  }
  .article-body table{border-color:var(--line)}
  .article-body th{background:var(--bg-soft)}
  .article-body code{background:var(--bg-soft);color:#8fd6cf}
  .card,.post-card,.sidebar-box{background:var(--bg-soft);border-color:var(--line)}
  img{filter:brightness(.92)}
}

/* ============================================================================
   Topic hub — the permanent page for one developing story
   ----------------------------------------------------------------------------
   Reads as a timeline, not a blog grid: a reader catching up needs the sequence
   of a story, and the ordering is also what the ItemList schema declares.
   ========================================================================== */

.topic-hero{
  padding:34px 0 26px;border-bottom:1px solid var(--line-soft);margin-bottom:30px;
}
.topic-hero-kicker{
  display:inline-block;padding:4px 10px;border-radius:999px;
  background:var(--primary-soft);color:var(--primary-dark);
  font-size:11px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;
}
.topic-hero h1{
  margin:14px 0 10px;font-size:32px;line-height:1.22;font-weight:600;letter-spacing:-.4px;
  color:var(--ink-strong);
}
.topic-hero-lead{font-size:16px;line-height:1.65;color:#5c5c5c;max-width:70ch;margin:0 0 12px}
.topic-hero-count{margin:0;font-size:13px;color:var(--muted)}
.topic-hero-count strong{color:var(--ink-strong);font-weight:600}

.topic-timeline{list-style:none;margin:0;padding:0;position:relative}
.topic-timeline::before{
  content:"";position:absolute;left:96px;top:8px;bottom:8px;width:1px;
  background:var(--line-soft);
}
.topic-item{
  display:flex;gap:26px;padding:0 0 30px;position:relative;
}
.topic-item-date{
  flex:0 0 84px;font-size:12px;color:var(--muted);line-height:1.5;
  padding-top:3px;text-align:right;
}
.topic-item-body{flex:1 1 auto;min-width:0}
.topic-item-body h2{
  margin:0 0 7px;font-size:19px;line-height:1.35;font-weight:600;letter-spacing:-.2px;
}
.topic-item-body h2 a{color:var(--ink-strong);text-decoration:none}
.topic-item-body h2 a:hover{color:var(--primary-dark)}
.topic-item-body p{margin:0 0 8px;font-size:14px;line-height:1.6;color:#5f5f5f}
.topic-item-meta{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)}

.topic-empty{padding:40px 0;color:var(--muted);font-size:14px}

/* Hub cross-link box shown inside a single article. */
.topic-hub{margin-top:34px}
.topic-hub-card{
  padding:20px 22px;border:1px solid var(--line);border-radius:10px;
  background:linear-gradient(180deg,var(--primary-soft),#ffffff);
}
.topic-hub-kicker{
  font-size:11px;font-weight:600;letter-spacing:.6px;text-transform:uppercase;
  color:var(--primary-dark);
}
.topic-hub-head h2{margin:7px 0 9px;font-size:19px;line-height:1.35}
.topic-hub-head h2 a{color:var(--ink-strong);text-decoration:none}
.topic-hub-summary{margin:0 0 12px;font-size:14px;line-height:1.6;color:#555}
.topic-hub-list{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:7px}
.topic-hub-list a{font-size:14px;color:var(--ink);text-decoration:none;line-height:1.45}
.topic-hub-list a:hover{color:var(--primary-dark);text-decoration:underline}
.topic-hub-all{font-size:13px;font-weight:600;color:var(--primary-dark);text-decoration:none}

@media (max-width:620px){
  .topic-hero{padding:24px 0 20px}
  .topic-hero h1{font-size:24px}
  .topic-hero-lead{font-size:15px}
  /* The timeline collapses to a plain stack: a 96px gutter on a 360px screen
     leaves too little room for the headline. */
  .topic-timeline::before{display:none}
  .topic-item{flex-direction:column;gap:4px;padding-bottom:24px}
  .topic-item-date{flex:none;text-align:left;font-size:11.5px}
  .topic-item-body h2{font-size:17px}
  .topic-hub-card{padding:16px 16px}
}

/* ============================================================================
   Listen button and own-video player
   ----------------------------------------------------------------------------
   Both are inline inside the article column. Neither floats over text: that is
   the line between a feature and an intrusive interstitial.
   ========================================================================== */

.article-listen{
  display:inline-flex;align-items:center;gap:8px;margin:14px 0 0;
  padding:9px 15px;min-height:42px;border:1px solid var(--line);border-radius:999px;
  background:#fff;color:var(--ink);font-size:13px;font-weight:500;cursor:pointer;
  transition:border-color .18s,color .18s,background .18s;
}
.article-listen svg{width:16px;height:16px;flex:0 0 auto}
.article-listen:hover{border-color:var(--primary);color:var(--primary-dark)}
.article-listen.is-speaking{background:var(--primary-soft);border-color:var(--primary);color:var(--primary-dark)}

.article-video{
  position:relative;margin:24px 0;border-radius:10px;overflow:hidden;background:#000;
}
.article-video video{display:block;width:100%;height:auto;max-height:70vh}
.article-video-close{
  position:absolute;top:8px;right:8px;width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  border:0;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;
  font-size:15px;line-height:1;cursor:pointer;
}
.article-video-close:hover{background:rgba(0,0,0,.82)}

@media (max-width:620px){
  .article-listen{min-height:44px;font-size:13.5px}
  .article-video video{max-height:56vh}
}

@media (prefers-color-scheme: dark){
  .article-listen{background:var(--bg-soft);border-color:var(--line);color:var(--ink)}
  .article-listen:hover{border-color:var(--primary)}
}
