/* ==========================================================================
   article.css. The casebook register for the article pages (learn/), re-skin
   in place 2026-09-05 (owner ruling: option A). Same markup and URLs as the
   V6 pages; this file replaces css/meridian.css + css/site.css for them.
   Tokens are the production palette, token for token with css/casebook.css.
   ========================================================================== */

/* ---------------------------------------------- production palette, day -- */
:root,
html[data-theme="ink"] {
  --bg:             #F4F1EC;
  --bg-elev:        #FFFFFF;
  --bg-sunken:      #ECE8E1;
  --border:         #DCD6CB;
  --border-strong:  #B8B0A2;
  --hairline:       rgba(20, 18, 14, .10);
  --text:           #14120E;
  --text-secondary: #5A5448;
  --text-tertiary:  #6E6858;
  --text-inverse:   #F4F1EC;
  --accent:         #1B2A4E;
  --accent-hover:   #243663;
  --accent-soft:    rgba(27, 42, 78, .08);
  --accent-text:    #FFFFFF;
}

/* -------------------------------------------- production palette, night -- */
html[data-theme="slate"] {
  --bg:             #0E1219;
  --bg-elev:        #161D28;
  --bg-sunken:      #0A0D13;
  --border:         #232C3B;
  --border-strong:  #2F3B4E;
  --hairline:       rgba(255, 255, 255, .08);
  --text:           #E8ECF2;
  --text-secondary: #95A0B3;
  --text-tertiary:  #7E8899;
  --text-inverse:   #0E1219;
  --accent:         #6FB1B0;
  --accent-hover:   #88C3C2;
  --accent-soft:    rgba(111, 177, 176, .12);
  --accent-text:    #0E1219;
}

:root {
  --font-display: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-text:    "EB Garamond", Georgia, "Times New Roman", serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, "Courier New", monospace;

  --t-base:   clamp(1.06rem, 1rem + 0.3vw, 1.24rem);
  --leading:  1.62;
  --gutter:   clamp(1.35rem, 4.5vw, 4.5rem);
  --measure:  44rem;
  --wide:     68rem;
}

/* ------------------------------------------------------------------ base -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font-text); font-size: var(--t-base); line-height: var(--leading);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.mono { font-family: var(--font-mono); }

/* Skip link: hidden until focused, above the running head when shown. */
.skip-link {
  position: fixed; top: 0.75rem; left: 0.75rem; z-index: 100; padding: 0.6rem 0.9rem;
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--accent-text);
  background: var(--accent); transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; outline: 3px solid var(--bg); outline-offset: 2px; }

/* ---------------------------------------------------------- running head -- */
.site-nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 60px; padding: 0.7rem var(--gutter);
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; }
.brand-logo { display: block; height: 30px; width: auto; }
.brand-dark-only { display: none; }
html[data-theme="slate"] .brand-light-only { display: none; }
html[data-theme="slate"] .brand-dark-only { display: block; }

.nav-right { display: flex; align-items: center; gap: 1.4rem; }
.topnav-link {
  font-family: var(--font-mono); font-size: 0.78rem; color: var(--text);
  text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px;
  padding: 0.6rem 0; margin: -0.6rem 0;
}
.topnav-link:hover, .topnav-link.active { color: var(--accent); }

.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--text-secondary);
}
.theme-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.theme-toggle .icon-moon { display: inline-flex; }
.theme-toggle .icon-sun { display: none; }
html[data-theme="slate"] .theme-toggle .icon-moon { display: none; }
html[data-theme="slate"] .theme-toggle .icon-sun { display: inline-flex; }

/* ---------------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.55rem 1.3rem;
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.02em;
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-secondary { border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { min-height: 40px; padding: 0.4rem 1rem; font-size: 0.76rem; }

/* ------------------------------------------------------------ the leaves -- */
.wrap-prose { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wrap { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

.article { padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(3.5rem, 7vw, 6.5rem); }
.crumbs {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); margin: 0 0 1.6rem;
}
.crumbs a { padding: 0.8rem 0; margin: -0.8rem 0; }
.crumbs a:hover { color: var(--text); }

.display, .article h1 {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(2.4rem, 5vw, 3.6rem); line-height: 1.05; letter-spacing: -0.012em;
  margin: 0 0 1.1rem; color: var(--text);
}
.standfirst {
  font-family: var(--font-display); font-style: italic; font-weight: 400;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); line-height: 1.4;
  color: var(--text-secondary); margin: 0 0 1.6rem; max-width: 36em;
}
.article .meta {
  font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); margin: 0 0 2.6rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--border);
}
.article h2 {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(1.6rem, 1.3rem + 1vw, 2rem);
  line-height: 1.15; letter-spacing: -0.008em; margin: 2.8rem 0 0.9rem;
}
.article h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; line-height: 1.2; margin: 2rem 0 0.7rem; }
.article p, .article ul, .article ol { margin: 0 0 1.15rem; }
.article ul, .article ol { padding-left: 1.4rem; }
.article li { margin-bottom: 0.45rem; }
.article strong { font-weight: 600; }
.article em { font-style: italic; }

/* Data table, the blotter's idiom: mono heads, hairline rows. */
.dtable { width: 100%; border-collapse: collapse; margin: 1.2rem 0 1.8rem; font-size: 0.95em; }
.dtable th {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-tertiary); text-align: left; padding: 0.5rem 0.8rem 0.5rem 0; border-bottom: 1px solid var(--border-strong);
}
.dtable td { padding: 0.6rem 0.8rem 0.6rem 0; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.dtable td.mono { font-family: var(--font-mono); font-size: 0.82rem; white-space: nowrap; }
.dtable-scroll { overflow-x: auto; }

/* The course card, in the order ticket's idiom. */
.article-cta {
  margin-top: 3rem; padding: 1.8rem 2rem 2rem;
  border: 1px solid var(--border); background: var(--bg-elev);
}
.eyebrow, .article-cta .eyebrow {
  display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-tertiary); margin: 0 0 0.6rem;
}
.article-cta h3 { margin: 0 0 0.6rem; font-size: 1.5rem; }
.article-cta p { color: var(--text-secondary); margin: 0 0 1.2rem; max-width: 36em; }

.page-end-nav {
  display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 3rem 0 0; padding-top: 1.6rem;
  border-top: 1px solid var(--border);
}

/* ---------------------------------------------------------------- the hub -- */
.learn-hub { padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(3.5rem, 7vw, 6.5rem); }
.learn-hub .article { padding-top: 0 !important; padding-bottom: 1.4rem !important; }
.pane { border: 1px solid var(--border); background: var(--bg-elev); }
.pane-tab {
  display: inline-block; background: var(--accent); color: var(--accent-text);
  font-family: var(--font-mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  padding: 0.35rem 0.9rem;
}
.pane-body { padding: 1rem 1.8rem 1.2rem; }
.pane-news a { display: block; padding: 1.1rem 1.8rem; margin: 0 -1.8rem; border-bottom: 1px solid var(--hairline); }
.pane-news a:last-child { border-bottom: 0; }
.pane-news a:hover { background: var(--accent-soft); }
.pane-news .h { display: block; font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; line-height: 1.15; color: var(--text); margin: 0; }
.pane-news a:hover .h { color: var(--accent); }
.pane-news .m { display: block; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-tertiary); margin-top: 0.4rem; }
.pane-news .d { display: block; color: var(--text-secondary); margin-top: 0.5rem; max-width: 40em; }

/* ---------------------------------------------------------------- footer -- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); }
.site-footer .foot-inner {
  max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 2.2rem var(--gutter);
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.site-footer .brand-logo { height: 28px; }
.foot-copy { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; color: var(--text-tertiary); }

/* ------------------------------------------------------------ responsive -- */
@media (max-width: 560px) {
  /* The text links fold away (Learn stays reachable from the page-end nav,
     Syllabus is one scroll away on the homepage); the button keeps its label. */
  .site-nav .topnav-link { display: none; }
  .nav-right { gap: 0.8rem; }
  .theme-toggle { width: 44px; height: 44px; }
  .brand-logo { height: 26px; }
  .pane-body { padding: 0.8rem 1.1rem 1rem; }
  .pane-news a { padding: 0.9rem 1.1rem; margin: 0 -1.1rem; }
  .article-cta { padding: 1.4rem 1.2rem 1.5rem; }
  .dtable { font-size: 0.88em; }
}
