/* =====================================================================
   site.css - the complete front-end stylesheet.

   Built from three sources, in this order:

     style.css      the customer's foundation layer
     newstyle.css   the customer's palette and page styling
     platform.css   the platform's own additions

   The order is not cosmetic: newstyle.css redefines the core palette and
   expects to override the foundation, and platform.css corrects rules
   that assume a context the platform can now put an element in.

   One file because two meant two requests, two chances to ship a
   mismatched pair, and - as happened here - a site running for a week
   with a stylesheet that had rules for barely half the markup.

   Edit the source files and rebuild rather than editing this.
   ===================================================================== */

/* ---- style.css ---- */
/* File: /assets/css/style.css
   =========================================================================
   DIET GUIDE

   Diet and nutrition sites almost all look the same: bright leaf green on
   white, lots of air, the visual language of a supplement advert. This one
   deliberately does not, because the site's whole proposition is that it
   is not selling you a plan.

   The ground is deep aubergine - a food colour, warm rather than clinical,
   and closer to a reference book than a wellness brand. Green is still
   here, because it is the right colour for fresh food, but it is the
   accent rather than the whole scheme. Demoting it is the point.

   The page background is a warm off-white with a faint pink cast rather
   than cream, which keeps food photography looking appetising without
   turning yellow.

   SIGNATURE: the accent underline on navigation and the green rule beneath
   section headings - quiet, editorial, and the only place the palette
   raises its voice.

   ACCESSIBILITY. Every pairing was contrast-checked; nothing sits below
   WCAG AA and the weakest is 4.75:1. Two consequences before editing:

     - Buttons print --primary on the green, never white. White on this
       green is 2.18:1 and unreadable.
     - Green as TEXT on a light ground uses --accent-dark. The accent
       itself is 2.18:1 on white and must never carry type.

   FONTS. Fraunces and Public Sans, matching the Google Fonts link in
   /includes/head-common.php.
   ========================================================================= */

:root{
  /* -- core palette ---------------------------------------------------- */
  --primary:#3B2340;        /* deep aubergine - header, footer, headings  */
  --primary-tint:#56355D;   /* hover on dark surfaces                     */
  --secondary:#6A4F70;      /* plum-grey - breadcrumb, supporting text    */

  --accent:#8CBF3F;         /* leaf green - buttons, rules, active states */
  --accent-dark:#4E7A12;    /* green as TEXT on light - 5.10:1 on white   */
  --accent-light:#CDE8A3;   /* green as TEXT on aubergine                 */

  --text:#241A28;
  --bg:#FAF6F4;             /* warm off-white, faint pink cast            */
  --card:#FFFFFF;
  --cream:#FAF6F4;
  --footer:#2C1930;         /* a step below primary                       */
  --muted-on-dark:#C9B6CE;  /* body copy on aubergine                     */

  --hairline:rgba(59,35,64,.14);
  --hairline-strong:rgba(59,35,64,.28);

  /* -- type ------------------------------------------------------------ */
  --serif:"Fraunces", Georgia, "Times New Roman", serif;
  --sans:"Public Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --display:var(--serif);   /* alias, so stray references still resolve   */

  --logo-mask:url(/assets/images/dglogo.png);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  font-family:var(--sans);
  color:var(--text);
  background:var(--bg);
  line-height:1.6;
}
img{max-width:100%;display:block;}
a{color:inherit;text-decoration:none;}
ul{list-style:none;margin:0;padding:0;}
h1,h2,h3,h4{font-family:var(--serif);margin:0;color:var(--primary);line-height:1.2;}

.eyebrow{
  font-family:var(--sans);
  font-size:.72rem;
  font-weight:700;
  letter-spacing:.14em;
  text-transform:uppercase;
  color:var(--accent-dark);
}

.wrap{max-width:1240px;margin:0 auto;padding:0 24px;}
.visually-hidden,.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

.skip-link{position:absolute;left:-999px;top:0;background:var(--primary);color:#fff;padding:10px 16px;z-index:200;}
.skip-link:focus{left:12px;top:12px;}

:focus-visible{outline:3px solid var(--primary);outline-offset:2px;border-radius:3px;}

/* ===================== HEADER ===================== */
/* The header is the dark, not the accent. Green at this saturation across
   a full-width bar reads as a supplement advert; held back to the
   underline and the buttons it reads as fresh produce. */
header.site-header{
  background:var(--primary);
  border-bottom:3px solid var(--accent);
  position:sticky;top:0;z-index:100;
}
.header-inner{
  display:flex;align-items:center;gap:28px;
  padding:10px 24px;max-width:1240px;margin:0 auto;
}
.logo-link{flex:0 0 auto;}
.logo-link img{height:auto;width:310px;border-radius:3px;}

nav.primary-nav{flex:1 1 auto;}
.nav-list{display:flex;align-items:center;justify-content:space-between;width:100%;}
.nav-list > li{position:relative;}
.nav-list > li > a,
.nav-list > li > button.nav-toggle{
  display:flex;align-items:center;gap:5px;
  font-family:var(--sans);
  font-weight:700;font-size:.86rem;letter-spacing:.03em;
  color:#fff;
  padding:10px 6px;
  background:none;border:none;cursor:pointer;
  position:relative;
}
/* Underline slides in from the left. The 2px bar is --primary, which sits
   at 8.45:1 on the marigold, so the affordance never relies on colour
   alone. */
.nav-list > li > a::after,
.nav-list > li > button.nav-toggle::after{
  content:"";position:absolute;left:6px;right:6px;bottom:4px;height:2px;
  background:var(--accent);
  transform:scaleX(0);transform-origin:left;
  transition:transform .18s ease;
}
.nav-list > li > a:hover::after,
.nav-list > li:hover > button.nav-toggle::after{transform:scaleX(1);}
.nav-list > li > a.is-active,
.nav-list > li > button.nav-toggle.is-active{color:var(--accent-light);}
.nav-list > li > a.is-active::after,
.nav-list > li > button.nav-toggle.is-active::after{transform:scaleX(1);}
.caret{font-size:.6rem;margin-top:2px;}

/* The dropdown sits flush against the button, with no margin gap. A gap
   belongs to neither element, so crossing it makes li:hover go false and
   the menu closes before the pointer arrives. There is no JavaScript here,
   so :hover carries the whole interaction. */
.dropdown{
  display:none;position:absolute;top:100%;left:50%;
  transform:translateX(-50%);
  min-width:230px;
  background:var(--primary);
  border-top:3px solid var(--accent);
  box-shadow:0 12px 24px rgba(44,25,48,.30);
  padding:10px 0;z-index:50;
}
.nav-list > li:hover .dropdown,
.nav-list > li:focus-within .dropdown{display:block;}
.dropdown a{
  display:block;padding:9px 20px;font-size:.85rem;
  color:var(--cream);border-left:3px solid transparent;
}
.dropdown a:hover{background:var(--primary-tint);border-left-color:var(--accent);color:#fff;}

.dropdown-wide{min-width:560px;columns:3;column-gap:0;left:auto;right:0;transform:none;}
.dropdown-wide li{break-inside:avoid;}

.header-actions{display:flex;align-items:center;gap:14px;flex:0 0 auto;}
.icon-btn{
  width:36px;height:36px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  color:#fff;background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.22);font-size:.9rem;
}
.icon-btn:hover{background:var(--accent);color:var(--primary);border-color:var(--accent);}

.header-search{
  display:flex;align-items:center;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.22);
  border-radius:20px;padding:4px 4px 4px 16px;min-width:310px;
}
.header-search input{
  border:none;background:none;outline:none;
  font-family:var(--sans);font-size:.84rem;color:#fff;width:100%;
}
.header-search input::placeholder{color:var(--muted-on-dark);}
.header-search button{
  flex:0 0 auto;width:32px;height:32px;border-radius:50%;border:none;
  background:var(--accent);color:var(--primary);
  display:flex;align-items:center;justify-content:center;
  font-size:.8rem;cursor:pointer;
}
.header-search button:hover{background:var(--accent-light);}

.nav-toggle-mobile{display:none;}

/* ===================== BREADCRUMB ===================== */
.breadcrumb-bar{background:var(--secondary);color:#fff;}
.breadcrumb-bar .wrap{
  padding:9px 24px;display:flex;align-items:center;gap:8px;
  font-size:.78rem;letter-spacing:.02em;
}
.breadcrumb-bar a{opacity:.9;}
.breadcrumb-bar a:hover{opacity:1;text-decoration:underline;}
.breadcrumb-bar .sep{opacity:.55;}
.breadcrumb-bar .current{color:var(--accent-light);font-weight:600;}

/* ===================== LAYOUT ===================== */
main{padding:36px 0 8px;}
.layout{display:grid;grid-template-columns:1fr 320px;gap:40px;align-items:start;}
.primary-content{min-width:0;}

/* ===================== HERO ===================== */
.hero-card{
  position:relative;background:var(--primary);
  border-radius:10px;overflow:hidden;
  aspect-ratio:16/9;max-height:560px;margin-bottom:44px;
  box-shadow:0 14px 30px rgba(59,35,64,.20);
}
.hero-media{position:absolute;inset:0;z-index:1;}
.hero-media img{width:100%;height:100%;object-fit:cover;display:block;}
.hero-media-fallback{
  width:100%;height:100%;
  background:linear-gradient(135deg,var(--primary-tint),var(--primary));
  display:flex;align-items:center;justify-content:center;color:rgba(205,232,163,.55);
}
.hero-media-fallback i{font-size:4rem;}
.hero-scrim{
  position:absolute;inset:0;z-index:2;
  background:linear-gradient(180deg, rgba(44,25,48,.05) 0%, rgba(44,25,48,.45) 45%, rgba(30,16,33,.94) 100%);
}
.hero-copy{
  position:relative;z-index:3;height:100%;
  padding:40px 48px;color:var(--cream);
  display:flex;flex-direction:column;justify-content:flex-end;gap:12px;max-width:640px;
}
.hero-copy .eyebrow{color:var(--accent-light);}
.hero-copy h1{color:#fff;font-size:2.15rem;line-height:1.15;font-weight:600;text-shadow:0 2px 12px rgba(0,0,0,.35);}
.hero-copy p{color:#E8DCEB;font-size:.98rem;max-width:52ch;margin:0;}
.hero-meta{display:flex;gap:14px;font-size:.78rem;color:var(--accent-light);letter-spacing:.02em;}
.hero-cta{
  margin-top:6px;display:inline-flex;align-items:center;gap:8px;
  color:var(--accent-light);font-weight:700;font-size:.88rem;width:fit-content;
  border-bottom:2px solid var(--accent);padding-bottom:3px;
}
.hero-cta:hover{color:#fff;border-color:#fff;}

/* ===================== SECTION HEAD ===================== */
.section-head{
  display:flex;align-items:baseline;justify-content:space-between;
  margin-bottom:20px;border-bottom:2px solid var(--hairline);padding-bottom:10px;
}
.section-head h2{font-size:1.5rem;}
.section-head a.view-all{font-size:.8rem;font-weight:700;color:var(--secondary);letter-spacing:.02em;}
.section-head a.view-all:hover{color:var(--accent-dark);}

/* ===================== CATEGORY PAGE ===================== */
.category-hero{margin-bottom:24px;}
.category-hero h1{font-size:2.1rem;margin:6px 0 12px;line-height:1.15;}
.category-hero p{font-size:.98rem;color:var(--secondary);max-width:70ch;margin:0 0 16px;}
.category-meta{display:flex;gap:20px;font-size:.82rem;color:var(--secondary);font-weight:600;}
.category-meta i{color:var(--accent-dark);margin-right:6px;}

.era-filter{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:40px;}
.era-pill{
  padding:9px 18px;border-radius:30px;font-size:.85rem;font-weight:600;
  background:var(--card);border:1px solid var(--hairline);color:var(--primary);
}
.era-pill:hover{border-color:var(--accent);}
.era-pill.is-active{background:var(--primary);border-color:var(--primary);color:#fff;}

.sort-form{display:flex;align-items:center;gap:8px;font-size:.78rem;color:var(--secondary);align-self:center;}
.sort-form label{font-weight:600;}
.sort-form select{
  padding:7px 30px 7px 12px;border-radius:6px;border:1px solid var(--hairline);
  background:var(--card);color:var(--primary);font-family:var(--sans);font-size:.82rem;font-weight:600;
  cursor:pointer;-webkit-appearance:none;appearance:none;
  background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233B2340' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat;background-position:right 8px center;background-size:14px;
}
.sort-form select:focus{outline:none;border-color:var(--accent);}
.article-grid.category-grid{margin-bottom:8px;grid-template-columns:repeat(3,1fr);}

.pagination{
  display:flex;align-items:center;justify-content:center;gap:8px;
  margin-top:12px;padding-top:28px;border-top:1px solid var(--hairline);
}
.page-btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:9px 16px;border-radius:6px;font-size:.85rem;font-weight:600;
  color:var(--primary);border:1px solid var(--hairline);background:var(--card);
}
.page-btn:hover{border-color:var(--accent);}
.page-btn.is-disabled{opacity:.4;pointer-events:none;}
.page-num{
  width:36px;height:36px;display:flex;align-items:center;justify-content:center;
  border-radius:6px;font-size:.85rem;font-weight:600;color:var(--primary);
}
.page-num:hover{background:var(--card);}
/* Marine on the marigold, not white. White here is 1.62:1. */
.page-num.is-active{background:var(--accent);color:var(--primary);}

/* ===================== ERAS ===================== */
/* Two columns by default, so the cards stay readable at any count.
   Odd counts of five or more leave a single orphan card on the final row,
   which reads as a mistake rather than a choice - so at exactly 5, 7 or 9
   the whole set collapses onto one row instead.

   :nth-child(N):last-child matches only when the Nth child is also the
   last, i.e. when there are exactly N of them. :has() applies that count
   to the grid container. Browsers without :has() keep the two-column
   default, which is a reasonable place to land. */
.eras{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:14px;margin-bottom:46px;
}
.eras:has(> :nth-child(5):last-child){grid-template-columns:repeat(5, minmax(0,1fr));}
.eras:has(> :nth-child(7):last-child){grid-template-columns:repeat(7, minmax(0,1fr));}
.eras:has(> :nth-child(9):last-child){grid-template-columns:repeat(9, minmax(0,1fr));}
.era-card{
  background:var(--card);border:1px solid var(--hairline);border-radius:8px;
  padding:18px 14px;text-align:center;transition:transform .15s ease, box-shadow .15s ease;
}
.era-card:hover{transform:translateY(-3px);box-shadow:0 10px 20px rgba(59,35,64,.12);border-color:var(--accent);}
.era-card .era-icon{
  width:44px;height:44px;margin:0 auto 10px;border-radius:50%;
  background:var(--bg);border:1px solid var(--hairline);
  display:flex;align-items:center;justify-content:center;color:var(--accent-dark);
}
.era-card:hover .era-icon{background:var(--accent);border-color:var(--accent);color:var(--primary);}
.era-card .era-icon i{font-size:1.2rem;}
.era-card .era-range{display:block;font-size:.68rem;color:var(--secondary);letter-spacing:.06em;text-transform:uppercase;margin-bottom:3px;}
.era-card h3{font-size:.95rem;color:var(--primary);}

/* ===================== ARTICLE GRID ===================== */
.article-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:24px;margin-bottom:46px;}
.article-card{
  background:var(--card);border:1px solid var(--hairline);border-radius:8px;overflow:hidden;
  display:flex;flex-direction:column;transition:box-shadow .15s ease, transform .15s ease;
}
.article-card:hover{box-shadow:0 12px 22px rgba(59,35,64,.14);transform:translateY(-2px);}
.article-thumb{
  width:100%;aspect-ratio:16/9;
  background:linear-gradient(135deg,var(--primary-tint),var(--primary));
  display:flex;align-items:center;justify-content:center;color:rgba(205,232,163,.55);
  overflow:hidden;
}
.article-thumb i{font-size:1.8rem;}
.article-thumb img{width:100%;height:100%;object-fit:cover;display:block;}
.article-body{padding:18px 20px 20px;}
.article-tag{font-size:.68rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-dark);}
.article-card h3{font-size:1.08rem;margin:8px 0 8px;line-height:1.3;}
.article-card h3 a:hover{color:var(--accent-dark);}
.article-card p{font-size:.86rem;color:var(--secondary);margin:0 0 12px;}
.article-foot{display:flex;justify-content:space-between;font-size:.72rem;color:var(--secondary);border-top:1px solid var(--hairline);padding-top:10px;}

/* ===================== ARTICLE PAGE ===================== */
.back-to-category{
  display:inline-flex;align-items:center;gap:8px;
  font-size:.85rem;font-weight:700;color:var(--secondary);margin-bottom:24px;
}
.back-to-category:hover{color:var(--accent-dark);}

.article-hero-image{
  width:100%;aspect-ratio:16/9;border-radius:10px;overflow:hidden;margin-bottom:28px;
  background:linear-gradient(135deg,var(--primary-tint),var(--primary));
  display:flex;align-items:center;justify-content:center;color:rgba(205,232,163,.55);
}
.article-hero-image img{width:100%;height:100%;object-fit:cover;display:block;}
.article-hero-image i{font-size:3rem;}

.article-page-header{margin-bottom:8px;}
/* The hero image sits between the title and the byline, so its spacing is
   tighter than it was as a standalone block above the article. */
.article-page-header .article-hero-image{margin:18px 0 24px;}
.article-page-header h1{font-size:2rem;line-height:1.2;margin:10px 0 16px;}
.article-page-meta{
  display:flex;gap:18px;flex-wrap:wrap;font-size:.82rem;color:var(--secondary);
  border-bottom:2px solid var(--hairline);padding-bottom:22px;margin-bottom:28px;
}
.article-page-meta span{display:flex;align-items:center;gap:6px;}
.article-page-meta i{color:var(--accent-dark);}

.article-content{font-size:1.02rem;line-height:1.75;color:var(--text);}
.article-content p{margin:0 0 20px;}
.article-content h2{font-family:var(--serif);color:var(--primary);font-size:1.5rem;margin:36px 0 16px;}
.article-content h3{font-family:var(--serif);color:var(--primary);font-size:1.25rem;margin:28px 0 12px;}
.article-content a{color:var(--accent-dark);text-decoration:underline;text-decoration-color:var(--accent);text-underline-offset:3px;}
.article-content a:hover{color:var(--primary);text-decoration-color:var(--primary);}
.article-content blockquote{
  border-left:4px solid var(--accent);margin:24px 0;padding:2px 0 2px 20px;
  font-family:var(--serif);font-style:italic;font-size:1.15rem;color:var(--primary);
}
.article-content img{width:100%;border-radius:8px;margin:8px 0 24px;}
.article-content ul,.article-content ol{margin:0 0 20px;padding-left:24px;}
.article-content ul{list-style:disc;}
.article-content ol{list-style:decimal;}
.article-content li{margin-bottom:8px;}
.article-content strong{font-weight:700;color:var(--primary);}

.related-articles{margin-top:48px;padding-top:8px;}

/* ===================== CHIPS ===================== */
.places-section{margin-bottom:46px;}
.place-chips{display:flex;flex-wrap:wrap;gap:10px;}
.place-chips a{
  display:inline-flex;align-items:center;gap:8px;
  background:var(--card);border:1px solid var(--hairline);
  padding:9px 16px;border-radius:30px;font-size:.85rem;font-weight:600;color:var(--primary);
}
.place-chips a:hover{background:var(--primary);color:#fff;border-color:var(--primary);}
.place-chips a .dot{width:6px;height:6px;border-radius:50%;background:var(--accent);}
.place-chips a:hover .dot{background:var(--accent-light);}

/* ===================== PROFILE CARDS ===================== */
.people-section{margin-bottom:10px;}
.people-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:20px;}
.person-card{
  background:var(--card);border:1px solid var(--hairline);border-radius:8px;
  padding:20px;display:flex;gap:14px;align-items:flex-start;
}
.person-avatar{
  flex:0 0 auto;width:52px;height:52px;border-radius:50%;
  background:var(--accent-light);color:var(--primary);
  display:flex;align-items:center;justify-content:center;
  font-family:var(--serif);font-weight:600;border:2px solid var(--accent);
}
.person-card h3{font-size:.98rem;margin-bottom:3px;}
.person-card .role{font-size:.72rem;color:var(--secondary);text-transform:uppercase;letter-spacing:.05em;margin-bottom:6px;display:block;}
.person-card p{font-size:.82rem;color:var(--secondary);margin:0;}

/* ===================== SIDEBAR ===================== */
aside.sidebar{display:flex;flex-direction:column;gap:34px;}
.widget h2{font-size:1.02rem;margin-bottom:14px;padding-bottom:10px;border-bottom:2px solid var(--hairline);}

.ad-slot{
  width:100%;max-width:300px;height:250px;margin:0 auto 14px;
  background:repeating-linear-gradient(45deg,#F0EAF2,#F0EAF2 10px,#E6DCE9 10px,#E6DCE9 20px);
  border:1px dashed var(--secondary);border-radius:6px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:var(--secondary);
}
.ad-slot span.label{font-size:.7rem;letter-spacing:.08em;text-transform:uppercase;font-weight:700;}
.ad-slot span.dims{font-size:.72rem;}
.ad-slot-live{background:none;border:none;padding:0;overflow:hidden;}
.ad-slot-live img{width:100%;height:100%;object-fit:cover;display:block;}

.side-list li{border-bottom:1px solid var(--hairline);padding:11px 0;}
.side-list li:first-child{padding-top:0;}
.side-list li:last-child{border-bottom:none;padding-bottom:0;}
.side-list a{font-size:.87rem;font-weight:600;color:var(--primary);line-height:1.35;}
.side-list a:hover{color:var(--accent-dark);}
.side-list .meta{display:block;font-size:.72rem;color:var(--secondary);margin-top:3px;font-weight:400;}

.popular-list li{display:flex;gap:12px;align-items:flex-start;}
.rank{
  flex:0 0 auto;width:24px;height:24px;border-radius:50%;
  background:var(--primary);color:var(--accent-light);
  font-family:var(--serif);font-size:.78rem;font-weight:600;
  display:flex;align-items:center;justify-content:center;
}

.cat-list li{padding:0;border:none;}
.cat-list a{
  display:flex;justify-content:space-between;align-items:center;
  padding:10px 0;border-bottom:1px solid var(--hairline);
  font-size:.87rem;font-weight:600;color:var(--primary);
}
.cat-list li:last-child a{border-bottom:none;}
.cat-list .count{
  font-size:.72rem;font-weight:700;color:var(--secondary);
  background:var(--bg);border:1px solid var(--hairline);border-radius:20px;padding:2px 9px;
}
.cat-list a:hover .count{background:var(--accent);color:var(--primary);border-color:var(--accent);}

/* ===================== NEWSLETTER BAND ===================== */
.newsletter-band{
  background:var(--primary);
  background-image:radial-gradient(circle at 15% 20%, rgba(140,191,63,.20), transparent 55%);
  color:#fff;margin-top:56px;
}
.newsletter-inner{
  max-width:1240px;margin:0 auto;padding:52px 24px;
  display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:40px;
}
.newsletter-copy{max-width:460px;flex:1 1 360px;}
.newsletter-copy .eyebrow{color:var(--accent-light);}
.newsletter-copy h2{color:#fff;font-size:1.65rem;margin:6px 0 8px;}
.newsletter-copy p{color:var(--muted-on-dark);font-size:.92rem;margin:0;}
.newsletter-form{display:flex;flex-direction:column;gap:10px;flex:1 1 500px;max-width:580px;}
.newsletter-fields{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;}
.newsletter-form input{
  flex:1 1 200px;min-width:0;padding:13px 16px;border-radius:4px;
  border:1px solid rgba(255,255,255,.25);
  background:rgba(255,255,255,.08);color:#fff;font-family:var(--sans);font-size:.88rem;
}
.newsletter-form input::placeholder{color:var(--muted-on-dark);}
.newsletter-form input:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(140,191,63,.28);}
.newsletter-form button{
  flex:0 0 auto;padding:13px 24px;border-radius:4px;border:none;
  background:var(--accent);color:var(--primary);
  font-weight:800;font-size:.86rem;letter-spacing:.02em;cursor:pointer;white-space:nowrap;
}
.newsletter-form button:hover{background:var(--accent-light);}
.newsletter-form small{display:block;color:var(--muted-on-dark);font-size:.72rem;}
.newsletter-errors{color:#FFD1D1;font-size:.8rem;margin:0;}

/* ===================== FOOTER ===================== */
footer.site-footer{background:var(--footer);color:var(--muted-on-dark);border-top:4px solid var(--accent);}
/* Brand block, then one equal column per footer category.
   The original template sized this for four categories plus a long list
   of areas, which is why the last column was 1.75fr. With five categories
   of six sub-categories each that made the final column sprawl, and put
   six children into a five-column grid so the last one wrapped.
   If you change footer_max_columns, change the repeat() count to match. */
.footer-main{
  max-width:1240px;margin:0 auto;padding:52px 24px 36px;
  display:grid;
  grid-template-columns:1.5fr repeat(5, minmax(0,1fr));
  gap:28px 20px;
}
.footer-brand img{height:46px;margin-bottom:14px;border-radius:3px;}
.footer-logo-mark{
  display:block;width:230px;aspect-ratio:1653/213;margin-bottom:14px;
  background-color:var(--accent);
  -webkit-mask-image:var(--logo-mask);mask-image:var(--logo-mask);
  -webkit-mask-size:contain;mask-size:contain;
  -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;
  -webkit-mask-position:left center;mask-position:left center;
  -webkit-mask-mode:alpha;mask-mode:alpha;
}
.footer-brand p{font-size:.83rem;line-height:1.65;color:var(--muted-on-dark);margin:0 0 16px;}
footer h3{font-family:var(--sans);font-size:.78rem;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-light);margin-bottom:16px;}
footer .footer-links li{margin-bottom:10px;}
footer .footer-links a{font-size:.85rem;color:var(--muted-on-dark);}
footer .footer-links a:hover{color:#fff;text-decoration:underline;}
/* footer.php still tags the final column .footer-areas, which in the
   original carried a three-column list of ~21 area links. Six links do
   not need three sub-columns, so it matches every other column. */
.footer-areas .footer-links{columns:1;}
.footer-areas .footer-links li{margin-bottom:10px;}
.footer-areas .footer-links a{font-size:.85rem;}

/* Section headings carry a green rule, which is where the accent earns
   its place: fresh, food-related, and only a few pixels of it. */
.section-head{border-bottom-color:var(--accent);}

.footer-bottom{border-top:1px solid rgba(255,255,255,.12);}
.footer-bottom .wrap{
  max-width:1240px;margin:0 auto;padding:18px 24px;
  display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px;
  font-size:.76rem;color:var(--muted-on-dark);
}
.footer-bottom .legal-links{display:flex;gap:18px;flex-wrap:wrap;}
.footer-bottom a:hover{color:#fff;text-decoration:underline;}

/* ===================== BUTTONS ===================== */
.btn{
  display:inline-flex;align-items:center;gap:8px;
  padding:11px 22px;border-radius:6px;border:1px solid transparent;
  font-family:var(--sans);font-weight:700;font-size:.86rem;cursor:pointer;
}
.btn-primary{background:var(--primary);color:#fff;}
.btn-primary:hover{background:var(--primary-tint);}
.btn-accent{background:var(--accent);color:var(--primary);}
.btn-accent:hover{background:var(--accent-light);}
.btn-secondary{background:var(--card);color:var(--primary);border-color:var(--hairline-strong);}
.btn-secondary:hover{border-color:var(--accent);}
.btn-danger{background:#B91C1C;color:#fff;}
.btn-sm{padding:7px 14px;font-size:.8rem;border-radius:5px;}
.btn-sm:hover{border-color:var(--accent);color:var(--accent-dark);}

/* ===================== FORMS & UTILITY PAGES ===================== */
.form-grid{display:grid;gap:18px;max-width:640px;}
.form-row{display:grid;grid-template-columns:1fr 1fr;gap:18px;}
.form-group{display:flex;flex-direction:column;gap:6px;}
.form-group label{font-size:.82rem;font-weight:700;color:var(--primary);}
.form-group input,.form-group textarea,.form-group select{
  padding:11px 14px;border-radius:6px;border:1px solid var(--hairline-strong);
  background:var(--card);font-family:var(--sans);font-size:.92rem;color:var(--text);
}
.form-group input:focus,.form-group textarea:focus,.form-group select:focus{
  outline:none;border-color:var(--accent);box-shadow:0 0 0 3px rgba(140,191,63,.25);
}
.form-group .hint{font-size:.76rem;color:var(--secondary);}
.form-actions{display:flex;gap:12px;align-items:center;margin-top:6px;}
.captcha-row{display:flex;align-items:center;gap:14px;}
.contact-errors,.alert-error{
  background:#FEE2E2;border:1px solid #F5B5B5;color:#8A1616;
  padding:12px 16px;border-radius:6px;font-size:.86rem;margin-bottom:20px;
}
.alert-success{
  background:#DCF7E7;border:1px solid #A6DFC0;color:#0B5B2E;
  padding:12px 16px;border-radius:6px;font-size:.86rem;margin-bottom:20px;
}
.confirmation-box{
  background:var(--card);border:1px solid var(--hairline);border-left:4px solid var(--accent);
  border-radius:0 8px 8px 0;padding:24px 26px;margin-bottom:28px;
}
.confirmation-box h1{font-size:1.6rem;margin-bottom:10px;}
.confirmation-box p{color:var(--secondary);margin:0 0 12px;font-size:.94rem;}
.unsub-btn{margin-top:8px;}

.sitemap-section{margin-bottom:44px;}
.sitemap-jump{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:36px;}
.sitemap-jump a{
  padding:8px 16px;border-radius:30px;font-size:.82rem;font-weight:600;
  background:var(--card);border:1px solid var(--hairline);color:var(--primary);
}
.sitemap-jump a:hover{border-color:var(--accent);background:var(--accent);color:var(--primary);}
.sitemap-group{margin-bottom:26px;}
.sitemap-group h3{font-size:1rem;margin-bottom:10px;}
.sitemap-links{columns:2;column-gap:32px;}
.sitemap-links li{break-inside:avoid;margin-bottom:8px;}
.sitemap-links a{font-size:.88rem;color:var(--primary);}
.sitemap-links a:hover{color:var(--accent-dark);text-decoration:underline;}
.sitemap-pages{display:flex;flex-wrap:wrap;gap:18px;}

/* ===================== RESPONSIVE ===================== */
@media (max-width:1080px){
  .layout{grid-template-columns:1fr;}
  aside.sidebar{flex-direction:row;flex-wrap:wrap;}
  aside.sidebar .widget{flex:1 1 260px;}
  .footer-main{grid-template-columns:repeat(3, minmax(0,1fr));}
  .article-grid.category-grid{grid-template-columns:repeat(2,1fr);}
  .eras,
  .eras:has(> :nth-child(5):last-child),
  .eras:has(> :nth-child(7):last-child),
  .eras:has(> :nth-child(9):last-child){grid-template-columns:repeat(3, minmax(0,1fr));}
}
@media (max-width:900px){
  .logo-link img{height:44px;}
  .nav-list{display:none;}
  .nav-toggle-mobile{display:flex;}
  .header-inner{justify-content:space-between;gap:14px;}
  .header-search{min-width:0;flex:1 1 auto;}
  .hero-card{aspect-ratio:4/3;max-height:none;}
  .hero-copy{padding:28px 24px;}
  .hero-copy h1{font-size:1.6rem;}
  .article-grid,.article-grid.category-grid{grid-template-columns:1fr;}
  .people-grid{grid-template-columns:1fr;}
  .footer-main{grid-template-columns:repeat(2, minmax(0,1fr));}
  .form-row{grid-template-columns:1fr;}
  .sitemap-links{columns:1;}
}
@media (max-width:560px){
  .header-search{display:none;}
  .eras,
  .eras:has(> :nth-child(5):last-child),
  .eras:has(> :nth-child(7):last-child),
  .eras:has(> :nth-child(9):last-child){grid-template-columns:repeat(2, minmax(0,1fr));}
  .footer-main{grid-template-columns:1fr;}
  .newsletter-fields{flex-wrap:wrap;}
  .newsletter-form button{width:100%;justify-content:center;}
  .article-page-header h1{font-size:1.55rem;}
}
@media (prefers-reduced-motion:reduce){
  *{transition:none !important;scroll-behavior:auto !important;}
  .article-card:hover,.era-card:hover{transform:none;}
}

/* ---- newstyle.css ---- */
/* ==========================================================================
   File: /assets/css/newstyle.css

   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 and in style.css's own colours.

   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 - "72,78,88" rather than "#484E58".
   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
     Prescription Medicines colours.

     Supplied colours:
       #DC0B25  Primary Red      -> --accent        buttons, rules, active
       #484E58  Dark Slate Gray  -> --primary       header, footer, headings
       #FBFCFC  White            -> --card          card and panel fills
       #D7D2CD  Light Gray       -> --muted-on-dark copy on dark surfaces
       #371010  Dark Text        -> --text          body copy

     Derived (lightness shifts of the five, nothing new introduced):
       --primary-tint #5E636C   --secondary #62676F   --footer #34383F
       --accent-light #F1ACB5   --bg #F3F3F2
     Every pair measured against WCAG 2.1 AA. */

  --primary:#484E58;
  --primary-tint:#5E636C;
  --secondary:#62676F;

  --accent:#DC0B25;
  --accent-dark:#DC0B25;        /* red as TEXT on light - 4.96:1 on --card */
  --accent-light:#F1ACB5;       /* red as TEXT on slate - 4.51:1          */

  --text:#371010;
  --bg:#F3F3F2;
  --card:#FBFCFC;
  --cream:#F3F3F2;
  --footer:#34383F;
  --muted-on-dark:#D7D2CD;

  --hairline:rgba(72,78,88,.14);
  --hairline-strong:rgba(72,78,88,.28);

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

  --home-primary-rgb:72,78,88;          /* keep in step with --primary      #484E58 */
  --home-accent-rgb:220,11,37;          /* keep in step with --accent       #DC0B25 */
  --home-accent-light-rgb:241,172,181;  /* keep in step with --accent-light #F1ACB5 */

  /* Deeper than --footer, and used only over photographs - a scrim mixed
     from the page palette turns muddy against a real image. */
  --home-scrim-rgb:55,16,16;

  --home-light-rgb:251,252,252;         /* --card / White                   #FBFCFC */

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

  --home-glow-hero:rgba(var(--home-accent-rgb),.10);
  --home-glow-network:rgba(var(--home-accent-rgb),.14);
  --home-band-top:#FBFCFC;              /* top of the hero gradient, fades to --bg */
  --home-focus-ring:rgba(var(--home-accent-rgb),.22);

  /* -- 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),.30);
  --home-shadow-accent-hover:rgba(var(--home-accent-rgb),.38);

  /* -- 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:72,78,88;           /* keep in step with --primary  #484E58 */
  --cat-accent-rgb:220,11,37;           /* keep in step with --accent   #DC0B25 */
  --cat-light-rgb:251,252,252;          /* keep in step with --card     #FBFCFC */

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

  --cat-hero-wash:rgba(var(--cat-accent-rgb),.05);
  --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),.06);

  /* -- 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),.26);

  /* -- 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),.32);

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


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

  --art-primary-rgb:72,78,88;           /* keep in step with --primary  #484E58 */
  --art-accent-rgb:220,11,37;           /* keep in step with --accent   #DC0B25 */
  --art-light-rgb:251,252,252;          /* keep in step with --card     #FBFCFC */

  /* -- 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 a strong fill behind medical
     warnings reads as alarmist rather than clear. */
  --art-callout-bg:rgba(var(--art-accent-rgb),.05);
  --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),.32);

}


/* ==========================================================================
   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);
  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(--card);
  box-shadow:0 4px 12px var(--cat-shadow-pill);
}

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

.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(--card);
}

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

.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);
  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;}
}

/* ---- platform.css ---- */
/* =====================================================================
   platform.css - the platform's own layer, appended to site.css after
   style.css and newstyle.css.

   WHY THIS EXISTS SEPARATELY

   style.css and newstyle.css are the customer's files and are shipped
   byte-faithful; a build check asserts it. But the platform renders a few
   things those files were never written for - a search form outside the
   dark header, for one - and the fix has to live somewhere.

   Everything here is an addition or a correction to a rule that assumes
   a context the platform can now put an element in. Nothing here
   restyles the design.
   ===================================================================== */

/* ---------------------------------------------------------------------
   A search form on a light page.

   .header-search is written for the dark header band: white text on a
   10%-white background with a 22%-white border. Reused inside the page,
   as the search results page does, the border and background vanish and
   the text you type is white on white - invisible.

   .header-search--page restates only the parts that assume a dark
   background. The shape, the radius and the button are inherited.
   --------------------------------------------------------------------- */
.header-search--page{
  background:var(--card);
  border:1px solid var(--hairline-strong);
}
.header-search--page input{
  color:var(--text);
}
.header-search--page input::placeholder{
  color:var(--secondary);
  opacity:1;                 /* Firefox dims placeholders by default */
}
.header-search--page:focus-within{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(var(--home-accent-rgb, 220,11,37), .14);
}

/* The button already uses --accent on --primary, which reads correctly
   on either background, so only the hover state needs a light-page
   equivalent: --accent-light is designed for dark surfaces and washes
   out to nearly nothing here. */
.header-search--page button:hover{
  background:var(--accent-dark);
  color:var(--card);
}

/* ---------------------------------------------------------------------
   The active navigation link.

   Two things were wrong, and measuring the palette showed both.

   The underline marking the active item uses --accent, which is chosen
   to work as a BACKGROUND, not against one. On the nav bar it measures
   1.64:1 - not dim, invisible. The marker that says which page you are
   on could not be seen at all.

   And the active text uses --accent-light at 4.51:1 while its inactive
   neighbours are white at 8.38:1. The current item was the faintest
   thing in the bar, which is backwards.

   --accent-light is the palette's own "readable on primary" colour, so
   the underline uses that. The text goes to full white and gains weight:
   the active item should read as MORE prominent than its neighbours, not
   less, and weight carries that without relying on colour alone.
   --------------------------------------------------------------------- */
.nav-list > li > a.is-active,
.nav-list > li > button.nav-toggle.is-active{
  color:#fff;
  font-weight:800;
}
.nav-list > li > a.is-active::after,
.nav-list > li > button.nav-toggle.is-active::after{
  background:var(--accent-light);
  height:3px;
  transform:scaleX(1);
}

/* The hover underline has the same problem for the same reason. */
.nav-list > li > a:hover::after,
.nav-list > li:hover > button.nav-toggle::after{
  background:var(--accent-light);
}

/* The dropdown items sit on the primary colour too, so an active one
   there needs the same treatment rather than the accent it inherits. */
.dropdown a.is-active{
  color:#fff;
  font-weight:700;
}

/* ---------------------------------------------------------------------
   Footer column headings.

   footer h3 uses --accent-light on the footer background. That passes
   contrast, but it is DIMMER than the links underneath it: on the
   default palette the heading measures 6.34:1 while its own links, in
   --muted-on-dark, measure 7.84:1. The label organising the column ends
   up quieter than the things it organises, which is why it reads as
   lost rather than as a heading.

   White is the brightest available on any palette, so the heading is
   unambiguously the strongest thing in its column regardless of the
   colours chosen. Uppercase, letter-spacing and weight already mark it
   as a heading, so colour is not carrying that job alone.
   --------------------------------------------------------------------- */
footer h3{
  color:#fff;
  font-weight:800;
}

/* The footer logo mark is a mask filled with a flat colour, and the
   stylesheet fills it with --accent - a colour chosen to work AS a
   background rather than on one. On a dark footer with a dark accent it
   measures 2.31:1: present, but barely visible.

   --on-footer is derived per site from the footer colour itself, so it
   is white on a dark band and the body colour on a pale one. The mask
   URL comes from the site's own logo, set inline on the element; the
   stylesheet hardcodes one site's filename, which 404s everywhere else
   and left the element rendering nothing. */
.footer-logo-mark{
  background-color:var(--on-footer, #fff);
}

/* Shown instead of the mark when a site has no logo yet. An empty box
   where a logo should be reads as a fault; the site's name does not. */
.footer-logo-text{
  display:block;margin-bottom:14px;
  font-family:var(--display, inherit);
  font-size:1.15rem;font-weight:800;letter-spacing:.01em;
  color:var(--on-footer, #fff);
}

/* ---------------------------------------------------------------------
   Text on an accent background.

   The stylesheet puts --primary text on --accent for the subscribe
   button and the active pagination number. Whether that is readable
   depends on the palette: with the default dark red accent it measures
   1.64:1 and cannot be read, while with a light amber accent it is
   5.99:1 and white would be the unreadable one.

   --on-accent is derived per site in Theme::toCssVars, choosing
   whichever of white or the primary colour contrasts better with the
   accent actually in use. The fallback here is white, which is correct
   for the accent the stylesheet itself ships.
   --------------------------------------------------------------------- */
:root{ --on-accent:#fff; }

/* EVERY rule in the stylesheet that puts --primary on an --accent fill.
   There are ten, and they are all the same bug: fixing them one at a
   time as each was spotted would have left the rest unreadable and no
   way to know which. Searched for rather than collected by eye. */
.header-search button,
.icon-btn:hover,
.page-num.is-active,
.era-card:hover .era-icon,
.cat-list a:hover .count,
.newsletter-form button,
.btn-accent,
.sitemap-jump a:hover,
.topic-card:hover .topic-icon,
.network-item:hover .network-icon{
  color:var(--on-accent);
}

/* Hover states that swap the fill to --accent-light have the same
   problem in reverse: that colour is meant to be READ on a dark surface,
   so as a fill it strands text chosen for the darker accent on a pale
   background. Darkening instead keeps the same text readable throughout. */
.newsletter-form button:hover,
.header-search button:hover,
.btn-accent:hover{
  background:var(--accent-dark);
  color:var(--on-accent);
}

/* ---------------------------------------------------------------------
   The ranked numbers in the sidebar.

   .rank is --accent-light text on a --primary fill: 4.51:1 on the
   default palette. That clears the 4.5 bar by a hundredth, which is a
   pass on paper and a failure in practice - it is 0.78rem type inside a
   24px circle, and a pale tint on a mid tone at that size reads as one
   colour rather than two.

   --on-primary is derived per site the same way as --on-accent, so it is
   white on a dark primary and dark text on a pale one.
   --------------------------------------------------------------------- */
:root{ --on-primary:#fff; }

.rank{
  color:var(--on-primary);
  font-weight:700;
}

/* The same sweep turned up two more that scrape the bar and fail in
   practice. Both are small marks where a tint sits on a tint. */

/* An icon in a pale circle, drawn in --accent-dark: 4.59:1 on the
   default palette, where the accent and its dark variant are the same
   colour. The text colour is the site's darkest and always contrasts
   with the pale card background. */
.era-card .era-icon{
  color:var(--text);
}

/* Initials on an --accent-light disc in --primary: 4.51:1. The disc is
   pale on every palette, so the body colour reads on it. */
.person-avatar{
  color:var(--text);
}

/* ---------------------------------------------------------------------
   Card thumbnails are links.

   More readers click the picture than the headline, so a dead image
   beside a live title reads as a broken card. The element became an <a>,
   which needs the block behaviour a <div> had by default.
   --------------------------------------------------------------------- */
a.article-thumb{
  /* display is NOT set here on purpose.
     .article-thumb is display:flex and centres the icon shown when an
     article has no image. Overriding it to block - as this rule first
     did - left that icon jammed in the top-left corner of every card
     without a picture. The element became an <a> rather than gaining a
     wrapper, so it keeps its own aspect-ratio and needs nothing else. */
  text-decoration:none;
  color:inherit;
}
a.article-thumb img{transition:transform .35s ease;}
.article-card:hover a.article-thumb img{transform:scale(1.03);}

/* ---------------------------------------------------------------------
   Home page spacing.

   The hero, the topic tiles and the chips ran into each other with no
   breathing room between the bands, so the page read as one dense block
   rather than three sections.
   --------------------------------------------------------------------- */
.home-hero-band{padding-bottom:8px;}
.home-topics{padding:38px 0 10px;}
.topic-grid{gap:18px;}
.place-chips{gap:10px;margin-top:4px;}
.home-block{margin-bottom:44px;}
.home-block .section-head{margin-bottom:18px;}

/* The chips sat hard against the tiles above them. */
.places-section .place-chips{margin-top:14px;}

@media (max-width:860px){
  .home-topics{padding:26px 0 6px;}
  .home-block{margin-bottom:32px;}
}

/* ---------------------------------------------------------------------
   Share links at the end of an article.

   Plain links rather than platform widgets: an embedded share button
   loads third-party script on every article, tracks the reader whether
   or not they use it, and is usually the slowest thing on the page.
   --------------------------------------------------------------------- */
.article-share{margin:34px 0 10px;padding-top:22px;border-top:1px solid var(--hairline);}
.article-share h2{
  font-family:var(--sans);font-size:.78rem;letter-spacing:.08em;
  text-transform:uppercase;color:var(--secondary);margin:0 0 14px;
}
.share-links{display:flex;flex-wrap:wrap;gap:10px;list-style:none;margin:0;padding:0;}
.share-link{
  display:inline-flex;align-items:center;gap:8px;
  padding:9px 16px;border-radius:22px;
  border:1px solid var(--hairline-strong);background:var(--card);
  color:var(--text);text-decoration:none;
  font-family:var(--sans);font-size:.82rem;font-weight:600;
  transition:background .16s ease,border-color .16s ease,color .16s ease;
}
.share-link i{font-size:.9rem;}
.share-link:hover{background:var(--primary);border-color:var(--primary);color:var(--on-primary,#fff);}
.share-link:focus-visible{outline:2px solid var(--accent);outline-offset:2px;}

@media (max-width:520px){
  /* The labels are the first thing to go: the icons are recognisable
     and five wrapped pills read worse than five compact ones. */
  .share-link span{display:none;}
  .share-link{padding:10px 14px;}
}

/* ---------------------------------------------------------------------
   The HTML sitemap.

   440 article links in a flat run of headings is a wall of blue text.
   Structure carries the page instead: a jump strip that shows how big
   each section is, then one card per category with its groupings in
   columns, so the eye lands on a heading rather than a link.
   --------------------------------------------------------------------- */
.sitemap-jump{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:10px;margin:0 0 34px;
}
.sitemap-jump-link{
  display:flex;align-items:baseline;justify-content:space-between;gap:10px;
  padding:12px 16px;border-radius:8px;
  border:1px solid var(--hairline-strong);background:var(--card);
  color:var(--text);text-decoration:none;
  font-family:var(--sans);font-weight:700;font-size:.88rem;
  transition:background .16s ease,border-color .16s ease,color .16s ease;
}
.sitemap-jump-link small{font-weight:600;font-size:.76rem;color:var(--secondary);}
.sitemap-jump-link:hover{background:var(--primary);border-color:var(--primary);color:var(--on-primary,#fff);}
.sitemap-jump-link:hover small{color:inherit;opacity:.75;}

.sitemap-section{
  margin:0 0 26px;padding:22px 24px;
  border:1px solid var(--hairline);border-radius:10px;background:var(--card);
  scroll-margin-top:90px;
}
.sitemap-section-head{
  display:flex;align-items:baseline;justify-content:space-between;gap:16px;
  flex-wrap:wrap;margin:0 0 18px;padding-bottom:12px;
  border-bottom:2px solid var(--accent);
}
.sitemap-section-head h2{font-family:var(--serif);font-size:1.35rem;margin:0;}
.sitemap-section-head h2 a{color:var(--primary);text-decoration:none;}
.sitemap-section-head h2 a:hover{text-decoration:underline;}
.sitemap-section-head .count{font-size:.8rem;font-weight:600;color:var(--secondary);}

/* Groupings side by side. auto-fit rather than a fixed count, so a
   category with two groups does not leave three empty columns. */
.sitemap-groups{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
  gap:22px 28px;
}
.sitemap-group h3{
  display:flex;align-items:baseline;gap:8px;
  font-family:var(--sans);font-size:.8rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--secondary);margin:0 0 10px;padding-bottom:8px;
  border-bottom:1px solid var(--hairline);
}
.sitemap-group h3 a{color:inherit;text-decoration:none;}
.sitemap-group h3 a:hover{color:var(--primary);text-decoration:underline;}
.sitemap-group h3 small{
  margin-left:auto;font-size:.72rem;font-weight:600;letter-spacing:0;
  color:var(--secondary);opacity:.8;
}
.sitemap-links{list-style:none;margin:0;padding:0;display:block;}
.sitemap-links li{margin-bottom:7px;line-height:1.45;}
.sitemap-links a{font-size:.88rem;color:var(--text);text-decoration:none;}
.sitemap-links a:hover{color:var(--primary);text-decoration:underline;}

.sitemap-empty{color:var(--secondary);font-size:.9rem;margin:0;}

.sitemap-pages ul{
  list-style:none;margin:0;padding:0;
  display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:9px 24px;
}
.sitemap-pages a{font-size:.9rem;color:var(--text);text-decoration:none;}
.sitemap-pages a:hover{color:var(--primary);text-decoration:underline;}

@media (max-width:640px){
  .sitemap-section{padding:18px 16px;}
  .sitemap-groups{grid-template-columns:1fr;gap:18px;}
}

/* ---------------------------------------------------------------------
   The hero article is clickable, not just its button.

   The headline and the image were plain text and a plain image, with
   only the small button beneath them linking anywhere - so the two
   largest, most prominent things on the home page did nothing when
   clicked, which is the first thing most readers try.
   --------------------------------------------------------------------- */
.home-hero-copy h1 a{
  color:inherit;
  text-decoration:none;
}
.home-hero-copy h1 a:hover{
  text-decoration:underline;
  text-decoration-color:var(--accent);
  text-underline-offset:4px;
}
.home-hero-copy h1 a:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}

.home-hero-link{
  /* MUST fill the figure.
     .home-hero-figure sets aspect-ratio:4/3 and its img is height:100%
     - of its PARENT. Wrapping the image in this link put an auto-height
     box between the two, so the 100% resolved against nothing, the
     image collapsed to its natural height, and the figure's dark
     background showed through underneath it. */
  display:block;
  width:100%;
  height:100%;
  overflow:hidden;
  border-radius:inherit;
}
.home-hero-link img{transition:transform .4s ease;}
.home-hero-figure:hover .home-hero-link img{transform:scale(1.02);}

/* ---------------------------------------------------------------------
   The home page's own sidebar extras.

   These sit BELOW the shared sidebar, after the eBook that closes it:
   Start Here, then the newsletter box, then a fourth advert. Rendered
   above it instead, "Start Here" landed over the article lists and
   pushed the paid slots down the page.
   --------------------------------------------------------------------- */
.home-side-extra{margin-top:26px;}

/* The newsletter box in the column is narrow, so its fields stack rather
   than sitting in a row as they do in the footer band. */
.home-side-nl form{display:flex;flex-direction:column;gap:10px;margin-top:12px;}
.home-side-nl input{
  width:100%;padding:11px 14px;
  border:1px solid var(--hairline-strong);border-radius:8px;
  background:var(--card);color:var(--text);font-size:.88rem;
}
.home-side-nl input::placeholder{color:var(--secondary);opacity:1;}
.home-side-nl input:focus-visible{outline:2px solid var(--accent);outline-offset:1px;}
.home-side-nl .btn{width:100%;justify-content:center;}

/* ---------------------------------------------------------------------
   Guide template: three cards across.

   The home page shows three; the category page showed two, which made
   the two pages feel like different sites. Scoped to .guide-cat-grid so
   the Classic template is untouched.

   Placed after the base grid rules because .article-grid and
   .category-grid are each set in more than one stylesheet - specificity
   alone would not settle it.
   --------------------------------------------------------------------- */
.article-grid.category-grid.guide-cat-grid,
.article-grid.guide-grid.guide-home-grid{
  grid-template-columns:repeat(3, minmax(0, 1fr));
}

/* Two across once the column is too narrow for three: three 200px cards
   beside a sidebar is a row of thumbnails, not a listing. */
@media (max-width:1180px){
  .article-grid.category-grid.guide-cat-grid,
  .article-grid.guide-grid.guide-home-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }
}
@media (max-width:720px){
  .article-grid.category-grid.guide-cat-grid,
  .article-grid.guide-grid.guide-home-grid{grid-template-columns:1fr;}
}


