/* ============================================================
   cimo.business — static article surface
   Shared by /articles/ and the article pages.

   Token-only. Every value resolves to /design/tokens.css (loaded
   before this file); there is no local token block, no colour
   literal, and no off-ladder size. Spec:
   agents/designer/knowledge/components/article-surface.md +
   projects/cimo/specs/article-surface-2026-10-25.md.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* tokens.css sets html/body/#root height:100% for the app shell; the static
     article page must let body grow so the sticky header has a full-page
     containing block. */
  height: auto;
  min-height: 100%;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  font-size: var(--type-h3);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-decoration-thickness: var(--border-width-hairline);
  text-underline-offset: 2px;
}

@media (hover: hover) {
  a:hover {
    color: var(--color-primary-pressed);
  }
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* ---------- page + chrome boxes ---------- */

.page,
.site-header__inner,
.site-footer__inner {
  width: min(calc(100% - 2 * var(--grid-margin)), var(--content-max));
  margin-inline: auto;
}

.page {
  padding-block: var(--space-6) 0;
}

/* one content edge per article page: breadcrumb, header, body, CTA, sources */
.article-col {
  width: min(100%, var(--measure-prose));
  margin-inline: auto;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--color-bg);
  border-bottom: var(--border-width-hairline) solid var(--color-border);
}

.site-header__inner {
  min-height: calc(var(--touch-target) + 2 * var(--space-3) + var(--border-width-hairline));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.wordmark {
  font-size: var(--type-title);
  font-weight: 700;
  letter-spacing: var(--track-display);
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-decoration: none;
}

@media (hover: hover) {
  .wordmark:hover {
    color: transparent;
  }
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-nav a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  color: var(--color-text);
  text-decoration: none;
  font-size: var(--type-sm);
  font-weight: 600;
}

.site-nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: var(--border-width-hairline);
  text-underline-offset: var(--space-1);
}

@media (hover: hover) {
  .site-nav a:not(.btn):hover {
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-thickness: var(--border-width-hairline);
    text-underline-offset: var(--space-1);
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-target);
  padding-inline: var(--space-5);
  border: none;
  border-radius: var(--radius-pill);
  background: var(--gradient-cta);
  color: var(--color-primary-contrast);
  font-size: var(--type-sm);
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: none;
}

@media (hover: hover) {
  .btn:hover {
    color: var(--color-primary-contrast);
    filter: brightness(0.96);
  }
}

.btn:active {
  filter: brightness(0.92);
  transform: translateY(var(--border-width-hairline));
}

/* ---------- breadcrumb ---------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--type-caption);
  line-height: 1.4;
  margin: var(--space-2) 0 var(--space-6);
}

.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}

@media (hover: hover) {
  .breadcrumb a:hover {
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-thickness: var(--border-width-hairline);
    text-underline-offset: var(--space-1);
  }
}

.breadcrumb span[aria-current="page"] {
  color: var(--color-text);
}

/* ---------- article header ---------- */

.article-header h1,
.hub-header h1 {
  margin: 0 0 var(--space-4);
  font-size: var(--type-hero);
  line-height: 48px;
  font-weight: 700;
  letter-spacing: var(--track-display);
}

.standfirst {
  margin: 0 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--type-h3);
  line-height: 1.6;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--type-caption);
  line-height: 1.4;
  padding-bottom: var(--space-5);
  border-bottom: var(--border-width-hairline) solid var(--color-border);
}

/* ---------- hero plate ---------- */

.article-hero {
  margin: var(--space-5) 0 0;
}

.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--color-surface-raised);
}

.article-hero figcaption {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  max-width: 100%;
  min-width: 0;
  font-size: var(--type-micro);
  font-weight: 600;
  line-height: 1.4;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-hero figcaption::before {
  content: "";
  flex: 0 0 var(--space-5);
  height: var(--border-width-hairline);
  background: var(--color-border);
}

/* ---------- body ---------- */

.article-body {
  padding-bottom: var(--space-5);
}

.article-body p,
.article-body li {
  font-size: var(--type-h3);
  line-height: 1.6;
  color: var(--color-text);
}

.article-body p {
  margin: 0 0 var(--space-5);
}

.article-body ul,
.article-body ol {
  margin: 0 0 var(--space-5);
  padding-left: var(--space-4);
}

.article-body li {
  margin: var(--space-1) 0;
}

.article-body strong {
  font-weight: 700;
}

/* Roles live on the element/block, never as a descendant-heading override. */
h2 {
  margin: var(--space-8) 0 var(--space-3);
  font-size: var(--type-title);
  line-height: 1.2;
  letter-spacing: var(--track-tight);
  font-weight: 700;
}

h3 {
  margin: var(--space-6) 0 var(--space-2);
  font-size: var(--type-h3);
  line-height: 1.3;
  letter-spacing: var(--track-tight);
  font-weight: 700;
}

.article-body blockquote {
  margin: var(--space-5) 0;
  padding: var(--space-5);
  background: var(--color-surface-raised);
  border: 0;
  border-radius: var(--radius-lg);
  color: var(--color-text);
  font-size: var(--type-h3);
  line-height: 1.6;
}

/* ---------- key takeaways (card/default) ---------- */

.takeaways {
  margin: var(--space-5) 0;
  padding: var(--space-5);
  background: var(--color-surface);
  border: var(--border-width-hairline) solid var(--color-border);
  border-radius: var(--radius-lg);
}

.takeaways h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--type-sm);
  line-height: 1.3;
  letter-spacing: var(--track-tight);
  font-weight: 700;
}

.takeaways ul {
  margin: 0;
  padding-left: var(--space-4);
}

.takeaways li {
  margin: var(--space-1) 0;
  font-size: var(--type-h3);
  line-height: 1.6;
  color: var(--color-text);
}

/* ---------- the answer passage (designer component `answer`, recipe changed) --
   ONE device, two slots: the page's short answer at the top (.article-answer) and
   each section's quick answer under its h2 (.quick-answer). D5: it used to be a
   filled well (surface-raised + radius 20 + 24 padding + 24 margin) — six wells plus
   a takeaways plate plus two table plates is ten boxes in one article, the
   stack-of-blocks shape in the place that must read as a feature. Now it is a ruled
   passage: hairline above, micro label, ink paragraph. Nothing is lost — the label
   still announces it and the rule still separates it — and the fills are freed for
   the three things that need setting off (takeaways, tables, a quotation). */

.article-answer,
.quick-answer {
  margin: 0 0 var(--space-5);
  padding: 0;
  padding-block-start: var(--space-4);
  background: transparent;
  border: 0;
  border-block-start: var(--border-width-hairline) solid var(--color-border);
  border-radius: 0;
}

.article-answer p,
.quick-answer p {
  margin: 0;
  font-size: var(--type-h3);
  line-height: 1.6;
  color: var(--color-text);
}

.article-answer .quick-answer__label,
.quick-answer .quick-answer__label {
  margin: 0 0 var(--space-1);
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

/* ---------- note ---------- */

.article-body .note {
  margin: var(--space-4) 0 var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--type-caption);
  line-height: 1.6;
}

/* ---------- table plate ---------- */

.table-wrap {
  margin: var(--space-5) 0;
  overflow-x: auto;
  border: var(--border-width-hairline) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--type-sm);
  line-height: 1.5;
}

th,
td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--border-width-hairline) solid var(--color-border);
}

th {
  background: var(--color-surface-raised);
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

td {
  font-size: var(--type-sm);
  color: var(--color-text);
}

tr:last-child td {
  border-bottom: 0;
}

/* ---------- FAQ ---------- */

.faq {
  margin: var(--space-8) 0 var(--space-2);
}

.faq h2 {
  margin-top: 0;
}

.faq details {
  border-top: var(--border-width-hairline) solid var(--color-border);
  padding-block: var(--space-4);
}

.faq details:last-of-type {
  border-bottom: var(--border-width-hairline) solid var(--color-border);
}

.faq summary {
  display: flex;
  align-items: center;
  min-height: var(--touch-target);
  cursor: pointer;
  list-style: none;
  padding-right: var(--space-6);
  position: relative;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  font-size: var(--type-h3);
  font-weight: 400;
}

.faq details[open] summary::after {
  content: "–";
}

.faq-q {
  margin: 0;
  font-size: var(--type-h3);
  font-weight: 700;
  letter-spacing: var(--track-tight);
  line-height: 1.4;
}

.faq .faq-answer {
  margin: var(--space-4) 0 0;
  color: var(--color-text);
  font-size: var(--type-h3);
  line-height: 1.6;
}

/* ---------- CTA band ---------- */

.cta-block {
  margin-block-start: var(--space-8);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5);
}

.cta-block h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--type-title);
  line-height: 1.25;
  letter-spacing: var(--track-tight);
  font-weight: 700;
}

.cta-block p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--type-caption);
  line-height: 1.6;
}

.cta-block .btn {
  flex: 0 0 auto;
}

/* ---------- the guide's end block (designer component `store-end`) ----------
   C-16/D01: the end of a guide is the real store it ends at plus ONE CTA. Two
   separate links, no nesting, no whole-card anchor (resources-surface §9). The
   store name is the only h2 here — the label above it is a <p>, so the heading
   outline stays h1/h2/h3 for chapters and FAQ. Cross-origin store links open in a
   new tab (mirrors StoreLink); same-origin /s/{slug} links do not. */

.store-end {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-block-start: var(--space-8);
  padding: var(--space-4);
  background: var(--color-surface);
  border: var(--border-width-hairline) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.store-end__label {
  margin: 0;
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.store-end__name {
  margin: 0;
  font-size: var(--type-title);
  line-height: 1.2;
  letter-spacing: var(--track-tight);
  font-weight: 700;
}

.store-end__name a {
  color: var(--color-text);
  text-decoration: underline;
  text-decoration-thickness: var(--border-width-hairline);
  text-decoration-color: var(--color-text-muted);
  text-underline-offset: var(--space-1);
}

@media (hover: hover) {
  .store-end__name a:hover {
    color: var(--color-text);
    text-decoration-color: currentColor;
  }
}

.store-end .btn {
  width: 100%;
}

@media (min-width: 768px) {
  .store-end {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: var(--space-5);
    padding: var(--space-5);
  }

  .store-end__label { grid-column: 1 / -1; }

  .store-end .btn { width: auto; }
}

/* ---------- sources ---------- */

.sources {
  margin-block-start: var(--space-8);
  padding-top: var(--space-5);
  border-top: var(--border-width-hairline) solid var(--color-border);
  color: var(--color-text-muted);
  font-size: var(--type-caption);
  line-height: 1.6;
}

.sources h2 {
  margin: 0 0 var(--space-2);
  font-size: var(--type-micro);
  line-height: 1.3;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 700;
}

.sources ol {
  margin: 0;
  padding-left: var(--space-4);
}

.sources li {
  margin: var(--space-1) 0;
  font-size: var(--type-caption);
  line-height: 1.6;
}

/* ---------- hub ---------- */

.hub-header {
  max-width: var(--measure-prose);
}

.hub-header p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--type-h3);
  line-height: 1.6;
}

/* ---------- hub: the numbered contents page (designer `guide-row`, RB-2) -----
   The hub is a contents page, not a card grid. Three grounds (design RB-2): a thin
   set of 2-up boxes reads as a sparse store while rows in a numbered index read as
   a complete issue; the new guides have no media, and a media-less card grid is the
   weakest object in the system; the number is already the house device (chapters
   01-09, cards "Guide 01..04"). One 560 column, left-aligned; the right half is
   silence, not an empty slot. No badge, no count, no "updated" (§B.6). */

.guide-index {
  list-style: none;
  max-width: var(--measure-prose);
  margin: var(--space-6) 0 0;
  padding: 0;
}

.guide-row {
  border-block-start: var(--border-width-hairline) solid var(--color-border);
}

.guide-row:last-child {
  border-block-end: var(--border-width-hairline) solid var(--color-border);
}

.guide-row__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding-block: var(--space-4);
  color: var(--color-text);
  text-decoration: none;
}

.guide-row__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-block-end: var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--type-micro);
  font-weight: 700;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
}

.guide-row__cue {
  font-size: var(--type-sm);
  font-weight: 600;
  letter-spacing: normal;
  color: var(--color-text);
}

.guide-row__title {
  margin: 0;
  font-size: var(--type-title);
  line-height: 1.2;
  letter-spacing: var(--track-tight);
  font-weight: 700;
}

.guide-row__desc {
  font-size: var(--type-sm);
  line-height: 1.6;
  color: var(--color-text-muted);
}

@media (hover: hover) {
  .guide-row__link:hover .guide-row__title {
    text-decoration: underline;
    text-decoration-thickness: var(--border-width-hairline);
    text-underline-offset: var(--space-1);
  }
}

.guide-row__link:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

/* ---------- footer ---------- */

.site-footer {
  margin-block-start: var(--space-8);
  border-top: var(--border-width-hairline) solid var(--color-border);
}

.site-footer__inner {
  padding-block: var(--space-5) var(--space-8);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  color: var(--color-text-muted);
  font-size: var(--type-caption);
  line-height: 1.5;
}

.site-footer a {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-target);
  color: var(--color-text-muted);
  text-decoration: none;
}

@media (hover: hover) {
  .site-footer a:hover {
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-thickness: var(--border-width-hairline);
    text-underline-offset: var(--space-1);
  }
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
}

/* ---------- responsive ---------- */

@media (max-width: 1023px) {
  .page,
  .site-header__inner,
  .site-footer__inner {
    width: min(calc(100% - 2 * var(--space-6)), var(--content-max));
  }
}

@media (max-width: 767px) {
  .page,
  .site-header__inner,
  .site-footer__inner {
    width: min(calc(100% - 2 * var(--space-4)), var(--content-max));
  }

  .cta-block {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-block .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
    animation: none !important;
  }
}
