/* eurostocks-docs-design v0.3.0 — copied from the kit; change the kit, not this file.
   The EuroStocks docs layer (layout, sidebar, article, code blocks, callouts, step cards, tables,
   footer, landing hero + card grid). Load AFTER colors_and_type.css: it reads the brand tokens and never
   redefines one, but its base block deliberately overrides the brand element defaults for docs reading
   (body/p 17px / 1.65, a box-sizing reset, h6, a focus ring). */

:root {
  /* Docs layout tokens (the only tokens this layer adds) */
  --header-height: 64px;
  --sidebar-width: 260px;
}

/* ============================================================
   Base / element defaults
   ============================================================ */

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

html {
  font-family: var(--font-sans);
  color: var(--fg-1);
  background: var(--bg-1);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
}

body {
  font-size: 17px;
  line-height: 1.65;
  font-weight: var(--fw-regular);
  margin: 0;
}

h1, .h1 {
  font-size: var(--fs-h1);
  font-weight: var(--fw-extrabold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
h2, .h2 {
  font-size: var(--fs-h2);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  margin: 0;
}
h3, .h3 {
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  margin: 0;
}
h4, .h4 {
  font-size: var(--fs-h4);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  margin: 0;
}
h5, .h5 {
  font-size: var(--fs-h5);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-snug);
  margin: 0;
}
h6, .h6 {
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: var(--lh-snug);
  margin: 0;
}

p, .p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--fg-1);
  margin: 0;
}
.lead {
  font-size: var(--fs-h5);
  line-height: var(--lh-relaxed);
  color: var(--fg-2);
}
.small { font-size: var(--fs-small); color: var(--fg-2); }
.caption { font-size: var(--fs-caption); color: var(--fg-3); }

.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--fg-accent);
}

a {
  color: var(--fg-accent);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--es-cyan-700); }
a:focus-visible { outline: none; box-shadow: var(--ring-accent); border-radius: 2px; }

code, .mono { font-family: var(--font-mono); font-size: 0.9em; }

/* ============================================================
   Utility: the "punt" — the signature cyan dot
   ============================================================ */
.es-dot::after {
  content: '';
  display: inline-block;
  width: 0.32em;
  height: 0.32em;
  margin-left: 0.1em;
  border-radius: 50%;
  background: var(--es-cyan);
  transform: translateY(-0.05em);
}

/* ============================================================
   Site layout
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-1);
  height: var(--header-height);
}
.site-header-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  height: 100%;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-6);
}
.site-header-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--fg-1);
}
.site-header-brand img { height: 28px; width: auto; display: block; }
.site-header-title {
  font-size: var(--fs-h5);
  font-weight: var(--fw-semibold);
  color: var(--fg-1);
  letter-spacing: var(--tracking-tight);
}
.site-header-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  font-size: var(--fs-small);
}
.site-header-nav a { color: var(--fg-2); font-weight: var(--fw-medium); }
.site-header-nav a:hover { color: var(--fg-1); }
/* Right-aligned header group: the language switch + the external link. */
.site-header-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
.site-header-tools .site-header-nav { margin-left: 0; }

/* Language switch (variant A): a segmented pill of language codes, the current one brand blue.
   Plain links to the same page in each language — see i18n.md. */
.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-pill);
  background: var(--bg-1);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
}
.lang-switch a {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: var(--fg-2);
  line-height: 1.2;
}
.lang-switch a:hover { color: var(--fg-1); background: var(--bg-2); }
.lang-switch a[aria-current="true"] { background: var(--es-blue-700); color: var(--fg-on-dark); }
.lang-switch a:focus-visible { outline: none; box-shadow: var(--ring-accent); }

/* Phones, for a header carrying a site name only (a header without one — infra-guides — is unchanged):
   the name stays on one line, the external link drops, and spacing + logo tighten so name and switch
   fit at 390 px (measured: 14 px too wide otherwise). */
.site-header-title { white-space: nowrap; }
@media (max-width: 600px) {
  .site-header-inner:has(.site-header-title) { padding: 0 var(--space-4); gap: var(--space-3); }
  .site-header-inner:has(.site-header-title) .site-header-brand { gap: var(--space-2); }
  .site-header-inner:has(.site-header-title) .site-header-brand img { height: 22px; }
  .site-header-inner:has(.site-header-title) .site-header-nav { display: none; }
  .site-header-inner:has(.site-header-title) .site-header-tools { gap: var(--space-3); }
}

.site-layout {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  gap: var(--space-12);
  align-items: start;
}
.site-layout--no-sidebar { grid-template-columns: 1fr; padding-left: 0; padding-right: 0; }

/* ============================================================
   Sidebar
   ============================================================ */
.site-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-6));
  max-height: calc(100vh - var(--header-height) - var(--space-8));
  overflow-y: auto;
  font-size: var(--fs-small);
}
.site-sidebar-group + .site-sidebar-group { margin-top: var(--space-6); }
.site-sidebar-group h6 {
  color: var(--fg-3);
  margin-bottom: var(--space-2);
}
.site-sidebar-group ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.site-sidebar-group li {
  line-height: 1.4;
  border-radius: var(--radius-sm);
}
.site-sidebar-group li > a {
  display: block;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.site-sidebar-group li > a:hover {
  background: var(--bg-2);
  color: var(--fg-1);
}
.site-sidebar-group li[aria-current="page"] > a,
.site-sidebar-group li > a[aria-current="page"] {
  background: var(--bg-brand-soft);
  color: var(--es-blue-700);
  font-weight: var(--fw-semibold);
}
/* TODO items: name + pill on the same line, flex-aligned */
.site-sidebar-group li:has(> .todo) {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
}
.site-sidebar-group li > .todo {
  color: var(--fg-3);
  font-style: italic;
  flex: 1;
  min-width: 0;
}
.site-sidebar-group .todo-pill {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--es-ink-100);
  color: var(--fg-3);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
}

.sidebar-mobile { display: none; }
@media (max-width: 900px) {
  .site-layout { grid-template-columns: 1fr; gap: var(--space-6); }
  .site-sidebar { display: none; }
  .sidebar-mobile {
    display: block;
    margin-bottom: var(--space-6);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-md);
    background: var(--bg-1);
  }
  .sidebar-mobile > summary {
    list-style: none;
    padding: var(--space-3) var(--space-4);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    user-select: none;
  }
  .sidebar-mobile > summary::-webkit-details-marker { display: none; }
  .sidebar-mobile > summary::after { content: '▾'; float: right; color: var(--fg-3); }
  .sidebar-mobile[open] > summary::after { content: '▴'; }
  .sidebar-mobile .site-sidebar-inner { padding: 0 var(--space-4) var(--space-4); }
}

/* ============================================================
   Article (main content)
   ============================================================ */
/* min-width:0 lets the grid column shrink below its widest child instead of
   growing to fit it: a 1fr grid item defaults to min-width:auto, which would
   let wide content (code, tables) blow the column out past its track. */
main { min-width: 0; }
.site-article { max-width: none; min-width: 0; }

.breadcrumb {
  font-size: var(--fs-small);
  color: var(--fg-3);
  margin-bottom: var(--space-4);
}
.breadcrumb a { color: var(--fg-3); }
.breadcrumb a:hover { color: var(--fg-1); }
.breadcrumb .sep { color: var(--es-gray); margin: 0 6px; }

.site-article h1 { margin-bottom: var(--space-4); }
.site-article > .lead { margin-bottom: var(--space-8); }

.site-article h2 {
  margin-top: var(--space-12);
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-1);
}
.site-article h3 {
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}
.site-article h4 {
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
}
.site-article p { margin-top: 0; margin-bottom: var(--space-4); }
.site-article ul, .site-article ol { margin: 0 0 var(--space-4); padding-left: var(--space-6); }
.site-article li { margin-bottom: var(--space-2); }
.site-article li > p { margin-bottom: var(--space-2); }
.site-article hr { border: 0; border-top: 1px solid var(--border-1); margin: var(--space-10) 0; }

/* Inline code */
.site-article :not(pre) > code {
  background: var(--es-light-gray);
  color: var(--es-ink-800);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: 0.88em;
  font-family: var(--font-mono);
  word-break: break-word;
}

/* Plain quotes (Markdown `>` without a callout marker) */
.site-article blockquote {
  margin: 0 0 var(--space-5);
  padding: var(--space-1) var(--space-5);
  border-left: 3px solid var(--border-2);
  color: var(--fg-2);
}
.site-article blockquote > :last-child { margin-bottom: 0; }

/* ============================================================
   Code blocks (<figure class="code">)
   ============================================================ */
figure.code {
  margin: 0 0 var(--space-5);
  background: var(--es-light-gray);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
figure.code .lang {
  position: absolute;
  top: 10px;
  left: 14px;
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--fg-3);
  pointer-events: none;
}
figure.code .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  font: inherit;
  font-size: 11px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--bg-1);
  color: var(--fg-2);
  border: 1px solid var(--border-1);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
figure.code .copy-btn:hover { color: var(--fg-1); border-color: var(--border-2); }
figure.code .copy-btn:focus-visible { outline: none; box-shadow: var(--ring-accent); }
figure.code .copy-btn.is-copied {
  color: var(--es-success);
  border-color: var(--es-success);
}
figure.code pre {
  margin: 0;
  padding: 36px 16px 16px;
  /* Wrap long lines instead of scrolling. pre-wrap keeps indentation and
     explicit newlines; overflow-wrap:anywhere breaks unbreakable tokens
     (long URLs, hashes) so nothing forces a horizontal scrollbar. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--es-ink-800);
}
figure.code pre code { font-family: inherit; font-size: inherit; background: none; padding: 0; }

/* ============================================================
   Callouts
   ============================================================ */
.callout {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  border-left: 3px solid;
  font-size: 15.5px;
  line-height: 1.6;
}
.callout > :first-child { margin-top: 0; }
.callout > :last-child  { margin-bottom: 0; }
.callout-info {
  background: var(--bg-brand-soft);
  border-left-color: var(--es-blue-700);
  color: var(--es-ink-800);
}
.callout-warning {
  background: #fffaf0;
  border-left-color: var(--es-warning);
  color: var(--es-ink-800);
}
.callout-tip {
  background: var(--es-cyan-100);
  border-left-color: var(--es-cyan-500);
  color: var(--es-ink-800);
}

/* ============================================================
   Step cards (Prerequisites / Next steps)
   ============================================================ */
.step-card {
  margin: 0 0 var(--space-8);
  padding: var(--space-5) var(--space-6);
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.step-card .eyebrow { margin-bottom: var(--space-3); display: block; }
.step-card--prereq { border-left: 3px solid var(--es-blue-700); }
.step-card--prereq .eyebrow { color: var(--es-blue-700); }
.step-card--next   { border-left: 3px solid var(--es-cyan-500); }
.step-card--next   .eyebrow { color: var(--es-cyan-700); }
.step-card ul { padding-left: var(--space-5); margin-bottom: 0; }
.step-card ul:last-child { margin-bottom: 0; }
.step-card > p:last-child { margin-bottom: 0; }

/* Prev/Next row at bottom of Next steps card */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-1);
}
.prev-next a {
  display: block;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  color: var(--fg-1);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.prev-next a:hover { border-color: var(--es-blue-300); color: var(--fg-1); }
.prev-next .label {
  display: block;
  font-size: 11px;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--fg-3);
  margin-bottom: 2px;
}
.prev-next .next { text-align: right; }
.prev-next a.disabled { color: var(--fg-3); pointer-events: none; opacity: 0.5; }

@media (max-width: 600px) { .prev-next { grid-template-columns: 1fr; } }

/* ============================================================
   Tables
   ============================================================ */
.site-article table, table.es-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  margin: 0 0 var(--space-6);
}
.site-article th, table.es-table th {
  text-align: left;
  font-weight: var(--fw-semibold);
  background: var(--es-light-gray);
  color: var(--fg-1);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-2);
}
.site-article td, table.es-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-1);
  vertical-align: top;
}
.site-article tr:last-child td, table.es-table tr:last-child td { border-bottom: none; }

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: var(--es-blue-700);
  color: var(--fg-on-dark);
  padding: var(--space-8) 0;
  margin-top: var(--space-16);
}
.site-footer-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  align-items: center;
  justify-content: space-between;
}
.site-footer-brand {
  font-size: var(--fs-h5);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tight);
}
.site-footer-tagline {
  display: block;
  font-size: var(--fs-small);
  color: var(--es-blue-200);
  font-weight: var(--fw-regular);
  margin-top: 2px;
}
.site-footer-small {
  font-size: var(--fs-small);
  color: var(--es-blue-200);
}

/* ============================================================
   Landing page: Hero
   ============================================================ */
.hero {
  background: var(--es-blue-700);
  color: var(--fg-on-dark);
  padding: var(--space-16) 0;
}
.hero-inner {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.hero .eyebrow {
  color: var(--es-cyan-500);
  margin-bottom: var(--space-4);
  display: block;
}
.hero h1 {
  font-size: clamp(40px, 5.5vw, 64px);
  font-weight: var(--fw-extrabold);
  letter-spacing: var(--tracking-tight);
  line-height: 1.05;
  margin: 0 0 var(--space-5);
  color: var(--fg-on-dark);
}
.hero .lead {
  font-size: var(--fs-h5);
  line-height: 1.55;
  color: var(--es-blue-100);
  max-width: 60ch;
  margin-bottom: var(--space-8);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-weight: var(--fw-semibold);
  font-size: 15px;
  letter-spacing: 0.01em;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.btn-primary {
  background: var(--es-cyan-500);
  color: var(--es-ink-900);
  border: 1px solid var(--es-cyan-500);
}
.btn-primary:hover { background: var(--es-cyan-400); border-color: var(--es-cyan-400); color: var(--es-ink-900); }
.btn-ghost {
  background: transparent;
  color: var(--fg-on-dark);
  border: 1px solid var(--es-blue-300);
}
.btn-ghost:hover { background: var(--es-blue-600); border-color: var(--es-blue-400); color: var(--fg-on-dark); }

/* ============================================================
   Landing page: Role cards grid
   ============================================================ */
.landing-section {
  max-width: var(--container-wide);
  margin: 0 auto;
  padding: var(--space-16) var(--space-6);
}
.landing-section h2 {
  margin-bottom: var(--space-8);
  max-width: 22ch;
}
.landing-section > .eyebrow { display: block; margin-bottom: var(--space-3); }
/* A heading + text section below the cards (no grid): the heading closer to its text, text sections closer
   together. */
.landing-section--text { padding-top: var(--space-10); padding-bottom: var(--space-10); }
.landing-section--text h2 { margin-bottom: var(--space-4); }
.landing-section--text p + p { margin-top: var(--space-4); }

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}
@media (max-width: 900px) { .role-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .role-grid { grid-template-columns: 1fr; } }

.role-card {
  background: var(--bg-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.role-card:hover { border-color: var(--es-blue-300); box-shadow: var(--shadow-md); }
.role-card.is-empty { background: var(--bg-2); }
.role-card h3 {
  font-size: 22px;
  font-family: var(--font-mono);
  color: var(--es-blue-700);
}
.role-card .role-desc { color: var(--fg-2); font-size: 15px; line-height: 1.55; }
.role-card ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  counter-reset: card;
}
.role-card ol li {
  counter-increment: card;
  position: relative;
  padding-left: 26px;
  font-size: 14.5px;
  line-height: 1.45;
}
.role-card ol li::before {
  content: counter(card) ".";
  position: absolute;
  left: 0;
  width: 22px;
  font-weight: var(--fw-bold);
  color: var(--es-cyan-600);
  font-feature-settings: 'tnum' 1;
}
.role-card .todo { color: var(--fg-3); font-style: italic; }
.role-card .todo-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: var(--fw-bold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--es-ink-100);
  color: var(--fg-3);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  margin-left: 4px;
  vertical-align: 1px;
}

