/* ============================================================
   Elvebredden Tannlegesenter – redesign-prototype
   Lys palett bygget på logoens to farger:
     #6AAED8 (lys blå)  ·  #2F4D5A (dyp petrol)
   Én font på hele siden: Figtree
   ============================================================ */
:root {
  /* Logofarger */
  --dig-blue:          #6AAED8;   /* lys blå fra logoen – dekor/aksent */
  --dig-blue-deep:     #4E97C5;   /* mørkere variant til dekor */
  --dig-deep:          #2F4D5A;   /* dyp petrol fra logoen – primærfarge */
  --dig-deep-hover:    #24404C;
  --dig-deep-active:   #1B323C;

  /* Lyse flater */
  --dig-white:         #FFFFFF;
  --dig-bg:            #F5FAFD;   /* sidebakgrunn */
  --dig-pale:          #EAF4FA;   /* lys seksjonsflate */
  --dig-soft:          #DCEDF7;   /* CTA-bånd / topplinje */
  --dig-border:        #CFE1EC;

  /* Tekst */
  --dig-ink:           #1B323C;   /* overskrifter */
  --dig-body:          #3D555F;   /* brødtekst */
  --dig-muted:         #566F7A;   /* sekundærtekst */

  /* Typografi – kun én font */
  --font-body:         "Figtree", system-ui, -apple-system, sans-serif;

  --text-hero:         clamp(29px, 2.7vw, 43px);
  --text-h2:           clamp(25px, 2.5vw, 38px);
  --text-h3:           20px;
  --text-body:         18px;
  --text-base:         16px;
  --text-tag:          13px;

  --leading-tight:     1.15;
  --leading-body:      1.55;

  --radius-card:       16px;
  --radius-pill:       9999px;

  --space-lg:          24px;
  --space-section:     clamp(64px, 8vw, 96px);

  --transition-base:   300ms ease;
  --shadow-card:       0 10px 30px rgba(47, 77, 90, 0.12);
  --maxw:              1200px;
}

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

html { scroll-behavior: smooth; font-family: var(--font-body); }

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--leading-body);
  color: var(--dig-body);
  background: var(--dig-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-body);
  color: var(--dig-ink);
  line-height: var(--leading-tight);
  text-wrap: balance;
  overflow-wrap: break-word;
}
h1 { font-size: var(--text-hero); font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: var(--text-h2); font-weight: 700; letter-spacing: -0.015em; }
h3 { font-size: var(--text-h3); font-weight: 600; }

p { max-width: 68ch; }
a { color: inherit; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding-block: var(--space-section); }

:focus-visible { outline: 3px solid var(--dig-deep); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--dig-deep); color: #fff; padding: 12px 20px;
  border-radius: 0 0 8px 0; z-index: 200; font-weight: 600; text-decoration: none;
}
.skip-link:focus-visible { left: 0; }

/* ── Topplinje ── */
.topbar {
  background: var(--dig-soft); color: var(--dig-deep);
  font-size: 15px; text-align: center; padding: 10px 16px;
  border-bottom: 1px solid var(--dig-border);
}
.topbar a { color: var(--dig-deep); font-weight: 700; text-underline-offset: 3px; }

/* ── Navigasjon ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--dig-white);
  border-bottom: 1px solid var(--dig-border);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px; min-height: 100px;
}
.nav__logo img { height: 56px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 4px; list-style: none; margin-left: auto; }
.nav__links a {
  display: inline-block; padding: 10px 14px; text-decoration: none;
  font-size: 16px; font-weight: 500; color: var(--dig-ink);
  border-radius: var(--radius-pill); transition: background-color var(--transition-base);
}
.nav__links a:hover { background: var(--dig-pale); }
.nav__links a[aria-current="page"] { font-weight: 700; }
.has-sub { position: relative; }
.has-sub > button {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; font: inherit; font-size: 16px; font-weight: 500;
  background: none; border: 0; cursor: pointer; color: var(--dig-ink);
  border-radius: var(--radius-pill); transition: background-color var(--transition-base);
}
.has-sub > button:hover { background: var(--dig-pale); }
.has-sub > button::after {
  content: ""; width: 8px; height: 8px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform var(--transition-base);
}
.has-sub[data-open] > button::after { transform: rotate(-135deg) translateY(-2px); }
.sub {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 280px;
  background: var(--dig-white); border: 1px solid var(--dig-border);
  border-radius: var(--radius-card); box-shadow: var(--shadow-card);
  padding: 10px; list-style: none; display: none;
  columns: 1;
}
.has-sub[data-open] .sub { display: block; }
.sub a {
  display: block; padding: 9px 14px; border-radius: 10px;
  font-size: 15.5px; font-weight: 500;
}
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-body); font-size: 16px; font-weight: 700;
  padding: 14px 28px; border-radius: var(--radius-pill);
  text-decoration: none; border: 2px solid transparent; cursor: pointer;
  transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}
.btn { background: var(--dig-deep); color: #fff; }
.btn:hover { background: var(--dig-deep-hover); }
.btn:active { background: var(--dig-deep-active); transform: scale(0.98); }
.btn-ghost { background: transparent; border-color: var(--dig-deep); color: var(--dig-deep); }
.btn-ghost:hover { background: var(--dig-pale); }

.nav .btn { padding: 11px 22px; font-size: 15px; }

.nav__burger {
  display: none; margin-left: auto;
  width: 48px; height: 48px; border: 1px solid var(--dig-border);
  border-radius: 12px; background: #fff; cursor: pointer; font: inherit;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav__burger span { width: 22px; height: 2px; background: var(--dig-ink); transition: transform var(--transition-base), opacity var(--transition-base); }

/* ── Hero (forside) ── */
.hero {
  background: linear-gradient(180deg, var(--dig-pale) 0%, var(--dig-bg) 100%);
  color: var(--dig-body);
  border-bottom: 1px solid var(--dig-border);
  overflow: hidden;
}
.hero__grid {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(48px, 6vw, 88px) 24px;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(32px, 5vw, 64px); align-items: center;
}
.hero h1 { color: var(--dig-ink); }
.hero p { color: var(--dig-body); font-size: 19px; margin-top: 18px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }
.hero__media { border-radius: var(--radius-card); overflow: hidden; box-shadow: var(--shadow-card); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16/10; }

/* ── Undersider: sidetopp ── */
.pagehead { background: var(--dig-white); border-bottom: 1px solid var(--dig-border); }
.pagehead .wrap { padding-top: clamp(36px, 5vw, 60px); padding-bottom: clamp(36px, 5vw, 60px); }
.crumbs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; font-size: 14.5px; color: var(--dig-muted); margin-bottom: 14px; }
.crumbs a { color: var(--dig-muted); text-underline-offset: 3px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--dig-border); }
.pagehead p.lede { margin-top: 14px; font-size: 19px; color: var(--dig-muted); }

/* ── Kort ── */
.cards { display: grid; gap: 24px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--dig-white); border-radius: var(--radius-card);
  border: 3px solid var(--dig-border); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}
a.card { text-decoration: none; color: inherit; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card); border-color: var(--dig-blue); }
.card__media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__body h3 { font-size: 21px; }
.card__body p { font-size: 16px; color: var(--dig-muted); }

/* Tjenestekort (behandlinger) – rent hvitt kort med mørkeblå ramme */
.card--service { border-color: var(--dig-deep); }
.card--service .card__body { padding: 26px 24px 24px; gap: 8px; }
.card--service .card__body h3 { font-size: 19px; }
.card--service .card__body p { font-size: 15.5px; }
.card__link { margin-top: auto; padding-top: 10px; font-weight: 600; font-size: 15.5px; color: var(--dig-ink); text-decoration: none; }
.card:hover .card__link { text-decoration: underline; text-underline-offset: 3px; }

/* ── Avdelingskort ── */
.dept .card__body { gap: 6px; }
.dept h3 { font-size: 22px; }
.dept address { font-style: normal; color: var(--dig-muted); font-size: 16px; }
.dept .tel { font-family: var(--font-body); font-weight: 700; font-size: 24px; color: var(--dig-ink); text-decoration: none; margin-top: 6px; display: inline-block; }
.dept .tast { font-size: 14px; font-weight: 600; color: var(--dig-white); background: var(--dig-deep); border-radius: var(--radius-pill); padding: 3px 12px; display: inline-block; margin-left: 8px; vertical-align: 3px; }
.hours { margin-top: 14px; border-top: 1px solid var(--dig-border); padding-top: 14px; font-size: 15.5px; }
.hours dt { font-weight: 700; color: var(--dig-ink); margin-top: 10px; }
.hours dt:first-child { margin-top: 0; }
.hours dd { color: var(--dig-muted); }
.dept .note { font-size: 14.5px; color: var(--dig-muted); margin-top: 12px; }
.dept .btn { margin-top: 16px; align-self: flex-start; }

/* ── Behandlingsside ── */
.treat { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 5vw, 56px); align-items: start; }
.treat__text { display: flex; flex-direction: column; gap: 18px; }
.treat__text h2 { font-size: 23px; margin-top: 10px; }
.treat__media { border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--dig-border); background: #fff; position: sticky; top: 100px; }
.treat__media img { width: 100%; object-fit: cover; }
.treat__media figcaption { padding: 10px 16px; font-size: 13.5px; color: var(--dig-muted); border-top: 1px solid var(--dig-border); }

.pricetable { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius-card); overflow: hidden; border: 1px solid var(--dig-border); }
.pricetable caption { text-align: left; font-family: var(--font-body); font-weight: 700; font-size: 22px; color: var(--dig-ink); padding: 20px 24px 4px; background: #fff; caption-side: top; border: 1px solid var(--dig-border); border-bottom: 0; border-radius: var(--radius-card) var(--radius-card) 0 0; }
.pricetable th, .pricetable td { padding: 14px 24px; text-align: left; font-size: 16.5px; }
.pricetable thead th { font-size: 13.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--dig-muted); background: var(--dig-pale); border-bottom: 1px solid var(--dig-border); }
.pricetable tbody tr + tr td { border-top: 1px solid var(--dig-border); }
.pricetable td:last-child { font-weight: 700; color: var(--dig-ink); white-space: nowrap; }
.price-note { font-size: 14.5px; color: var(--dig-muted); margin-top: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; }
.chips a {
  display: inline-block; background: #fff; border: 1px solid var(--dig-border);
  padding: 9px 18px; border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 600; text-decoration: none; color: var(--dig-ink);
  transition: border-color var(--transition-base), background-color var(--transition-base), color var(--transition-base);
}
.chips a:hover { border-color: var(--dig-blue); background: var(--dig-pale); }
.chips a[aria-current="page"] { background: var(--dig-deep); border-color: var(--dig-deep); color: #fff; }

/* ── CTA-bånd ── */
.ctaband { background: var(--dig-soft); color: var(--dig-body); border-block: 1px solid var(--dig-border); }
.ctaband .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-block: clamp(44px, 6vw, 64px); }
.ctaband h2 { color: var(--dig-ink); font-size: clamp(23px, 2.2vw, 31px); }
.ctaband p { color: var(--dig-body); margin-top: 8px; }
.ctaband__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ── Team ── */
.teamgroup + .teamgroup { margin-top: clamp(40px, 5vw, 64px); }
.teamgroup h2 { margin-bottom: 24px; font-size: clamp(22px, 2.1vw, 29px); }
.person { text-align: left; }
.person img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.person .card__body { padding: 18px 20px 22px; gap: 2px; }
.person h3 { font-size: 19px; }
.person p { font-size: 15px; color: var(--dig-muted); }
.person .since { font-size: 13.5px; color: var(--dig-muted); }

/* ── Prosa (personvern) ── */
.prose { max-width: 76ch; }
.prose h2 { font-size: 25px; margin: 40px 0 14px; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; }
.prose p { margin-bottom: 16px; }
.prose ul { margin: 0 0 16px 22px; }

/* ── Footer ── */
.footer { background: var(--dig-pale); color: var(--dig-body); font-size: 15.5px; border-top: 1px solid var(--dig-border); }
.footer .wrap { padding-block: clamp(48px, 6vw, 72px); display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 40px; }
.footer h3 { color: var(--dig-ink); font-size: 17px; margin-bottom: 14px; }
.footer a { color: var(--dig-body); text-underline-offset: 3px; }
.footer a:hover { color: var(--dig-deep); }
.footer .btn, .footer .btn:hover { color: #fff; }
.footer ul { list-style: none; display: grid; gap: 8px; }
.footer img { height: 52px; width: auto; margin-bottom: 16px; }
.footer address { font-style: normal; }
.footer__bottom { border-top: 1px solid var(--dig-border); }
.footer__bottom .wrap { display: flex; justify-content: space-between; gap: 16px; padding-block: 22px; color: var(--dig-muted); }

/* ── Responsivt ── */
@media (max-width: 1024px) {
  .cards--4 { grid-template-columns: repeat(2, 1fr); }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .nav__links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--dig-border);
    flex-direction: column; align-items: stretch; padding: 16px 24px 24px; gap: 2px;
  }
  .nav__links.open { display: flex; }
  .nav__links a, .has-sub > button { width: 100%; text-align: left; justify-content: space-between; border-radius: 10px; }
  .sub { position: static; box-shadow: none; border: 0; padding: 0 0 6px 14px; min-width: 0; }
  .nav__burger { display: flex; }
  .nav .btn { display: none; }
  .hero__grid, .treat { grid-template-columns: 1fr; }
  .treat__media { position: static; }
  .cards--3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .cards--4 { grid-template-columns: 1fr; }
  .footer .wrap { grid-template-columns: 1fr; gap: 28px; }
  .footer__bottom .wrap { flex-direction: column; }
}

/* ── Redusert bevegelse ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .card:hover { transition: none !important; transform: none !important; }
  .btn:active { transform: none; }
  * { transition-duration: 0.01ms !important; }
}
