/* =========================================================
   APP.CSS CONTENTS STRUCTURE
   ---------------------------------------------------------
   0) TOKENS
   1) BASE + TYPOGRAPHY
   2) LAYOUT WRAPPERS
   3) COMPONENTS
      3a) Header + Navigation
      3b) Footer
      3c) Homepage (articles.php)
      3d) Article page (article.php)
      3e) Category pages
      3f) Utilities + helpers
   4) MEDIA
   5) RESPONSIVE
   ========================================================= */

   

/* ==========================
   BASE STYLES
   ========================== */  

/* ===== IMPORTS ===== */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,100..900;1,9..144,100..900&display=swap'); /* Fraunces for headings */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap'); /* Manrope for body text */
@import url('https://fonts.googleapis.com/css2?family=Prata&display=swap'); /* Prata for logo text */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap'); /* JetBrains Mono for monospace/code */

/* ===== TOKENS ===== */
:root {
  /* Fonts */
  --font-body: "Manrope", system-ui, -apple-system, sans-serif;
  --font-heading: "Fraunces", serif;
  --font-logo: "Prata", serif;
  --font-monospace: "JetBrains Mono", monospace;
  --font-quote: "Playfair Display", serif;

  /* Colours */
  --color-bg: #FFF3E0;
  --paper: #FFF3E0;
  --color-text: #222222;
  --color-text-light: #666666;
  --color-accent: #0076ff;
  --color-ink: #8BAACE; /* #3B6EA8; */
  --color-ink-dark: #2E5E93;
  --color-ink-soft: color-mix(in srgb, var(--color-ink) 14%, var(--paper));

  --code-bg: #F3E7D3;          /* inline code background */
  --code-bg-strong: #EFE1C8;   /* block code background */
  --code-border: rgba(0, 0, 0, 0.08);
  --code-text: currentColor;

  /* Root baseline */
  --baseline-size: 62.5%; /* 1rem = 10px (assuming browser default 16px) */

  /* Layout rails */
  --page-max: 128rem;
  --gutter: clamp(1.6rem, 3vw, 4rem);
  --gutter-mobile: 1.6rem;

  /* Readable measures */
  --prose-max: 65ch;
  --prose-wide: 75ch;

  /* Spacing scale */
  --space-1: 0.4rem;
  --space-2: 0.8rem;
  --space-3: 1.2rem;
  --space-4: 1.6rem;
  --space-5: 2.4rem;
  --space-6: 3.2rem;
  --space-7: 4.8rem;
  --space-8: 6.4rem;

  /* Radii */
  --radius-s: 0.8rem;
  --radius-m: 1.2rem;
  --radius-l: 2rem;

  /* Type sizes (fluid) ... slightly smaller, more longform-friendly */
  --fs-body: clamp(1.45rem, 1.35rem + 0.25vw, 1.65rem);     /* 14.5px ... 16.5px */
  /* --fs-small: clamp(1.25rem, 1.15rem + 0.2vw, 1.4rem); */     /* 12.5px ... 14px */
  --fs-small: calc(var(--fs-body) * 0.9);
  --fs-caption: clamp(1.15rem, 1.05rem + 0.15vw, 1.3rem);   /* 11.5px ... 13px */
  --fs-lead: clamp(1.6rem, 1.45rem + 0.3vw, 1.9rem);        /* 16px ... 19px */

  --fs-h1: clamp(2.6rem, 2.1rem + 0.9vw, 3.6rem);           /* 26px ... 36px */
  --fs-h2: clamp(2.2rem, 1.85rem + 0.7vw, 3.0rem);          /* 22px ... 30px */
  --fs-h3: clamp(1.9rem, 1.65rem + 0.55vw, 2.4rem);         /* 19px ... 24px */
  --fs-h4: clamp(1.7rem, 1.5rem + 0.4vw, 2.1rem);           /* 17px ... 21px */
  --fs-h5: clamp(1.55rem, 1.4rem + 0.25vw, 1.9rem);         /* 15.5px ... 19px */
  --fs-h6: clamp(1.45rem, 1.35rem + 0.2vw, 1.7rem);         /* 14.5px ... 17px */

  /* Line heights ... slightly more generous for reading */
  --lh-body: 1.7;
  --lh-heading: 1.25;
  --lh-tight: 1.12;
}

/* ===== BASE RESET ===== */
html {
  font-size: var(--baseline-size);
  box-sizing: border-box;
  text-size-adjust: 100%;
}

*, *::before, *::after {
  box-sizing: inherit;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
  background: var(--color-bg);
  overflow-x: hidden;

  font-kerning: normal;
  font-feature-settings: "kern", "liga", "clig";
}

/* ===== LAYOUT WRAPPERS ===== */
.page {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.prose {
  max-width: var(--prose-max);
}

.prose--wide {
  max-width: var(--prose-wide);
}

/* Default rhythm for longform containers */
.prose > * + * {
  margin-top: var(--space-4);
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-heading);
  line-height: var(--lh-heading);
  text-wrap: balance;
  font-weight: 400;
}

h1 { font-size: var(--fs-h1); line-height: var(--lh-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

/* Heading spacing inside prose */
.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: var(--space-7);
}

.prose h1:first-child,
.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}

p {
  margin: 0;
}

/* Optional lead paragraph */
.lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
}

/* Small, captions */
small {
  font-size: var(--fs-small);
}

.caption,
figcaption {
  font-size: var(--fs-caption);
  line-height: 1.4;
}

/* Links */
a {
  color: inherit;
  text-decoration-color: currentColor;
  text-underline-offset: 0.2em;
  text-decoration-thickness: 0.08em;
}

a:hover {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }

  .nav-drawer {
    transition: none;
  }
}

/* ===== LISTS ===== */
ul, ol {
  margin: 0;
  padding-left: var(--space-4);
  margin-left: var(--space-4);
}

li + li {
  margin-top: var(--space-1);
}

/* ===== QUOTES ===== */
blockquote {
  margin: 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  font-style: italic;
  position: relative;
  font-weight: 300;
  color: var(--color-ink-dark);
}

blockquote:before, blockquote:after {
  font-size: 4em;
  line-height: 0.8;
  font-weight: 600;
  font-family: var(--font-body);
}

blockquote:before {
  content: '“';
  float: left;
  margin-left: calc(var(--space-5) * -2.8);
}

blockquote:after {
  content: '”';
  right: 0;
  bottom: var(--space-3);
  position:absolute;
}

blockquote p {
  font-size: 1em;
}

blockquote footer {
  font-family: var(--font-body);
  margin-bottom: 0 !important;
  padding: var(--space-5) var(--space-6) 0 var(--space-5);
  font-size: 0.8em;
}

/* Variant pattern ... reuse an H3 but scale it down */
.quote h3 {
  font-size: 0.9em; /* 0.9 x computed h3 size */
  line-height: 1.35;
  font-style: italic;
}

/* ===== CODE ===== */
code, kbd, samp, pre {
  font-family: var(--font-monospace);
  color: var(--code-text);
}

/* Inline code, keyboard input, sample output */
code, kbd, samp {
  font-size: 0.95em;
  border-radius: 0.6rem;
  padding: 0.15em 0.4em;
  background: var(--code-bg);
}

/* Inline code tweaks */
code {
  letter-spacing: 0.02em;
}

/* Keyboard input */
kbd {
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid var(--code-border);
  box-shadow: 0 1px 0 var(--code-border);
  text-transform: uppercase;
}

/* Sample output */
samp {
  font-style: normal;
  opacity: 0.9;
}

/* Block code */
pre {
  margin: 0;
  padding: var(--space-5);
  border-radius: var(--radius-m);
  background: var(--code-bg-strong);
  border: 1px solid var(--code-border);
  overflow-x: auto;
  line-height: 1.45;
  font-size: var(--fs-small);
}

/* Prevent double styling */
pre code {
  padding: 0;
  border-radius: 0;
  background: none;
}

/* ===== MEDIA ===== */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 0;
}

/* ===== FORMS ===== */
button, input, select, textarea {
  font: inherit;
}

button,
input[type="button"],
input[type="submit"] {
  padding: 1.2rem 1.6rem;
  border-radius: var(--radius-m);
}

input, select, textarea {
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-m);
}

/* ===== DROP CAP (OPT-IN) =====
   Add class "dropcap" to the paragraph you want to stylise */
p.dropcap::first-letter {
  float: left;
  font-family: var(--font-heading);
  font-size: 3.1em;      /* scales with body clamp */
  line-height: 0.9;      /* helps keep it to 2 lines */
  margin: 0.12em 0.14em 0 0; /* nudges down and spaces it */
  font-weight: 600;
}

/* Progressive enhancement */
@supports (initial-letter: 2) {
  p.dropcap::first-letter {
    float: none;
    font-size: 1em;
    line-height: inherit;
    margin: 0 0.12em 0 0;
    initial-letter: 2;
    initial-letter-align: alphabetic;
  }
}

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



/* ==========================
   HEADER & FOOTER STYLES
   ========================== */  


header, main, footer {
  margin: 0 auto;
  padding: var(--space-6) var(--gutter);
}


/* ===== HEADER ===== */
header {
  border-bottom: 1px solid color-mix(in srgb, var(--color-text) 25%, transparent);
  margin-bottom: 10px;
}


/* ===== FOOTER UPGRADE (works with your existing layout rules) ===== */
footer p {
  text-align: center;
  font-family: var(--font-body);
}

.site-footer {
  border-top: 1px solid color-mix(in srgb, var(--color-text) 25%, transparent);         /* matches your header */
  margin-top: 10px;                   /* matches your header spacing rhythm */
  padding: 4rem 2rem;                      /* matches your global footer padding */
  min-height: 10rem;
}

/* prevent double padding if you keep an inner wrapper */
.site-footer-inner {
  padding: 0;
  display: grid;
  grid-template-columns: auto auto;
  gap: 1.25rem;
  justify-content: space-between;
}

/* neutralise the old footer p sizing so it doesn't overpower */
.site-footer p {
  margin: 0;
  text-align: left;
  font-size: var(--fs-small);
  line-height: 1.6;
}

/* brand */
.site-footer-title {
  font-family: var(--font-logo);
  font-size: var(--fs-small);
  line-height: 1.2;
  letter-spacing: 0.02em;
}

.site-footer-title a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 300;
}

.site-footer-title a:hover {
  text-decoration: underline;
}

.site-footer-tagline {
  margin-top: 0.5rem;
  max-width: 38ch;
  opacity: 0.85;
}

p.site-footer-copyright {
  margin-top: 0.75rem;
  font-size: var(--fs-caption);
  opacity: 0.8;
}

/* nav lists */
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer-links--meta {
  font-size: 0.8em;
}

.site-footer-link {
  text-decoration: none;
  color: var(--color-text);
  opacity: 0.85;
}

.site-footer-link:hover {
  text-decoration: underline;
  opacity: 1;
}



/* ==========================
   MAIN BODY ELEMENT STYLES
   ========================== */  


/* ========== NAV ========== */
.site-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-header-inner{
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: -1.6rem; /* offset the gutter so the clickable area extends to the edge of the screen */
}

.nav-toggle:hover {
  cursor: pointer;
}

.nav-toggle-icon {
  font-size: 2.4rem;
  line-height: 1;
  color: var(--color-text);
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(2px);
  z-index: 80;
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(360px, 85vw);
  background: var(--color-bg);
  z-index: 90;
  transform: translateX(102%);
  transition: transform 0.25s ease;
  box-shadow: -12px 0 30px rgba(0, 0, 0, 0.12);
  padding: 1.25rem;
}

.nav-drawer[aria-hidden="false"] {
  transform: translateX(0);
}

html.nav-open .nav-overlay {
  display: block;
}

.nav-drawer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);;
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--code-border);
}

.nav-drawer-title {
  margin: 0;
}

.nav-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: clamp(2rem, 2rem + 0.5vw, 3rem);
  line-height: 0.8;
}

.nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.nav-list-link {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  padding: 0.5rem 0.25rem;
}

.nav-list-link:hover {
  color: var(--color-accent);
}

/* Desktop nav ... hidden on mobile by default */
.nav-desktop{
  display: none;
}

.nav-desktop-link i, .nav-list-link i {
  display: inline-block;
  font-size: 1.1em;
  line-height: 1;
}

.nav-desktop-link i {
  padding: 0.25rem;
}

.nav-desktop-link i:hover {
  color: var(--color-accent)
}

.nav-desktop-link i + span,
.nav-list-link i + span {
  margin-left: 0.5rem;
}

.nav-list-link i {
  color: var(--color-accent);
  text-align: left;
}

/* Desktop mode */
@media (min-width: 768px){

  /* Layout */
  .site-header{
    justify-content: space-between;
  }

  .site-header-inner{
    justify-content: space-between;
    gap: var(--space-5);
  }

  /* Hide hamburger + drawer on desktop */
  .nav-toggle,
  .nav-overlay,
  .nav-drawer{
    display: none;
  }

  /* Show desktop nav */
  .nav-desktop{
    display: block;
  }

  .nav-desktop-list{
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--space-5);
  }

  .nav-desktop-item{
    margin: 0;
    padding: 0;
  }

  .nav-desktop-link{
    padding: 0.25rem 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    opacity: 0.85;
    text-decoration: none;
    position: relative;
  }

  .nav-desktop-link:hover{
    opacity: 1;
    background: transparent;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 0.3em;
    text-decoration-thickness: 0.1em;
  }

  .nav-desktop-link.is-active{
    opacity: 1;
    background: transparent;
    border: 0;
    text-decoration: underline;
    text-underline-offset: 0.3em;
    text-decoration-thickness: 0.12em;
  }
}


/* ===== ARTICLES INDEX ===== */
.label {
  text-transform: uppercase;
  color: var(--color-text-light);
  font-size: var(--fs-caption);
  margin: 0 0 var(--space-4) 0;
}

main.articles h1 {
  text-align: center;
  margin-bottom: 2rem;
}

/* ===== HOMEPAGE (articles.php) ===== */

.latest-section {
  margin-bottom: var(--space-7);
  border-bottom: 1px solid var(--code-border);
  padding-bottom: var(--space-4);
}


.latest-section-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  align-items: start;
}

.latest-section-main,
.latest-section-aside {
  min-width: 0;
}

/* Latest article (main column) */
.latest-article a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.latest-article .article-cover {
  margin: 0 0 var(--space-5) 0;
}

.latest-article p {
  margin: 0;
  max-width: 75ch;
  line-height: var(--lh-body);
  color: color-mix(in srgb, var(--color-text) 88%, transparent);
}

/* Spotlight (right column) */
.spotlight {
  background: color-mix(in srgb, var(--paper) 86%, #ffffff);
  border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.spotlight-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) 0;
  text-decoration: none;
  color: inherit;
}

.spotlight-item + .spotlight-item {
  border-top: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
}

.spotlight-media {
  margin: 0;
}

.spotlight-media .halftone {
  aspect-ratio: 1 / 1;
}

.spotlight-date {
  margin: 0;
  font-size: var(--fs-caption);
  color: var(--color-text-light);
}

/* Recent articles label + grid */

.article-list.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-7);
}

.article-card a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.article-card .article-cover {
  margin: 0 0 var(--space-3) 0;
}

/* Layout spacing for homepage headings (typography-neutral) */
.latest-article h2 { margin: 0 0 var(--space-3) 0; }
.spotlight-title {
  margin: 0 0 var(--space-1) 0;
  font-size: var(--fs-h5);
}
.article-card h3 { margin: 0 0 var(--space-2) 0; text-transform: capitalize;}

.article-card p {
  margin: 0 0 var(--space-5) 0;
  font-size: var(--fs-small);
  color: color-mix(in srgb, var(--color-text) 86%, transparent);
}

/* Hover treatment */
/* 
.latest-article a:hover h2,
.spotlight-item:hover .spotlight-title,
.article-card a:hover h3 {
  color: var(--color-accent);
}
*/

/* ===== ARTICLE PAGE ===== */
/* Keep layout rules here, keep global typography in base.css */





/* If you want drop caps, use p.dropcap in base.css */

.block-text {
  max-width: 72ch;
  margin: 2.25rem auto;
}

.block-text--left {
  margin-left: 0;
  margin-right: auto;
  max-width: 68ch;
}

.block-text--right {
  margin-left: auto;
  margin-right: 0;
  max-width: 68ch;
}

/* ===== GENERIC PAGE ===== */
main.default-page .page-header {
  margin-bottom: var(--space-6);
}


/* ===== HELPERS ===== */

.categories {
  margin-bottom: 2rem;
}

.category-pill-link {
  text-decoration: none;
}

.category-pill {
  background: none;
  color: #222222;
  border: 1px solid #222222;

  padding: var(--space-1) var(--space-2);
  border-radius: 0.7rem;
  margin-right: 0.5rem;
  font-size: clamp(1.2rem, 1rem + 0.2vw, 1.5rem);
  text-transform: uppercase;

  display: inline-flex;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
}

.category-pill:hover {
  --accent-dark: color-mix(in srgb, var(--accent), #222222 60%);
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}

.category-header {
  text-align: center;
  margin-bottom: 3rem;
}

.category-header h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 0.75rem;
}

.category-description {
  color: #555;
}





/* ==========================
   IMAGE STYLES
   ========================== */


/* ===== COVER IMAGE ===== */
figure {
  margin: 0;
}

figcaption.cover-caption {
  color: var(--color-text-light);
  text-align: right;
  margin: 0.5rem;
  font-size: var(--fs-caption);
}

figcaption.cover-caption:first-letter {
  text-transform: capitalize;
}

/* ===== HALFTONE STYLING ===== */
.halftone {
  --paper: #FFF3E0;
  position: relative;
  overflow: hidden;
  aspect-ratio: 2/1;
  background: var(--paper);
}

.halftone.tinted::before {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--tint);
  background-color: color-mix(in srgb, var(--tint) 85%, #fff3e0);
  mix-blend-mode: multiply;
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
  filter: saturate(0.8);
}

.halftone img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(1) contrast(1.2);
  z-index: -1;
  mix-blend-mode: overlay;
  background-color: var(--paper);
  opacity: 1;
}



/* ===== INLINE IMAGE (Blocks) ===== */
.article-content .text figure,
.article-content .text .block-type-image,
.article-content .text .block-image {
  margin: var(--space-6) 0;
}

.article-content .text figure img,
.article-content .text .block-type-image img,
.article-content .text .block-image img,
.article-content .text > p > img {
  display: block;
  width: 100%;
  height: auto;

  /* stops overflow and horizontal scroll */
  max-width: 100%;
  overflow: hidden;

  /* optional ... keeps big images from getting silly tall */
  max-height: 70vh;
  object-fit: contain;
}


/* ==========================
   RESPONSIVE STYLES
   ========================== */

/* Desktop and tablet ... allow a gentle overhang but never beyond viewport */
@media (min-width: 481px) {
  .article-content .text figure,
  .article-content .text .block-type-image,
  .article-content .text .block-image {
    margin-left: calc(clamp(0rem, 3vw, 3.2rem) * -1);
    margin-right: calc(clamp(0rem, 3vw, 3.2rem) * -1);
  }
}

@media (max-width: 768px) {
  html.nav-open,
  html.nav-open body {
    overflow: hidden;
  }

  .page {
    padding-inline: 0;
  }

  .site-header-inner {
    align-items: center;
    justify-content: space-between;
  }

  .article-list.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-6);
  }

  .article-card p, .article-card .date, .latest-article p, .latest-article .date, .article-body {
    font-size: var(--fs-small)
  }

  .article-body p, .article-body li {
    font-size: 0.9em;
    line-height: 1.6;
  }

  blockquote {
    font-size: calc(var(--fs-body) * 1.1);
    padding: var(--space-3) var(--space-4);
  }

  .article-meta-card-grid{
    grid-template-columns: 1fr;
  }

  .latest-section-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .spotlight {
    padding: var(--space-4);
  }

  .spotlight-item {
    grid-template-columns: 84px 1fr;
  }

  .block-text,
  .block-text--left,
  .block-text--right {
    margin-left: auto;
    margin-right: auto;
    max-width: 72ch;
  }
}

@media (max-width: 480px) {
  /* Mobile readability */
  :root {
    --fs-body: 1.75rem;
    --fs-small: 1.5rem;
    --fs-caption: 1.4rem;
    --fs-lead: 1.9rem;
  }

  header, main, footer {
    padding: calc(var(--gutter-mobile) - 0.6rem) var(--gutter-mobile)
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .site-footer-meta {
    justify-self: start;
  }

  .article-list.grid {
    grid-template-columns: 1fr;
  }

  body {
    font-size: calc(var(--fs-body) * 1.12);
  }

  .page {
    padding-inline: 0;
  }

  .latest-section {
    margin-bottom: var(--space-6);
  }

  .latest-article .article-cover {
    margin-bottom: var(--space-4);
  }

  .date{
    gap: var(--space-1);
    margin-bottom: var(--space-3);
  }

  .latest-article p {
    max-width: 100%;
    font-size: 0.9em;
    line-height: 1.6;
  }

  /* Spotlight */
  .spotlight {
    padding: var(--space-4);
  }

  .spotlight-item {
    grid-template-columns: 84px 1fr;
    gap: var(--space-3);
    padding: var(--space-3) 0;
  }

  .spotlight-title {
    line-height: 1.25;
    font-size: var(--fs-h4);
  }

  /* Recent articles: force single column from 425px and below */
  .article-list.grid {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .article-card p, .latest-article p {
    line-height: calc(var(--lh-body) * 1.08);
    margin-bottom: var(--space-4);
  }

  /* Make pills easier to tap when they appear on mobile */
  .category-pill {
    padding: calc(var(--space-1) * 1.15) calc(var(--space-2) * 1.1);
  }


  /* Full-bleed cover on mobile */
  main.article-page .article-image {
    width: 100vw;
    max-width: 100vw;

    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }

  main.article-page .article-image .article-cover,
  main.article-page .article-image .halftone {
    width: 100%;
    max-width: 100%;
  }

  main.article-page .article-image img {
    width: 100%;
    height: 100%;
    display: block;
  }

  /* Full bleed images on mobile */
  .article-content .text figure,
  .article-content .text .block-type-image,
  .article-content .text .block-image {
    width: 100vw;
    max-width: 100vw;

    /* pulls it out of the centred column */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    margin-top: var(--space-6);
    margin-bottom: var(--space-6);
  }

  .article-content .text figure img,
  .article-content .text .block-type-image img,
  .article-content .text .block-image img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
  }

  .article-references ol {
    margin: 5px;
    font-size: 0.8em;
  }

  .article-meta-card{
    padding: 1.8rem 1.6rem 1.6rem;
  }

  .article-meta-card-kicker{
    font-size: 1.2rem;
    letter-spacing: 0.12em;
  }

  .article-meta-card-title{
    font-size: clamp(2.0rem, 5vw, 2.6rem);
    line-height: 1.2;
  }

  .article-meta-card-grid{
    gap: 1.25rem;
  }

  .article-meta-card dt{
    font-size: 1.25rem;
    opacity: 0.75;
  }

  .article-meta-card dd{
    font-size: 1.65rem;
    line-height: 1.35;
    font-weight: 500;
  }

  .article-meta-card-item--full dd{
    line-height: 1.5;
  }

}















/* === Nav & Header === */

.wordmark {
  font-family: var(--font-logo);
  padding: 0;
  font-size: var(--fs-h3);
  line-height: 1;
  letter-spacing: 0.02em; /* optional, especially for all caps */
  margin-bottom: -5px; /* optional, helps visually align the wordmark with nav items */
}

.wordmark a {
  text-decoration: none;
  color: var(--color-ink-dark);
}

.wordmark-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.wordmark-link svg {
  display: block;
  height: 3.2rem;
  width: auto;
}

.wordmark-link svg,
.wordmark-link svg * {
  fill: currentColor;
}

@media (min-width: 768px) {
  .wordmark-link svg {
    height: 3.4rem;
  }

  html.nav-open,
  html.nav-open body {
    overflow: hidden;
  }
}

/* screen reader only helper */
.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;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-dropdown[open] .nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
}



/* === Articles Listing Page === */

h1.article-title {
  text-transform: capitalize;
  line-height: var(--lh-heading);
  margin: 0 0 var(--space-5) 0;
}

h2.article-title {
  font-size: var(--fs-h2)
}

h3.article-title {
  font-size: var(--fs-h3);
}

h2.article-title, h3.article-title {
  text-transform: capitalize;
  line-height: var(--lh-heading);
  padding: inherit;
  margin: 0 0 var(--space-3) 0;
}

p.article-date {
  font-size: var(--fs-small);
  color: var(--color-ink-dark);
  margin: 0 0 var(--space-3) 0;
}

p.article-date span {
  padding: 0 0.25rem;
}

p.article-date span:first-of-type {
  padding-left: 0;
}

.ordinal {
  font-size: 0.7em;
  vertical-align: super;
  line-height: 0;
}

p.article-excerpt {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
}


.latest-article {
  margin-bottom: var(--space-5);
}

@media (max-width: 768px) {
  h2.article-title, h3.article-title {
    font-size: var(--fs-h2);
  }
  p.article-excerpt {
    font-size: var(--fs-small);
  }
}


/* === Article Page === */
.article-content {
  max-width: var(--prose-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-block: var(--space-6);
}

/* Prevent long strings (URLs, DOIs) from forcing horizontal scroll */
.article-content,
.article-content * {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Local rhythm ... independent of .prose class */
.article-content > * + * {
  margin-top: var(--space-5);
}

h2.article-subheading {
  font-family: var(--font-body);
  font-weight: 200;
  font-size: var(--fs-h4);
  line-height: var(--lh-heading);
  margin: 0 0 var(--space-5) 0;
}

.article-content a {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.article-content code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-body * {
  margin-bottom: var(--space-5);
}

.article-body p {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-text);
}

.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4,
.article-body h5,
.article-body h6 {
  text-transform: capitalize;
  font-weight: 400;
}

.article-body p:first-of-type::first-letter {
  float: left;
  font-family: var(--font-heading);
  font-size: 3em;      /* scales with body clamp */
  line-height: 0.9;      /* helps keep it to 2 lines */
  margin: 0.1em 0.15em 0 0; /* nudges down and spaces it */
  font-weight: 400;
}

.article-body li {
  margin-bottom: var(--space-2);
}

.article-body li:first-of-type {
  display: block;
  margin-left: calc(var(--space-6) * -1);
  font-weight: 600;
  text-transform: capitalize;
}


/* === Article references === */
.article-references {
  border-top: var(--code-border) 1px solid;
}

.article-references,
.article-references li {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.article-references h4 {
  padding: var(--space-4) 0;
}

.article-references ol {
  padding-left: 2.2rem; /* keeps numbers readable */
  font-size: var(--fs-small);
}

.article-references li {
  margin-bottom: 1.2rem;
}

.article-references a.ref-link{
  overflow-wrap: anywhere;
  word-break: break-word;
  color: color-mix(in srgb, var(--color-text) 60%, var(--color-accent));
  text-underline-offset: 0.2em;
}

/* === Article Meta Card === */
.article-meta-card{
  margin-top: 3rem;
  padding: 1.5rem 1.5rem 1.25rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.35);
  border: 1px solid rgba(0,0,0,0.06);
}

.article-meta-card-kicker{
  margin: 0 0 0.35rem;
  font-size: calc(var(--fs-caption) * 0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}

.article-meta-card-title{
  margin: 0;
  font-family: var(--font-heading);
  font-size: var(--fs-h4);
  line-height: 1.15;
  text-transform: capitalize;
}

/* important … force meta text back to sane sizes */
.article-meta-card dt{
  font-size: calc(var(--fs-caption) * 0.8);
  opacity: 0.7;
  margin: 0 0 0.25rem;
}

.article-meta-card dd{
  margin: 0;
  font-size: calc(var(--fs-caption) * 1.1);
  line-height: 1.25;
  font-weight: 400;
}

.article-meta-card-grid{
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 1rem 1.25rem;
  margin: 1.25rem 0 0;
}

.article-meta-card-item--full{grid-column: 1 / -1;}

/* === PDF download === */
.pdf-pill-link {
  text-decoration: none;
}

.pdf-pill {
  background: none;
  color: #222222;
  border: 1px solid #222222;

  padding: var(--space-1) var(--space-2);
  border-radius: 0.7rem;
  margin-right: 0.5rem;
  font-size: clamp(1.2rem, 1rem + 0.2vw, 1.5rem);
  text-transform: uppercase;

  display: inline-flex;
  align-items: center;
  line-height: 1;
  white-space: nowrap;
}

.pdf-pill:hover {
  background: var(--color-ink-dark);
  color: #ffffff;
  border: 1px solid var(--color-ink-dark);
}

.pdf-pill i {
  margin-right: 0.5rem;
} 
