/* ============================================================
   Nordic Club UA — base.css
   Element defaults, typography, utilities. Load after tokens.css.

   Surface-context variables (--c-*) are the section-rhythm
   system: light values live on <body>, dark sections override
   them (layout.css). Components consume ONLY --c-* so their
   colours flip automatically on dark surfaces.
   ============================================================ */

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  background: var(--paper);
  color: var(--ink-800);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* Surface context — light defaults */
  --c-bg: var(--paper);
  --c-text: var(--ink-800);
  --c-muted: var(--slate-600);
  --c-line: var(--paper-200);
  --c-line-soft: var(--paper-100);
  /* Темне золото: 5.9:1 на білому. Див. коментар у tokens.css. */
  --c-accent-text: var(--gold-800);
  --c-focus: var(--gold-800);
  --c-card-bg: var(--paper);
  --c-surface: var(--paper-50);
  --c-field-bg: var(--paper);
  --c-field-border: var(--paper-200);
  --c-hover-fill: rgba(8, 29, 42, .05);
  --c-solid: var(--ink-800);
  --c-solid-text: var(--paper);
}

/* ---- Headings — Manrope, light, tight ---- */

h1,
.h1 {
  font-family: var(--font-display);
  font-size: var(--fs-hero);
  font-weight: 200;
  line-height: var(--lh-hero);
  letter-spacing: var(--ls-hero);
  color: var(--c-text);
}

h2,
.h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 300;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--c-text);
}

h3,
.h3 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--c-text);
}

h4,
.h4 {
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  font-weight: 500;
  line-height: var(--lh-sub);
  color: var(--c-text);
}

/* ---- Body text ---- */

.lead {
  font-size: var(--fs-lead);
  line-height: 1.55;
  color: var(--c-muted);
  max-width: var(--measure);
}

/* Links: quiet inherit + gold underline. Never small gold text on white. */
a {
  color: inherit;
}

a:where(:not([class])) {
  text-decoration: underline;
  text-decoration-color: var(--c-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-thickness var(--t-fast) var(--ease-ui);
}

a:where(:not([class])):hover {
  text-decoration-thickness: 2px;
}

/* ---- Lists ---- */

ul:where(:not([class])),
ol:where(:not([class])) {
  padding-inline-start: 1.25em;
}

ul:where(:not([class])) {
  list-style: square;
}

li:where(:not([class]))::marker {
  color: var(--c-accent-text);
}

li:where(:not([class])) + li:where(:not([class])) {
  margin-top: 0.5em;
}

/* ---- Tables (raw element defaults; .table in components.css) ---- */

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 0.75em 1em;
  border-bottom: 1px solid var(--c-line);
  vertical-align: top;
}

th {
  font-weight: 600;
}

/* ---- Misc elements ---- */

code,
kbd,
samp {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--c-surface);
  padding: 0.15em 0.4em;
  border-radius: var(--r-sm);
}

hr {
  border: 0;
  border-top: 1px solid var(--c-line);
  margin-block: 2em;
}

blockquote:where(:not([class])) {
  padding-inline-start: 1.25em;
  border-inline-start: 2px solid var(--gold-500);
  color: var(--c-muted);
}

strong,
b {
  font-weight: 600;
}

small {
  font-size: var(--fs-sm);
}

/* ---- Eyebrow label — Inter 500, caps, tracked ---- */

.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: var(--ls-eyebrow);
  color: var(--c-accent-text);
}

.eyebrow--muted {
  color: var(--c-muted);
}

/* Two-digit index prefix, e.g. <span class="eyebrow__num">01</span> */
.eyebrow__num {
  color: var(--c-muted);
  margin-inline-end: 0.75em;
  font-variant-numeric: tabular-nums;
}

/* ---- Utilities ---- */

.u-measure {
  max-width: var(--measure);
}

.u-center {
  margin-inline: auto;
  text-align: center;
}

.u-muted {
  color: var(--c-muted);
}

.u-accent {
  color: var(--c-accent-text);
}

/* Важкі секції нижче першого екрана рендеряться за потребою. НЕ
   ставте .u-cv на секцію з id, на який веде посилання: пропущені
   секції міряються за contain-intrinsic-size, і перехід за
   #фрагментом «не долітає». */
.u-cv {
  content-visibility: auto;
  contain-intrinsic-size: auto 900px;
}

/* Vertical rhythm inside prose blocks */
.flow > * + * {
  margin-block-start: var(--flow-space, 1.25em);
}

.flow > h2 + *,
.flow > h3 + * {
  --flow-space: 0.75em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--z-skip);
  padding: 12px 20px;
  background: var(--gold-500);
  color: var(--ink-900);
  /* Пігулка сама золота — золота рамка на ній була б невидима */
  --c-focus: var(--ink-900);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  border-radius: var(--r-sm);
  transform: translateY(-200%);
}

/* Рамка ВСЕРЕДИНІ золотої пігулки: вона спливає над темним hero,
   тому зовнішня темна рамка була б невидима. 11.5:1. */
.skip-link:focus-visible {
  transform: none;
  outline-offset: -4px;
}

/* <main> має tabindex="-1", щоб skip-link справді переносив фокус
   (Safari інакше лишає його в хедері). Фокус програмний. */
main:focus {
  outline: none;
}

/* ---- Print basics ---- */

@media print {
  .site-header,
  .site-footer .site-footer__socials,
  .skip-link,
  .nav-overlay,
  .btn {
    display: none;
  }

  body {
    background: var(--paper);
    color: var(--ink-900);
  }

  a:where(:not([class]))::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }
}
