@charset "UTF-8";
/* ==========================================================================
   egadgets4me — theme.css
   A troubleshooting library. Engineering-handbook typography, information
   density, colour used strictly as signal.

   No remote assets. No @import. System font stacks only.

   Contents
     01  Reset & box model
     02  Design tokens (light is the source of truth)
     03  Dark theme (system preference, then manual override)
     04  Base elements
     05  Utilities  .eg-wrap .eg-visually-hidden .eg-skip .eg-card--hidden
     06  Header, nav, toggles
     07  Footer
     08  Home — hero & search
     09  Home — lanes
     10  Home — sections & card grid
     11  Article — layout, head, chips
     12  Article — .eg-prose (raw WordPress content)
     13  Post-body — .eg-symptom
     14  Post-body — .eg-fix
     15  Post-body — .eg-cmd
     16  Post-body — .eg-note
     17  Aside — table of contents
     18  Pager
     19  Archive / search — hub, filters, results, pagination
     20  Reduced motion, forced colours, print
   ========================================================================== */


/* ==========================================================================
   01  RESET & BOX MODEL
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  tab-size: 4;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol, pre { margin: 0; }

ul[class], ol[class] { padding-left: 0; list-style: none; }

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button { background: none; border: 0; padding: 0; }

table { border-collapse: collapse; border-spacing: 0; }

/* Grid and flex children must be allowed to shrink, or long <pre> and wide
   tables push the page sideways. This single rule prevents most horizontal
   scroll bugs on this theme. */
.eg-layout > *,
.eg-lanes > *,
.eg-cards > *,
.eg-results > *,
.eg-header__inner > *,
.eg-footer__inner > * { min-width: 0; }


/* ==========================================================================
   02  DESIGN TOKENS
   Every colour is defined here, in the light theme, unconditionally.
   No colour's only definition lives inside a media query.
   ========================================================================== */

:root {
  /* -- Type stacks ------------------------------------------------------- */
  --eg-font-sans:
    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", "Liberation Sans", Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
  --eg-font-mono:
    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "DejaVu Sans Mono", "Liberation Mono", "Courier New", monospace;

  /* -- Fluid type scale -------------------------------------------------- */
  --eg-text-xs:   0.75rem;                                  /* 12 */
  --eg-text-sm:   0.8125rem;                                /* 13 */
  --eg-text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem); /* 16 -> 17 */
  --eg-text-md:   clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem);
  --eg-text-lg:   clamp(1.1875rem, 1.12rem + 0.35vw, 1.375rem);
  --eg-text-xl:   clamp(1.375rem, 1.26rem + 0.55vw, 1.75rem);
  --eg-text-2xl:  clamp(1.625rem, 1.42rem + 1vw, 2.25rem);
  --eg-text-3xl:  clamp(1.9375rem, 1.6rem + 1.7vw, 2.875rem);

  --eg-lh-tight: 1.18;
  --eg-lh-snug:  1.35;
  --eg-lh-body:  1.62;
  --eg-lh-loose: 1.75;

  --eg-track-caps: 0.08em;
  --eg-track-tight: -0.011em;

  /* -- Measure & layout -------------------------------------------------- */
  --eg-measure: 72ch;
  --eg-wrap-max: 76rem;
  --eg-gutter: clamp(1rem, 0.6rem + 2vw, 2rem);
  --eg-aside-width: 16.5rem;
  --eg-header-height: 3.75rem;

  /* -- Space scale ------------------------------------------------------- */
  --eg-space-1: 0.25rem;
  --eg-space-2: 0.5rem;
  --eg-space-3: 0.75rem;
  --eg-space-4: 1rem;
  --eg-space-5: 1.5rem;
  --eg-space-6: 2rem;
  --eg-space-7: 2.75rem;
  --eg-space-8: 4rem;
  --eg-space-9: 6rem;

  /* -- Radius & lines ---------------------------------------------------- */
  --eg-radius-sm: 3px;
  --eg-radius-md: 6px;
  --eg-radius-lg: 10px;
  --eg-radius-pill: 999px;
  --eg-hairline: 1px;

  /* -- Motion ------------------------------------------------------------ */
  --eg-dur-fast: 90ms;
  --eg-dur: 160ms;
  --eg-ease: cubic-bezier(0.2, 0, 0.2, 1);

  /* -- Neutral surfaces (warm paper, not clinical white) ----------------- */
  --eg-bg:          #fbfaf8;
  --eg-bg-sunken:   #f2f0ec;
  --eg-surface:     #ffffff;
  --eg-surface-2:   #f6f4f1;
  --eg-surface-3:   #ecebe6;

  /* -- Ink --------------------------------------------------------------- */
  --eg-ink:         #16191d;  /* 15.6:1 on --eg-bg */
  --eg-ink-2:       #3d444d;  /*  9.6:1 */
  --eg-ink-3:       #646c76;  /*  5.1:1 — smallest permitted body colour */
  --eg-ink-inverse: #ffffff;

  /* -- Rules ------------------------------------------------------------- */
  --eg-rule:        #ddd9d2;
  --eg-rule-strong: #c2bcb2;

  /* -- Accent: interactive & brand (steel cobalt) ------------------------ */
  --eg-accent:       #0a5ba9;  /* 6.4:1 on --eg-bg */
  --eg-accent-hover: #08487f;
  --eg-accent-ink:   #ffffff;
  --eg-accent-soft:  #e8f0f9;
  --eg-accent-line:  #a9c8e6;

  /* -- Signal: problem / symptom (brick) --------------------------------- */
  --eg-danger:      #b3261e;  /* 6.3:1 on --eg-bg */
  --eg-danger-ink:  #8d1c16;
  --eg-danger-soft: #fdeeec;
  --eg-danger-line: #eab7b2;

  /* -- Signal: resolution / success (evergreen) -------------------------- */
  --eg-success:      #1f6b3f;  /* 6.3:1 on --eg-bg */
  --eg-success-ink:  #17532f;
  --eg-success-soft: #e9f4ec;
  --eg-success-line: #a9cfb7;

  /* -- Signal: quoted output / caution (ochre) --------------------------- */
  --eg-note:      #8a5a06;  /* 5.7:1 on --eg-bg */
  --eg-note-ink:  #6d4705;
  --eg-note-soft: #fbf3e2;
  --eg-note-line: #e0c894;

  /* -- Terminal surface. Intentionally dark in BOTH themes: a command
        block should read as a terminal, not as a paragraph. ------------- */
  --eg-code-bg:      #161618;
  --eg-code-bar:     #202024;
  --eg-code-ink:     #eaeaeb;
  --eg-code-ink-2:   #9d9da2;
  --eg-code-rule:    #303035;
  --eg-code-accent:  #85c0f7;

  /* Inline code inside prose stays on paper, not on terminal black. */
  --eg-inline-code-bg:   #f0eee9;
  --eg-inline-code-ink:  #8a2f26;
  --eg-inline-code-line: #ddd9d2;

  /* -- Focus & selection ------------------------------------------------- */
  --eg-focus:      #0a5ba9;
  --eg-focus-halo: #ffffff;
  --eg-select-bg:  #cfe1f5;
  --eg-select-ink: #0d1116;

  /* -- Elevation --------------------------------------------------------- */
  --eg-shadow-1: 0 1px 2px rgba(20, 24, 30, 0.06);
  --eg-shadow-2: 0 2px 4px rgba(20, 24, 30, 0.06),
                 0 8px 20px -12px rgba(20, 24, 30, 0.28);
  --eg-shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  color-scheme: light;
}


/* ==========================================================================
   03  DARK THEME
   Opt-in only. The site defaults to light for everyone, including visitors
   whose system is set to dark, and switches only when the header toggle has
   stored a choice (the inline script in functions.php stamps data-theme
   before first paint). Restoring "follow the system" means adding back a
   @media (prefers-color-scheme: dark) copy of this block, guarded as
   :root:not([data-theme="light"]).
   ========================================================================== */

:root[data-theme="dark"] {
  --eg-bg:          #141416;
  --eg-bg-sunken:   #0e0e10;
  --eg-surface:     #1d1d20;
  --eg-surface-2:   #26262a;
  --eg-surface-3:   #303035;

  --eg-ink:         #ededee;
  --eg-ink-2:       #bcbcc0;
  --eg-ink-3:       #96969c;
  --eg-ink-inverse: #141416;

  --eg-rule:        #38383e;
  --eg-rule-strong: #4a4a52;

  --eg-accent:       #7cb8f5;
  --eg-accent-hover: #a3cdf9;
  --eg-accent-ink:   #08182b;
  --eg-accent-soft:  #10233a;
  --eg-accent-line:  #2c4d76;

  --eg-danger:      #ff9b90;
  --eg-danger-ink:  #ffb8b0;
  --eg-danger-soft: #2a1512;
  --eg-danger-line: #61302a;

  --eg-success:      #6fd48c;
  --eg-success-ink:  #96e2ab;
  --eg-success-soft: #10241a;
  --eg-success-line: #2c5a3e;

  --eg-note:      #e8bd66;
  --eg-note-ink:  #f0d091;
  --eg-note-soft: #241c0c;
  --eg-note-line: #574321;

  --eg-code-bg:     #070708;
  --eg-code-bar:    #131315;
  --eg-code-ink:    #eaeaeb;
  --eg-code-ink-2:  #9d9da2;
  --eg-code-rule:   #26262a;
  --eg-code-accent: #85c0f7;

  --eg-inline-code-bg:   #26262a;
  --eg-inline-code-ink:  #ffab9f;
  --eg-inline-code-line: #38383e;

  --eg-focus:      #8ec2f7;
  --eg-focus-halo: #141416;
  --eg-select-bg:  #234066;
  --eg-select-ink: #f2f2f3;

  --eg-shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --eg-shadow-2: 0 2px 4px rgba(0, 0, 0, 0.45),
                 0 10px 24px -14px rgba(0, 0, 0, 0.9);
  --eg-shadow-inset-top: inset 0 1px 0 rgba(255, 255, 255, 0.04);

  color-scheme: dark;
}


/* ==========================================================================
   04  BASE ELEMENTS
   ========================================================================== */

html { background-color: var(--eg-bg); }

body {
  margin: 0;
  background-color: var(--eg-bg);
  color: var(--eg-ink);
  font-family: var(--eg-font-sans);
  font-size: var(--eg-text-base);
  line-height: var(--eg-lh-body);
  letter-spacing: var(--eg-track-tight);
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

::selection {
  background-color: var(--eg-select-bg);
  color: var(--eg-select-ink);
}

a {
  color: var(--eg-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--eg-accent) 45%, transparent);
  transition: color var(--eg-dur) var(--eg-ease),
              text-decoration-color var(--eg-dur) var(--eg-ease);
}

a:hover {
  color: var(--eg-accent-hover);
  text-decoration-color: currentColor;
}

/* One focus treatment for the whole theme: a solid ring plus a halo so it
   stays visible on both paper and terminal-black surfaces. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--eg-focus);
  outline-offset: 2px;
  border-radius: var(--eg-radius-sm);
  box-shadow: 0 0 0 4px var(--eg-focus-halo);
}

:where(a, button, input, select, textarea, summary):focus:not(:focus-visible) {
  outline: none;
}

hr {
  height: 0;
  margin: var(--eg-space-6) 0;
  border: 0;
  border-top: var(--eg-hairline) solid var(--eg-rule);
}

strong, b { font-weight: 650; }

small { font-size: var(--eg-text-sm); }

code, kbd, samp, pre {
  font-family: var(--eg-font-mono);
  font-size: 0.9em;
  font-variant-ligatures: none;
}

kbd {
  display: inline-block;
  padding: 0.05em 0.4em;
  border: var(--eg-hairline) solid var(--eg-rule-strong);
  border-bottom-width: 2px;
  border-radius: var(--eg-radius-sm);
  background-color: var(--eg-surface-2);
  color: var(--eg-ink);
  font-size: 0.82em;
  line-height: 1.5;
  white-space: nowrap;
}


/* ==========================================================================
   05  UTILITIES
   ========================================================================== */

.eg-wrap {
  width: 100%;
  max-width: var(--eg-wrap-max);
  margin-inline: auto;
  padding-inline: var(--eg-gutter);
}

.eg-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link: off-canvas until focused, then pinned top-left. */
.eg-skip {
  position: absolute;
  top: 0;
  left: var(--eg-space-3);
  z-index: 100;
  transform: translateY(-120%);
  padding: var(--eg-space-2) var(--eg-space-4);
  border: var(--eg-hairline) solid var(--eg-accent);
  border-top: 0;
  border-radius: 0 0 var(--eg-radius-md) var(--eg-radius-md);
  background-color: var(--eg-accent);
  color: var(--eg-accent-ink);
  font-size: var(--eg-text-sm);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--eg-dur) var(--eg-ease);
}

.eg-skip:focus,
.eg-skip:focus-visible {
  transform: translateY(0);
  color: var(--eg-accent-ink);
}

/* Filter utility — JS hides non-matching cards with this class. */
.eg-card--hidden { display: none !important; }

[hidden] { display: none !important; }


/* ==========================================================================
   06  HEADER, NAV, TOGGLES
   ========================================================================== */

.eg-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--eg-bg);
  border-bottom: var(--eg-hairline) solid var(--eg-rule);
}

.eg-header__inner {
  display: flex;
  align-items: center;
  gap: var(--eg-space-4);
  width: 100%;
  max-width: var(--eg-wrap-max);
  margin-inline: auto;
  min-height: var(--eg-header-height);
  padding-inline: var(--eg-gutter);
}

.eg-logo {
  flex: 0 0 auto;
  margin-right: auto;
  color: var(--eg-ink);
  font-size: var(--eg-text-md);
  font-weight: 680;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.eg-logo:hover { color: var(--eg-ink); }

/* A single accent tick before the wordmark — the only decoration in the
   header. Cheap, and it makes the brand read as a mark, not just text. */
.eg-logo::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.5rem;
  border-radius: 1px;
  background-color: var(--eg-accent);
  vertical-align: baseline;
}

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

.eg-nav__link {
  display: inline-block;
  padding: var(--eg-space-2) var(--eg-space-3);
  border-radius: var(--eg-radius-md);
  color: var(--eg-ink-2);
  font-size: var(--eg-text-sm);
  font-weight: 560;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--eg-dur) var(--eg-ease),
              color var(--eg-dur) var(--eg-ease);
}

.eg-nav__link:hover {
  background-color: var(--eg-surface-2);
  color: var(--eg-ink);
}

.eg-nav__link--active {
  color: var(--eg-ink);
  background-color: var(--eg-surface-2);
  box-shadow: inset 0 -2px 0 var(--eg-accent);
}

/* Square icon buttons, matched so they sit as a pair. */
.eg-theme-toggle,
.eg-menu-toggle {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-surface);
  color: var(--eg-ink-2);
  cursor: pointer;
  line-height: 1;
  transition: background-color var(--eg-dur) var(--eg-ease),
              border-color var(--eg-dur) var(--eg-ease),
              color var(--eg-dur) var(--eg-ease);
}

.eg-theme-toggle:hover,
.eg-menu-toggle:hover {
  border-color: var(--eg-rule-strong);
  background-color: var(--eg-surface-2);
  color: var(--eg-ink);
}

.eg-theme-toggle svg,
.eg-menu-toggle svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eg-menu-toggle { display: none; }

/* Mobile: the nav collapses only when a toggle actually exists in the
   header, so the menu can never become unreachable if the JS never runs. */
@media (max-width: 47.99em) {
  .eg-menu-toggle { display: inline-grid; }

  .eg-header:has(.eg-menu-toggle) .eg-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--eg-space-2) var(--eg-gutter) var(--eg-space-4);
    background-color: var(--eg-bg);
    border-bottom: var(--eg-hairline) solid var(--eg-rule);
    box-shadow: var(--eg-shadow-2);
  }

  .eg-header:has(.eg-menu-toggle[aria-expanded="true"]) .eg-nav { display: flex; }

  .eg-nav__link {
    padding: var(--eg-space-3) var(--eg-space-2);
    font-size: var(--eg-text-base);
    border-bottom: var(--eg-hairline) solid var(--eg-rule);
    border-radius: 0;
  }

  .eg-nav__link--active { box-shadow: inset 3px 0 0 var(--eg-accent); }
}

@media (min-width: 48em) {
  .eg-nav { gap: var(--eg-space-1); }
}


/* ==========================================================================
   07  FOOTER
   ========================================================================== */

.eg-footer {
  margin-top: var(--eg-space-9);
  border-top: var(--eg-hairline) solid var(--eg-rule);
  background-color: var(--eg-bg-sunken);
  color: var(--eg-ink-2);
  font-size: var(--eg-text-sm);
}

.eg-footer__inner {
  display: grid;
  gap: var(--eg-space-6);
  grid-template-columns: 1fr;
  width: 100%;
  max-width: var(--eg-wrap-max);
  margin-inline: auto;
  padding: var(--eg-space-7) var(--eg-gutter) var(--eg-space-8);
}

@media (min-width: 40em) {
  .eg-footer__inner { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64em) {
  .eg-footer__inner {
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: var(--eg-space-7);
  }
}

.eg-footer__col > :is(h2, h3, p:first-child strong) {
  margin-bottom: var(--eg-space-3);
  color: var(--eg-ink);
  font-size: var(--eg-text-xs);
  font-weight: 650;
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
}

.eg-footer__col ul { margin: 0; padding: 0; list-style: none; }

.eg-footer__col li + li { margin-top: var(--eg-space-2); }

.eg-footer__col a {
  color: var(--eg-ink-2);
  text-decoration: none;
}

.eg-footer__col a:hover {
  color: var(--eg-accent);
  text-decoration: underline;
}

.eg-footer__col p { color: var(--eg-ink-3); }


/* ==========================================================================
   08  HOME — HERO & SEARCH
   No marketing hero. A title, one line of orientation, a search field,
   and real example queries. The page's job is to route someone who is
   already annoyed.
   ========================================================================== */

.eg-hero {
  padding-block: var(--eg-space-7) var(--eg-space-6);
  border-bottom: var(--eg-hairline) solid var(--eg-rule);
}

.eg-hero__title {
  max-width: 20ch;
  font-size: var(--eg-text-3xl);
  font-weight: 700;
  line-height: var(--eg-lh-tight);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.eg-hero__sub {
  max-width: 58ch;
  margin-top: var(--eg-space-3);
  color: var(--eg-ink-2);
  font-size: var(--eg-text-md);
  line-height: var(--eg-lh-snug);
  text-wrap: pretty;
}

.eg-hero__examples {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--eg-space-2);
  margin-top: var(--eg-space-4);
  color: var(--eg-ink-3);
  font-size: var(--eg-text-sm);
}

.eg-hero__examples a {
  color: var(--eg-ink-2);
  font-family: var(--eg-font-mono);
  font-size: 0.92em;
  text-decoration: none;
  padding: 0.15em 0.5em;
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-sm);
  background-color: var(--eg-surface);
  white-space: nowrap;
  transition: border-color var(--eg-dur) var(--eg-ease),
              color var(--eg-dur) var(--eg-ease);
}

.eg-hero__examples a:hover {
  border-color: var(--eg-accent-line);
  color: var(--eg-accent);
}

/* -- Search form --------------------------------------------------------- */

.eg-searchform {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--eg-space-2);
  max-width: 42rem;
  margin-top: var(--eg-space-5);
}

.eg-searchform__input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: var(--eg-hairline) solid var(--eg-rule-strong);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-surface);
  color: var(--eg-ink);
  font-size: var(--eg-text-base);
  box-shadow: var(--eg-shadow-1);
  transition: border-color var(--eg-dur) var(--eg-ease),
              box-shadow var(--eg-dur) var(--eg-ease);
  appearance: none;
}

.eg-searchform__input::placeholder {
  color: var(--eg-ink-3);
  opacity: 1;
}

.eg-searchform__input:hover { border-color: var(--eg-ink-3); }

.eg-searchform__input:focus-visible {
  border-color: var(--eg-accent);
  outline-offset: 1px;
}

.eg-searchform__submit {
  padding: 0.7rem 1.15rem;
  border: var(--eg-hairline) solid var(--eg-accent);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-accent);
  color: var(--eg-accent-ink);
  font-size: var(--eg-text-sm);
  font-weight: 620;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--eg-dur) var(--eg-ease),
              border-color var(--eg-dur) var(--eg-ease);
}

.eg-searchform__submit:hover {
  background-color: var(--eg-accent-hover);
  border-color: var(--eg-accent-hover);
}

.eg-searchform__submit:active { transform: translateY(1px); }


/* ==========================================================================
   09  HOME — LANES (platform entry points)
   ========================================================================== */

.eg-lanes {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--eg-space-4);
  margin-top: var(--eg-space-5);
}

@media (min-width: 34em) {
  .eg-lanes { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
}

.eg-lane {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--eg-space-4) var(--eg-space-4) var(--eg-space-4);
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-lg);
  background-color: var(--eg-surface);
  box-shadow: var(--eg-shadow-1);
  transition: border-color var(--eg-dur) var(--eg-ease),
              box-shadow var(--eg-dur) var(--eg-ease),
              transform var(--eg-dur) var(--eg-ease);
}

.eg-lane:hover {
  border-color: var(--eg-rule-strong);
  box-shadow: var(--eg-shadow-2);
  transform: translateY(-1px);
}

.eg-lane__icon {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: var(--eg-space-3);
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-surface-2);
  color: var(--eg-ink-2);
  font-size: var(--eg-text-sm);
  font-weight: 650;
}

.eg-lane__icon svg,
.eg-lane__icon img {
  width: 1.25rem;
  height: 1.25rem;
}

.eg-lane__icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.eg-lane__title {
  font-size: var(--eg-text-md);
  font-weight: 660;
  line-height: var(--eg-lh-snug);
  letter-spacing: -0.015em;
}

.eg-lane__title a {
  color: var(--eg-ink);
  text-decoration: none;
}

/* Whole-card hit area, without nesting interactive elements. */
.eg-lane__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.eg-lane:hover .eg-lane__title a { color: var(--eg-accent); }

.eg-lane__count {
  margin-top: var(--eg-space-1);
  color: var(--eg-ink-3);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  letter-spacing: 0.02em;
}

.eg-lane__links {
  margin: var(--eg-space-3) 0 0;
  padding: var(--eg-space-3) 0 0;
  border-top: var(--eg-hairline) solid var(--eg-rule);
  list-style: none;
  font-size: var(--eg-text-sm);
}

.eg-lane__links li + li { margin-top: var(--eg-space-2); }

.eg-lane__links a {
  position: relative;
  z-index: 1;
  color: var(--eg-ink-2);
  text-decoration: none;
}

.eg-lane__links a:hover {
  color: var(--eg-accent);
  text-decoration: underline;
}


/* ==========================================================================
   10  HOME — SECTIONS & CARD GRID
   ========================================================================== */

.eg-section { padding-block: var(--eg-space-7); }

.eg-section + .eg-section { padding-top: 0; }

.eg-section__title {
  display: flex;
  align-items: center;
  gap: var(--eg-space-3);
  margin-bottom: var(--eg-space-5);
  color: var(--eg-ink);
  font-size: var(--eg-text-xs);
  font-weight: 680;
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
}

/* Rule that runs out from the label to the edge — handbook chapter marker. */
.eg-section__title::after {
  content: "";
  flex: 1 1 auto;
  height: var(--eg-hairline);
  background-color: var(--eg-rule);
}

.eg-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--eg-space-4);
}

@media (min-width: 34em) {
  .eg-cards { grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); }
}

.eg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--eg-space-2);
  padding: var(--eg-space-4);
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-lg);
  background-color: var(--eg-surface);
  transition: border-color var(--eg-dur) var(--eg-ease),
              box-shadow var(--eg-dur) var(--eg-ease);
}

.eg-card:hover {
  border-color: var(--eg-rule-strong);
  box-shadow: var(--eg-shadow-2);
}

.eg-card:focus-within {
  border-color: var(--eg-accent-line);
}

.eg-card__kicker {
  color: var(--eg-accent);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.eg-card__title {
  font-size: var(--eg-text-md);
  font-weight: 640;
  line-height: var(--eg-lh-snug);
  letter-spacing: -0.015em;
  text-wrap: pretty;
}

.eg-card__title a {
  color: var(--eg-ink);
  text-decoration: none;
}

.eg-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.eg-card:hover .eg-card__title a { color: var(--eg-accent); }

.eg-card__excerpt {
  color: var(--eg-ink-2);
  font-size: var(--eg-text-sm);
  line-height: var(--eg-lh-snug);
  /* Keep the grid tidy: three lines, then stop. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eg-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--eg-space-2);
  margin-top: auto;
  padding-top: var(--eg-space-3);
  border-top: var(--eg-hairline) solid var(--eg-rule);
  color: var(--eg-ink-3);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  letter-spacing: 0.01em;
}

.eg-card__meta > * + *::before {
  content: "·";
  margin-right: var(--eg-space-2);
  color: var(--eg-rule-strong);
}


/* ==========================================================================
   11  ARTICLE — LAYOUT, HEAD, CHIPS
   ========================================================================== */

.eg-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--eg-space-6);
  align-items: start;
  padding-block: var(--eg-space-6) var(--eg-space-8);
}

@media (min-width: 56.25em) {  /* ~900px */
  .eg-layout {
    grid-template-columns: minmax(0, 1fr) var(--eg-aside-width);
    gap: var(--eg-space-8);
  }
}

.eg-article {
  max-width: var(--eg-measure);
  min-width: 0;
}

.eg-article__head {
  padding-bottom: var(--eg-space-5);
  margin-bottom: var(--eg-space-6);
  border-bottom: 2px solid var(--eg-rule);
}

.eg-article__title {
  font-size: var(--eg-text-2xl);
  font-weight: 700;
  line-height: var(--eg-lh-tight);
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.eg-article__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--eg-space-2) var(--eg-space-3);
  margin-top: var(--eg-space-3);
  color: var(--eg-ink-3);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  letter-spacing: 0.02em;
}

.eg-article__meta a { color: var(--eg-ink-2); text-decoration: none; }
.eg-article__meta a:hover { color: var(--eg-accent); text-decoration: underline; }

/* "Applies to" strip — verified-scope line. Someone must be able to bail
   out in two seconds if their OS is not listed. */
.eg-applies {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--eg-space-2);
  margin-top: var(--eg-space-4);
}

.eg-applies__label {
  color: var(--eg-ink-3);
  font-size: var(--eg-text-xs);
  font-weight: 650;
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
}

.eg-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.2em 0.6em;
  border: var(--eg-hairline) solid var(--eg-rule-strong);
  border-radius: var(--eg-radius-pill);
  background-color: var(--eg-surface-2);
  color: var(--eg-ink-2);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  line-height: 1.7;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

a.eg-chip:hover {
  border-color: var(--eg-accent);
  color: var(--eg-accent);
  background-color: var(--eg-accent-soft);
}


/* ==========================================================================
   12  ARTICLE — .eg-prose  (raw WordPress content)
   Vertical rhythm is owned here, by margin-top on adjacent siblings, so
   whatever the editor emits still stacks correctly.
   ========================================================================== */

.eg-prose {
  max-width: var(--eg-measure);
  color: var(--eg-ink);
  font-size: var(--eg-text-base);
  line-height: var(--eg-lh-body);
}

.eg-prose > * + * { margin-top: var(--eg-space-4); }

.eg-prose p { text-wrap: pretty; }

.eg-prose :is(h2, h3, h4) {
  color: var(--eg-ink);
  line-height: var(--eg-lh-snug);
  letter-spacing: -0.018em;
  text-wrap: balance;
  scroll-margin-top: calc(var(--eg-header-height) + var(--eg-space-4));
}

.eg-prose > h2 {
  margin-top: var(--eg-space-7);
  padding-top: var(--eg-space-4);
  border-top: var(--eg-hairline) solid var(--eg-rule);
  font-size: var(--eg-text-xl);
  font-weight: 680;
}

.eg-prose > h3 {
  margin-top: var(--eg-space-6);
  font-size: var(--eg-text-lg);
  font-weight: 660;
}

.eg-prose > h4 {
  margin-top: var(--eg-space-5);
  font-size: var(--eg-text-md);
  font-weight: 660;
}

.eg-prose :is(h2, h3, h4) + * { margin-top: var(--eg-space-3); }

.eg-prose a {
  font-weight: 520;
  text-decoration: underline;
}

.eg-prose strong { color: var(--eg-ink); font-weight: 660; }

.eg-prose :is(ul, ol) {
  margin-top: var(--eg-space-3);
  padding-left: 1.5rem;
}

.eg-prose ul { list-style: square; }
.eg-prose ol { list-style: decimal; }

.eg-prose li + li { margin-top: var(--eg-space-2); }

.eg-prose li::marker {
  color: var(--eg-ink-3);
  font-family: var(--eg-font-mono);
  font-size: 0.9em;
}

.eg-prose :is(ul, ol) :is(ul, ol) {
  margin-top: var(--eg-space-2);
}

.eg-prose img,
.eg-prose figure img {
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-surface-2);
}

.eg-prose figure { margin: var(--eg-space-5) 0; }

.eg-prose figcaption {
  margin-top: var(--eg-space-2);
  color: var(--eg-ink-3);
  font-size: var(--eg-text-sm);
  line-height: var(--eg-lh-snug);
}

/* Inline code: paper-toned, never the terminal surface. */
.eg-prose :not(pre) > code {
  padding: 0.12em 0.36em;
  border: var(--eg-hairline) solid var(--eg-inline-code-line);
  border-radius: var(--eg-radius-sm);
  background-color: var(--eg-inline-code-bg);
  color: var(--eg-inline-code-ink);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

/* Bare <pre> straight out of the editor still has to behave. The component
   blocks below own their own chrome, so they are excluded here — otherwise
   .eg-prose pre out-specifies .eg-cmd__code and draws a second border. */
.eg-prose pre:not(.eg-cmd__code) {
  overflow-x: auto;
  padding: var(--eg-space-4);
  border: var(--eg-hairline) solid var(--eg-code-rule);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-code-bg);
  color: var(--eg-code-ink);
  font-size: var(--eg-text-sm);
  line-height: 1.55;
  -webkit-overflow-scrolling: touch;
}

.eg-prose pre:not(.eg-cmd__code) code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

/* Tables: displayed as a block so they scroll inside themselves instead of
   widening the page. Wide comparison tables are common in these posts. */
.eg-prose table {
  display: block;
  overflow-x: auto;
  /* fit-content, not max-content: a narrow table hugs its rows so the border
     is not left hanging past them, and a wide one clamps to the column and
     scrolls inside itself instead of widening the page. */
  width: fit-content;
  max-width: 100%;
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-md);
  font-size: var(--eg-text-sm);
  -webkit-overflow-scrolling: touch;
}

.eg-prose :is(th, td) {
  padding: var(--eg-space-2) var(--eg-space-3);
  border-bottom: var(--eg-hairline) solid var(--eg-rule);
  text-align: left;
  vertical-align: top;
}

.eg-prose th {
  background-color: var(--eg-surface-2);
  color: var(--eg-ink);
  font-weight: 650;
  font-size: var(--eg-text-xs);
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
  white-space: nowrap;
}

.eg-prose tbody tr:last-child :is(th, td) { border-bottom: 0; }

.eg-prose tbody tr:nth-child(even) { background-color: var(--eg-surface-2); }

.eg-prose blockquote:not(.eg-note) {
  padding: var(--eg-space-3) var(--eg-space-4);
  border-left: 3px solid var(--eg-rule-strong);
  color: var(--eg-ink-2);
  font-style: normal;
}

.eg-prose blockquote:not(.eg-note) > * + * { margin-top: var(--eg-space-3); }

.eg-prose hr { border-top-color: var(--eg-rule); }


/* ==========================================================================
   13  POST-BODY — .eg-symptom
   The problem statement. Red family, hard left edge, mono label. Should be
   identifiable as "this is what is wrong" from across the room.
   ========================================================================== */

.eg-symptom {
  margin-block: var(--eg-space-6);
  border: var(--eg-hairline) solid var(--eg-danger-line);
  border-left: 4px solid var(--eg-danger);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-danger-soft);
  color: var(--eg-ink);
  overflow: hidden;
}

.eg-symptom__label {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: var(--eg-space-2) var(--eg-space-4);
  border-bottom: var(--eg-hairline) solid var(--eg-danger-line);
  color: var(--eg-danger-ink);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  font-weight: 650;
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
}

/* Filled square marker rather than an emoji — prints, and never renders
   as a colour font. */
.eg-symptom__label::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 1px;
  background-color: var(--eg-danger);
  flex: 0 0 auto;
}

.eg-symptom__body {
  padding: var(--eg-space-4);
  font-size: var(--eg-text-base);
  line-height: var(--eg-lh-body);
}

.eg-symptom__body > * + * { margin-top: var(--eg-space-3); }

.eg-symptom__body :is(ul, ol) {
  margin: 0;
  padding-left: 1.25rem;
}

.eg-symptom__body ul { list-style: square; }

.eg-symptom__body li + li { margin-top: var(--eg-space-2); }

.eg-symptom__body li::marker { color: var(--eg-danger); }

.eg-symptom__body :not(pre) > code {
  padding: 0.12em 0.36em;
  border: var(--eg-hairline) solid var(--eg-danger-line);
  border-radius: var(--eg-radius-sm);
  background-color: var(--eg-surface);
  color: var(--eg-danger-ink);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.eg-symptom__body a { color: var(--eg-accent); }


/* ==========================================================================
   14  POST-BODY — .eg-fix
   The resolution. Its <ol> is the most important object on the site: the
   step numbers are large, boxed and connected by a spine, so someone can
   look away at a broken machine and find their place again.
   ========================================================================== */

.eg-fix {
  margin-block: var(--eg-space-6);
  border: var(--eg-hairline) solid var(--eg-success-line);
  border-left: 4px solid var(--eg-success);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-surface);
  overflow: hidden;
}

.eg-fix__label {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: var(--eg-space-2) var(--eg-space-4);
  border-bottom: var(--eg-hairline) solid var(--eg-success-line);
  background-color: var(--eg-success-soft);
  color: var(--eg-success-ink);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  font-weight: 650;
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
}

.eg-fix__label::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-radius: 1px;
  background-color: var(--eg-success);
  flex: 0 0 auto;
}

.eg-fix__body {
  padding: var(--eg-space-5) var(--eg-space-4);
  font-size: var(--eg-text-md);
  line-height: var(--eg-lh-loose);
}

.eg-fix__body > * + * { margin-top: var(--eg-space-4); }

/* -- The step list ------------------------------------------------------- */

.eg-fix__body ol {
  counter-reset: eg-step;
  margin: 0;
  padding: 0;
  list-style: none;
}

.eg-fix__body ol > li {
  position: relative;
  padding-left: 3.25rem;
  padding-bottom: var(--eg-space-5);
  min-height: 2.5rem;
}

.eg-fix__body ol > li:last-child { padding-bottom: 0; }

.eg-fix__body ol > li + li { margin-top: 0; }

/* Step number */
.eg-fix__body ol > li::before {
  counter-increment: eg-step;
  content: counter(eg-step);
  position: absolute;
  left: 0;
  top: -0.1em;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: var(--eg-hairline) solid var(--eg-success-line);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-success-soft);
  color: var(--eg-success-ink);
  font-family: var(--eg-font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* Spine connecting one step to the next */
.eg-fix__body ol > li::after {
  content: "";
  position: absolute;
  left: 1.125rem;
  top: 2.45rem;
  bottom: 0.35rem;
  width: var(--eg-hairline);
  background-color: var(--eg-success-line);
}

.eg-fix__body ol > li:last-child::after { display: none; }

.eg-fix__body ol > li > * + * { margin-top: var(--eg-space-3); }

/* A command block inside a step keeps the spine but drops the indent gap. */
.eg-fix__body ol > li .eg-cmd { margin-block: var(--eg-space-3); }

/* Nested lists inside a step: quieter, no boxes, no spine. */
.eg-fix__body ol ol,
.eg-fix__body ol ul {
  counter-reset: none;
  margin-top: var(--eg-space-3);
  padding-left: 1.25rem;
  font-size: var(--eg-text-base);
  line-height: var(--eg-lh-body);
}

.eg-fix__body ol ol { list-style: lower-alpha; }
.eg-fix__body ol ul { list-style: square; }

.eg-fix__body ol ol > li,
.eg-fix__body ol ul > li {
  position: static;
  min-height: 0;
  padding: 0;
}

.eg-fix__body ol ol > li::before,
.eg-fix__body ol ul > li::before,
.eg-fix__body ol ol > li::after,
.eg-fix__body ol ul > li::after { content: none; }

.eg-fix__body ol ol > li + li,
.eg-fix__body ol ul > li + li { margin-top: var(--eg-space-2); }

.eg-fix__body ol ol > li::marker,
.eg-fix__body ol ul > li::marker { color: var(--eg-ink-3); }

/* Standalone (non-step) lists in a fix card */
.eg-fix__body > ul {
  margin-left: 0;
  padding-left: 1.25rem;
  list-style: square;
  font-size: var(--eg-text-base);
}

.eg-fix__body > ul > li + li { margin-top: var(--eg-space-2); }

.eg-fix__body :not(pre) > code {
  padding: 0.12em 0.36em;
  border: var(--eg-hairline) solid var(--eg-inline-code-line);
  border-radius: var(--eg-radius-sm);
  background-color: var(--eg-inline-code-bg);
  color: var(--eg-inline-code-ink);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.eg-fix__body :is(h3, h4) {
  font-size: var(--eg-text-md);
  font-weight: 660;
  line-height: var(--eg-lh-snug);
}

@media (min-width: 40em) {
  .eg-fix__body { padding: var(--eg-space-6); }
  .eg-symptom__body { padding: var(--eg-space-5); }
}


/* ==========================================================================
   15  POST-BODY — .eg-cmd  (terminal block with copy button)
   Dark in both themes on purpose: a command block should look like a
   terminal, and stay recognisable when someone flips the theme.
   ========================================================================== */

.eg-cmd {
  margin-block: var(--eg-space-5);
  border: var(--eg-hairline) solid var(--eg-code-rule);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-code-bg);
  box-shadow: var(--eg-shadow-1);
  overflow: hidden;
}

.eg-cmd__bar {
  display: flex;
  align-items: center;
  gap: var(--eg-space-3);
  padding: 0.4rem 0.5rem 0.4rem 0.85rem;
  border-bottom: var(--eg-hairline) solid var(--eg-code-rule);
  background-color: var(--eg-code-bar);
}

.eg-cmd__label {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--eg-code-ink-2);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eg-cmd__copy {
  flex: 0 0 auto;
  padding: 0.3rem 0.65rem;
  border: var(--eg-hairline) solid var(--eg-code-rule);
  border-radius: var(--eg-radius-sm);
  background-color: transparent;
  color: var(--eg-code-ink-2);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--eg-dur) var(--eg-ease),
              border-color var(--eg-dur) var(--eg-ease),
              color var(--eg-dur) var(--eg-ease);
}

.eg-cmd__copy:hover {
  border-color: var(--eg-code-accent);
  color: var(--eg-code-accent);
  background-color: rgba(133, 192, 247, 0.08);
}

.eg-cmd__copy:active { transform: translateY(1px); }

/* Focus ring must be visible on the dark bar, so the halo goes dark here. */
.eg-cmd__copy:focus-visible {
  outline-color: var(--eg-code-accent);
  box-shadow: 0 0 0 4px var(--eg-code-bg);
}

.eg-cmd__copy.is-copied {
  border-color: #4bbf75;
  color: #8fe0a9;
  background-color: rgba(75, 191, 117, 0.12);
}

.eg-cmd__code {
  display: block;
  overflow-x: auto;
  margin: 0;
  padding: var(--eg-space-4) var(--eg-space-4);
  background: none;
  color: var(--eg-code-ink);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-sm);
  line-height: 1.6;
  white-space: pre;
  tab-size: 4;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: var(--eg-code-rule) transparent;
}

.eg-cmd__code code {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.eg-cmd__code::-webkit-scrollbar { height: 10px; }
.eg-cmd__code::-webkit-scrollbar-track { background: transparent; }
.eg-cmd__code::-webkit-scrollbar-thumb {
  background-color: var(--eg-code-rule);
  border-radius: var(--eg-radius-pill);
}

/* Selecting a command should give you the command, not the chrome. */
.eg-cmd__code::selection { background-color: #2f5a86; color: #ffffff; }
.eg-cmd__code ::selection { background-color: #2f5a86; color: #ffffff; }


/* ==========================================================================
   16  POST-BODY — .eg-note  (quoted error text left over in the body)
   Deliberately NOT terminal-like: paper surface, ochre rule, serif-free
   quotation. It reads as "something the machine said", not "type this".
   ========================================================================== */

.eg-note {
  margin-block: var(--eg-space-5);
  padding: var(--eg-space-3) var(--eg-space-4);
  border: var(--eg-hairline) solid var(--eg-note-line);
  border-left: 3px solid var(--eg-note);
  border-radius: 0 var(--eg-radius-md) var(--eg-radius-md) 0;
  background-color: var(--eg-note-soft);
  color: var(--eg-ink-2);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-sm);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.eg-note > * + * { margin-top: var(--eg-space-2); }

.eg-note :is(p, li) { color: inherit; }

.eg-note cite,
.eg-note footer {
  display: block;
  margin-top: var(--eg-space-2);
  color: var(--eg-note-ink);
  font-family: var(--eg-font-sans);
  font-size: var(--eg-text-xs);
  font-style: normal;
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
}

.eg-note :not(pre) > code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 1em;
}


/* ==========================================================================
   17  ASIDE — TABLE OF CONTENTS
   ========================================================================== */

.eg-toc {
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-surface);
  padding: var(--eg-space-4);
  font-size: var(--eg-text-sm);
}

@media (min-width: 56.25em) {
  .eg-toc {
    position: sticky;
    top: calc(var(--eg-header-height) + var(--eg-space-4));
    max-height: calc(100vh - var(--eg-header-height) - var(--eg-space-6));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-left: var(--eg-hairline) solid var(--eg-rule);
    border-radius: 0;
    background: none;
    padding: var(--eg-space-1) 0 var(--eg-space-1) var(--eg-space-4);
  }
}

.eg-toc__title {
  margin-bottom: var(--eg-space-3);
  color: var(--eg-ink-3);
  font-size: var(--eg-text-xs);
  font-weight: 680;
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
}

.eg-toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.eg-toc__list ul {
  margin: var(--eg-space-1) 0 var(--eg-space-1) var(--eg-space-3);
  padding: 0;
  list-style: none;
}

.eg-toc__link {
  display: block;
  padding: 0.3rem 0 0.3rem var(--eg-space-3);
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--eg-ink-2);
  line-height: var(--eg-lh-snug);
  text-decoration: none;
  transition: color var(--eg-dur) var(--eg-ease),
              border-color var(--eg-dur) var(--eg-ease);
}

.eg-toc__link:hover {
  color: var(--eg-ink);
  border-left-color: var(--eg-rule-strong);
}

.eg-toc__link--active {
  color: var(--eg-accent);
  font-weight: 620;
  border-left-color: var(--eg-accent);
}


/* ==========================================================================
   18  PAGER
   ========================================================================== */

.eg-pager {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--eg-space-3);
  max-width: var(--eg-measure);
  margin-top: var(--eg-space-7);
  padding-top: var(--eg-space-5);
  border-top: var(--eg-hairline) solid var(--eg-rule);
}

@media (min-width: 40em) {
  .eg-pager { grid-template-columns: 1fr 1fr; }
}

.eg-pager__prev,
.eg-pager__next {
  display: block;
  padding: var(--eg-space-3) var(--eg-space-4);
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-surface);
  color: var(--eg-ink);
  font-weight: 580;
  line-height: var(--eg-lh-snug);
  text-decoration: none;
  transition: border-color var(--eg-dur) var(--eg-ease),
              background-color var(--eg-dur) var(--eg-ease);
}

.eg-pager__next { text-align: right; }

.eg-pager__prev:hover,
.eg-pager__next:hover {
  border-color: var(--eg-accent-line);
  background-color: var(--eg-accent-soft);
  color: var(--eg-ink);
}

.eg-pager__prev::before,
.eg-pager__next::before {
  display: block;
  margin-bottom: var(--eg-space-1);
  color: var(--eg-ink-3);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-xs);
  font-weight: 600;
  letter-spacing: var(--eg-track-caps);
  text-transform: uppercase;
}

.eg-pager__prev::before { content: "\2190  Previous"; }
.eg-pager__next::before { content: "Next  \2192"; }


/* ==========================================================================
   19  ARCHIVE / SEARCH
   ========================================================================== */

.eg-hub { padding-block: var(--eg-space-6) var(--eg-space-8); }

.eg-hub__head {
  padding-bottom: var(--eg-space-5);
  margin-bottom: var(--eg-space-5);
  border-bottom: 2px solid var(--eg-rule);
}

.eg-hub__title {
  font-size: var(--eg-text-2xl);
  font-weight: 700;
  line-height: var(--eg-lh-tight);
  letter-spacing: -0.024em;
  text-wrap: balance;
}

.eg-hub__desc {
  max-width: 64ch;
  margin-top: var(--eg-space-3);
  color: var(--eg-ink-2);
  font-size: var(--eg-text-md);
  line-height: var(--eg-lh-snug);
  text-wrap: pretty;
}

.eg-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--eg-space-2);
  margin-bottom: var(--eg-space-5);
}

.eg-filters__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.35rem 0.75rem;
  border: var(--eg-hairline) solid var(--eg-rule-strong);
  border-radius: var(--eg-radius-pill);
  background-color: var(--eg-surface);
  color: var(--eg-ink-2);
  font-size: var(--eg-text-sm);
  font-weight: 560;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--eg-dur) var(--eg-ease),
              border-color var(--eg-dur) var(--eg-ease),
              color var(--eg-dur) var(--eg-ease);
}

.eg-filters__chip[aria-pressed="false"]:hover {
  border-color: var(--eg-ink-3);
  color: var(--eg-ink);
}

.eg-filters__chip[aria-pressed="true"] {
  border-color: var(--eg-accent);
  background-color: var(--eg-accent);
  color: var(--eg-accent-ink);
}

/* Selected state must survive a forced-colours / no-colour reading, so it
   also carries a check glyph, not colour alone. */
.eg-filters__chip[aria-pressed="true"]::before {
  content: "\2713";
  font-size: 0.9em;
  line-height: 1;
}

.eg-filters__chip[aria-pressed="true"]:hover {
  background-color: var(--eg-accent-hover);
  border-color: var(--eg-accent-hover);
}

.eg-results {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--eg-space-4);
}

@media (min-width: 34em) {
  .eg-results { grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr)); }
}

.eg-empty {
  grid-column: 1 / -1;
  padding: var(--eg-space-7) var(--eg-space-5);
  border: var(--eg-hairline) dashed var(--eg-rule-strong);
  border-radius: var(--eg-radius-lg);
  background-color: var(--eg-surface-2);
  color: var(--eg-ink-2);
  text-align: center;
}

.eg-empty > * + * { margin-top: var(--eg-space-3); }

.eg-empty :is(h2, h3, strong) {
  display: block;
  color: var(--eg-ink);
  font-size: var(--eg-text-lg);
  font-weight: 660;
}

.eg-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--eg-space-2);
  margin-top: var(--eg-space-7);
  padding-top: var(--eg-space-5);
  border-top: var(--eg-hairline) solid var(--eg-rule);
  font-family: var(--eg-font-mono);
  font-size: var(--eg-text-sm);
}

.eg-pagination a,
.eg-pagination .current,
.eg-pagination .dots {
  display: inline-grid;
  place-items: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding-inline: 0.6rem;
  border: var(--eg-hairline) solid var(--eg-rule);
  border-radius: var(--eg-radius-md);
  background-color: var(--eg-surface);
  color: var(--eg-ink-2);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--eg-dur) var(--eg-ease),
              background-color var(--eg-dur) var(--eg-ease),
              color var(--eg-dur) var(--eg-ease);
}

.eg-pagination a:hover {
  border-color: var(--eg-accent);
  background-color: var(--eg-accent-soft);
  color: var(--eg-accent);
}

.eg-pagination .current {
  border-color: var(--eg-accent);
  background-color: var(--eg-accent);
  color: var(--eg-accent-ink);
  font-weight: 700;
}

.eg-pagination .dots {
  border-color: transparent;
  background: none;
  color: var(--eg-ink-3);
}


/* ==========================================================================
   20  REDUCED MOTION, FORCED COLOURS, PRINT
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* Nothing may move: the lane lift and the button press are removed
     outright rather than merely shortened. */
  .eg-lane:hover { transform: none; }
  .eg-searchform__submit:active,
  .eg-cmd__copy:active { transform: none; }

  /* The skip link still has to arrive — it just arrives instantly. */
  .eg-skip { transition: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (forced-colors: active) {
  .eg-card,
  .eg-lane,
  .eg-symptom,
  .eg-fix,
  .eg-cmd,
  .eg-note,
  .eg-toc { border: 1px solid CanvasText; }

  .eg-filters__chip[aria-pressed="true"],
  .eg-pagination .current { forced-color-adjust: none; }

  .eg-fix__body ol > li::before { border: 1px solid CanvasText; }

  :where(a, button, input, select, textarea):focus-visible {
    outline: 3px solid Highlight;
  }
}

@media print {
  :root {
    --eg-bg: #ffffff;
    --eg-surface: #ffffff;
    --eg-surface-2: #ffffff;
    --eg-ink: #000000;
    --eg-ink-2: #1a1a1a;
    --eg-ink-3: #444444;
    --eg-rule: #999999;
    --eg-rule-strong: #666666;
    --eg-code-bg: #ffffff;
    --eg-code-bar: #ffffff;
    --eg-code-ink: #000000;
    --eg-code-ink-2: #333333;
    --eg-code-rule: #999999;
  }

  .eg-header,
  .eg-footer,
  .eg-toc,
  .eg-pager,
  .eg-pagination,
  .eg-filters,
  .eg-searchform,
  .eg-theme-toggle,
  .eg-menu-toggle,
  .eg-cmd__copy,
  .eg-skip { display: none !important; }

  .eg-layout { display: block; }
  .eg-article, .eg-prose { max-width: none; }

  .eg-cmd,
  .eg-symptom,
  .eg-fix,
  .eg-note,
  .eg-fix__body ol > li { break-inside: avoid; }

  .eg-prose a::after {
    content: " (" attr(href) ")";
    font-family: var(--eg-font-mono);
    font-size: 0.8em;
    color: #444444;
    word-break: break-all;
  }
}


/* ==========================================================================
   TEMPLATE INTEGRATION
   Rules that depend on where the PHP templates place things, kept apart from
   the design system above.
   ========================================================================== */

/* Below the two-column breakpoint the contents list belongs above the guide,
   not stranded under it. The layout is a flex column there so `order` applies. */
@media (max-width: 56.24em) {
  .eg-layout {
    display: flex;
    flex-direction: column;
    /* The grid rule sets align-items:start, which in a column flex container
       sizes children to their content and lets long command lines widen the
       page. Stretch keeps them at the container width. */
    align-items: stretch;
  }

  .eg-layout > .eg-toc {
    order: -1;
  }
}

/* The wordmark ships as two transparent PNGs, one per theme. A single image
   flipped with `filter: invert(1) hue-rotate(180deg)` gets the neutral ink right
   but drags the brand red from rgb(255,0,0) to a pale rgb(255,146,146) — the
   filter is a colour matrix, not a true hue rotation. Swapping the asset keeps
   the red exact and costs one small extra request only in dark mode. */
.eg-logo {
  display: inline-flex;
  align-items: center;
}

.eg-logo__img {
  max-height: 34px;
  width: auto;
  height: auto;
}

.eg-logo__img--dark { display: none; }

:root[data-theme="dark"] .eg-logo__img--light { display: none; }
:root[data-theme="dark"] .eg-logo__img--dark { display: block; }

.eg-header { background-color: var(--eg-bg); }
