/* ============================================================================
   BYTEWORKS REBUILD — base.css
   Fonter, nollställning, grundtypografi, ytor och globala tillstånd.
   ========================================================================== */

/* ── Manrope, självhostad ─────────────────────────────────────────────── */
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Manrope'; src: url('../fonts/manrope-latin-800-normal.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }

/* ── Nollställning ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

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

body {
  font-family: var(--font);
  font-size: var(--text-body);
  font-weight: var(--vikt-normal);
  line-height: var(--lh-body);
  color: var(--t-mid);
  background: var(--yta-sida);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

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

input, button, textarea, select { font: inherit; color: inherit; }

button { background: none; border: 0; padding: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul[class], ol[class] { list-style: none; padding: 0; }

/* ── Rubriker — hela hierarkin definieras här, aldrig i komponenter ───── */
h1, h2, h3, h4 {
  color: var(--t-hi);
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); font-weight: var(--vikt-display); line-height: var(--lh-display); letter-spacing: var(--ls-h1); }
h2 { font-size: var(--text-h2); font-weight: var(--vikt-fet); line-height: var(--lh-rubrik); letter-spacing: var(--ls-rubrik); }
h3 { font-size: var(--text-h3); font-weight: var(--vikt-fet); line-height: var(--lh-rubrik); letter-spacing: var(--ls-rubrik); }
h4 { font-size: var(--text-h4); font-weight: var(--vikt-fet); line-height: var(--lh-kort);   letter-spacing: var(--ls-kort); }

p { max-width: var(--matt-text); text-wrap: pretty; }

strong { font-weight: var(--vikt-halvfet); color: var(--t-hi); }

::selection { background: var(--markering); color: var(--t-pa-accent); }

/* ── Textroller ────────────────────────────────────────────────────────── */
.etikett {
  display: inline-flex;
  align-items: center;
  gap: .6em;
  font-size: var(--text-eyebrow);
  font-weight: var(--vikt-fet);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--t-accent);
}
.etikett::before {
  content: "";
  width: 22px; height: 1.5px;
  background: var(--grad-accent);
  border-radius: 2px;
}

.lead {
  font-size: var(--text-lead);
  line-height: var(--lh-lead);
  max-width: var(--matt-lead);
  color: var(--t-mid);
}

.accent {
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.smal { max-width: var(--matt-text); }

/* ── Ytor ──────────────────────────────────────────────────────────────── */
.yta-mork    { background: var(--yta-sida);  color: var(--t-mid); }
.yta-royal   { background: var(--grad-djup); color: var(--t-mid); }
.yta-feature { background: var(--grad-royal); color: var(--t-hi); }   /* max EN per sida; fri brödtext hör inte hemma här — innehåll bor i kort */
.yta-ljus  { background: var(--yta-ljus); color: var(--t-body); }
.yta-moln  { background: var(--yta-moln); color: var(--t-body); }

.yta-ljus h1, .yta-ljus h2, .yta-ljus h3, .yta-ljus h4,
.yta-moln h1, .yta-moln h2, .yta-moln h3, .yta-moln h4 { color: var(--t-ink); }
.yta-ljus strong, .yta-moln strong { color: var(--t-ink); }
.yta-ljus .lead, .yta-moln .lead { color: var(--t-body); }
.yta-ljus .etikett, .yta-moln .etikett { color: var(--t-accent-ljus); }
.yta-ljus ::selection, .yta-moln ::selection { background: var(--markering-ljus); color: var(--t-ink); }

/* ── Fokus ─────────────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--fokus);
  outline-offset: 3px;
  border-radius: 6px;
}
.yta-ljus :focus-visible, .yta-moln :focus-visible { outline-color: var(--fokus-ljus); }

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: calc(var(--z-topp) + 1);
  padding: .7rem 1.2rem;
  background: var(--bw-cobalt-500);
  color: var(--t-pa-accent);
  font-weight: var(--vikt-fet);
  border-radius: var(--r-btn);
  transition: top var(--t-snabb) var(--ease);
}
.skip-link:focus-visible { top: 1rem; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Scroll-lås (drawer/dialog) ────────────────────────────────────────── */
body.ar-last { overflow: hidden; }

/* ── Reduced motion: bas ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
