/* ============================================================
   ClearCourse House Style
   v3.0 — ClearCourse Brand (visual restyle, August 2026)

   Official lockup + Articulat. Orange is header-bar only.
   Compass gold is logo-only. Primary buttons are charcoal pills.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --color-logo-wordmark: #323E48;
  --color-logo-compass: #F7A70A;
  --color-hero-start: #F4A900;
  --color-hero-end: #FA6A28;
  --color-slate: #597183;
  --color-link: #046BD2;
  --color-link-hover: #045CB4;
  --color-body: #212529;
  --color-ink: #0D0E10;
  --color-surface: #FFFFFF;
  --color-surface-muted: #F4F4F4;
  --color-amber-tint: #FEF6E6;
  --font-brand: "Articulat CF", "articulat-cf", system-ui, sans-serif;

  /* Map legacy --cc-* so existing rules pick up ClearCourse Brand. */
  --cc-orange:        var(--color-logo-wordmark); /* not a button fill */
  --cc-orange-hover:  #283039;

  --cc-cream:         var(--color-surface);
  --cc-cream-soft:    var(--color-surface-muted);
  --cc-ink:           var(--color-logo-wordmark);
  --cc-ink-soft:      var(--color-slate);
  --cc-sand:          #cfd4d8;
  --cc-sand-light:    #e4e7ea;

  --cc-font-ui:        var(--font-brand);
  --cc-font-display:   var(--font-brand);
  --cc-font-editorial: "Fraunces", "Source Serif 4", "Charter", "Georgia", serif;
  --cc-font-mono:      "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;

  /* Spacing scale (8pt grid) */
  --cc-s1: 4px;
  --cc-s2: 8px;
  --cc-s3: 12px;
  --cc-s4: 16px;
  --cc-s5: 24px;
  --cc-s6: 32px;
  --cc-s7: 48px;
  --cc-s8: 64px;
  --cc-s9: 96px;

  /* Radii — pills for buttons/inputs; cards stay 8–20px */
  --cc-radius-sm: 999px;
  --cc-radius-md: 8px;

  /* Borders — sand is the structural workhorse */
  --cc-border:          1px solid var(--cc-sand);
  --cc-border-hairline: 1px solid var(--cc-sand-light);

  /* Layout — full width with content-aware constraints */
  --cc-prose-width:  75ch;                          /* readable text column ~720-780px */
  --cc-wide-width:   1280px;                        /* tables, metrics, header, footer, tabs */
  --cc-narrow-width: 800px;                         /* for the --narrow modifier */
  --cc-padding-x:    clamp(20px, 4vw, 64px);        /* responsive horizontal padding */
  --cc-padding-y:    clamp(32px, 6vw, 80px);        /* responsive vertical padding */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0;
  font-family: var(--cc-font-ui);
  font-size: 17px;
  line-height: 1.55;
  color: var(--color-body);
  background: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Layout wrapper ---------- */
/* The .cc-doc container is centred in the viewport once, capped at wide-width.
   All direct children share the same left edge — prose stops short at its
   max-width, wide structural components fill the container. */
.cc-doc {
  width: 100%;
  max-width: var(--cc-wide-width);
  margin: 0 auto;
  padding: var(--cc-padding-y) var(--cc-padding-x);
}

/* Prose children: constrained max-width for legibility, left-aligned naturally */
.cc-doc > p,
.cc-doc > h2,
.cc-doc > h3,
.cc-doc > h4,
.cc-doc > ul,
.cc-doc > ol,
.cc-doc > .cc-lede,
.cc-doc > .cc-eyebrow,
.cc-doc > blockquote,
.cc-doc > .cc-callout,
.cc-doc > pre,
.cc-doc > hr {
  max-width: var(--cc-prose-width);
}

/* H1 even tighter — keeps the compressed display effect wrapping satisfyingly */
.cc-doc > h1 {
  max-width: 22ch;
}

/* Modifier: classic narrow editorial document (~800px column for everything) */
.cc-doc--narrow {
  max-width: var(--cc-narrow-width);
}
.cc-doc--narrow > p,
.cc-doc--narrow > h1,
.cc-doc--narrow > h2,
.cc-doc--narrow > h3,
.cc-doc--narrow > h4,
.cc-doc--narrow > ul,
.cc-doc--narrow > ol,
.cc-doc--narrow > .cc-lede,
.cc-doc--narrow > .cc-eyebrow,
.cc-doc--narrow > blockquote,
.cc-doc--narrow > .cc-callout,
.cc-doc--narrow > pre,
.cc-doc--narrow > hr {
  max-width: 100%;
}

/* Modifier: true edge-to-edge for dashboards and data-heavy layouts */
.cc-doc--full {
  max-width: 100%;
}
.cc-doc--full > p,
.cc-doc--full > h2,
.cc-doc--full > h3,
.cc-doc--full > h4,
.cc-doc--full > ul,
.cc-doc--full > ol,
.cc-doc--full > .cc-lede,
.cc-doc--full > .cc-eyebrow,
.cc-doc--full > blockquote,
.cc-doc--full > .cc-callout,
.cc-doc--full > pre,
.cc-doc--full > hr {
  max-width: 100%;
}
.cc-doc--full > h1 {
  max-width: 22ch;
}

/* ---------- Document header ---------- */
.cc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  padding-bottom: var(--cc-s4);
  margin-bottom: var(--cc-s5);
  border-bottom: none;
}
.cc-header__brand,
.cc-header__brand:hover {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--color-logo-wordmark);
}
.cc-header__logo {
  display: block;
  height: 28px;
  width: auto;
}
.cc-header__accent {
  position: absolute;
  left: calc(-1 * var(--cc-padding-x));
  right: calc(-1 * var(--cc-padding-x));
  bottom: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--color-hero-start), var(--color-hero-end));
}
.cc-header__product {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-slate);
}
.cc-header__meta {
  font-size: 0.8rem;
  color: var(--cc-ink-soft);
  text-align: right;
  line-height: 1.5;
}

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--cc-font-display);
  color: var(--color-logo-wordmark);
  margin: var(--cc-s7) 0 var(--cc-s4);
}
h1 {
  font-size: 3.75rem;
  font-weight: 700;
  line-height: 0.90;          /* compressed display signature */
  letter-spacing: -0.035em;
  margin: 0 0 var(--cc-s4);
}
h1 + .cc-lede {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--cc-ink-soft);
  font-weight: 400;
  margin-bottom: var(--cc-s7);
  max-width: 60ch;
}
h2 {
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.0;
  letter-spacing: -0.025em;
  margin-top: var(--cc-s8);
}
h3 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-top: var(--cc-s6);
}
h4 {
  font-family: var(--cc-font-ui);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cc-ink-soft);
  margin-top: var(--cc-s5);
  margin-bottom: var(--cc-s3);
}

p { margin: 0 0 var(--cc-s4); }
p:last-child { margin-bottom: 0; }

/* Strong stays near-black — emphasis through weight, not colour */
strong {
  font-weight: 700;
  color: var(--cc-ink);
}

/* Links — ClearCourse Brand blue */
a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-color: var(--color-link);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s, color 0.15s;
}
a:hover {
  color: var(--color-link-hover);
  text-decoration-color: var(--color-link-hover);
}

/* ---------- Lists ---------- */
ul, ol { padding-left: var(--cc-s5); margin: 0 0 var(--cc-s4); }
li { margin-bottom: var(--cc-s2); }
ul li::marker { color: var(--cc-ink-soft); }
ol li::marker { color: var(--cc-ink); font-weight: 700; }

/* ---------- Eyebrow label ---------- */
/* Optional small uppercase label above section H2s */
.cc-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cc-ink-soft);
  margin-bottom: var(--cc-s2);
}

/* ---------- Callouts ---------- */
.cc-callout {
  border: var(--cc-border);
  border-radius: var(--cc-radius-md);
  padding: var(--cc-s5);
  margin: var(--cc-s6) 0;
  background: var(--cc-cream);
}
.cc-callout--accent {
  border-left: 3px solid var(--cc-orange);
  padding-left: calc(var(--cc-s5) - 2px);
}
.cc-callout--error {
  border-left: 3px solid #9a321b;
  padding-left: calc(var(--cc-s5) - 2px);
}
.cc-callout__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--cc-ink-soft);
  margin-bottom: var(--cc-s2);
}
.cc-callout--accent .cc-callout__label {
  color: var(--cc-orange);
}

/* ---------- Blockquotes (editorial) ---------- */
blockquote {
  font-family: var(--cc-font-editorial);
  font-size: 1.6rem;
  line-height: 1.35;
  font-weight: 400;
  color: var(--cc-ink);
  margin: var(--cc-s7) 0;
  padding: var(--cc-s2) 0 var(--cc-s2) var(--cc-s5);
  border-left: 2px solid var(--cc-ink);
}
blockquote cite {
  display: block;
  margin-top: var(--cc-s3);
  font-family: var(--cc-font-ui);
  font-style: normal;
  font-size: 0.85rem;
  color: var(--cc-ink-soft);
}
blockquote cite::before { content: "— "; }

/* ---------- Metric cards ---------- */
.cc-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--cc-s4);
  margin: var(--cc-s6) 0;
}
.cc-metric {
  border: var(--cc-border);
  border-radius: var(--cc-radius-md);
  padding: var(--cc-s5);
  background: var(--cc-cream);
}
.cc-metric__value {
  display: block;
  font-family: var(--cc-font-display);
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 0.95;
  color: var(--cc-ink);
  margin-bottom: var(--cc-s2);
}
.cc-metric__value--accent { color: var(--cc-orange); }
.cc-metric__label {
  font-size: 0.8rem;
  color: var(--cc-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ---------- Tables ---------- */
.cc-table-wrap {
  border: var(--cc-border);
  border-radius: var(--cc-radius-md);
  overflow: hidden;
  margin: var(--cc-s6) 0;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  background: var(--cc-cream);
}
th {
  text-align: left;
  padding: var(--cc-s3) var(--cc-s4);
  background: var(--cc-cream);
  border-bottom: var(--cc-border);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--cc-ink-soft);
}
td {
  padding: var(--cc-s3) var(--cc-s4);
  border-bottom: var(--cc-border-hairline);
}
tr:last-child td { border-bottom: none; }

/* ---------- Buttons / CTAs ---------- */
.cc-btn {
  display: inline-block;
  padding: 20px 24px;            /* generous, per spec */
  background: var(--color-logo-wordmark);
  color: var(--color-surface);
  font-family: var(--cc-font-ui);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.005em;
  border-radius: var(--cc-radius-sm);
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.cc-btn:hover {
  background: var(--cc-orange-hover);
  color: var(--color-surface);
  text-decoration: none;
}
.cc-btn--ghost {
  background: transparent;
  color: var(--cc-ink);
  border: 1.5px solid var(--cc-ink);
  padding: calc(20px - 1.5px) calc(24px - 1.5px);
}
.cc-btn--ghost:hover {
  background: var(--cc-ink);
  color: var(--cc-cream);
}

/* ---------- Tabs ---------- */
/* Active tab uses inset box-shadow per spec — not border-bottom */
.cc-tabs {
  display: flex;
  gap: var(--cc-s5);
  border-bottom: var(--cc-border);
  margin: var(--cc-s6) 0 var(--cc-s5);
}
.cc-tab {
  padding: var(--cc-s3) 0;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--cc-ink-soft);
  text-decoration: none;
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.15s;
}
.cc-tab:hover {
  color: var(--cc-ink);
  text-decoration: none;
}
.cc-tab--active {
  color: var(--cc-ink);
  box-shadow: var(--cc-orange) 0 -4px 0 0 inset;
}

/* ---------- Tags / pills ---------- */
.cc-tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--cc-sand);
  border-radius: var(--cc-radius-sm);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--cc-ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--cc-cream);
}
.cc-tag--accent {
  border-color: var(--cc-orange);
  color: var(--cc-orange);
}

/* ---------- Dividers ---------- */
hr {
  border: none;
  height: 1px;
  background: var(--cc-sand);
  margin: var(--cc-s7) 0;
}

/* ---------- Code ---------- */
code {
  font-family: var(--cc-font-mono);
  font-size: 0.9em;
  background: var(--cc-cream-soft);
  border: var(--cc-border-hairline);
  color: var(--cc-ink);
  padding: 1px 6px;
  border-radius: var(--cc-radius-sm);
}
pre {
  background: var(--cc-ink);
  color: var(--cc-cream);
  padding: var(--cc-s5);
  border-radius: var(--cc-radius-md);
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: var(--cc-s5) 0;
  border: none;
}
pre code {
  background: none;
  border: none;
  color: inherit;
  padding: 0;
}

/* ---------- Footer ---------- */
.cc-footer {
  margin-top: var(--cc-s9);
  padding-top: var(--cc-s5);
  border-top: var(--cc-border);
  font-size: 0.8rem;
  color: var(--cc-ink-soft);
  display: flex;
  justify-content: flex-start;
  text-align: left;
  flex-wrap: wrap;
  gap: var(--cc-s3);
}

/* ---------- Print ---------- */
@media print {
  body { background: white; font-size: 11pt; }
  .cc-doc { padding: 0; max-width: 100%; }
  .cc-doc > * { max-width: 100%; }
  h1, h2, h3 { page-break-after: avoid; }
  .cc-callout, .cc-metric, blockquote, table { page-break-inside: avoid; }
  a { color: var(--cc-ink); }
}

/* ---------- Mobile ---------- */
/* Most layout responsiveness is handled by clamp() on padding above.
   This block tunes typography and component-specific behaviour at narrow widths. */
@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.75rem; }
  h3 { font-size: 1.2rem; }
  .cc-metric__value { font-size: 2.25rem; }
  .cc-header { flex-direction: column; align-items: flex-start; gap: var(--cc-s3); }
  .cc-header__meta { text-align: left; }
  .cc-btn, .cc-btn--ghost { padding: 16px 20px; font-size: 0.95rem; }
  /* On mobile, all width constraints relax — the viewport is already narrow */
  .cc-doc > h1,
  .cc-doc > p,
  .cc-doc > h2,
  .cc-doc > h3,
  .cc-doc > h4,
  .cc-doc > ul,
  .cc-doc > ol,
  .cc-doc > .cc-lede,
  .cc-doc > .cc-eyebrow,
  .cc-doc > blockquote,
  .cc-doc > .cc-callout,
  .cc-doc > pre,
  .cc-doc > hr { max-width: 100%; }
  .cc-tabs { gap: var(--cc-s4); overflow-x: auto; }
}