/**
 * Global layout: resets, containers, header/nav (desktop + mobile drawer),
 * page headers, breadcrumbs, footer, prose. Card styles live in cards.css;
 * this file never redefines radius/shadow/colour — only structure, always
 * referencing tokens.css.
 */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

html, body { max-width: 100%; overflow-x: hidden; }
body { min-height: 100vh; display: flex; flex-direction: column; }
.dg-site-main { flex: 1 0 auto; }

img, svg, video { max-width: 100%; height: auto; display: block; }

/* ---------- Icon baseline ----------
 *
 * darsgaah_icon() already sets fill/stroke on the element itself, which is
 * the real fix for icons rendering as solid black blobs (a <path> defaults
 * to fill:black, so an icon in a context without a matching CSS rule
 * painted a filled shape — that was the black square on "Book a class").
 * This rule is the second line of defence: any inline SVG inside the
 * theme's own components inherits the same treatment even if it was
 * authored without the attributes. Size and colour still come from the
 * component, never from here.
 */
.dg-icon { flex: none; }
.dg-btn svg,
.dg-card svg,
.dg-status svg,
.dg-nav svg,
.dg-site-footer svg,
.dg-state svg,
.dg-doc-tool svg,
.dg-study-search svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Third line of defence, for SIZE rather than colour: every icon svg
   carries aria-hidden="true" (see darsgaah_icon() in functions.php), so
   this is a safe way to catch any icon that lands somewhere without its
   own width/height rule. Without this, a missed spot falls through to the
   "img, svg, video" reset above — max-width: 100%; height: auto — and
   scales up to fill its container, which drags stroke-width up with it
   until a small line icon reads as a solid black blob or arc. A specific
   component rule (e.g. .dg-card__icon svg) still always wins over this. */
svg[aria-hidden="true"] { width: 20px; height: 20px; }

/* Anchored headings clear the sticky header instead of hiding behind it. */
:target { scroll-margin-top: calc(var(--dg-header-height) + var(--dg-space-5)); }

.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dg-skip-link {
  position: absolute;
  top: -60px;
  left: var(--dg-space-3);
  z-index: 1000;
  background: var(--dg-maroon);
  color: var(--dg-surface);
  padding: var(--dg-space-2) var(--dg-space-4);
  border-radius: var(--dg-radius-sm);
  text-decoration: none;
  transition: top var(--dg-transition);
}
.dg-skip-link:focus { top: var(--dg-space-3); color: var(--dg-surface); }

/* ---------- Containers ---------- */

.dg-container {
  width: 100%;
  max-width: var(--dg-container-max);
  margin-inline: auto;
  padding-inline: var(--dg-container-pad);
}
.dg-container--narrow { max-width: calc(var(--dg-container-narrow) + 2 * var(--dg-container-pad)); }
.dg-container--wide { max-width: var(--dg-container-wide); }

/* Prose measure for long-form reading, without the inline styles the old
   templates used to reach for. */
.dg-measure { max-width: var(--dg-container-narrow); margin-inline: auto; }

/* ---------- Header / Nav ---------- */

/**
 * Single-row header: logo pinned to the left edge, nav links centred, and
 * the actions cluster (Browse classes / search / Darsgah AI) pinned right.
 * All three anchor to the same .dg-container edges so left/right padding
 * always matches. The bar sticks to the viewport top on scroll and gains a
 * hairline shadow once the page has moved, so it separates from content
 * without a permanent heavy border.
 */
.dg-site-header {
  position: sticky;
  top: 0;
  z-index: var(--dg-z-header);
  background: color-mix(in srgb, var(--dg-surface) 92%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--dg-line);
  transition: box-shadow var(--dg-transition), border-color var(--dg-transition);
}
@supports not (backdrop-filter: blur(10px)) {
  .dg-site-header { background: var(--dg-surface); }
}
.dg-site-header.is-stuck {
  box-shadow: var(--dg-shadow-md);
  border-bottom-color: transparent;
}

.dg-site-header__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--dg-header-gap);
  min-height: var(--dg-header-height);
  padding-top: var(--dg-header-padding-y);
  padding-bottom: var(--dg-header-padding-y);
}

.dg-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--dg-space-2);
  text-decoration: none;
  flex-shrink: 0;
  transform: translate(var(--dg-logo-offset-x), var(--dg-logo-offset-y));
}
.dg-logo__mark {
  display: block;
  height: var(--dg-logo-height);
  width: var(--dg-logo-width);
  object-fit: contain;
  transition: transform var(--dg-transition);
}
.dg-logo:hover .dg-logo__mark { transform: scale(1.03); }
.dg-logo__text {
  font-family: var(--dg-font-display);
  font-weight: 700;
  font-size: var(--dg-text-lg);
  color: var(--dg-maroon-deep);
  letter-spacing: var(--dg-tracking-tight);
}

/* Stand-in until the final logo file is dropped in — sized off the same
   --dg-logo-* variables so it previews exactly like the real mark. */
.dg-logo__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--dg-line);
  border-radius: var(--dg-radius-sm);
  background: var(--dg-cream);
  color: var(--dg-ink-muted);
  font-family: var(--dg-font-body);
  font-weight: 700;
  font-size: var(--dg-text-xs);
}

.dg-nav-toggle {
  display: none;
  grid-column: 3;
  justify-self: end;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  border: 1px solid var(--dg-line);
  border-radius: var(--dg-radius-sm);
  background: var(--dg-surface);
  cursor: pointer;
  transition: border-color var(--dg-transition), background var(--dg-transition);
}
.dg-nav-toggle:hover { border-color: var(--dg-maroon); }
.dg-nav-toggle__bar {
  width: 18px; height: 2px;
  background: var(--dg-maroon-deep);
  border-radius: 2px;
  margin: 0 auto;
  transition: transform var(--dg-transition), opacity var(--dg-transition-fast);
}
/* Bars fold into an X while the drawer is open — motion that reports what
   the tap did, rather than decoration. */
.dg-nav-toggle[aria-expanded="true"] .dg-nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.dg-nav-toggle[aria-expanded="true"] .dg-nav-toggle__bar:nth-child(2) { opacity: 0; }
.dg-nav-toggle[aria-expanded="true"] .dg-nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.dg-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--dg-header-gap);
  flex: 1;
  min-width: 0;
  justify-content: flex-end;
}

.dg-nav__list {
  display: flex;
  align-items: center;
  gap: var(--dg-nav-link-gap);
  list-style: none;
  margin: 0; padding: 0;
  flex-wrap: nowrap;
}
.dg-nav__list a {
  position: relative;
  display: block;
  padding: var(--dg-space-2) 0;
  text-decoration: none;
  color: var(--dg-ink);
  font-weight: 500;
  font-size: var(--dg-text-sm);
  white-space: nowrap;
  transition: color var(--dg-transition);
}
/* Active/hover marker is a 2px underline grown from the centre — it marks
   the current section without shifting anything around it. */
.dg-nav__list a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: var(--dg-maroon);
  transform: scaleX(0);
  transition: transform var(--dg-transition);
}
.dg-nav__list a:hover,
.dg-nav__list .current-menu-item > a,
.dg-nav__list .current_page_item > a { color: var(--dg-maroon); }
.dg-nav__list a:hover::after,
.dg-nav__list .current-menu-item > a::after,
.dg-nav__list .current_page_item > a::after { transform: scaleX(1); }

.dg-nav__actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--dg-nav-actions-gap);
  flex-shrink: 0;
  margin-inline-start: auto;
}

/* ---------- Header search ---------- */

.dg-nav-search {
  display: flex;
  align-items: center;
  gap: var(--dg-space-2);
  border: 1px solid var(--dg-line-strong);
  border-radius: var(--dg-radius-pill);
  padding: 4px 4px 4px var(--dg-space-3);
  background: var(--dg-cream);
  flex-shrink: 0;
  transition: border-color var(--dg-transition), box-shadow var(--dg-transition), background var(--dg-transition);
}
.dg-nav-search:focus-within {
  border-color: var(--dg-maroon);
  background: var(--dg-surface);
  box-shadow: var(--dg-focus-ring);
}
.dg-nav-search__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--dg-ink-faint);
}
.dg-nav-search__icon svg { width: 16px; height: 16px; stroke-width: 2; }
.dg-nav-search:focus-within .dg-nav-search__icon { color: var(--dg-maroon); }
.dg-nav-search input {
  border: 0; background: transparent; outline: none;
  font-family: var(--dg-font-body);
  font-size: var(--dg-text-sm);
  color: var(--dg-ink);
  width: clamp(90px, 14vw, var(--dg-search-width));
  min-width: 0;
}
.dg-nav-search input::placeholder { color: var(--dg-ink-faint); }
.dg-nav-search button {
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  width: 32px; height: 32px;
  padding: 0;
  border: 0; border-radius: 50%;
  background: var(--dg-maroon); color: var(--dg-surface);
  cursor: pointer;
  transition: background var(--dg-transition);
}
.dg-nav-search button:hover { background: var(--dg-maroon-deep); }
.dg-nav-search button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* The header carries no AI control — see template-parts/nav-primary.php.
   One launcher only, rendered on study pages (assets/css/ai-widget.css). */

/**
 * Desktop header: three fixed zones — logo left, nav links centred in the
 * remaining space, actions pinned right. Only above the drawer breakpoint;
 * the drawer below is position:fixed so it never interacts with the grid.
 */
@media (min-width: 1081px) {
  .dg-logo { grid-column: 1; }
  .dg-nav { display: contents; }
  .dg-nav__list { grid-column: 2; justify-self: center; }
  .dg-nav__actions { grid-column: 3; justify-self: end; margin-inline-start: 0; }
}

/* Touch targets. The footer and breadcrumb links are ~19px tall as text,
   which is fine with a mouse and poor with a thumb. Below the drawer
   breakpoint they get real vertical padding so each link clears the ~44px
   guidance without changing how the footer reads on desktop. */
@media (max-width: 1080px) {
  .dg-site-footer__list a { display: block; padding-block: 7px; }
  .dg-breadcrumbs a { display: inline-block; padding-block: 6px; }
  .dg-section__link { display: inline-flex; align-items: center; min-height: 40px; }
  .dg-nav-search input { min-height: 38px; }
}

@media (max-width: 1080px) {
  .dg-nav-toggle { display: flex; }

  .dg-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(340px, 86vw);
    height: 100dvh;
    background: var(--dg-surface);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--dg-space-5);
    padding: calc(var(--dg-header-height) + var(--dg-space-5)) var(--dg-space-5) var(--dg-space-6);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform var(--dg-transition-slow), visibility var(--dg-transition-slow);
    z-index: var(--dg-z-drawer);
    box-shadow: var(--dg-shadow-lg);
  }
  .dg-nav.is-open { transform: translateX(0); visibility: visible; }

  /* No dark scrim behind the open drawer — the drawer's own shadow
     (--dg-shadow-lg) plus the body scroll-lock below is enough to read as
     the active surface, without dimming the page a translucent black.
     Element and classes are kept (opacity/visibility only) so nav.js and
     the markup in header.php don't need to change. */
  .dg-nav-scrim {
    position: fixed;
    inset: 0;
    z-index: calc(var(--dg-z-drawer) - 1);
    background: transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  body.dg-nav-open .dg-nav-scrim { visibility: visible; }
  /* Without this the page behind the open drawer keeps scrolling under a
     thumb swipe, which reads as the drawer being broken/detached from the
     page rather than an intentional overlay. */
  body.dg-nav-open { overflow: hidden; }

  .dg-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .dg-nav__list li + li { border-top: 1px solid var(--dg-line-soft); }
  .dg-nav__list a {
    padding: var(--dg-space-3) 0;
    font-size: var(--dg-text-base);
    font-weight: 600;
  }
  .dg-nav__list a::after { display: none; }

  .dg-nav__actions { flex-direction: column; align-items: stretch; gap: var(--dg-space-3); }
  .dg-nav-search { width: 100%; padding: 5px 5px 5px var(--dg-space-4); }
  .dg-nav-search input { width: 100%; font-size: var(--dg-text-base); }
  .dg-nav-search button { width: 36px; height: 36px; }
}

/* ---------- Page header (title + breadcrumb block) ---------- */

/**
 * Every non-home page opens with the same block: breadcrumb, title,
 * optional one-line context, optional actions. Having one component means
 * "where am I / what is this / what can I do" always sits in the same
 * place, which is the whole point of an orientation zone.
 */
.dg-page-header {
  padding-block: var(--dg-space-6) var(--dg-space-5);
  border-bottom: 1px solid var(--dg-line);
  background: var(--dg-surface);
}
.dg-page-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--dg-space-4);
}
.dg-page-header__text { min-width: 0; flex: 1 1 24rem; }
.dg-page-header__eyebrow {
  margin: 0 0 var(--dg-space-2);
  font-size: var(--dg-text-sm);
  font-weight: 600;
  color: var(--dg-maroon);
}
.dg-page-header h1 { margin-bottom: 0; }
.dg-page-header__lead {
  margin: var(--dg-space-3) 0 0;
  max-width: 62ch;
  color: var(--dg-ink-muted);
  font-size: var(--dg-text-md);
  line-height: var(--dg-leading-relaxed);
}
.dg-page-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--dg-space-2);
  margin-top: var(--dg-space-4);
}
.dg-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--dg-space-3);
  flex-shrink: 0;
}
.dg-page-header .dg-breadcrumbs { padding-top: 0; }

/* ---------- Breadcrumbs ---------- */

.dg-breadcrumbs { padding: var(--dg-space-2) 0 var(--dg-space-3); }
.dg-breadcrumbs ol {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: var(--dg-space-1) var(--dg-space-2);
  list-style: none; margin: 0; padding: 0;
  font-size: var(--dg-text-xs);
  color: var(--dg-ink-muted);
}
.dg-breadcrumbs li { display: flex; align-items: center; gap: var(--dg-space-2); min-width: 0; }
.dg-breadcrumbs li:not(:last-child)::after {
  content: "";
  flex-shrink: 0;
  width: 5px; height: 5px;
  border-right: 1.5px solid var(--dg-line-strong);
  border-top: 1.5px solid var(--dg-line-strong);
  transform: rotate(45deg);
}
.dg-breadcrumbs a {
  color: var(--dg-ink-muted);
  text-decoration: none;
  border-radius: var(--dg-radius-xs);
  transition: color var(--dg-transition);
}
.dg-breadcrumbs a:hover { color: var(--dg-maroon); text-decoration: underline; text-underline-offset: 3px; }
.dg-breadcrumbs [aria-current="page"] {
  color: var(--dg-maroon-deep);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 22ch;
}
/* Phones: the trail scrolls sideways inside its own rail rather than
   wrapping to three lines above the title. */
@media (max-width: 600px) {
  .dg-breadcrumbs ol {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .dg-breadcrumbs ol::-webkit-scrollbar { display: none; }
  .dg-breadcrumbs li { flex-shrink: 0; }
}

/* ---------- Footer ---------- */

.dg-site-footer {
  margin-top: var(--dg-space-10);
  background: var(--dg-maroon-deep);
  color: var(--dg-surface);
  padding: var(--dg-space-8) 0 var(--dg-space-5);
}
.dg-site-footer a { color: var(--dg-surface); }
.dg-site-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--dg-space-6);
  padding-bottom: var(--dg-space-6);
  border-bottom: 1px solid rgba(255,255,255,0.14);
}
@media (min-width: 700px) {
  .dg-site-footer__inner { grid-template-columns: 1.4fr 1fr 1fr; gap: var(--dg-space-6) var(--dg-space-8); }
}
@media (min-width: 1000px) {
  .dg-site-footer__inner { grid-template-columns: 1.6fr 1fr 1fr 1fr; }
}

.dg-site-footer__brand .dg-logo__text { color: var(--dg-surface); }
.dg-logo--footer { margin-bottom: var(--dg-space-2); }
.dg-logo--footer .dg-logo__mark { width: 38px; height: 38px; filter: none; }
.dg-site-footer__tagline {
  max-width: 34ch;
  color: rgba(255,255,255,0.72);
  font-size: var(--dg-text-sm);
  line-height: var(--dg-leading-relaxed);
  margin-top: var(--dg-space-2);
}

.dg-site-footer__col-title {
  margin: 0 0 var(--dg-space-3);
  font-family: var(--dg-font-body);
  font-size: var(--dg-text-sm);
  font-weight: 700;
  color: var(--dg-gold);
}
.dg-site-footer__list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: var(--dg-space-2);
  font-size: var(--dg-text-sm);
}
.dg-site-footer__list a {
  text-decoration: none;
  color: rgba(255,255,255,0.8);
  transition: color var(--dg-transition);
}
.dg-site-footer__list a:hover { color: var(--dg-surface); text-decoration: underline; text-underline-offset: 3px; }

.dg-site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--dg-space-3);
  padding-top: var(--dg-space-5);
}
.dg-site-footer__copyright {
  margin: 0;
  font-size: var(--dg-text-xs);
  color: rgba(255,255,255,0.58);
}

/* Phone footer: the previous pass already tightened padding, but the real
   height cost on mobile is each link sitting on its own line across three
   columns of 4–8 items — that's 200px+ per column no matter how tight the
   padding is. So below 699px the lists wrap horizontally like a tag flow
   instead of stacking vertically, the tagline (decorative, not essential)
   is dropped, and the footer collapses to brand + a compact row of link
   groups + copyright. */
@media (max-width: 699px) {
  .dg-site-footer { padding-top: var(--dg-space-5); padding-bottom: var(--dg-space-3); }
  .dg-site-footer__inner,
  .dg-site-footer__bottom { padding-inline: 0; }
  .dg-site-footer__inner {
    grid-template-columns: 1fr;
    gap: var(--dg-space-3);
    padding-bottom: var(--dg-space-4);
  }
  .dg-site-footer__brand { grid-column: 1 / -1; }
  .dg-site-footer__tagline { display: none; }
  .dg-logo--footer { margin-bottom: 0; }
  .dg-logo--footer .dg-logo__mark { width: 28px; height: 28px; }
  .dg-site-footer__col-title { margin-bottom: var(--dg-space-1); font-size: var(--dg-text-xs); }
  .dg-site-footer__list {
    flex-direction: row;
    flex-wrap: wrap;
    row-gap: 2px;
    column-gap: var(--dg-space-4);
  }
  .dg-site-footer__list a { padding-block: 4px; font-size: var(--dg-text-xs); }
  .dg-site-footer__bottom { padding-top: var(--dg-space-2); justify-content: center; text-align: center; }
}

/* ---------- Section rhythm shared by templates ---------- */

.dg-section { padding-block: var(--dg-section-y); }
.dg-section--tight { padding-block: var(--dg-section-y-tight); }
.dg-section--flush-top { padding-top: 0; }

.dg-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--dg-space-3) var(--dg-space-5);
  margin-bottom: var(--dg-space-5);
}
.dg-section__head > div { min-width: 0; }
.dg-section__head h2 { margin-bottom: 0; }
.dg-section__head p {
  margin: var(--dg-space-2) 0 0;
  max-width: 58ch;
  color: var(--dg-ink-muted);
  font-size: var(--dg-text-sm);
}
.dg-section__head--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.dg-section__head--center p { text-align: center; }

.dg-section__link {
  flex-shrink: 0;
  font-size: var(--dg-text-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.dg-section__link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* A panel wrapping a whole section (used by "Popular resources" so it reads
   as a different kind of shelf from "Latest" without changing card style).
   A light maroon wash rather than a neutral beige tint, so the contrast
   against the white page reads as brand color, not just "greyed out". */
.dg-panel {
  background: var(--dg-maroon-tint-06);
  border: 1px solid var(--dg-maroon-tint-10);
  border-radius: var(--dg-radius-lg);
  padding: var(--dg-space-6) var(--dg-space-5);
}
@media (min-width: 900px) { .dg-panel { padding: var(--dg-space-7); } }

/* ---------- Prose (the_content() output) ---------- */

.dg-post-content,
.dg-resource-intro__body {
  color: var(--dg-ink);
  font-size: var(--dg-text-md);
  line-height: var(--dg-leading-relaxed);
}
.dg-post-content > *,
.dg-resource-intro__body > * { margin-bottom: var(--dg-space-4); }
.dg-post-content > *:last-child,
.dg-resource-intro__body > *:last-child { margin-bottom: 0; }
.dg-post-content h2, .dg-resource-intro__body h2 { margin-top: var(--dg-space-7); }
.dg-post-content h3, .dg-resource-intro__body h3 { margin-top: var(--dg-space-6); }
.dg-post-content ul, .dg-post-content ol,
.dg-resource-intro__body ul, .dg-resource-intro__body ol { padding-left: var(--dg-space-5); }
.dg-post-content li, .dg-resource-intro__body li { margin-bottom: var(--dg-space-2); }
.dg-post-content img, .dg-resource-intro__body img { border-radius: var(--dg-radius); }
.dg-post-content a, .dg-resource-intro__body a { color: var(--dg-maroon); text-underline-offset: 3px; }
.dg-post-content blockquote, .dg-resource-intro__body blockquote {
  margin-inline: 0;
  padding: var(--dg-space-2) 0 var(--dg-space-2) var(--dg-space-5);
  border-left: 3px solid var(--dg-gold);
  color: var(--dg-ink-muted);
}
.dg-post-content code, .dg-resource-intro__body code {
  padding: 2px 6px;
  border-radius: var(--dg-radius-xs);
  background: var(--dg-surface-sunken);
  font-size: 0.9em;
}
/* Wide content scrolls inside its own rail so the page body never scrolls
   sideways on a phone. */
.dg-post-content table, .dg-resource-intro__body table { width: 100%; border-collapse: collapse; font-size: var(--dg-text-sm); }
.dg-post-content th, .dg-post-content td,
.dg-resource-intro__body th, .dg-resource-intro__body td {
  padding: var(--dg-space-3);
  border: 1px solid var(--dg-line);
  text-align: left;
}
.dg-post-content th, .dg-resource-intro__body th { background: var(--dg-surface-alt); }
.dg-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- Pagination ---------- */

.dg-post-content .navigation,
.pagination, .navigation.pagination { margin-top: var(--dg-space-7); }
.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--dg-space-2);
}
.nav-links .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px; height: 42px;
  padding-inline: var(--dg-space-3);
  border: 1px solid var(--dg-line);
  border-radius: var(--dg-radius-sm);
  background: var(--dg-surface);
  color: var(--dg-ink);
  font-size: var(--dg-text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--dg-transition), background var(--dg-transition), color var(--dg-transition);
}
.nav-links .page-numbers:hover { border-color: var(--dg-maroon); color: var(--dg-maroon); }
.nav-links .page-numbers.current {
  background: var(--dg-maroon);
  border-color: var(--dg-maroon);
  color: var(--dg-surface);
}
.nav-links .page-numbers.dots { border-color: transparent; background: transparent; }
