/* ============================================================
   Toms Arena: footeren (runde 2026-10-19)
   En markup på alle sider, satt inn av scripts/bygg-footer.js.
   Erstatter shared/footer-sted.css og de gamle footerreglene i
   index.html, det gamle stilarket til historiesidene og v2-sider.css (de treffer
   ingenting lenger: alle klassene her begynner på ft-).

   Oppbygging, ovenfra:
     .ft-cta    bestillingsbånd i salvie med et skjevt bildekort
     .ft-grid   merke + sosiale ikoner, Klinikk, Kontakt, Besøk oss
     .ft-bunn   © til venstre, juridiske lenker til høyre
   Under 760 px står alt sentrert i en spalte, og sidelenkene blir
   en sentrert rad med piller.

   Kontrast på grunnfargen #2A4A31 (Dyp skog, 12.11): hvit 9,9:1, salvie #DCEBD6 8,0:1.
   I båndet: #0F2418 på #DCEBD6 13:1.
   ============================================================ */
html body footer.ta-footer {
  --ft-bg: var(--hdr-ft, #2A4A31);   /* Dyp skog, samme som headeren (12.11) */
  --ft-mork: #0F2418;
  --ft-salvie: var(--sage-2, #DCEBD6);
  --ft-tekst: #fff;
  --ft-dempet: rgba(255, 255, 255, .92);
  --ft-strek: rgba(255, 255, 255, .2);
  --ft-fokus: #fff;
  background: var(--ft-bg) !important;
  color: var(--ft-tekst);
  border: 0;
  border-radius: var(--r-panel, 32px) var(--r-panel, 32px) 0 0;
  margin-top: clamp(24px, 4vw, 48px);
  padding: clamp(16px, 2.4vw, 28px) 0 32px;
  font-family: 'Poppins', system-ui, sans-serif;
  text-align: start;
}
.ta-footer *, .ta-footer *::before, .ta-footer *::after { box-sizing: border-box; }
.ta-footer :is(h2, h3, p, ul) { margin: 0; padding: 0; }
.ta-footer ul { list-style: none; }
.ta-footer a { color: inherit; text-decoration: none; }
.ta-footer a:focus-visible {
  outline: 2px solid var(--ft-fokus); outline-offset: 3px; border-radius: 6px;
}
.ft-wrap { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); }

/* ---------- Bestillingsbåndet ---------- */
.ft-cta {
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px);
  align-items: center; gap: clamp(24px, 4vw, 64px);
  padding: clamp(32px, 4.4vw, 60px) clamp(28px, 4.4vw, 64px);
  border-radius: 28px;
  background: var(--ft-salvie); color: var(--ft-mork);
}
.ft-cta-h {
  font-family: 'TA Serif', 'Instrument Serif', 'Fraunces', Georgia, serif;
  font-weight: 400; font-size: clamp(34px, 4.4vw, 58px); line-height: 1.02;
  letter-spacing: -.01em; color: var(--ft-mork); max-width: 14ch;
  text-wrap: balance;
}
.ft-cta-h em { font-style: italic; color: #2A4A31; }
.ft-cta-p { margin-top: 16px !important; max-width: 36ch; font-size: 16px; line-height: 1.55; color: #1F3326; }
.ft-cta-knapper { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.ft-knapp {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 24px; border-radius: var(--r-pill, 999px);
  font-size: 15px; font-weight: 600; line-height: 1.2; white-space: nowrap;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.ft-knapp svg { flex: none; }
.ft-knapp-fylt { background: var(--ft-mork); color: #fff !important; }
.ft-knapp-fylt:hover { background: #2A4A31; }
.ft-knapp-fylt svg { transition: transform .25s ease; }
.ft-knapp-fylt:hover svg { transform: translateX(3px); }
.ft-knapp-linje { border: 1.5px solid var(--ft-mork); color: var(--ft-mork) !important; }
.ft-knapp-linje:hover { background: var(--ft-mork); color: #fff !important; }
.ft-cta .ft-knapp:focus-visible { outline-color: var(--ft-mork); }

/* Det skjeve kortet: Tom i et hvitt kort, med en mørk plate bak
   som heller motsatt vei. Rent pynt, derfor aria-hidden. */
.ft-cta-kort {
  position: relative; justify-self: center;
  width: min(100%, 250px); aspect-ratio: 4 / 5;
  margin-block: -12px;
}
.ft-cta-kort img, .ft-cta-kort-bak {
  position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 22px;
}
.ft-cta-kort-bak { background: var(--ft-bg); transform: rotate(-7deg) translate(-6px, 4px); }
.ft-cta-kort img {
  object-fit: cover; object-position: 50% 18%;
  border: 6px solid #fff; background: #fff;
  transform: rotate(5deg);
  box-shadow: 0 24px 48px -20px rgba(15, 36, 24, .55);
}
.ta-footer[data-cta="av"] .ft-cta { display: none; }

/* ---------- Hovedrutenettet ---------- */
.ft-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr) minmax(0, 1fr) minmax(0, 1.3fr);
  gap: clamp(28px, 3.6vw, 56px);
  padding: clamp(48px, 5vw, 72px) 0 clamp(40px, 4vw, 56px);
}
.ta-footer[data-cta="av"] .ft-grid { padding-top: clamp(28px, 3vw, 44px); }
.ft-merke { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.ft-logo { display: inline-block; border-radius: 8px; }
.ft-logo img { display: block; height: clamp(52px, 4.6vw, 66px); width: auto; }
.ft-tag { max-width: 30ch; font-size: 15px; line-height: 1.6; color: var(--ft-dempet); }

/* Varemerket: et lite merke, ikke en påstand om godkjenning.
   Ikonet er hvitt med mørk tegning (runde 2026-10-19). */
.ft-tm {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 5px 16px 5px 6px; border-radius: var(--r-pill, 999px);
  border: 1px solid rgba(255, 255, 255, .28);
  color: var(--ft-dempet); font-size: 13px; line-height: 1.35;
  transition: background-color .25s ease, border-color .25s ease;
}
.ft-tm:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .5); }
.ft-tm b { font-weight: 600; color: #fff; }
@media (min-width: 1081px) { .ft-tm { white-space: nowrap; } }
.ft-tm-ikon {
  display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: var(--ft-mork);
  box-shadow: 0 0 0 3px rgba(220, 235, 214, .28);
}
.ft-tm-ikon svg { width: 20px; height: 20px; stroke-width: 2.2; }

/* Runde 22 C: ikonene står sentrert i merkespalten på alle bredder. */
.ft-sosial { display: flex; gap: 10px; align-self: stretch; justify-content: center; }
.ft-rund {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .4); color: #fff;
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}
.ft-rund:hover { background: #fff; border-color: #fff; color: var(--ft-mork); }
.ft-rund svg { display: block; }

.ft-h {
  font-family: 'Poppins', system-ui, sans-serif;
  font-size: 12px; font-weight: 600; line-height: 1.3;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ft-salvie);
  margin-bottom: 18px !important;
}
.ft-h-under { margin-top: 26px !important; margin-bottom: 10px !important; }
.ft-liste { display: flex; flex-direction: column; gap: 0; }
.ft-liste a, .ft-linje {
  display: inline-block; padding: 4px 0;
  font-size: 15px; line-height: 1.5; color: var(--ft-dempet);
  overflow-wrap: anywhere;
}
/* Trykkflate minst 44 px høy (runde 3, PA A4). Avstanden mellom
   lenkene ligger nå i selve flata, ikke i gap. */
.ft-liste a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  text-decoration: underline; text-decoration-color: transparent;
  text-underline-offset: 4px; text-decoration-thickness: 1px;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.ft-liste a:hover { color: #fff; text-decoration-color: currentColor; }
.ft-liste a[aria-current="page"] { color: #fff; text-decoration-color: var(--ft-salvie); }

/* Kartkortet */
.ft-kart {
  position: relative; display: block; overflow: hidden; isolation: isolate;
  aspect-ratio: 4 / 3; border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: #0E2217; color: #fff;
}
.ft-kart img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .8s cubic-bezier(.2, .7, .2, 1);
}
.ft-kart:hover img { transform: scale(1.035); }
.ft-kart::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 34, 23, 0) 40%, rgba(14, 34, 23, .82) 100%);
}
.ft-kart-pin {
  position: absolute; left: 50%; top: 40%; z-index: 1;
  width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--ft-salvie);
  box-shadow: 0 0 0 5px rgba(220, 235, 214, .22), 0 0 0 12px rgba(220, 235, 214, .1), 0 6px 16px rgba(0, 0, 0, .4);
}
.ft-kart-pin::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--ft-bg); }
.ft-kart-tekst {
  position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.ft-kart-adr { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.35; color: rgba(255, 255, 255, .9); }
.ft-kart-adr b { font-size: 15px; font-weight: 600; color: #fff; }
.ft-kart-cta {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border-radius: var(--r-pill, 999px);
  background: var(--ft-salvie); color: var(--ft-mork); font-size: 13.5px; font-weight: 600;
  transition: background-color .25s ease;
}
.ft-kart:hover .ft-kart-cta { background: #fff; }
.ft-kart-osm {
  /* Lisensen (ODbL) krever kreditering ved kartet, saa den staar, men
     diskret: liten tekst uten boks oeverst i hjoernet (runde 25). */
  position: absolute; top: 8px; right: 10px; z-index: 2;
  font-size: 9px; line-height: 1; color: rgba(255, 255, 255, .6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35); pointer-events: none;
}

/* ---------- Bunnlinja ---------- */
.ft-bunn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px 32px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px solid var(--ft-strek);
  font-size: 13px; line-height: 1.5; color: var(--ft-dempet);
}
.ft-juss { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; }
.ft-juss a, .ft-kreditt a {
  display: inline-flex; align-items: center; min-height: 44px;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px;
  transition: text-decoration-color .2s ease, color .2s ease;
}
.ft-juss a:hover, .ft-juss a[aria-current="page"] { color: #fff; text-decoration-color: currentColor; }
.ft-kreditt a { text-decoration-color: rgba(255, 255, 255, .45); }

/* ---------- Mellombredde: to og to ---------- */
@media (max-width: 1080px) {
  .ft-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

/* ---------- Mobil: sentrert, en spalte ---------- */
@media (max-width: 760px) {
  html body footer.ta-footer {
    border-radius: 24px 24px 0 0;
    /* Chat-knappen ligger fast nederst til høyre og dekker de siste
       ~64 px; bunnlinja skal ikke havne under den. */
    padding: 12px 0 88px;
  }
  .ft-wrap { padding: 0 12px; }
  .ft-cta {
    grid-template-columns: 1fr; justify-items: center; text-align: center;
    gap: 28px; padding: 36px 20px 40px; border-radius: 22px;
  }
  .ft-cta-h { max-width: none; font-size: clamp(32px, 9vw, 40px); margin-inline: auto !important; }
  .ft-cta-p { margin-inline: auto !important; font-size: 15px; }
  .ft-cta-knapper { flex-direction: column; align-items: stretch; width: 100%; max-width: 340px; margin-inline: auto; }
  .ft-cta-kort { width: 190px; margin-block: 0; order: -1; }

  .ft-grid { grid-template-columns: 1fr; gap: 40px; padding: 44px 8px 36px; text-align: center; }
  .ft-merke { align-items: center; }
  .ft-tag { margin-inline: auto !important; }
  .ft-sosial { justify-content: center; }

  /* Sidelenkene: en sentrert rad med piller. */
  .ft-sider { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px; }
  .ft-sider a {
    display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
    border-radius: var(--r-pill, 999px); border: 1px solid rgba(255, 255, 255, .28);
    text-decoration: none; font-size: 14.5px;
  }
  .ft-sider a:hover, .ft-sider a[aria-current="page"] { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .55); }
  .ft-liste { align-items: center; }
  .ft-kart { aspect-ratio: 16 / 10; text-align: start; }

  .ft-bunn { flex-direction: column-reverse; justify-content: center; text-align: center; gap: 14px; padding: 20px 8px 0; }
  .ft-juss { justify-content: center; gap: 0 18px; }
  .ft-kreditt { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .ta-footer * { transition: none !important; }
  .ft-kart:hover img, .ft-knapp-fylt:hover svg { transform: none; }
}
