/* cybernotes.it — non-critical styles.
 *
 * Every colour, font and measure here comes from a var() defined in the inline
 * critical block (pages/templates/pages/_critical_css.html). Nothing is
 * redefined, so there is one place to change a token and no drift between the
 * inline block and this file.
 *
 * Plain hand-written CSS, no framework and no build step — the convention on
 * every site in this stack.
 */

/* --- Header --------------------------------------------------------------- */

.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--rule);
}

.site-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}

.brand {
  /* Standalone nav control, so the same 44px floor as the rest of the header.
     Measured 111x33 before this. */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { color: var(--link-hover); }

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 44px minimum pointer target. These are standalone navigation controls, not
 * links inside a sentence, so WCAG 2.5.8's inline exception does not apply to
 * them — they measured 20px tall until a real browser was asked.
 *
 * Links inside prose (the breadcrumb, anything in body copy) are deliberately
 * left alone: they ARE inline, the exception does apply, and forcing 44px on
 * them would wreck line spacing for no accessibility gain. */
.site-nav__list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
}
.site-nav__list a:hover { color: var(--link-hover); }

/* Icon-only control: the accessible name comes from aria-label on the button,
 * and the glyph is aria-hidden. Sized to the 44px pointer target minimum. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--dur) ease, color var(--dur) ease;
}
.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Staging marker ------------------------------------------------------- */

/* Loud on purpose. Someone looking at staging must never spend a minute
 * wondering whether they are looking at production. */
.staging-banner {
  margin: 0;
  padding: 8px var(--gut);
  background: var(--gold-500);
  color: #10262f; /* fixed dark ink: this banner keeps its colours in both themes */
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
}

/* --- Content -------------------------------------------------------------- */

.prose {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-block: clamp(32px, 7vw, 72px);
}

.prose h1 {
  margin: 0 0 0.4em;
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.prose h2 {
  margin: 2em 0 0.5em;
  font-size: clamp(1.375rem, 3vw, 1.75rem);
  line-height: 1.25;
}

.prose p { margin: 0 0 1.1em; }

.lede {
  font-size: 1.1875rem;
  color: var(--ink-muted);
}

.prose a {
  color: var(--link);
  text-underline-offset: 0.15em;
}
.prose a:hover { color: var(--link-hover); }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  padding: 0.15em 0.35em;
  border-radius: 4px;
  background: var(--surface);
}

.prose pre {
  overflow-x: auto;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}
.prose pre code { padding: 0; background: none; }

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

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  margin-top: 48px;
  padding-block: 24px;
  border-top: 1px solid var(--rule);
  color: var(--ink-muted);
  font-size: 0.9375rem;
}
.site-footer p { margin: 0; }

/* ===== Phase 5: hero, parts list, callouts, credentials, footer ========== */

/* --- Hero ---------------------------------------------------------------- */

.hero {
  background: var(--banner-bg);
  color: var(--banner-ink);
  padding-block: clamp(40px, 8vw, 88px);
}
.hero__inner { max-width: var(--maxw); margin-inline: auto; }
.hero__heading {
  margin: 0 0 .4em;
  font-size: clamp(1.9rem, 5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.hero__sub {
  margin: 0 0 1.4em;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--banner-ink);
  max-width: 60ch;
}
.hero__cta-wrap { margin: 0; }

/* Gold FILL with dark ink on top, not gold text on teal. #10262f on #e8b923
 * measures 10.4:1, so the call to action is the most readable thing on the
 * page rather than the least — which is the opposite of what gold-on-teal
 * text would have given us at 3.85:1. */
/* `a.cta`, not `.cta` — the element selector is load-bearing.
 *
 * `.prose a { color: var(--link) }` is specificity 0,1,1 and beats a bare
 * `.cta` at 0,1,0, so a CTA placed inside prose took the prose link colour.
 * In dark theme that is gold-300 text on this gold-500 fill: about 1.15:1,
 * completely unreadable. Light theme looked fine, because --link is dark teal
 * there — which is why it survived until axe was run against the dark theme.
 *
 * `a.cta` ties at 0,1,1 and is declared later, so it wins. */
a.cta,
.cta {
  display: inline-block;
  padding: 13px 26px;
  min-height: 44px;
  border-radius: 6px;
  background: var(--gold-500);
  color: #10262f;
  font-weight: 650;
  text-decoration: none;
  transition: transform var(--dur) ease, filter var(--dur) ease;
}
.cta:hover { filter: brightness(1.06); }
.cta:active { transform: translateY(1px); }
.hero a:not(.cta) { color: var(--banner-link); }

/* --- Parts list ---------------------------------------------------------- */

.parts { list-style: none; margin: 1.2em 0; padding: 0; counter-reset: none; }

.parts__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.parts__item:first-child { border-top: 1px solid var(--rule); }

.parts__link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  flex: 1 1 auto;
  /* 44px minimum pointer target: padding rather than a fixed height, so a
   * two-line title on a narrow screen still grows instead of clipping. */
  min-height: 44px;
  padding-block: 8px;
  text-decoration: none;
  color: var(--link);
}
.parts__link:hover .parts__title { text-decoration: underline; }

.parts__n {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.parts__title { font-weight: 600; font-size: 1.06rem; }
.parts__sub { flex: 1 1 100%; color: var(--ink-muted); font-size: .95rem; }
.parts__meta { flex: 0 0 auto; color: var(--ink-muted); font-size: .9rem; }

/* Not-yet-published parts. The distinction is carried by the words "In
 * preparation" and by the <li>'s aria-label — never by colour or position
 * alone. The muted treatment is a second, redundant signal. */
.parts__item--pending { color: var(--ink-muted); }
.parts__item--pending .parts__body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  flex: 1 1 auto;
  padding-block: 8px;
}
.parts__item--pending .parts__title { font-weight: 500; }
.parts__pending {
  flex: 0 0 auto;
  padding: 3px 10px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

/* --- Callout ------------------------------------------------------------- */

.callout {
  margin: 1.6em 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--surface);
}
.callout p { margin: 0 0 .7em; }
.callout p:last-child { margin-bottom: 0; }

/* --- Demo credentials ---------------------------------------------------- */

.cred { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; margin: 1.2em 0; }
#get-credentials { border: 1px solid var(--gold-500); cursor: pointer; font: inherit; font-weight: 650; }
#get-credentials:disabled { opacity: .65; cursor: progress; }

.cred-status { margin: 0; color: var(--ink-muted); font-size: .95rem; }
.cred-status--ok { color: var(--ink); font-weight: 600; }
/* Error text carries a word as well as a colour — the message itself says what
 * went wrong, so colour is never the only channel. */
.cred-status--error { color: var(--error); font-weight: 600; }

.cred-fields { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 1.2em 0; }
.cred-fields dt { font-weight: 600; color: var(--ink-muted); }
.cred-fields dd { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cred-fields code { word-break: break-all; }

.copy {
  min-height: 44px;
  min-width: 44px;
  padding: 6px 14px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
}
.copy:hover { border-color: var(--accent); color: var(--accent); }

/* --- Footer -------------------------------------------------------------- */

.site-footer__inner { display: flex; flex-direction: column; gap: 14px; }
.site-footer__nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
}
.site-footer__meta { margin: 0; }
.site-footer__meta a { color: var(--link); }

.crumb { color: var(--ink-muted); font-size: .95rem; }
.note { color: var(--ink-muted); font-size: .95rem; }

/* ===== Phase 6: detail page, spec index ================================== */

.training-part {
  margin: 0 0 .3em;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.training-meta { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 1.4em 0; }
.training-meta dt { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.training-meta dd { margin: 0 0 0 0; font-weight: 600; }
.training-meta dt, .training-meta dd { flex: 0 0 auto; }

.deck-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0 .6em; }
/* Same specificity note as a.cta above: any component dropped inside .prose
 * needs to out-rank `.prose a`, or it silently takes the prose link colour. */
a.btn-secondary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 12px 22px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  color: var(--link);
  text-decoration: none;
  font-weight: 600;
}
.btn-secondary:hover { border-color: var(--accent); }

.outcomes { padding-left: 1.2em; }
.outcomes li { margin-bottom: .4em; }

.crumb a { color: var(--link); }
.crumb span { margin: 0 .4em; color: var(--ink-muted); }

/* Pager */
.pager { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; margin-top: 2.6em; padding-top: 1.4em; border-top: 1px solid var(--rule); }
.pager a {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 44px;
  padding: 8px 0;
  text-decoration: none;
  max-width: 46%;
}
.pager__next { text-align: right; margin-left: auto; }
.pager__dir { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-muted); }
.pager__title { color: var(--link); font-weight: 600; }
.pager a:hover .pager__title { text-decoration: underline; }

/* Spec index */
.spec-list { list-style: none; margin: 1.6em 0; padding: 0; }
.spec { padding: 18px 0; border-bottom: 1px solid var(--rule); }
.spec:first-child { border-top: 1px solid var(--rule); }
.spec__title { margin: 0 0 .3em; font-size: 1.2rem; }
.spec__title a { display: inline-flex; align-items: center; min-height: 44px; color: var(--link); }
.spec__meta { margin: 0 0 .5em; font-size: .88rem; color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: 6px 10px; }
.spec__kind {
  padding: 2px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: .78rem;
  letter-spacing: .04em;
}
.spec__desc { margin: 0; }

/* The warning callout is a different shape as well as a different colour —
 * the border weight and the bold lead sentence both carry it, so the meaning
 * does not depend on seeing the hue. */
.callout--warning { border-left-width: 6px; border-left-color: var(--gold-500); background: var(--bg-alt); }
