/* =====================================================================
   OA Systems — Articles listing + detail (redesign v2)
   Drop-in replacement for /assets/css/articles.css.
   Everything is scoped to body.articles-page. Colours come from the site
   tokens in styles.css (:root dark + body[data-theme="light"]), so both
   themes work without extra rules. Loaded after styles.css.
   ===================================================================== */

.articles-page {
  /* Layout */
  --art-shell: var(--shell, 1180px);
  --art-main: 46rem;               /* main column: images, tables, code  */
  --art-measure: 68ch;             /* prose line length                  */
  --art-toc-w: 16rem;
  --art-gap: clamp(1rem, 2.4vw, 1.5rem);
  --art-header-offset: calc(var(--header-height, 82px) + 1rem);
  --art-radius: var(--radius, 8px);
  --art-tap: 44px;
  /* Fluid type */
  --art-fs-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);     /* 17 -> 19px */
  --art-lh-body: 1.7;
  --art-fs-h1: clamp(2rem, 1.35rem + 2.8vw, 3.25rem);            /* 32 -> 52px */
  --art-fs-h2: clamp(1.45rem, 1.2rem + 1.1vw, 1.95rem);
  --art-fs-h3: clamp(1.2rem, 1.1rem + 0.45vw, 1.4rem);
  --art-fs-h4: clamp(1.05rem, 1rem + 0.2vw, 1.15rem);
  --art-fs-small: 0.9rem;
  --art-font-display: var(--font-display, "Aptos Display", Aptos, "Segoe UI", sans-serif);
  --art-font-mono: ui-monospace, "Cascadia Code", SFMono-Regular, Menlo, Consolas, monospace;
  /* Colour (derived from site tokens) */
  --art-text: var(--text, #effff8);
  --art-muted: var(--muted, #9ab8ad);
  --art-brand: var(--brand, #28f7a8);
  --art-line: var(--line, rgba(174, 212, 198, 0.14));
  --art-surface: var(--surface, rgba(8, 24, 21, 0.74));
  --art-surface-soft: var(--surface-soft, rgba(85, 255, 203, 0.08));
  --art-code-bg: rgba(0, 3, 2, 0.55);
  --art-media-bg: linear-gradient(135deg, rgba(40, 247, 168, 0.18), rgba(124, 207, 213, 0.08) 55%, rgba(2, 8, 7, 0.2));
}

body[data-theme="light"].articles-page {
  --art-code-bg: #0f1f1a;          /* keep code dark in light theme for contrast */
  --art-media-bg: linear-gradient(135deg, rgba(8, 123, 83, 0.16), rgba(23, 127, 140, 0.08) 55%, rgba(255, 255, 255, 0.4));
}

/* Never let a child widen the page: grid/flex children default to min-width:auto. */
.articles-page .article-detail-shell > *,
.articles-page .article-layout > *,
.articles-page .article-main > *,
.articles-page .articles-card-grid > * {
  min-width: 0;
}

/* ------------------------------------------------------------------ */
/* Listing hero                                                        */
/* ------------------------------------------------------------------ */
.articles-page .articles-hero {
  padding: calc(var(--header-height, 82px) + clamp(1.6rem, 3vw, 2.4rem)) 0 clamp(1.4rem, 3vw, 2rem);
}

.articles-page .articles-hero-shell,
.articles-page .article-detail-shell {
  max-width: calc(var(--art-shell) + 2rem);
}

.articles-page .articles-hero h1 {
  max-width: none;                         /* cancels global h1 { max-width: 12ch } */
  margin: 0 0 0.75rem;
  font-family: var(--art-font-display);
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.articles-page .articles-hero .page-intro {
  max-width: 60ch;
  margin: 0;
  color: var(--art-muted);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.15rem);
}

.articles-page .articles-listing-section {
  padding-top: 0.5rem;
}

/* ------------------------------------------------------------------ */
/* Card grid: 1 / 2 / 3 columns; featured spans 2 cols (and 2 rows)    */
/* ------------------------------------------------------------------ */
.articles-page .articles-card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--art-gap);
  margin-block: 0;                 /* keep .shell's margin-inline:auto */
  padding-block: 0;
  list-style: none;
}

@media (min-width: 640px) {
  .articles-page .articles-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .articles-page .article-card--featured {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .articles-page .articles-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row dense;
  }
  .articles-page .article-card--featured {
    grid-column: span 2;
    grid-row: span 2;
  }
}

.articles-page .article-card {
  position: relative;
  display: flex;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--art-line);
  border-radius: var(--art-radius);
  background: var(--art-surface);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.articles-page .article-card:hover,
.articles-page .article-card:focus-within {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--art-brand) 45%, transparent);
  box-shadow: var(--shadow, 0 24px 58px rgba(0, 0, 0, 0.34));
}

.articles-page .article-card-link {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.articles-page .article-card-link:focus-visible {
  outline: 2px solid var(--art-brand);
  outline-offset: -2px;
  border-radius: var(--art-radius);
}

/* Media: space is always reserved by aspect-ratio, so no CLS. The box is always 16:9
   (never flex-grown or stretched); the card text takes any spare height. */
.articles-page .article-card-media {
  position: relative;
  flex: 0 0 auto;
  height: auto;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--art-media-bg);
}

.articles-page .article-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform 300ms ease;
}

.articles-page .article-card:hover .article-card-media img {
  transform: scale(1.03);
}

.articles-page .article-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.6rem;
  padding: clamp(1rem, 2.5vw, 1.25rem) clamp(1rem, 2.5vw, 1.35rem) 1.2rem;
}

/* No-image card: no empty box. A thin brand rule + more summary instead. */
.articles-page .article-card--no-image .article-card-body {
  padding-top: 1.35rem;
  border-top: 3px solid var(--art-brand);
}

.articles-page .article-card--no-image .article-card-summary {
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

/* Category chip */
.articles-page .article-card-topic,
.articles-page .article-topic {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 1.75rem;
  margin: 0;
  padding: 0.15rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--art-brand) 35%, transparent);
  border-radius: 999px;
  color: var(--art-brand);
  background: var(--art-surface-soft);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.articles-page .article-card h2 {
  display: -webkit-box;
  max-width: none;
  margin: 0;
  overflow: hidden;
  font-family: var(--art-font-display);
  font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.35rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.articles-page .article-card-summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--art-muted);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.articles-page .article-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: auto 0 0;
  padding-top: 0.6rem;
  color: var(--art-muted);
  font-size: var(--art-fs-small);
}

.articles-page .article-card-meta .meta-sep {
  opacity: 0.6;
}

.articles-page .card-author {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--art-text);
  font-weight: 600;
}

.articles-page .card-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.articles-page .card-avatar-initials,
.articles-page .byline-avatar-initials,
.articles-page .author-avatar-initials {
  color: #020807;
  background: var(--brand, #28f7a8);
  font-family: var(--art-font-display);
  font-weight: 700;
  line-height: 1;
}

.articles-page .card-avatar-initials { font-size: 0.72rem; }

/* Featured card */
.articles-page .article-card--featured h2 {
  font-size: clamp(1.45rem, 1.1rem + 1.5vw, 2.1rem);
  line-height: 1.12;
}

.articles-page .article-card--featured .article-card-summary {
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  -webkit-line-clamp: 4;
  line-clamp: 4;
}

@media (min-width: 640px) and (max-width: 1023.98px) {
  /* Tablet: featured as a horizontal card (image left, text right). */
  .articles-page .article-card--featured .article-card-link {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  }
  /* The media box stays 16:9 (never stretched to the text column's height); the text absorbs spare height. */
  .articles-page .article-card--featured .article-card-media {
    align-self: start;
  }
  .articles-page .article-card--featured.article-card--no-image .article-card-link {
    display: flex;
  }
}

@media (min-width: 1024px) {
  /* Featured spans 2 rows: the media box keeps 16:9 and the text area absorbs any extra height. */
  .articles-page .article-card--featured .article-card-body {
    flex: 1 1 auto;
    padding: 1.5rem 1.75rem 1.6rem;
  }
  /* Featured without an image: a branded cover panel (pattern + glow), text sits at the bottom. */
  .articles-page .article-card--featured.article-card--no-image .article-card-body {
    flex: 1 1 auto;
    justify-content: flex-end;
    padding: 2.25rem 2.5rem;
    background:
      radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--art-brand) 26%, transparent), transparent 42%),
      radial-gradient(circle at 62% 62%, color-mix(in srgb, var(--cyan, #7ccfd5) 14%, transparent), transparent 30%),
      linear-gradient(90deg, color-mix(in srgb, var(--art-brand) 9%, transparent) 1px, transparent 1px) 0 0 / 48px 48px,
      linear-gradient(180deg, color-mix(in srgb, var(--art-brand) 9%, transparent) 1px, transparent 1px) 0 0 / 48px 48px,
      var(--art-surface);
  }
  .articles-page .article-card--featured.article-card--no-image .article-card-meta {
    margin-top: 0.75rem;
  }
  .articles-page .article-card--featured.article-card--no-image h2 {
    font-size: clamp(2rem, 1.2rem + 1.6vw, 2.75rem);
  }
}

.articles-page .articles-empty {
  grid-column: 1 / -1;
  padding: 1.4rem 0 2rem;
  color: var(--art-muted);
}

/* ------------------------------------------------------------------ */
/* Article detail: shell + layout                                      */
/* ------------------------------------------------------------------ */
.articles-page .article-detail {
  padding: calc(var(--header-height, 82px) + 1.25rem) 0 clamp(3rem, 5vw, 4.5rem);
}

.articles-page .article-detail-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);    /* FIX: was an auto track -> 672px column on 390px phones */
  gap: clamp(1.25rem, 3vw, 2rem);
}

.articles-page .article-breadcrumb,
.articles-page .article-header,
.articles-page .article-hero {
  max-width: var(--art-main);
}

.articles-page .article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.articles-page .article-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.75rem, 4vw, 2.5rem);
  max-width: var(--art-main);
}

@media (min-width: 1100px) {
  .articles-page .article-layout {
    grid-template-columns: minmax(0, var(--art-main)) var(--art-toc-w);
    justify-content: space-between;
    column-gap: clamp(2.5rem, 5vw, 4.5rem);
  }
  .articles-page .article-layout > .article-toc {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-height, 82px) + 1.5rem);
    max-height: calc(100vh - var(--header-height, 82px) - 3rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .articles-page .article-layout > .article-main {
    grid-column: 1;
    grid-row: 1;
  }
}

/* Breadcrumb (44px targets) */
.articles-page .article-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 0.25rem;
  margin: 0 0 -0.5rem;
  color: var(--art-muted);
  font-size: var(--art-fs-small);
}

.articles-page .article-breadcrumb a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--art-tap);
  min-height: var(--art-tap);
  padding-inline: 0.15rem;
  color: inherit;
  text-decoration: none;
}

.articles-page .article-breadcrumb [aria-current="page"] {
  overflow: hidden;
  max-width: 100%;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--art-text);
}

@media (max-width: 639.98px) {
  /* Long current-page label adds nothing on phones: keep the trail to one line. */
  .articles-page .article-breadcrumb [aria-current="page"],
  .articles-page .article-breadcrumb [aria-current="page"] ~ *,
  .articles-page .article-breadcrumb span[aria-hidden="true"]:nth-last-child(2) {
    display: none;
  }
}

.articles-page .article-breadcrumb a:hover,
.articles-page .article-breadcrumb a:focus-visible {
  color: var(--art-brand);
}

/* Header */
.articles-page .article-header h1 {
  max-width: none;                           /* FIX: global h1 { max-width: 12ch } made a 331px, 4-line title on desktop */
  margin: 0.75rem 0 0.85rem;
  font-family: var(--art-font-display);
  font-size: var(--art-fs-h1);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.articles-page .article-summary {
  max-width: 60ch;
  margin: 0 0 1.25rem;
  color: var(--art-muted);
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.25rem);
  line-height: 1.55;
}

/* Byline */
.articles-page .article-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.25rem;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--art-line);
  color: var(--art-muted);
  font-size: 0.95rem;
}

.articles-page .byline-author a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: var(--art-tap);
  color: inherit;
  text-decoration: none;
}

.articles-page .byline-author-text {
  display: grid;
  line-height: 1.3;
}

.articles-page .byline-name {
  color: var(--art-text);
  font-weight: 700;
}

.articles-page .byline-role {
  font-size: 0.88rem;
}

.articles-page .byline-author a:hover .byline-name,
.articles-page .byline-author a:focus-visible .byline-name {
  color: var(--art-brand);
}

.articles-page .byline-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.articles-page .byline-avatar-initials { font-size: 0.95rem; }

.articles-page .byline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  margin: 0;
}

.articles-page .byline-meta > * + *::before {
  content: "·";
  margin-right: 0.6rem;
  opacity: 0.6;
}

/* Subscribe via RSS (listing intro + end of each article, before Related articles) */
.articles-page .articles-rss {
  margin: 0.5rem 0 0;
}
.articles-page .articles-rss--article {
  max-width: var(--art-main);
  margin: clamp(1.25rem, 3vw, 2rem) 0 0;
}
.articles-page .rss-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.25rem;
  margin-left: -0.25rem;
  color: var(--art-muted);
  font-size: var(--art-fs-small);
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: color 150ms ease;
}
.articles-page .rss-link:hover,
.articles-page .rss-link:focus-visible {
  color: var(--art-brand);
}
.articles-page .rss-link:hover span {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}
.articles-page .rss-link:focus-visible {
  outline: 2px solid var(--art-brand);
  outline-offset: 2px;
}
.articles-page .rss-link-icon {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}

/* Generated topic images (.media--topic): shown whole (contain) on their own dark green so the
   topic text and logo can never be cropped; no hover zoom. Real photos and diagrams stay cover. */
.articles-page .media--topic {
  background: #0b3d2e;
}
.articles-page .media--topic img,
.articles-page .article-hero.media--topic img {
  object-fit: contain;
  background: #0b3d2e;
}
.articles-page .article-card:hover .media--topic img {
  transform: none;
}

/* Hero image (only rendered when the article has one) */
.articles-page .article-hero {
  margin: 0;
}

.articles-page .article-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--art-radius);
  background: var(--art-media-bg);
}

.articles-page .article-hero figcaption {
  margin-top: 0.5rem;
  color: var(--art-muted);
  font-size: var(--art-fs-small);
}

/* ------------------------------------------------------------------ */
/* Table of contents: <details> on mobile/tablet, sticky sidebar >=1100 */
/* ------------------------------------------------------------------ */
.articles-page .article-toc {
  border: 1px solid var(--art-line);
  border-radius: var(--art-radius);
  background: var(--art-surface);
}

.articles-page .article-toc-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 52px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  list-style: none;
}

.articles-page .article-toc-summary::-webkit-details-marker { display: none; }

.articles-page .article-toc-summary::after {
  content: "";
  flex: 0 0 auto;
  width: 0.6rem;
  height: 0.6rem;
  margin-right: 0.25rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-25%);
  transition: transform 160ms ease;
}

.articles-page .article-toc-details[open] > .article-toc-summary::after {
  transform: rotate(-135deg) translateY(-25%);
}

.articles-page .article-toc-summary:focus-visible {
  outline: 2px solid var(--art-brand);
  outline-offset: -2px;
  border-radius: var(--art-radius);
}

.articles-page .article-toc-title {
  margin: 0;
  color: var(--art-text);
  font-family: var(--art-font-display);
  font-size: 1rem;
  font-weight: 700;
}

.articles-page .article-toc-count {
  margin-left: auto;
  color: var(--art-muted);
  font-size: 0.85rem;
}

.articles-page .article-toc ol {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0.5rem 0.5rem;
  list-style: none;
  counter-reset: toc;
}

.articles-page .article-toc a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--art-tap);
  padding: 0.45rem 0.6rem;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  color: var(--art-muted);
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
}

.articles-page .article-toc .toc-h3 a {
  padding-left: 1.6rem;
  font-size: 0.9rem;
}

.articles-page .article-toc a:hover,
.articles-page .article-toc a:focus-visible {
  color: var(--art-text);
  background: var(--art-surface-soft);
}

.articles-page .article-toc a[aria-current="location"],
.articles-page .article-toc a.is-active {
  border-left-color: var(--art-brand);
  color: var(--art-brand);
  background: var(--art-surface-soft);
  font-weight: 700;
}

@media (min-width: 1100px) {
  .articles-page .article-toc {
    border: 0;
    background: transparent;
  }
  .articles-page .article-toc-summary {
    min-height: 0;
    padding: 0 0 0.75rem 0.6rem;
    cursor: default;
    pointer-events: none;           /* sidebar is always open (JS sets [open]) */
  }
  .articles-page .article-toc-summary::after { display: none; }
  .articles-page .article-toc-count { display: none; }
  .articles-page .article-toc ol {
    padding: 0;
    border-left: 1px solid var(--art-line);
  }
  .articles-page .article-toc a {
    min-height: 36px;               /* desktop pointer target; still >=24px WCAG 2.5.8 */
    margin-left: -1px;
    font-size: 0.9rem;
  }
}

/* ------------------------------------------------------------------ */
/* Topics panel on /articles and /articles/category/<slug>: reuses the  */
/* TOC look (.article-toc). Collapsible strip above the cards below     */
/* 1100px (44px targets); sticky right-hand aside from 1100px.          */
/* ------------------------------------------------------------------ */
.articles-page .articles-listing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--art-gap);
  align-items: start;
}

.articles-page .articles-listing-layout > * {
  min-width: 0;
}

.articles-page .articles-topics a {
  justify-content: space-between;
  min-height: var(--art-tap);
}

.articles-page .articles-topic-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.articles-page .articles-topic-count {
  flex: 0 0 auto;
  min-width: 1.75rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--art-line);
  border-radius: 999px;
  color: var(--art-muted);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
}

.articles-page .articles-topics a[aria-current="page"] .articles-topic-count {
  border-color: currentColor;
  color: inherit;
}

.articles-page .articles-topics-current {
  overflow: hidden;
  max-width: 60%;
  color: var(--art-text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.articles-page .articles-topics a[aria-current="page"] {
  border-left-color: var(--art-brand);
  color: var(--art-brand);
  background: var(--art-surface-soft);
  font-weight: 700;
}

@media (min-width: 1100px) {
  .articles-page .articles-listing-layout--topics {
    grid-template-columns: minmax(0, 1fr) var(--art-toc-w);
    column-gap: clamp(2rem, 4vw, 3.5rem);
  }
  .articles-page .articles-listing-layout--topics > .articles-topics {
    grid-column: 2;
    grid-row: 1;
    position: sticky;
    top: calc(var(--header-height, 82px) + 1.5rem);
    max-height: calc(100vh - var(--header-height, 82px) - 3rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .articles-page .articles-listing-layout--topics > .articles-card-grid {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .articles-page .articles-listing-layout--topics .article-card--featured {
    grid-column: 1 / -1;
    grid-row: auto;
  }
  .articles-page .articles-topics a {
    min-height: var(--art-tap);
  }
  /* Without JS the sidebar stays a working disclosure (article-toc.js opens it). */
  .articles-page .articles-topics .article-toc-details:not([open]) > .article-toc-summary {
    pointer-events: auto;
    cursor: pointer;
  }
  .articles-page .articles-topics .article-toc-details:not([open]) > .article-toc-summary::after {
    display: block;
  }
}

/* ------------------------------------------------------------------ */
/* Markdown body                                                       */
/* ------------------------------------------------------------------ */
.articles-page .article-body {
  max-width: var(--art-main);
  color: var(--art-text);
  font-size: var(--art-fs-body);
  line-height: var(--art-lh-body);
  overflow-wrap: break-word;
}

.articles-page .article-body > :first-child { margin-top: 0; }
.articles-page .article-body > :last-child { margin-bottom: 0; }

/* Prose measure ~68ch; media/tables/code may use the full main column. */
.articles-page .article-body > :is(p, ul, ol, blockquote, h2, h3, h4, dl) {
  max-width: var(--art-measure);
}

.articles-page .article-body p,
.articles-page .article-body ul,
.articles-page .article-body ol,
.articles-page .article-body blockquote,
.articles-page .article-body pre,
.articles-page .article-body .table-wrap,
.articles-page .article-body > table,
.articles-page .article-body figure {
  margin: 0 0 1.25em;
}

/* Headings */
.articles-page .article-body :is(h2, h3, h4) {
  max-width: var(--art-measure);
  scroll-margin-top: calc(var(--header-height, 82px) + 1rem);
  color: var(--art-text);
  font-family: var(--art-font-display);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.articles-page .article-body h2 {
  margin: 2.2em 0 0.6em;
  padding-top: 0.2em;
  font-size: var(--art-fs-h2);
}

.articles-page .article-body h3 {
  margin: 1.8em 0 0.5em;
  font-size: var(--art-fs-h3);
}

.articles-page .article-body h4 {
  margin: 1.6em 0 0.4em;
  font-size: var(--art-fs-h4);
  letter-spacing: 0;
}

.articles-page .article-body :is(h2, h3, h4) + :is(h3, h4) { margin-top: 0.8em; }

/* FAQ accordion: native <details>/<summary>, closed by default (see scripts/articles/faq.py).
   The H3 stays inside the summary so its id anchor and heading level are kept. */
.articles-page .article-body > .faq-item {
  max-width: var(--art-measure);
  margin: 0;
  border-bottom: 1px solid var(--art-line);
}

.articles-page .article-body > h2 + .faq-item { border-top: 1px solid var(--art-line); }
.articles-page .article-body > .faq-item:has(+ :not(.faq-item)) { margin-bottom: 1.25em; }

.articles-page .faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--art-tap);
  padding: 0.75rem 0.25rem;
  cursor: pointer;
  list-style: none;                      /* Firefox / spec marker */
  border-radius: var(--art-radius);
}

.articles-page .faq-item > summary::-webkit-details-marker { display: none; }  /* Safari */
.articles-page .faq-item > summary::marker { content: ""; }

.articles-page .article-body .faq-item > summary > h3 {
  margin: 0;
  font-size: var(--art-fs-h4);
}

/* Plus / minus indicator drawn with two bars in the brand colour. */
.articles-page .faq-item > summary::after {
  content: "";
  flex: 0 0 auto;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.25rem;
  background:
    linear-gradient(var(--art-brand), var(--art-brand)) center / 100% 2px no-repeat,
    linear-gradient(var(--art-brand), var(--art-brand)) center / 2px 100% no-repeat;
  transition: background-size 160ms ease;
}

.articles-page .faq-item[open] > summary::after {
  background-size: 100% 2px, 2px 0;
}

.articles-page .faq-item > summary:hover { background: var(--art-surface-soft); }

.articles-page .faq-item > summary:focus-visible {
  outline: 2px solid var(--art-brand);
  outline-offset: 2px;
}

.articles-page .faq-answer {
  padding: 0 0.25rem 1rem;
}

.articles-page .faq-answer > :last-child { margin-bottom: 0; }

/* Links */
.articles-page .article-body a {
  color: var(--art-brand);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.articles-page .article-body a:hover { text-decoration-thickness: 2px; }

.articles-page .article-body a:focus-visible {
  outline: 2px solid var(--art-brand);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Lists, including nested */
.articles-page .article-body :is(ul, ol) {
  padding-left: 1.4em;
}

.articles-page .article-body li { padding-left: 0.2em; }
.articles-page .article-body li + li { margin-top: 0.4em; }
.articles-page .article-body li::marker { color: var(--art-brand); }
.articles-page .article-body ol > li::marker { font-weight: 700; font-variant-numeric: tabular-nums; }

.articles-page .article-body li > :is(ul, ol) {
  margin: 0.4em 0 0;
  padding-left: 1.2em;
}

.articles-page .article-body ul ul { list-style-type: circle; }
.articles-page .article-body ul ul ul { list-style-type: square; }
.articles-page .article-body ol ol { list-style-type: lower-alpha; }
.articles-page .article-body li > p { margin: 0 0 0.4em; }

@media (max-width: 479.98px) {
  .articles-page .article-body :is(ul, ol) { padding-left: 1.2em; }
  .articles-page .article-body li > :is(ul, ol) { padding-left: 1em; }
}

/* Task lists (Markdown "- [ ]" renders <li><input type=checkbox disabled>) */
.articles-page .article-body ul:has(> li > input[type="checkbox"]),
.articles-page .article-body ul.contains-task-list {
  padding: 0;
  list-style: none;
}

.articles-page .article-body li:has(> input[type="checkbox"]),
.articles-page .article-body li.task-list-item {
  position: relative;
  padding: 0.55em 0.75em 0.55em 2.6em;
  border: 1px solid var(--art-line);
  border-radius: 6px;
  background: var(--art-surface);
}

.articles-page .article-body li:has(> input[type="checkbox"]) + li { margin-top: 0.4em; }

.articles-page .article-body li > input[type="checkbox"] {
  position: absolute;
  top: 0.75em;
  left: 0.85em;
  width: 1.1em;
  height: 1.1em;
  margin: 0;
  accent-color: var(--art-brand);
  pointer-events: none;            /* read-only checklist, not a tap target */
}

/* Blockquote */
.articles-page .article-body blockquote {
  padding: 0.9em 1.1em;
  border-left: 4px solid var(--art-brand);
  border-radius: 0 var(--art-radius) var(--art-radius) 0;
  color: var(--art-text);
  background: var(--art-surface-soft);
  font-size: 0.97em;
}

.articles-page .article-body blockquote > :last-child { margin-bottom: 0; }

/* Code */
.articles-page .article-body code {
  font-family: var(--art-font-mono);
  font-size: 0.88em;
}

.articles-page .article-body :not(pre) > code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--art-line);
  border-radius: 4px;
  background: var(--art-surface-soft);
  overflow-wrap: anywhere;          /* long identifiers wrap instead of widening the line */
}

.articles-page .article-body pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1em 1.1em;
  border: 1px solid var(--art-line);
  border-radius: var(--art-radius);
  color: #e6fff4;
  background: var(--art-code-bg);
  font-size: clamp(0.82rem, 0.78rem + 0.2vw, 0.92rem);
  line-height: 1.6;
  tab-size: 4;
  font-variant-ligatures: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.articles-page .article-body pre code {
  display: block;
  width: max-content;               /* long lines scroll inside the <pre> */
  min-width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  white-space: pre;
}

@media (max-width: 639.98px) {
  /* Full-bleed code on phones: more room, still scrolls inside. */
  .articles-page .article-body pre {
    width: calc(100% + 2rem);
    max-width: none;
    margin-inline: -1rem;
    border-inline: 0;
    border-radius: 0;
  }
}

/* Tables: always scroll inside .table-wrap; the page never widens. */
.articles-page .article-body .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--art-line);
  border-radius: var(--art-radius);
  background: var(--art-surface);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.articles-page .article-body .table-wrap:focus-visible {
  outline: 2px solid var(--art-brand);
  outline-offset: 2px;
}

.articles-page .article-body table {
  width: 100%;
  min-width: 34rem;                 /* readable columns; wrapper scrolls below this */
  border-collapse: collapse;
  font-size: 0.92em;
  line-height: 1.5;
}

/* Fallback if the generator has not added .table-wrap yet */
.articles-page .article-body > table {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

.articles-page .article-body th,
.articles-page .article-body td {
  padding: 0.65em 0.8em;
  border-bottom: 1px solid var(--art-line);
  text-align: left;
  vertical-align: top;
}

.articles-page .article-body th + th,
.articles-page .article-body td + td {
  border-left: 1px solid var(--art-line);
}

.articles-page .article-body tbody tr:last-child td { border-bottom: 0; }

.articles-page .article-body th {
  color: var(--art-text);
  background: var(--art-surface-soft);
  font-weight: 700;
  white-space: nowrap;
}

.articles-page .article-body td:first-child { font-weight: 600; color: var(--art-text); }

.articles-page .article-body td :is(code) { white-space: nowrap; overflow-wrap: normal; }

/* Images and figures: Full (default), Half, Small */
.articles-page .article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--art-radius);
}

.articles-page .article-body .article-figure {
  margin: 1.75em 0;
}

.articles-page .article-body .article-figure img {
  width: 100%;
  background: var(--art-media-bg);
}

.articles-page .article-body figcaption {
  max-width: var(--art-measure);
  margin-top: 0.6em;
  color: var(--art-muted);
  font-size: var(--art-fs-small);
  line-height: 1.5;
}

/* Half / Small: float-free; side-by-side when consecutive on wide screens */
.articles-page .article-body .article-figure--half,
.articles-page .article-body .article-figure--small,
.articles-page .article-body img.article-img--half,
.articles-page .article-body img.article-img--small {
  width: 100%;
}

@media (min-width: 640px) {
  .articles-page .article-body .article-figure--half,
  .articles-page .article-body img.article-img--half {
    width: calc(50% - 0.5rem);
  }
  .articles-page .article-body .article-figure--small,
  .articles-page .article-body img.article-img--small {
    width: calc(33.333% - 0.67rem);
  }
  .articles-page .article-body .article-figure-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    margin: 1.75em 0;
  }
  .articles-page .article-body .article-figure-row > .article-figure { margin: 0; }
  .articles-page .article-body img.article-img--half,
  .articles-page .article-body img.article-img--small {
    display: inline-block;
    vertical-align: top;
    margin-right: 0.5rem;
  }
}

@media (min-width: 480px) and (max-width: 639.98px) {
  /* Small images stay small-ish on large phones */
  .articles-page .article-body .article-figure--small,
  .articles-page .article-body img.article-img--small {
    width: calc(50% - 0.5rem);
  }
  .articles-page .article-body .article-figure-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  .articles-page .article-body .article-figure-row > .article-figure { margin: 0; }
}

.articles-page .article-body hr {
  height: 1px;
  margin: 2.5em 0;
  border: 0;
  background: var(--art-line);
}

/* ------------------------------------------------------------------ */
/* Author box                                                          */
/* ------------------------------------------------------------------ */
.articles-page .author-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  border: 1px solid var(--art-line);
  border-radius: var(--art-radius);
  background: var(--art-surface);
}

@media (max-width: 559.98px) {
  .articles-page .author-box { grid-template-columns: minmax(0, 1fr); }
  .articles-page .author-box .author-avatar { width: 72px; height: 72px; }
}

.articles-page .author-box-text { min-width: 0; }

.articles-page .author-box-label {
  margin: 0 0 0.2rem;
  color: var(--art-muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.articles-page .author-box-name {
  margin: 0;
  font-family: var(--art-font-display);
  font-size: 1.35rem;
  line-height: 1.2;
}

.articles-page .author-box-name a {
  display: inline-flex;
  align-items: center;
  min-height: var(--art-tap);
}

.articles-page .author-box-name a,
.articles-page .author-all a,
.articles-page .author-card h2 a {
  color: inherit;
  text-decoration: none;
}

.articles-page .author-box-name a:hover,
.articles-page .author-box-name a:focus-visible,
.articles-page .author-all a:hover,
.articles-page .author-all a:focus-visible,
.articles-page .author-card h2 a:hover,
.articles-page .author-card h2 a:focus-visible {
  color: var(--art-brand);
}

.articles-page .author-role {
  margin: 0.2rem 0 0.85rem;
  color: var(--art-text);
  font-size: 1rem;
}

.articles-page .author-box .author-role {
  margin: 0.1rem 0 0.7rem;
  color: var(--art-muted);
}

.articles-page .author-bio {
  margin: 0 0 1rem;
  color: var(--art-muted);
  font-size: 1rem;
  line-height: 1.65;
}

.articles-page .author-bio :is(p, ul, ol) { margin: 0 0 0.75rem; }
.articles-page .author-bio :is(ul, ol) { padding-left: 1.2rem; }
.articles-page .author-bio > :last-child { margin-bottom: 0; }
.articles-page .author-bio a { color: var(--art-brand); }

.articles-page .author-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
}

.articles-page .author-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--art-tap);
  padding: 0 1rem;
  border: 1px solid var(--art-line);
  border-radius: 999px;
  color: var(--art-text);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.articles-page .author-links a:hover,
.articles-page .author-links a:focus-visible {
  border-color: var(--art-brand);
  color: var(--art-brand);
}

.articles-page .author-avatar {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
}

.articles-page .author-avatar-initials { font-size: 2rem; }

.articles-page .author-all { margin: 0.75rem 0 0; }

/* ------------------------------------------------------------------ */
/* Related articles (only rendered when 1–3 related items exist)       */
/* ------------------------------------------------------------------ */
.articles-page .article-related {
  padding-top: clamp(1.5rem, 4vw, 2.5rem);
  border-top: 1px solid var(--art-line);
}

.articles-page .article-related > h2,
.articles-page .article-invite h2 {
  max-width: none;
  margin: 0 0 1rem;
  font-family: var(--art-font-display);
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem);
  line-height: 1.2;
}

.articles-page .related-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .articles-page .related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--art-gap);
  }
}

.articles-page .related-card {
  height: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--art-line);
  border-radius: var(--art-radius);
  background: var(--art-surface);
  transition: border-color 180ms ease, transform 180ms ease;
}

.articles-page .related-card:hover,
.articles-page .related-card:focus-within {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--art-brand) 45%, transparent);
}

.articles-page .related-card-link {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);  /* phones: compact horizontal card */
  height: 100%;
  min-height: 88px;
  color: inherit;
  text-decoration: none;
}

.articles-page .related-card-link:focus-visible {
  outline: 2px solid var(--art-brand);
  outline-offset: -2px;
}

.articles-page .related-card-media {
  margin: 0;
  aspect-ratio: 16 / 9;
  height: auto;
  align-self: start;              /* never stretch to the text height: keep the box 16:9 */
  overflow: hidden;
  background: var(--art-media-bg);
}

.articles-page .related-card-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.articles-page .related-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.75rem 0.9rem;
}

.articles-page .related-card--no-image .related-card-link {
  grid-template-columns: minmax(0, 1fr);
  border-left: 3px solid var(--art-brand);
}

.articles-page .related-card .article-card-topic {
  min-height: 1.5rem;
  padding: 0.05rem 0.55rem;
  font-size: 0.68rem;
}

.articles-page .related-card h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-family: var(--art-font-display);
  font-size: 1.02rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.articles-page .related-card-meta {
  margin: auto 0 0;
  color: var(--art-muted);
  font-size: 0.84rem;
}

@media (min-width: 760px) {
  .articles-page .related-card-link {
    display: flex;
    flex-direction: column;
  }
  .articles-page .related-card-media { flex: 0 0 auto; align-self: stretch; }  /* full width in a column; height from 16:9 */
  .articles-page .related-card-body { flex: 1 1 auto; padding: 1rem 1.1rem 1.1rem; }
  .articles-page .related-card h3 { font-size: 1.1rem; }
  .articles-page .related-card--no-image .related-card-link {
    border-left: 0;
    border-top: 3px solid var(--art-brand);
  }
}

/* ------------------------------------------------------------------ */
/* Talk-to-OA invite                                                   */
/* ------------------------------------------------------------------ */
.articles-page .article-invite {
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--art-line);
  border-radius: var(--art-radius);
  background:
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--art-brand) 14%, transparent), transparent 50%),
    var(--art-surface);
}

.articles-page .article-invite p {
  max-width: 60ch;
  margin: 0 0 1rem;
  color: var(--art-muted);
}

.articles-page .article-invite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 559.98px) {
  .articles-page .article-invite-actions { display: grid; }
  .articles-page .article-invite-actions .button { justify-content: center; }
}

/* ------------------------------------------------------------------ */
/* /authors index (unchanged behaviour)                                */
/* ------------------------------------------------------------------ */
.articles-page .author-header .author-avatar { width: 160px; height: 160px; margin-bottom: 1rem; }
.articles-page .author-header .author-avatar-initials { font-size: 3.2rem; }
.articles-page .author-card-list { display: grid; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.articles-page .author-card { display: flex; gap: 1rem; align-items: flex-start; }
.articles-page .author-card .author-avatar { width: 72px; height: 72px; }
.articles-page .author-card .author-avatar-initials { font-size: 1.5rem; }
.articles-page .author-card h2 { margin: 0; font-size: 1.3rem; }
.articles-page .author-card .author-role { margin: 0.1rem 0 0.4rem; }
.articles-page .author-card-bio { margin: 0; color: var(--art-muted); }
.articles-page .author-articles ul { margin: 0; padding-left: 1.2rem; color: var(--art-muted); }
.articles-page .author-articles a { color: inherit; text-decoration: none; }
.articles-page .author-articles a:hover,
.articles-page .author-articles a:focus-visible { color: var(--art-brand); }

/* ------------------------------------------------------------------ */
/* AI disclosure note (articles/templates/partials/article-ai-note.html) */
/* ------------------------------------------------------------------ */
.article-ai-note { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--line); max-width: 65ch; }
.article-ai-note p { margin: 0; font-size: 0.8rem; line-height: 1.55; color: var(--muted); }
.article-ai-note a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.article-ai-note a:hover, .article-ai-note a:focus-visible { color: var(--text); }

/* ------------------------------------------------------------------ */
/* Light theme heading colour (site uses #08231b for headings)         */
/* ------------------------------------------------------------------ */
body[data-theme="light"].articles-page :is(.article-body h2, .article-body h3, .article-body h4,
  .article-header h1, .articles-hero h1, .author-box-name, .author-card h2, .article-card h2, .related-card h3) {
  color: #08231b;
}

body[data-theme="light"].articles-page .article-body pre { color: #e6fff4; }

/* ------------------------------------------------------------------ */
/* Motion                                                              */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .articles-page :is(.article-card, .related-card, .article-card-media img, .article-toc-summary::after, .faq-item > summary::after) {
    transition: none !important;
  }
  .articles-page :is(.article-card, .related-card):is(:hover, :focus-within),
  .articles-page .article-card:hover .article-card-media img {
    transform: none;
  }
}

/* Hero from the article's own image (sort order 1): diagrams with labels to the edges, never crop. */
.articles-page .article-hero--image img {
  aspect-ratio: auto;
  object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* Draft previews (/preview, scripts/articles/preview.py)              */
/* ------------------------------------------------------------------ */
.preview-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  background: #ffd400;
  color: #111;
  border-top: 3px solid #111;
  box-shadow: 0 -2px 8px rgb(0 0 0 / 25%);
}
.preview-banner p {
  margin: 0 auto;
  padding: 0.6rem 1rem;
  max-width: 80rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  align-items: center;
  font-size: 0.9rem;
  line-height: 1.4;
}
.preview-banner-title { font-weight: 800; letter-spacing: 0.02em; }
.preview-banner a { color: #111; text-decoration: underline; text-underline-offset: 2px; font-weight: 700; }
.preview-banner a:focus-visible { outline: 3px solid #111; outline-offset: 2px; }
body.is-preview { padding-bottom: 5rem; }
.preview-index { padding: 8rem 1rem 3rem; }
.preview-index .table-wrap { overflow-x: auto; }
.preview-table { width: 100%; border-collapse: collapse; }
.preview-table th, .preview-table td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line, #ddd); vertical-align: top; }

/* ---------------------------------------------------------------- Event articles
   Event details block in the article header (when, where, format, Register while upcoming) and the
   small Upcoming/Past event badge on listing cards. */
.articles-page .article-event {
  margin-top: 1.25rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--art-line);
  border-radius: var(--art-radius);
  background: var(--art-surface-soft);
  max-width: var(--art-main);
}

.articles-page .article-event-badge,
.articles-page .article-card-badge {
  display: inline-block;
  margin: 0 0 0.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.5;
  border: 1px solid var(--art-line);
  color: var(--art-muted);
}

.articles-page .article-event-badge--upcoming,
.articles-page .article-card-badge--upcoming {
  color: var(--art-brand);
  border-color: currentColor;
}

.articles-page .article-event-details {
  display: grid;
  gap: 0.35rem;
  margin: 0;
}

.articles-page .article-event-details > div {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.75rem;
}

.articles-page .article-event-details dt {
  color: var(--art-muted);
  font-size: var(--art-fs-small);
}

.articles-page .article-event-details dd {
  margin: 0;
}

.articles-page .article-event-actions {
  margin: 0.9rem 0 0;
}

.articles-page .article-event-register,
.articles-page .article-event-interest {
  min-height: var(--art-tap);
  display: inline-flex;
  align-items: center;
}

.articles-page .article-event-ended,
.articles-page .article-event-interest-note {
  margin: 0.75rem 0 0;
  color: var(--art-muted);
  font-size: var(--art-fs-small);
}

.articles-page .article-card-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.6rem;
  margin: 0 0 0.35rem;
  font-size: var(--art-fs-small);
  color: var(--art-muted);
}

.articles-page .article-card-event .article-card-badge {
  margin: 0;
}

@media (max-width: 480px) {
  .articles-page .article-event-details > div {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}
