/* =====================================================================
   CAPE LOUGI · base.css
   Reset, lehe baas, tüpograafia rollid (.t-*), sektsiooniraam.
   Ainus koht peale tokens.css-i, kus tohib määrata font-*, line-height, letter-spacing.
   ===================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scrollbar-gutter: stable;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scrollbar-color: color-mix(in srgb, var(--soft) 55%, transparent) var(--surface);
  scrollbar-width: thin;
}
html.is-scroll-locked { overflow: hidden; }
body {
  background: var(--ground);
  color: var(--ink);
  cursor: default;
  font-family: var(--f-body);
  font-weight: var(--w-light);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}
img, picture, video, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; background: none; border: 0; border-radius: 0; }
button, a, [role="button"], summary { cursor: pointer; }
input, textarea { cursor: text; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
h1, h2, h3, h4 { font-weight: inherit; font-size: inherit; line-height: inherit; }

/* Fookus ei reosta visuaali (AI_KULDREEGLID §13); klaviatuuriga kasutatavus jääb */
button:focus, a:focus, [role="button"]:focus { outline: none; box-shadow: none; }

/* ---------- Valik ja kerimisriba ---------- */
::selection      { background: var(--accent); color: var(--ground); text-shadow: none; }
::-moz-selection { background: var(--accent); color: var(--ground); text-shadow: none; }

@supports selector(::-webkit-scrollbar) {
  html { scrollbar-color: auto; scrollbar-width: auto; }
  ::-webkit-scrollbar { width: var(--scrollbar); height: var(--scrollbar); }
  ::-webkit-scrollbar-track { background: var(--surface); }
  ::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--soft) 55%, transparent);
    border: var(--scrollbar-inset) solid var(--surface);
    border-radius: 0;
  }
  ::-webkit-scrollbar-thumb:hover { background: var(--accent); }
}

/* ---------- Tüpograafia rollid ---------- */
.t-name {      /* hero ja closing'u nimi; --t-name määratakse hero juures (tokens.css) */
  font-family: var(--f-display);
  font-weight: var(--w-regular);
  font-size: var(--t-name, var(--t-h2));
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
}
.t-h2 {
  font-family: var(--f-display);
  font-weight: var(--w-regular);
  font-size: var(--t-h2);
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  text-wrap: balance;
}
.t-h2.head-gap { margin-bottom: calc(var(--head-gap) - var(--h2-below-base)); }
.t-h3 {
  font-family: var(--f-display);
  font-weight: var(--w-regular);
  font-size: var(--t-h3);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-none);
}
.t-sub {
  font-family: var(--f-display);
  font-weight: var(--w-regular);
  font-size: var(--t-sub);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-none);
}
.t-figure {
  font-family: var(--f-display);
  font-weight: var(--w-regular);
  font-size: var(--t-figure);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  font-variant-numeric: lining-nums;
}
.t-price {
  font-family: var(--f-display);
  font-weight: var(--w-regular);
  font-size: var(--t-price);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  font-variant-numeric: lining-nums;
}
.t-lead {
  font-family: var(--f-body);
  font-weight: var(--w-light);
  font-size: var(--t-lead);
  line-height: var(--lh-lead);
  letter-spacing: var(--ls-none);
  text-wrap: pretty;
}
.t-statement {   /* hero lause: lead, kõrgel ekraanil h3 suurusega */
  font-family: var(--f-body);
  font-weight: var(--w-light);
  font-size: var(--t-lead);
  line-height: var(--lh-lead);
  letter-spacing: var(--ls-none);
  text-wrap: pretty;
}
@media (min-width: 900px) and (min-height: 820px) {
  .t-statement { font-size: var(--t-h3); line-height: var(--lh-statement); }
}
.t-body {
  font-family: var(--f-body);
  font-weight: var(--w-light);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  letter-spacing: var(--ls-none);
  text-wrap: pretty;
}
.t-label {     /* suurtähtsildid */
  font-family: var(--f-label);
  font-weight: var(--w-regular);
  font-size: var(--t-small);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
}
.t-data {      /* andmeread = body suurus, Horiva */
  font-family: var(--f-label);
  font-weight: var(--w-regular);
  font-size: var(--t-body);
  line-height: var(--lh-label);
  letter-spacing: var(--ls-none);
  font-variant-numeric: tabular-nums;
}
.t-small {
  font-family: var(--f-body);
  font-weight: var(--w-regular);
  font-size: var(--t-small);
  line-height: var(--lh-lead);
  letter-spacing: var(--ls-none);
}
.t-note {      /* disclaimer */
  font-family: var(--f-body);
  font-weight: var(--w-regular);
  font-size: var(--t-fine);
  line-height: var(--lh-lead);
  letter-spacing: var(--ls-none);
  max-width: var(--measure-note);
}
.t-button {
  font-family: var(--f-label);
  font-weight: var(--w-regular);
  font-size: var(--t-button);
  line-height: 1;
  letter-spacing: var(--ls-none);
  text-transform: uppercase;
}
.t-button--fine { font-size: var(--t-fine); }   /* ringnupp „Ask" (kasutaja 2026-12-02): 12 px */

.t-menu-link { /* menüülingid: suurus laiusest JA kõrgusest (--t-menu) */
  font-family: var(--f-display);
  font-weight: var(--w-regular);
  font-size: var(--t-menu);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}
.t-menu-name { /* menüü kontaktinimi */
  font-family: var(--f-display);
  font-weight: var(--w-regular);
  font-size: var(--t-menu-name);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

/* ---------- Sektsiooniraam ---------- */
.wrap { padding-inline: var(--pad-x); }
.sec { padding-block: var(--sec); padding-inline: var(--pad-x); }
.sec--flush-top { padding-top: 0; }          /* sama tooniga järgmine sektsioon: üks --sec */
.sec--surface { background: var(--surface); }
.measure { max-width: var(--measure); }

/* ---------- Fotod ---------- */
.photo { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Vormiväljade autofill (AI_KULDREEGLID §15) ---------- */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  -webkit-box-shadow: inset 0 0 0 1000px var(--ground); /* lint-ok: autofill-kihi katmine */
  box-shadow: inset 0 0 0 1000px var(--ground); /* lint-ok: autofill-kihi katmine */
  transition: background-color 9999s ease-in-out 0s; /* lint-ok: autofill-kihi hoidmine */
}
.field input:-webkit-autofill:focus {
  box-shadow: inset 0 0 0 1000px var(--ground), 0 1px 0 0 var(--ink); /* lint-ok: autofill + alljoon */
}

/* ---------- Ligipääs ---------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; /* lint-ok: standardne sr-only */
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; /* lint-ok: reduced-motion */
    transition-duration: .01ms !important; /* lint-ok: reduced-motion */
    scroll-behavior: auto !important;
  }
}
