/* ==========================================================================
   File: /assets/css/newstyle.css
   ABSOLUTELY RECIPES

   Site styling: palette, homepage, category pages, article pages.

   Loaded from includes/head-common.php AFTER style.css, so every page on
   the site gets it. Section 0 redefines the core palette (--primary,
   --accent, --text and the rest), which means style.css does NOT need to
   be edited to recolour the site - whatever is set here wins.

   Sections 1-10 style the homepage, 11 the category and sub-category
   listings, 12 the single article pages. Everything is additive: remove
   the <link> and every page still renders using style.css alone, just
   flatter.

   Contents
     0.  Theme                 :root - every colour in this file
     1.  Hero band            .home-hero-*
     2.  Topic cards          .home-topics, .topic-*
     3.  Section rhythm       .home-block, .home-section-note
     4.  Magazine cards       .guide-grid, .home-card-*
     5.  Sidebar column       .home-sidebar-col, .home-side-*
     6.  Network strip        .network-*
     7.  Responsive
     8.  Reduced motion
     9.  Touch targets
     10. Shared header overflow  (a style.css bug - see the note there)
     11. Category and sub-category pages   (category.php)
     12. Single article pages              (article.php)
   ========================================================================== */


/* ==========================================================================
   0. THEME

   Every colour this stylesheet paints is declared here. Nothing below this
   block contains a hex code or an rgba() literal, so re-colouring the
   homepage means editing this section and nothing else.

   HOW IT IS PUT TOGETHER

   The first group is channel triplets - "31,51,64" rather than "#1F3340".
   They are written that way because most of the colour on this page is
   semi-transparent: a shadow at 5%, a scrim at 62%, a glow at 10%. A hex
   variable cannot carry a varying alpha, but rgba(var(--token), .05) can,
   so one triplet serves a dozen different opacities.

   The second group builds the actual values out of those triplets. Adjust
   one of these to change a single effect; adjust a triplet to change
   everywhere that colour appears at once.

   KEEPING IT IN STEP WITH style.css

   The first three triplets are the same colours as --primary, --accent and
   --accent-light in style.css, restated in channel form. CSS cannot pull
   the channels out of a hex custom property, so they are duplicated by
   hand: if you change the palette in style.css, change the matching
   triplet here too. The comment against each one says which.

   (Browsers released since 2024 support relative colour syntax -
   rgb(from var(--primary) r g b / .05) - which would remove the
   duplication entirely. It is deliberately not used here, because this
   file otherwise works in anything, and a silently-dropped shadow is a
   poor trade for four lines of maintenance.)
   ========================================================================== */

:root{

  /* -- CORE PALETTE ------------------------------------------------------
     These override the same names in style.css. Because this file is
     loaded AFTER style.css, whatever is set here wins, so style.css never
     has to be edited and can be replaced wholesale without losing the
     Absolutely Recipes colours.

     The scheme in one line: a cold frame around warm content. Deep enamel
     blue does the furniture - header, footer, headings - and turmeric
     amber is the single accent, used the way a highlighter is used.

       #1F3340  Enamel Blue    -> --primary        header, footer, headings
       #E9A13B  Turmeric Amber -> --accent         buttons, rules, active
       #FCF7EF  Warm Paper     -> --bg             page ground
       #FFFFFF  White          -> --card           card and panel fills
       #C4D3DB  Pale Slate     -> --muted-on-dark  copy on dark surfaces
       #1C2A32  Ink            -> --text           body copy

     Derived (lightness shifts of the above, nothing new introduced):
       --primary-tint #31505F   --secondary #496675   --footer #16262F
       --accent-dark #8A5410    --accent-light #F7D9A8

     Every pair measured against WCAG 2.1 AA; the weakest is 5.72:1.

     ONE RULE. Never print white on the amber - it is 2.18:1. Buttons,
     active pills and pagination print --primary on it, and amber used as
     TYPE on a light ground uses --accent-dark instead. */

  --primary:#1F3340;
  --primary-tint:#31505F;
  --secondary:#496675;

  --accent:#E9A13B;
  --accent-dark:#8A5410;        /* amber as TEXT on light  - 6.26:1 on --card */
  --accent-light:#F7D9A8;       /* amber as TEXT on enamel - 9.62:1           */

  --text:#1C2A32;
  --bg:#FCF7EF;
  --card:#FFFFFF;
  --cream:#FCF7EF;
  --footer:#16262F;
  --muted-on-dark:#C4D3DB;

  --hairline:rgba(31,51,64,.14);
  --hairline-strong:rgba(31,51,64,.28);

  /* -- channels ---------------------------------------------------------
     The four levers. Change these and the whole homepage follows. */

  --home-primary-rgb:31,51,64;          /* keep in step with --primary      #1F3340 */
  --home-accent-rgb:233,161,59;         /* keep in step with --accent       #E9A13B */
  --home-accent-light-rgb:247,217,168;  /* keep in step with --accent-light #F7D9A8 */

  /* Deeper than --footer, and used only over photographs - a scrim mixed
     from the page palette turns muddy against a real image, and food
     photography is the one thing on this site that must not go grey. */
  --home-scrim-rgb:11,20,26;

  --home-light-rgb:255,255,255;         /* --card / White                   #FFFFFF */

  /* -- washes and glows -------------------------------------------------
     The accent, well below the strength it can carry as a flat fill. */

  --home-glow-hero:rgba(var(--home-accent-rgb),.12);
  --home-glow-network:rgba(var(--home-accent-rgb),.16);
  --home-band-top:#FFFFFF;              /* top of the hero gradient, fades to --bg */
  --home-focus-ring:rgba(var(--home-accent-rgb),.32);

  /* -- elevation --------------------------------------------------------
     Geometry stays inline at each rule; only the tone is shared, so a
     palette change moves every shadow together without flattening the
     deliberate difference between a resting card and a lifted one. */

  --home-shadow-rest:rgba(var(--home-primary-rgb),.05);
  --home-shadow-lift:rgba(var(--home-primary-rgb),.24);
  --home-shadow-soft:rgba(var(--home-primary-rgb),.12);
  --home-shadow-figure-far:rgba(var(--home-primary-rgb),.42);
  --home-shadow-figure-near:rgba(var(--home-primary-rgb),.10);
  --home-shadow-badge:rgba(var(--home-scrim-rgb),.28);

  /* Accent-tinted shadows, for the accent button only. A neutral shadow
     under a saturated button reads as dirt; this one reads as light. */
  --home-shadow-accent:rgba(var(--home-accent-rgb),.34);
  --home-shadow-accent-hover:rgba(var(--home-accent-rgb),.44);

  /* -- hero figure ------------------------------------------------------ */

  --home-figure-bg:var(--primary);      /* shows while an image loads */
  --home-figure-fallback-from:var(--primary-tint);
  --home-figure-fallback-to:var(--primary);
  --home-figure-icon:rgba(var(--home-accent-light-rgb),.55);

  /* The two overlays laid over the image: a sheen at the top, a scrim at
     the foot to keep the category badge legible on a busy photograph. */
  --home-figure-sheen:rgba(var(--home-light-rgb),.10);
  --home-figure-scrim-foot:rgba(var(--home-scrim-rgb),.62);
  --home-figure-scrim-mid:rgba(var(--home-scrim-rgb),.12);

  --home-badge-bg:rgba(var(--home-light-rgb),.94);
  --home-badge-bg-hover:rgb(var(--home-light-rgb));

  /* ==== category listing tokens (was category.css) ==== */


  /* -- channels --------------------------------------------------------- */

  --cat-primary-rgb:31,51,64;           /* keep in step with --primary  #1F3340 */
  --cat-accent-rgb:233,161,59;          /* keep in step with --accent   #E9A13B */
  --cat-light-rgb:255,255,255;          /* keep in step with --card     #FFFFFF */

  /* -- surfaces --------------------------------------------------------- */

  --cat-hero-wash:rgba(var(--cat-accent-rgb),.07);
  --cat-thumb-bg:rgba(var(--cat-primary-rgb),.05);
  --cat-thumb-icon:rgba(var(--cat-primary-rgb),.30);
  --cat-pill-bg:rgba(var(--cat-light-rgb),1);
  --cat-pill-hover-bg:rgba(var(--cat-accent-rgb),.09);

  /* -- elevation --------------------------------------------------------
     Geometry stays inline at each rule; only the tone is shared, so a
     palette change moves every shadow together without flattening the
     difference between a resting card and a lifted one. */

  --cat-shadow-rest:rgba(var(--cat-primary-rgb),.06);
  --cat-shadow-lift:rgba(var(--cat-primary-rgb),.16);
  --cat-shadow-pill:rgba(var(--cat-accent-rgb),.30);

  /* -- focus ------------------------------------------------------------
     One ring, used on every interactive element on the page, so keyboard
     position is never ambiguous. */

  --cat-focus-ring:rgba(var(--cat-accent-rgb),.42);

  /* ==== article page tokens (was article.css) ==== */


  /* -- channels --------------------------------------------------------- */

  --art-primary-rgb:31,51,64;           /* keep in step with --primary  #1F3340 */
  --art-accent-rgb:233,161,59;          /* keep in step with --accent   #E9A13B */
  --art-light-rgb:255,255,255;          /* keep in step with --card     #FFFFFF */

  /* -- surfaces --------------------------------------------------------- */

  --art-figure-bg:rgba(var(--art-primary-rgb),.05);
  --art-figure-icon:rgba(var(--art-primary-rgb),.28);
  --art-rule:rgba(var(--art-primary-rgb),.14);
  --art-quote-bg:rgba(var(--art-primary-rgb),.04);

  /* Callout wash. Deliberately weak - these paragraphs already carry
     weight from the bold lead-in and the amber edge, and a strong fill
     behind a food-safety note reads as alarmist rather than clear. */
  --art-callout-bg:rgba(var(--art-accent-rgb),.08);
  --art-callout-edge:var(--accent);

  /* -- elevation and focus ---------------------------------------------- */

  --art-shadow-rest:rgba(var(--art-primary-rgb),.06);
  --art-shadow-lift:rgba(var(--art-primary-rgb),.16);
  --art-focus-ring:rgba(var(--art-accent-rgb),.42);

}


/* ==========================================================================
   1. HERO BAND
   Full-width band sitting between the breadcrumb bar and the topic cards,
   split 40/60 - editorial copy left, image right. To change the ratio,
   edit .home-hero's grid-template-columns; the two numbers just need to
   add up to 100.
   ========================================================================== */

.home-hero-band{
  background:
    radial-gradient(ellipse at 88% 0%, var(--home-glow-hero), transparent 58%),
    linear-gradient(180deg, var(--home-band-top) 0%, var(--bg) 100%);
  border-bottom:1px solid var(--hairline);
  padding:56px 0 60px;
}

.home-hero{
  display:grid;
  grid-template-columns:40fr 60fr;
  gap:52px;
  align-items:center;
}

/* ---- Left: copy ---- */

.home-hero-copy{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:18px;
}

.home-hero-copy h1{
  font-family:var(--serif);
  font-size:clamp(2.1rem, 3.4vw, 3.05rem);
  line-height:1.08;
  font-weight:600;
  letter-spacing:-.015em;
  color:var(--primary);
  margin:0;
  text-wrap:balance;
}

.home-hero-copy > p{
  font-size:1.04rem;
  line-height:1.65;
  color:var(--secondary);
  max-width:46ch;
  margin:0;
}

.home-hero-meta{
  display:flex;
  align-items:center;
  gap:12px;
  font-size:.78rem;
  font-weight:600;
  letter-spacing:.02em;
  color:var(--secondary);
}

.home-hero-dot{
  width:4px;
  height:4px;
  border-radius:50%;
  background:var(--accent);
  flex:0 0 auto;
}

.home-hero-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:6px;
}

/* The base .btn has no shadow. On a large hero the primary action needs a
   little more presence than a flat rectangle. */
.home-hero-actions .btn{
  padding:13px 26px;
  font-size:.9rem;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.home-hero-actions .btn-accent{
  box-shadow:0 8px 18px var(--home-shadow-accent);
}
.home-hero-actions .btn-accent:hover{
  transform:translateY(-2px);
  box-shadow:0 12px 24px var(--home-shadow-accent-hover);
}
.home-hero-actions .btn-secondary:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 20px var(--home-shadow-soft);
}

/* ---- Right: image ---- */

.home-hero-figure{
  position:relative;
  border-radius:14px;
  overflow:hidden;
  aspect-ratio:4/3;
  background:var(--home-figure-bg);
  box-shadow:
    0 26px 50px -18px var(--home-shadow-figure-far),
    0 2px 6px var(--home-shadow-figure-near);
}

.home-hero-figure img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.home-hero-figure-fallback{
  width:100%;
  height:100%;
  background:linear-gradient(135deg, var(--home-figure-fallback-from), var(--home-figure-fallback-to));
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--home-figure-icon);
}
.home-hero-figure-fallback i{font-size:4.5rem;}

/* Two overlapping gradients: a soft top-light so the image doesn't sit
   flat against the band, and a heavier foot so the category badge stays
   legible over a busy photograph. */
.home-hero-figure::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:
    linear-gradient(180deg, var(--home-figure-sheen) 0%, transparent 30%),
    linear-gradient(0deg, var(--home-figure-scrim-foot) 0%, var(--home-figure-scrim-mid) 32%, transparent 60%);
}

.home-hero-badge{
  position:absolute;
  left:20px;
  bottom:20px;
  z-index:2;
  display:inline-flex;
  align-items:center;
  gap:9px;
  padding:9px 16px;
  border-radius:999px;
  background:var(--home-badge-bg);
  color:var(--primary);
  font-family:var(--sans);
  font-size:.76rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
  backdrop-filter:blur(6px);
  box-shadow:0 6px 16px var(--home-shadow-badge);
  transition:background .15s ease, transform .15s ease;
}
.home-hero-badge i{color:var(--accent-dark);font-size:.82rem;}
.home-hero-badge:hover{background:var(--home-badge-bg-hover);transform:translateY(-2px);}


/* ==========================================================================
   2. TOPIC CARDS
   One card per category, immediately beneath the hero.
   ========================================================================== */

.home-topics{
  background:var(--bg);
  border-bottom:1px solid var(--hairline);
  padding:38px 0 42px;
}

/* Column count comes from index.php as --topic-cols, worked out by
   home_topic_columns() so the cards always fill whole rows: 5 or 7 or 9
   categories sit on one row, 6/8/10/12 split into two equal rows. The 3
   in the fallback only applies if the property is missing. */
.topic-grid{
  display:grid;
  grid-template-columns:repeat(var(--topic-cols, 3), minmax(0,1fr));
  gap:16px;
}

.topic-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:22px 22px 18px;
  background:var(--card);
  border:1px solid var(--hairline);
  border-radius:10px;
  box-shadow:0 1px 2px var(--home-shadow-rest);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/* A hairline of accent along the top edge, revealed on hover. Cheaper
   than animating the border and it never shifts the card's box. */
.topic-card::before{
  content:"";
  position:absolute;
  left:0; right:0; top:0;
  height:3px;
  border-radius:10px 10px 0 0;
  background:var(--accent);
  transform:scaleX(0);
  transform-origin:left;
  transition:transform .2s ease;
}

.topic-card:hover{
  transform:translateY(-3px);
  border-color:var(--hairline-strong);
  box-shadow:0 14px 26px -10px var(--home-shadow-lift);
}
.topic-card:hover::before{transform:scaleX(1);}

.topic-icon{
  width:42px;
  height:42px;
  border-radius:10px;
  background:var(--bg);
  border:1px solid var(--hairline);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--accent-dark);
  font-size:1.05rem;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.topic-card:hover .topic-icon{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--primary);
}

.topic-card h3{
  font-family:var(--serif);
  font-size:1.12rem;
  color:var(--primary);
  margin:2px 0 0;
}

.topic-card p{
  font-size:.85rem;
  line-height:1.55;
  color:var(--secondary);
  margin:0;
  flex:1 1 auto;
}

.topic-more{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:6px;
  padding-top:12px;
  border-top:1px solid var(--hairline);
  font-size:.75rem;
  font-weight:700;
  letter-spacing:.04em;
  color:var(--secondary);
}
.topic-more i{
  color:var(--accent-dark);
  transition:transform .15s ease;
}
.topic-card:hover .topic-more i{transform:translateX(4px);}

.topic-count{text-transform:uppercase;}

/* ---- Compact variant ----
   Applied by index.php once there are 5+ columns, where a card is too
   narrow for a sentence. Drops the description and centres what is left,
   which squares the cards up. */

.topic-grid-compact{gap:12px;}

.topic-grid-compact .topic-card{
  align-items:center;
  text-align:center;
  gap:6px;
  padding:18px 10px 14px;
}

.topic-grid-compact .topic-icon{
  width:46px;
  height:46px;
  border-radius:50%;
  font-size:1.1rem;
}

.topic-grid-compact .topic-card h3{
  font-size:.94rem;
  line-height:1.25;
  /* Long category names wrap rather than forcing the column wider. */
  overflow-wrap:anywhere;
}

.topic-grid-compact .topic-more{
  justify-content:center;
  gap:7px;
  width:100%;
  margin-top:auto;
  padding-top:10px;
  font-size:.7rem;
}


/* ==========================================================================
   3. SECTION RHYTHM
   ========================================================================== */

.home-block{margin-bottom:52px;}
.home-block:last-child{margin-bottom:8px;}

/* .place-chips sections carry their own bottom margin in style.css. */
.home-block.places-section{margin-bottom:46px;}

.home-section-note{
  font-size:.78rem;
  font-weight:600;
  letter-spacing:.02em;
  color:var(--secondary);
}


/* ==========================================================================
   4. MAGAZINE CARDS
   Reuses .article-card from style.css and changes the grid around it: the
   first card in Featured Guides runs full width and lays out side-on, the
   rest sit two-up underneath.
   ========================================================================== */

.guide-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:24px;
}

.home-card .article-body{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  padding:18px 20px 18px;
}

/* Pushes the footer + read-more to the bottom, so cards with shorter
   excerpts still line their baselines up across a row. */
.home-card .article-foot{margin-top:auto;}

.home-card-sub{
  color:var(--secondary);
  font-weight:600;
  letter-spacing:.04em;
}

.home-card-more{
  display:inline-flex;
  align-items:center;
  gap:7px;
  margin-top:12px;
  font-size:.78rem;
  font-weight:800;
  letter-spacing:.03em;
  color:var(--accent-dark);
  width:fit-content;
}
.home-card-more i{transition:transform .15s ease;font-size:.72rem;}
.home-card-more:hover{color:var(--primary);}
.home-card-more:hover i{transform:translateX(4px);}

/* ---- Lead card ---- */

.home-card-lead{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  align-items:stretch;
}

.home-card-lead .home-card-thumb{
  aspect-ratio:auto;
  height:100%;
  min-height:264px;
}

.home-card-lead .article-body{
  padding:30px 32px;
  justify-content:center;
}

.home-card-lead h3{
  font-size:1.6rem;
  line-height:1.2;
  margin:10px 0 12px;
  letter-spacing:-.01em;
}

.home-card-lead p{
  font-size:.95rem;
  line-height:1.6;
  margin-bottom:16px;
}

.home-card-lead .article-foot{
  margin-top:0;
  padding-top:14px;
}


/* ==========================================================================
   5. SIDEBAR COLUMN
   index.php wraps includes/sidebar.php and the homepage's own widgets in
   .home-sidebar-col, so the whole right-hand column is ONE grid child.

   Do not be tempted to make .home-side-extra a grid child of its own and
   force it into column 2. That lands it in grid row 2, and a grid row
   cannot begin until the tallest item in the row above has finished - so
   the length of the MAIN column decides where the extras start. With a
   long article list that opened a gap of over a thousand pixels beneath
   the sidebar. One wrapper and a flex column removes the problem at
   source, because there is no second row to wait for.
   ========================================================================== */

.home-sidebar-col{
  display:flex;
  flex-direction:column;
  gap:34px;
  min-width:0;
}

.home-side-extra{
  display:flex;
  flex-direction:column;
  gap:34px;
  min-width:0;
}

.home-side-intro{
  font-size:.83rem;
  line-height:1.55;
  color:var(--secondary);
  margin:0 0 12px;
}

/* ---- Sidebar newsletter ---- */

.home-side-nl form{
  display:flex;
  flex-direction:column;
  gap:9px;
}

.home-side-nl input{
  width:100%;
  padding:11px 13px;
  border-radius:6px;
  border:1px solid var(--hairline-strong);
  background:var(--card);
  font-family:var(--sans);
  font-size:.86rem;
  color:var(--text);
}
.home-side-nl input::placeholder{color:var(--secondary);opacity:.85;}
.home-side-nl input:focus{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--home-focus-ring);
}

.home-side-nl button{
  justify-content:center;
  width:100%;
}

/* ==========================================================================
   6. NETWORK STRIP
   Full-width, sits between </main> and the newsletter band. Deliberately
   light: the newsletter band directly below it is --primary, and two dark
   strips back to back read as the footer starting early.
   ========================================================================== */

.network-band{
  margin-top:56px;
  padding:34px 0 38px;
  background:
    radial-gradient(ellipse at 12% 50%, var(--home-glow-network), transparent 60%),
    var(--bg);
  border-top:1px solid var(--hairline);
  border-bottom:1px solid var(--hairline);
}

.network-head{
  display:flex;
  align-items:baseline;
  gap:14px;
  flex-wrap:wrap;
  margin-bottom:18px;
}
.network-head h2{
  font-family:var(--serif);
  font-size:1.3rem;
  color:var(--primary);
  margin:0;
}
.network-head p{
  font-size:.83rem;
  color:var(--secondary);
  margin:0;
}

.network-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(210px, 1fr));
  gap:14px;
}

.network-item{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:64px;
  padding:12px 14px;
  background:var(--card);
  border:1px solid var(--hairline);
  border-radius:10px;
  box-shadow:0 1px 2px var(--home-shadow-rest);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.network-item:hover{
  transform:translateY(-2px);
  border-color:var(--hairline-strong);
  box-shadow:0 12px 22px -10px var(--home-shadow-lift);
}

.network-icon{
  flex:0 0 auto;
  width:38px;
  height:38px;
  border-radius:9px;
  background:var(--bg);
  border:1px solid var(--hairline);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--accent-dark);
  font-size:.95rem;
  transition:background .15s ease, color .15s ease, border-color .15s ease;
}
.network-item:hover .network-icon{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--primary);
}

.network-text{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
  flex:1 1 auto;
}
.network-text strong{
  font-family:var(--sans);
  font-size:.87rem;
  font-weight:700;
  color:var(--primary);
  line-height:1.25;
  overflow-wrap:anywhere;
}
.network-text small{
  font-size:.74rem;
  color:var(--secondary);
  line-height:1.3;
}

.network-arrow{
  flex:0 0 auto;
  color:var(--accent-dark);
  font-size:.75rem;
  transition:transform .15s ease;
}
.network-item:hover .network-arrow{transform:translateX(4px);}


/* ==========================================================================
   7. RESPONSIVE
   Breakpoints match style.css (1080 / 900 / 560) so the two stylesheets
   reflow together rather than fighting each other.
   ========================================================================== */

@media (max-width:1080px){
  .home-hero{gap:40px;}
  .home-hero-band{padding:44px 0 48px;}

  /* Cap the run at 4 across on a tablet however many the desktop shows,
     then let home_topic_columns()'s intent resume below. */
  .topic-grid{grid-template-columns:repeat(min(var(--topic-cols, 3), 4), minmax(0,1fr));}

  /* .layout collapses to a single column here and aside.sidebar becomes a
     wrapping row (style.css), so the extras match that shape. */
  .home-side-extra{
    flex-direction:row;
    flex-wrap:wrap;
  }
  .home-side-extra > .widget{flex:1 1 260px;}
}

@media (max-width:900px){
  .home-hero{
    grid-template-columns:1fr;
    gap:32px;
  }
  /* Image first on narrow screens - it is the thing that establishes what
     the page is about at a glance. */
  .home-hero-figure{order:-1;aspect-ratio:16/9;}
  .home-hero-copy{gap:14px;}

  .topic-grid{grid-template-columns:repeat(min(var(--topic-cols, 3), 3), minmax(0,1fr));}

  .guide-grid{grid-template-columns:1fr;}
  .home-card-lead{grid-template-columns:1fr;}
  .home-card-lead .home-card-thumb{min-height:0;aspect-ratio:16/9;}
  .home-card-lead .article-body{padding:20px 22px 22px;}
  .home-card-lead h3{font-size:1.3rem;}
}

@media (max-width:560px){
  .home-hero-band{padding:32px 0 36px;}
  .home-hero-actions{width:100%;}
  .home-hero-actions .btn{flex:1 1 100%;justify-content:center;}

  .topic-grid{grid-template-columns:repeat(2, minmax(0,1fr));}
  .topic-grid .topic-card p{display:none;}

  .network-grid{grid-template-columns:1fr;}
  .network-band{padding:26px 0 30px;}
}


/* ==========================================================================
   8. REDUCED MOTION
   style.css already kills transitions globally under this query; these
   reset the transforms those transitions were carrying.
   ========================================================================== */

@media (prefers-reduced-motion:reduce){
  .topic-card:hover,
  .network-item:hover,
  .home-hero-badge:hover,
  .home-hero-actions .btn:hover{transform:none;}
  .topic-card:hover .topic-more i,
  .network-item:hover .network-arrow,
  .home-card-more:hover i{transform:none;}
  .topic-card::before{transition:none;}
}


/* ==========================================================================
   9. TOUCH TARGETS
   Below 900px the layout is being driven by a finger rather than a cursor.
   The WCAG 2.5.8 minimum is 24x24 CSS px and the practical guideline most
   design systems use is 44x44, which is what these aim for.

   Scoped to the mobile breakpoint deliberately: applying it at every width
   would inflate the desktop layout, where a mouse makes it unnecessary.
   ========================================================================== */

@media (max-width:900px){

  /* "Read more" is a ~20px-tall inline link at desktop sizes. Padding it
     out is enough - no need to change how it looks. */
  .home-card-more{
    min-height:44px;
    align-items:center;
    margin-top:8px;
  }

  .home-hero-badge{
    min-height:44px;
    padding:11px 18px;
  }

  .home-hero-actions .btn{
    min-height:48px;
  }

  .home-side-nl input{
    min-height:44px;
  }
  .home-side-nl button{
    min-height:48px;
  }

  /* .place-chips comes from style.css and is shared, so this is scoped to
     the homepage's own section rather than changed globally. */
  .home-block .place-chips a{
    min-height:44px;
    display:inline-flex;
    align-items:center;
  }

  /* 10.88px is too small to read comfortably on a phone. The desktop size
     is fine, so this only lifts it where it matters. */
  .home-card-sub{
    font-size:.74rem;
  }
}


/* ==========================================================================
   10. SHARED HEADER OVERFLOW  (fixes a bug in style.css, not in this file)
   --------------------------------------------------------------------------
   In style.css the header has three fixed-width, non-shrinking parts:

     .logo-link      flex:0 0 auto  with img{width:310px}
     .header-actions flex:0 0 auto
     .header-search  min-width:310px

   That is 620px of the 1192px content box spoken for before the navigation
   gets a say, and none of it can give way. Two consequences:

     * On a phone the logo alone is wider than the screen. The 900px
       breakpoint changes its HEIGHT to 44px but never unsets the 310px
       WIDTH, so the page scrolls sideways.
     * On the desktop the nav has ~516px to work with. Six categories fit.
       Ten do not, and the row pushes straight through the viewport.

   Measured before this block, with this stylesheet disabled:

     320px  -> 78px sideways     960px  -> 219px
     375px  -> 23px              1024px -> 155px
     390px  ->  8px              1100px ->  79px
     600px  -> 47px              1440px + 12 categories -> 175px

   The rules below let each part shrink, and let the nav wrap to a second
   line instead of overflowing. Nothing changes at the sizes that already
   fit, so a six-category header at 1440px looks exactly as it did.

   THIS BLOCK ONLY FIXES THE HOMEPAGE, because only the homepage loads this
   file. The header is on every page, so the real home for these rules is
   style.css - move them there and delete this section. They are written to
   be safe to paste in as-is.
   ========================================================================== */

/* Let the three fixed parts give way when there is not enough room.
   min-width:0 is the part that actually matters: without it a flex item
   refuses to shrink below its content, whatever its flex-basis says. */
.logo-link{min-width:0;}
.logo-link img{max-width:100%;}

nav.primary-nav{min-width:0;}

/* A safety valve for long category lists: the nav drops onto a second
   line rather than pushing the search box off the edge. No column-gap is
   set, so spacing stays exactly as style.css has it (justify-content:
   space-between does the work) and a normal 6-8 item nav still sits on a
   single line - this only engages when the row genuinely cannot fit. */
.nav-list{
  flex-wrap:wrap;
  row-gap:4px;
}

.header-actions{
  flex:0 1 auto;
  min-width:0;
}

/* On the desktop the search box keeps its designed 310px and the nav
   absorbs the squeeze by wrapping (above). Only below 1200px, where the
   nav is about to be hidden anyway, is the search allowed to shrink -
   that is what stops it forcing sideways scroll on a phone. */
@media (max-width:1200px){
  .header-search{
    min-width:0;
    flex:1 1 auto;
  }

  /* width:auto lets the logo scale on its own aspect ratio instead of
     staying pinned to 310px. */
  .logo-link img{
    width:auto;
    max-width:200px;
    height:40px;
  }
  .header-inner{gap:14px;}
}

@media (max-width:560px){
  .logo-link img{max-width:170px;}
}

/* ==========================================================================
   11. CATEGORY AND SUB-CATEGORY PAGES

   Applies to category.php, which renders both shapes - the category page
   (/medicines/) and the sub-category page (/medicines/antibiotics/) -
   from one template and one set of classes.
   ========================================================================== */
/* ==========================================================================
   1. CATEGORY HERO
   The band above the pills. On a sub-category page the eyebrow carries the
   parent category name, so it is doing real navigational work rather than
   decoration and is styled to be readable rather than whispered.
   ========================================================================== */

.category-hero{
  position:relative;
  padding:38px 0 30px;
  border-bottom:1px solid var(--hairline);
  margin-bottom:26px;
}

.category-hero .eyebrow{
  display:inline-block;
  font-family:var(--sans);
  font-size:.74rem;
  font-weight:700;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--accent-dark);
  margin-bottom:12px;
}

.category-hero h1{
  font-family:var(--serif);
  font-size:clamp(1.95rem, 3.1vw, 2.7rem);
  line-height:1.1;
  font-weight:600;
  letter-spacing:-.015em;
  color:var(--primary);
  margin:0 0 14px;
  text-wrap:balance;
}

.category-hero > p{
  font-size:1.03rem;
  line-height:1.7;
  color:var(--secondary);
  max-width:62ch;
  margin:0;
}

/* Article count and last-updated. Small, quiet, and separated from the
   intro so it reads as metadata rather than as part of the sentence. */
.category-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px 22px;
  margin-top:20px;
  font-size:.8rem;
  font-weight:600;
  letter-spacing:.01em;
  color:var(--secondary);
}

.category-meta span{
  display:inline-flex;
  align-items:center;
  gap:7px;
}

.category-meta i{
  color:var(--accent-dark);
  font-size:.85em;
}


/* ==========================================================================
   2. FILTER PILLS
   The sub-category navigation. There are seven per category, which is too
   many for one row on a phone, so the row scrolls horizontally rather than
   wrapping into a block that pushes the articles below the fold.
   ========================================================================== */

.era-filter{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin:0 0 30px;
}

.era-pill{
  display:inline-flex;
  align-items:center;
  padding:9px 16px;
  border:1px solid var(--hairline-strong);
  border-radius:30px;
  background:var(--cat-pill-bg);
  font-family:var(--sans);
  font-size:.86rem;
  font-weight:600;
  line-height:1.2;
  color:var(--primary);
  text-decoration:none;
  white-space:nowrap;
  transition:background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.era-pill:hover,
.era-pill:focus-visible{
  background:var(--cat-pill-hover-bg);
  border-color:var(--accent);
  color:var(--accent-dark);
}

.era-pill.is-active{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--primary);
  box-shadow:0 4px 12px var(--cat-shadow-pill);
}

.era-pill.is-active:hover{
  background:var(--accent);
  color:var(--primary);
}

.era-pill:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px var(--cat-focus-ring);
}


/* ==========================================================================
   3. SECTION HEAD AND SORT
   Heading left, sort control right, dropping to two stacked rows when
   there is no longer room for both.
   ========================================================================== */

.section-head{
  display:flex;
  flex-wrap:wrap;
  align-items:baseline;
  justify-content:space-between;
  gap:14px;
  margin:0 0 20px;
  padding-bottom:12px;
  border-bottom:1px solid var(--hairline);
}

.section-head h2{
  font-family:var(--serif);
  font-size:1.4rem;
  font-weight:600;
  letter-spacing:-.01em;
  color:var(--primary);
  margin:0;
}

.sort-form{
  display:flex;
  align-items:center;
  gap:9px;
  font-size:.84rem;
  color:var(--secondary);
}

.sort-form label{
  font-weight:600;
  white-space:nowrap;
}

.sort-form select{
  font:inherit;
  font-size:.86rem;
  padding:7px 11px;
  border:1px solid var(--hairline-strong);
  border-radius:6px;
  background:var(--card);
  color:var(--text);
  cursor:pointer;
}

.sort-form select:focus-visible{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--cat-focus-ring);
}


/* ==========================================================================
   4. ARTICLE CARDS
   Two per row at desktop width inside the content column. The whole card
   lifts on hover, but only the title is a link - the hover is a hint that
   the card is clickable, not a claim that all of it is.
   ========================================================================== */

.article-grid.category-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:22px;
}

.article-card{
  display:flex;
  flex-direction:column;
  background:var(--card);
  border:1px solid var(--hairline);
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 2px 8px var(--cat-shadow-rest);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.article-card:hover{
  transform:translateY(-3px);
  border-color:var(--hairline-strong);
  box-shadow:0 12px 26px var(--cat-shadow-lift);
}

/* Thumb. Most guides have no image, so the icon fallback is the normal
   case rather than the exception and is styled as a deliberate state. */
.article-card .article-thumb{
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:16 / 9;
  background:var(--cat-thumb-bg);
  border-bottom:1px solid var(--hairline);
  overflow:hidden;
}

.article-card .article-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.article-card .article-thumb i{
  font-size:2.1rem;
  color:var(--cat-thumb-icon);
}

.article-card .article-body{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  padding:18px 20px 16px;
  gap:9px;
}

.article-card .article-tag{
  align-self:flex-start;
  font-family:var(--sans);
  font-size:.68rem;
  font-weight:700;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--accent-dark);
}

.article-card h3{
  font-family:var(--serif);
  font-size:1.12rem;
  line-height:1.3;
  font-weight:600;
  margin:0;
  text-wrap:balance;
}

.article-card h3 a{
  color:var(--primary);
  text-decoration:none;
}

.article-card h3 a:hover{
  color:var(--accent-dark);
}

.article-card h3 a:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px var(--cat-focus-ring);
  border-radius:3px;
}

.article-card .article-body p{
  font-size:.9rem;
  line-height:1.6;
  color:var(--secondary);
  margin:0;
}

/* Byline and date, pinned to the bottom so cards of differing text length
   still line their feet up across a row. */
.article-card .article-foot{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:6px 14px;
  margin-top:auto;
  padding-top:14px;
  border-top:1px solid var(--hairline);
  font-size:.76rem;
  color:var(--secondary);
}


/* ==========================================================================
   5. EMPTY STATE
   A sub-category with no guides yet is a normal state on a new site, not
   an error, so it is styled as a quiet panel rather than a warning.
   ========================================================================== */

.article-grid.category-grid > p{
  grid-column:1 / -1;
  margin:0;
  padding:34px 26px;
  border:1px dashed var(--hairline-strong);
  border-radius:10px;
  background:var(--cat-hero-wash);
  text-align:center;
  font-size:.95rem;
  line-height:1.6;
  color:var(--secondary);
}


/* ==========================================================================
   6. PAGINATION
   ========================================================================== */

.pagination{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:7px;
  margin:36px 0 8px;
}

.page-btn,
.page-num{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:40px;
  height:40px;
  padding:0 14px;
  border:1px solid var(--hairline-strong);
  border-radius:6px;
  background:var(--card);
  font-family:var(--sans);
  font-size:.86rem;
  font-weight:600;
  color:var(--primary);
  text-decoration:none;
  transition:background .16s ease, border-color .16s ease, color .16s ease;
}

.page-num{
  padding:0 6px;
}

.page-btn:hover,
.page-num:hover{
  border-color:var(--accent);
  color:var(--accent-dark);
  background:var(--cat-pill-hover-bg);
}

.page-num.is-active{
  background:var(--accent);
  border-color:var(--accent);
  color:var(--primary);
}

.page-num.is-active:hover{
  background:var(--accent);
  color:var(--primary);
}

.page-btn.is-disabled{
  opacity:.42;
  cursor:default;
  pointer-events:none;
}

.page-btn:focus-visible,
.page-num:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px var(--cat-focus-ring);
}


/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */

@media (max-width: 900px){
  .article-grid.category-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:18px;
  }
}

@media (max-width: 700px){
  .category-hero{padding:28px 0 24px;}

  .article-grid.category-grid{
    grid-template-columns:1fr;
    gap:16px;
  }

  /* Seven pills will not wrap tidily on a phone. Scrolling the row keeps
     the article list at the top of the screen where it belongs. The
     negative margin lets the row bleed to the screen edge so it reads as
     scrollable rather than clipped. */
  .era-filter{
    flex-wrap:nowrap;
    overflow-x:auto;
    scrollbar-width:none;
    margin-left:-16px;
    margin-right:-16px;
    padding:2px 16px 10px;
    -webkit-overflow-scrolling:touch;
  }
  .era-filter::-webkit-scrollbar{display:none;}

  .section-head{
    align-items:flex-start;
    flex-direction:column;
  }

  .pagination{gap:5px;}
  .page-btn,.page-num{height:42px;min-width:42px;font-size:.82rem;}
}


/* ==========================================================================
   8. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce){
  .article-card,
  .era-pill,
  .page-btn,
  .page-num{
    transition:none;
  }
  .article-card:hover{
    transform:none;
  }
}


/* ==========================================================================
   9. TOUCH TARGETS
   Coarse pointers get a larger hit area on the pills and pagination,
   which are the two places on this page with small tap targets.
   ========================================================================== */

@media (pointer: coarse){
  .era-pill{padding:11px 18px;}
  .page-btn,.page-num{height:44px;min-width:44px;}
}

/* ==========================================================================
   12. SINGLE ARTICLE PAGES

   Applies to article.php. Most of this is the body typography: the guide
   bodies are raw h2/p/ul/strong/a echoed straight out of articles.body,
   so the typography of those elements IS the design of the page.
   ========================================================================== */
/* ==========================================================================
   1. BACK LINK
   ========================================================================== */

.back-to-category{
  display:inline-flex;
  align-items:center;
  gap:9px;
  margin:26px 0 22px;
  font-family:var(--sans);
  font-size:.84rem;
  font-weight:600;
  letter-spacing:.01em;
  color:var(--secondary);
  text-decoration:none;
  transition:color .16s ease, gap .16s ease;
}

.back-to-category:hover{
  color:var(--accent-dark);
  gap:12px;
}

.back-to-category i{font-size:.8em;}

.back-to-category:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px var(--art-focus-ring);
  border-radius:3px;
}


/* ==========================================================================
   2. ARTICLE HEADER
   ========================================================================== */

.article-page-header{
  margin:0 0 30px;
  padding-bottom:24px;
  border-bottom:1px solid var(--hairline);
}

.article-page-header .article-tag{
  display:inline-block;
  margin-bottom:14px;
  font-family:var(--sans);
  font-size:.7rem;
  font-weight:700;
  letter-spacing:.1em;
  text-transform:uppercase;
  color:var(--accent-dark);
}

.article-page-header h1{
  font-family:var(--serif);
  font-size:clamp(2rem, 3.6vw, 2.95rem);
  line-height:1.08;
  font-weight:600;
  letter-spacing:-.02em;
  color:var(--primary);
  margin:0 0 22px;
  max-width:22ch;
  text-wrap:balance;
}

/* Author and date. Reading these guides, who wrote it and when it was last
   looked at are load-bearing facts rather than furniture, so the meta row
   sits above the fold and is legible rather than greyed out. */
.article-page-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px 22px;
  font-size:.82rem;
  font-weight:600;
  color:var(--secondary);
}

.article-page-meta span{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.article-page-meta i{
  color:var(--accent-dark);
  font-size:.85em;
}


/* ==========================================================================
   3. HERO IMAGE
   Guides usually have no image, so the icon fallback is the normal case.
   It is sized as a deliberate graphic panel rather than a broken image.
   ========================================================================== */

.article-hero-image{
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:21 / 9;
  margin:0 0 24px;
  border:1px solid var(--hairline);
  border-radius:10px;
  background:var(--art-figure-bg);
  overflow:hidden;
}

.article-hero-image img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.article-hero-image i{
  font-size:3.2rem;
  color:var(--art-figure-icon);
}


/* ==========================================================================
   4. BODY TYPOGRAPHY

   The measure is capped at 68 characters. Long-form medical explanation is
   read start to finish rather than scanned, and a line much longer than
   this loses the reader's place on the return sweep.
   ========================================================================== */

.article-content{
  font-size:1.06rem;
  line-height:1.75;
  color:var(--text);
  max-width:68ch;
}

.article-content p{margin:0 0 22px;}

/* The opening paragraph answers the question in the title outright - it is
   the part most readers need and the part search engines lift. It is set
   larger so that a reader who stops after one paragraph has still had the
   answer. */
.article-content > p:first-of-type{
  font-size:1.18rem;
  line-height:1.6;
  color:var(--primary);
  margin-bottom:30px;
}

/* H2s carry a short accent rule above them. The guides run to seven or
   eight sections, and the rule gives a scanning reader a reliable stop
   without resorting to numbering, which would imply a sequence these
   sections do not have. */
.article-content h2{
  position:relative;
  font-family:var(--serif);
  font-size:1.55rem;
  line-height:1.22;
  font-weight:600;
  letter-spacing:-.01em;
  color:var(--primary);
  margin:42px 0 15px;
  padding-top:20px;
  text-wrap:balance;
}

.article-content h2::before{
  content:"";
  position:absolute;
  top:0;
  left:0;
  width:34px;
  height:3px;
  border-radius:2px;
  background:var(--accent);
}

.article-content h2:first-child{margin-top:0;}

.article-content h3{
  font-family:var(--serif);
  font-size:1.24rem;
  line-height:1.3;
  font-weight:600;
  color:var(--primary);
  margin:30px 0 11px;
}

/* Lists. Several guides use a list as the actual answer - the symptoms to
   act on, the checks to run - so the markers are drawn rather than left as
   browser default discs. */
.article-content ul,
.article-content ol{
  margin:0 0 24px;
  padding-left:0;
  list-style:none;
}

.article-content li{
  position:relative;
  margin-bottom:11px;
  padding-left:26px;
  line-height:1.7;
}

.article-content ul > li::before{
  content:"";
  position:absolute;
  left:4px;
  top:.72em;
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--accent);
}

.article-content ol{counter-reset:art-step;}

.article-content ol > li{counter-increment:art-step;}

.article-content ol > li::before{
  content:counter(art-step) ".";
  position:absolute;
  left:0;
  top:0;
  font-family:var(--sans);
  font-size:.9em;
  font-weight:700;
  color:var(--accent-dark);
}

.article-content strong{
  font-weight:700;
  color:var(--primary);
}

.article-content a{
  color:var(--accent-dark);
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
  text-decoration-color:var(--accent);
}

.article-content a:hover{
  color:var(--primary);
  text-decoration-color:var(--primary);
}

.article-content a:focus-visible{
  outline:none;
  box-shadow:0 0 0 3px var(--art-focus-ring);
  border-radius:2px;
}

.article-content blockquote{
  margin:0 0 24px;
  padding:18px 22px;
  border-left:3px solid var(--accent);
  border-radius:0 8px 8px 0;
  background:var(--art-quote-bg);
  font-size:1.02rem;
  line-height:1.7;
  color:var(--secondary);
}

.article-content blockquote p:last-child{margin-bottom:0;}

.article-content img{
  width:100%;
  height:auto;
  border-radius:10px;
  margin:8px 0 26px;
}

.article-content hr{
  height:1px;
  border:0;
  background:var(--art-rule);
  margin:34px 0;
}

.article-content table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 26px;
  font-size:.95rem;
}

.article-content th,
.article-content td{
  padding:11px 14px;
  border-bottom:1px solid var(--hairline);
  text-align:left;
  vertical-align:top;
}

.article-content th{
  font-family:var(--sans);
  font-size:.78rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--secondary);
}


/* ==========================================================================
   5. CALLOUTS

   The guides open some paragraphs with a bold lead-in - "Get urgent help
   if", "If too much has been taken" - and those are the sentences that
   matter most on a site about medicines. This lifts any paragraph that
   STARTS with <strong> into a bordered callout, so the urgent advice is
   findable by someone scrolling in a hurry.

   Done with :has(), which is a progressive enhancement: browsers without
   it simply render an ordinary paragraph with a bold opening, which is
   what the markup already says. Nothing breaks and no class is required
   in the article HTML.

   If you would rather mark these explicitly and not depend on :has(), add
   class="callout" to the paragraph - the same rule catches it.
   ========================================================================== */

.article-content > p.callout,
.article-content > p:has(> strong:first-child){
  padding:16px 20px;
  margin-bottom:24px;
  border-left:3px solid var(--art-callout-edge);
  border-radius:0 8px 8px 0;
  background:var(--art-callout-bg);
}

/* A callout that is entirely bold is a single urgent instruction rather
   than a lead-in to a longer point, so it loses the paragraph indent. */
.article-content > p.callout strong,
.article-content > p:has(> strong:first-child) strong{
  color:var(--primary);
}


/* ==========================================================================
   6. RELATED ARTICLES
   Three from the same category. Card styling matches category.css so a
   reader moving between the two pages sees one component, not two.
   ========================================================================== */

.related-articles{
  margin-top:48px;
  padding-top:8px;
  border-top:1px solid var(--hairline);
}

.related-articles .section-head{
  display:flex;
  align-items:baseline;
  gap:14px;
  margin:22px 0 20px;
  padding-bottom:12px;
  border-bottom:1px solid var(--hairline);
}

.related-articles .section-head h2{
  font-family:var(--serif);
  font-size:1.32rem;
  font-weight:600;
  color:var(--primary);
  margin:0;
}

.related-articles .article-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:18px;
}

.related-articles .article-card{
  display:flex;
  flex-direction:column;
  background:var(--card);
  border:1px solid var(--hairline);
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 2px 8px var(--art-shadow-rest);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.related-articles .article-card:hover{
  transform:translateY(-3px);
  border-color:var(--hairline-strong);
  box-shadow:0 12px 26px var(--art-shadow-lift);
}

.related-articles .article-thumb{
  display:flex;
  align-items:center;
  justify-content:center;
  aspect-ratio:16 / 9;
  background:var(--art-figure-bg);
  border-bottom:1px solid var(--hairline);
  overflow:hidden;
}

.related-articles .article-thumb img{
  width:100%;height:100%;object-fit:cover;display:block;
}

.related-articles .article-thumb i{
  font-size:1.7rem;
  color:var(--art-figure-icon);
}

.related-articles .article-body{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  gap:8px;
  padding:15px 17px 14px;
}

.related-articles .article-tag{
  font-family:var(--sans);
  font-size:.65rem;
  font-weight:700;
  letter-spacing:.09em;
  text-transform:uppercase;
  color:var(--accent-dark);
}

.related-articles .article-card h3{
  font-family:var(--serif);
  font-size:1.02rem;
  line-height:1.3;
  font-weight:600;
  margin:0;
}

.related-articles .article-card h3 a{
  color:var(--primary);
  text-decoration:none;
}

.related-articles .article-card h3 a:hover{color:var(--accent-dark);}

.related-articles .article-body p{
  font-size:.86rem;
  line-height:1.55;
  color:var(--secondary);
  margin:0;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.related-articles .article-foot{
  margin-top:auto;
  padding-top:12px;
  border-top:1px solid var(--hairline);
  font-size:.74rem;
  color:var(--secondary);
}


/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */

@media (max-width: 900px){
  .related-articles .article-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px){
  .article-page-header h1{max-width:none;}
  .article-hero-image{aspect-ratio:16 / 9;}
  .article-content{font-size:1.02rem;}
  .article-content > p:first-of-type{font-size:1.1rem;}
  .article-content h2{font-size:1.35rem;margin-top:34px;}
  .related-articles .article-grid{grid-template-columns:1fr;}
}


/* ==========================================================================
   8. PRINT

   People print guides about their own medicines, take them to
   appointments, and leave them by the kettle. Worth getting right: drop
   the furniture, keep the words, and expand links so a printed page is
   still usable away from the screen.
   ========================================================================== */

@media print{
  .back-to-category,
  .related-articles,
  .article-hero-image{display:none;}

  .article-content{
    max-width:none;
    font-size:11.5pt;
    line-height:1.55;
  }

  .article-content h2{
    padding-top:0;
    margin-top:20pt;
    page-break-after:avoid;
  }
  .article-content h2::before{display:none;}

  .article-content > p:first-of-type{font-size:12.5pt;}

  .article-content a::after{
    content:" (" attr(href) ")";
    font-size:9pt;
    word-break:break-all;
  }

  .article-content > p.callout,
  .article-content > p:has(> strong:first-child){
    border-left:2pt solid;
    background:none;
  }

  .article-content li,
  .article-content p{page-break-inside:avoid;}
}


/* ==========================================================================
   9. REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce){
  .back-to-category,
  .related-articles .article-card{transition:none;}
  .back-to-category:hover{gap:9px;}
  .related-articles .article-card:hover{transform:none;}
}