/* ─────────────────────────────────────────────────────────────
   runpace.no — designsystem
   Chrome (topplinje, meny, bunn), artikkeltypografi, tabeller og
   App Store-blokkene. Lastes av hver eneste side.
   ───────────────────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Grunnpalett — arvet fra appen */
  --bg:         #000;
  --surface:    #383838;   /* kort og knapper, som i kalkulatoren */
  --surface-2:  #131313;   /* svakt løft fra bakgrunnen, for lange flater */
  --surface-3:  #1c1c1c;   /* hover og tabellhoder */
  --accent:     #F2C800;
  --accent-dim: #8a7412;

  --text:       #fff;
  --text-mid:   rgba(255,255,255,0.72);
  --text-dim:   rgba(255,255,255,0.45);
  --text-faint: rgba(255,255,255,0.28);
  --divider:    rgba(255,255,255,0.1);
  --divider-2:  rgba(255,255,255,0.055);

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI',
          Roboto, Helvetica, Arial, sans-serif;

  --wrap:   1080px;   /* seksjoner i full bredde */
  --narrow:  720px;   /* brødtekst — rundt 75 tegn per linje */
  --header-h: 56px;
}

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }

.hidden { display: none !important; }

/* Synlig bare for skjermlesere — brukes av «hopp til innhold» */
.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;
}
.skip-link:focus {
  position: fixed; top: 0.5rem; left: 0.5rem; z-index: 400;
  width: auto; height: auto; clip: auto; margin: 0;
  padding: 0.6rem 1rem; background: var(--accent); color: #000;
  border-radius: 8px; font-weight: 600;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Layout ───────────────────────────────────────────────── */
.wrap   { width: 100%; max-width: var(--wrap);   margin: 0 auto; padding: 0 1.25rem; }
.narrow { width: 100%; max-width: var(--narrow); margin: 0 auto; padding: 0 1.25rem; }
main { display: block; min-height: 60vh; }
section { padding: 2.75rem 0; }
section + section { border-top: 1px solid var(--divider-2); }

/* ── Topplinje ────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 120;
  height: var(--header-h);
  display: flex; align-items: center;
  background: rgba(0,0,0,0.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--divider);
  padding-top: env(safe-area-inset-top);
}
.site-header .wrap { display: flex; align-items: center; gap: 0.75rem; }

.brand {
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none; flex-shrink: 0;
}
.brand:hover { text-decoration: none; }
.brand b { color: var(--accent); font-weight: 700; }

.nav-main { display: none; margin-left: 0.75rem; gap: 0.15rem; flex: 1; }
.nav-main a {
  font-size: 0.9rem; color: var(--text-mid); padding: 0.4rem 0.6rem;
  border-radius: 8px; white-space: nowrap;
}
.nav-main a:hover { color: var(--text); background: var(--surface-3); text-decoration: none; }
.nav-main a[aria-current="page"] { color: var(--accent); }

.header-spacer { flex: 1; }

.header-cta {
  display: inline-flex; align-items: center; gap: 0.4rem;
  flex-shrink: 0; padding: 0.4rem 0.75rem;
  background: var(--accent); color: #000;
  border: none; border-radius: 999px;
  font-family: inherit; font-size: 0.82rem; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.header-cta:hover { background: #ffd91f; text-decoration: none; }
.header-cta:active { opacity: 0.75; }
.header-cta span { display: none; }

.hamburger {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; background: none; border: none; cursor: pointer;
  touch-action: manipulation; margin-left: -0.4rem;
}
.hamburger span {
  display: block; width: 19px; height: 2px; border-radius: 2px;
  background: var(--text); transition: transform 0.22s ease, opacity 0.22s ease;
}
.nav-open .hamburger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .hamburger span:nth-child(2) { opacity: 0; }
.nav-open .hamburger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (min-width: 900px) {
  .hamburger { display: none; }
  .nav-main { display: flex; }
  .header-spacer { display: none; }
  .header-cta span { display: inline; }
}

/* ── Skuff (mobilmeny) ────────────────────────────────────── */
.nav-drawer {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 110;
  background: var(--bg);
  padding: 1.25rem 0 3rem; overflow-y: auto;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-open .nav-drawer { transform: none; opacity: 1; pointer-events: auto; }
body.nav-open { overflow: hidden; }
.nav-drawer .nav-group { margin-bottom: 1.5rem; }
.nav-drawer .nav-group-title {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.5rem;
}
.nav-drawer a {
  display: block; padding: 0.55rem 0; color: var(--text);
  font-size: 1.0625rem; border-bottom: 1px solid var(--divider-2);
}
.nav-drawer a:hover { color: var(--accent); text-decoration: none; }
.nav-drawer a[aria-current="page"] { color: var(--accent); }
@media (min-width: 900px) { .nav-drawer { display: none; } }

/* ── Brødsmuler ───────────────────────────────────────────── */
.crumbs {
  font-size: 0.8rem; color: var(--text-dim);
  padding: 1.1rem 0 0; display: flex; flex-wrap: wrap; gap: 0.35rem;
}
.crumbs a { color: var(--text-dim); }
.crumbs a:hover { color: var(--accent); }
.crumbs span[aria-current] { color: var(--text-mid); }

/* ── Typografi ────────────────────────────────────────────── */
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-size: clamp(1.65rem, 5.2vw, 2.35rem); margin: 0.9rem 0 0.85rem; }
h2 { font-size: clamp(1.25rem, 3.4vw, 1.55rem); margin: 2.4rem 0 0.75rem; }
h3 { font-size: 1.075rem; margin: 1.7rem 0 0.5rem; color: var(--text); }
h2 + h3 { margin-top: 1rem; }

p { margin: 0 0 1.05rem; color: var(--text-mid); }
p strong, li strong { color: var(--text); font-weight: 600; }
article ul, article ol { margin: 0 0 1.15rem 1.15rem; color: var(--text-mid); }
article li { margin-bottom: 0.5rem; padding-left: 0.2rem; }
article li::marker { color: var(--accent-dim); }

.lead { font-size: 1.15rem; color: var(--text); line-height: 1.6; }

.page-meta {
  font-size: 0.8rem; color: var(--text-faint);
  margin-bottom: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.6rem;
}

/* Svarboksen: det direkte svaret, først på sida. Den er både det
   leseren kom for, og det Google og AI-assistenter plukker ut. */
.answer {
  background: var(--surface-2);
  border: 1px solid var(--divider);
  border-left: 3px solid var(--accent);
  border-radius: 0 12px 12px 0;
  padding: 1.05rem 1.25rem;
  margin: 0 0 1.9rem;
}
.answer p { color: var(--text); font-size: 1.075rem; margin: 0; }
.answer p + p { margin-top: 0.7rem; color: var(--text-mid); font-size: 1rem; }
.answer strong { color: var(--accent); font-weight: 700; }

/* ── Tabeller ─────────────────────────────────────────────── */
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 0 0 1.5rem; border: 1px solid var(--divider); border-radius: 12px;
}
table {
  width: 100%; border-collapse: collapse;
  font-size: 0.95rem; font-variant-numeric: tabular-nums;
}
thead th {
  position: sticky; top: 0;
  background: var(--surface-3); color: var(--text);
  text-align: left; font-weight: 600; font-size: 0.8rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 0.7rem 0.9rem; white-space: nowrap;
  border-bottom: 1px solid var(--divider);
}
tbody td {
  padding: 0.6rem 0.9rem; color: var(--text-mid);
  border-bottom: 1px solid var(--divider-2); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) { background: rgba(255,255,255,0.022); }
tbody tr:hover { background: rgba(242,200,0,0.05); }
tbody td:first-child { color: var(--text); font-weight: 500; }
td.num, th.num { text-align: right; }
td.hi { color: var(--accent); }
caption {
  caption-side: bottom; text-align: left; padding: 0.7rem 0.9rem;
  font-size: 0.82rem; color: var(--text-faint);
}

/* ── Kort og rutenett ─────────────────────────────────────── */
.card-grid { display: grid; gap: 0.85rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .card-grid.three { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: block; padding: 1.1rem 1.15rem 1.2rem;
  background: var(--surface-2); border: 1px solid var(--divider);
  border-radius: 14px; color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.card:hover { border-color: rgba(242,200,0,0.4); background: var(--surface-3); text-decoration: none; }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--text); }
.card-text  { font-size: 0.9rem; color: var(--text-dim); line-height: 1.55; margin: 0; }
.card-kicker {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--accent-dim); margin-bottom: 0.45rem;
}

.section-title { font-size: 1.35rem; margin: 0 0 0.4rem; }
.section-intro { color: var(--text-dim); margin-bottom: 1.5rem; font-size: 0.98rem; }

/* ── Relaterte lenker under en artikkel ───────────────────── */
.related { margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--divider); }
.related h2 { font-size: 1.05rem; margin: 0 0 0.8rem; }
.related ul { list-style: none; margin: 0; }
.related li { margin-bottom: 0.45rem; }
.related a { color: var(--text-mid); }
.related a:hover { color: var(--accent); }
.related a::before { content: '→'; color: var(--accent-dim); margin-right: 0.5rem; }

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-item { border-bottom: 1px solid var(--divider-2); padding: 1rem 0; }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-weight: 600; color: var(--text); margin-bottom: 0.35rem; font-size: 1.02rem; }
.faq-a { color: var(--text-mid); margin: 0; font-size: 0.97rem; }

/* ── App Store / installering ─────────────────────────────── */
.store-cta {
  margin: 2rem 0 0;
  padding: 1.3rem 1.35rem 1.45rem;
  background: var(--surface-2);
  border: 1px solid var(--divider);
  border-radius: 16px;
  text-align: center;
}
.store-cta-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.35rem; color: var(--text); }
.store-cta-text  { font-size: 0.93rem; color: var(--text-dim); margin: 0 auto 1.1rem; max-width: 46ch; }
.store-badge { display: inline-block; line-height: 0; touch-action: manipulation; }
.store-badge img { height: 46px; width: auto; display: block; }
.store-badge:hover { opacity: 0.85; }
.store-badge:active { opacity: 0.7; }

.install-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  padding: 0.7rem 1.15rem; background: var(--surface); color: var(--text);
  border: 1px solid var(--divider); border-radius: 999px;
  font-family: inherit; font-size: 0.92rem; font-weight: 500;
  cursor: pointer; touch-action: manipulation;
}
.install-btn:hover { background: var(--surface-3); }
.install-btn:active { opacity: 0.75; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
}
.modal-sheet {
  background: var(--surface-2); border: 1px solid var(--divider);
  border-radius: 18px; padding: 1.5rem 1.5rem 1.25rem;
  max-width: 420px; width: 100%;
}
.modal-title { font-size: 1.1rem; font-weight: 600; text-align: center; margin-bottom: 1.25rem; }
.modal-step { display: flex; gap: 0.8rem; margin-bottom: 1rem; align-items: flex-start; }
.step-num {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%;
  background: var(--accent); color: #000;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}
.step-text { font-size: 0.93rem; color: var(--text-mid); margin: 0; }
.modal-close {
  display: block; width: 100%; padding: 0.7rem; margin-top: 0.5rem;
  background: none; border: none; border-top: 1px solid var(--divider);
  color: var(--accent); font-family: inherit; font-size: 0.98rem;
  font-weight: 500; cursor: pointer;
}

/* ── Hero (forsida) ───────────────────────────────────────── */
.hero { padding: 2rem 0 0; }
.hero h1 { margin: 0 0 0.6rem; }
.hero .lead { max-width: 40ch; margin-bottom: 1.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-bottom: 2rem; }
.hero-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .hero { padding-top: 3rem; }
  .hero-grid { grid-template-columns: 1fr 400px; gap: 3rem; }
}

.btn-primary {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 1.3rem; background: var(--accent); color: #000;
  border: none; border-radius: 999px; font-family: inherit;
  font-size: 0.98rem; font-weight: 600; cursor: pointer;
}
.btn-primary:hover { background: #ffd91f; text-decoration: none; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.7rem 1.2rem; background: none; color: var(--text);
  border: 1px solid var(--divider); border-radius: 999px;
  font-size: 0.98rem; font-weight: 500;
}
.btn-ghost:hover { background: var(--surface-3); text-decoration: none; }

/* ── Bunn ─────────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--divider);
  padding: 2.5rem 0 max(env(safe-area-inset-bottom), 2rem);
  margin-top: 3rem;
  font-size: 0.92rem;
}
.footer-cols {
  display: grid; gap: 1.75rem; grid-template-columns: repeat(2, 1fr);
  margin-bottom: 2rem;
}
@media (min-width: 760px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer-col h3 {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-faint); margin: 0 0 0.7rem;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.4rem; }
.footer-col a { color: var(--text-dim); font-size: 0.92rem; }
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 1rem 1.5rem;
  align-items: center; justify-content: space-between;
  padding-top: 1.5rem; border-top: 1px solid var(--divider-2);
  color: var(--text-faint); font-size: 0.85rem;
}
.lang-switch { display: flex; gap: 0.5rem; align-items: center; }
.lang-switch a { color: var(--text-dim); }
.lang-switch a[aria-current] { color: var(--accent); }

/* ── PWA: lagt på hjemskjermen skal fortsatt føles som appen ──
   Ingen topplinje med nettlenker, ingen bunn — bare verktøyet. */
@media (display-mode: standalone) {
  .site-footer,
  .crumbs,
  [data-browser-only] { display: none !important; }
  .site-header { position: static; }
  .hero { padding-top: 0.75rem; }
}

/* ── Skjermbilder på appsida ──────────────────────────────── */
.shots {
  display: grid; gap: 1rem; margin: 1.75rem 0 0;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 760px) { .shots { grid-template-columns: repeat(4, 1fr); } }
.shot { margin: 0; }
.shot img {
  width: 100%; height: auto; display: block;
  border-radius: 14px; border: 1px solid var(--divider);
  background: #f4f4f4;
}
.shot figcaption {
  font-size: 0.82rem; color: var(--text-dim);
  margin-top: 0.5rem; text-align: center;
}

/* ── Funksjonsliste ───────────────────────────────────────── */
.feature { margin-bottom: 1.5rem; }
.feature h3 { margin: 0 0 0.3rem; }
.feature p { margin: 0; }
/* Merkelapp for det som ligger bak RunPace Pro */
.pro-tag {
  display: inline-block; vertical-align: 0.1em;
  font-size: 0.62em; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.15em 0.5em; border-radius: 4px;
  background: var(--accent); color: #000;
}
.tick { list-style: none; margin-left: 0; }
.tick li { position: relative; padding-left: 1.5rem; }
.tick li::before {
  content: '✓'; position: absolute; left: 0;
  color: var(--accent); font-weight: 700;
}

.hero-note {
  font-size: 0.9rem; color: var(--text-dim);
  max-width: 40ch; margin-bottom: 1.25rem;
}

/* ── Kontaktkort (støttesida) ─────────────────────────────── */
.contact-card {
  background: var(--surface-2); border: 1px solid var(--divider);
  border-radius: 14px; padding: 1.25rem 1.35rem 1.35rem; margin: 1.25rem 0 0;
}
.contact-label {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 0.15rem;
}
.contact-value { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.9rem; }
.contact-value a { color: var(--accent); }

/* Personvernlenke under kalkulatoren på forsida. runpace.no er den
   registrerte Privacy Policy URL-en i App Store Connect, så erklæringen
   må være synlig ett klikk unna — ikke bare nevnt nederst i bunnen. */
.hero-legal { margin: 0.9rem 0 0; font-size: 0.85rem; text-align: center; }
.hero-legal a { color: var(--text-dim); }
.hero-legal a:hover { color: var(--accent); }
@media (min-width: 900px) { .hero-legal { grid-column: 2; } }
