/* ============================================================
   Elvebredden Tannlegesenter – ALTERNATIVT designforslag (B)
   Designspråk basert på referanse valgt av Kay:
   moderne klinikk-uttrykk med grønn palett, Work Sans,
   pill-formede knapper, mørk foto-hero og mørk footer.
   Alle fargekombinasjoner er verifisert mot WCAG AA.
   ============================================================ */
:root {
  /* Grønn palett */
  --dig-blue:          #0AA688;   /* klar grønn – KUN dekor (feiler AA som tekst/knapp) */
  --dig-blue-deep:     #077D67;   /* dekor, mørkere */
  --dig-deep:          #065F4E;   /* mørk grønn – tekstaksent/rammer (6,4:1 på hvit) */
  --dig-deep-hover:    #054C3E;
  --dig-deep-active:   #043E33;

  /* Knapper – 5,1:1 mot hvit tekst */
  --dig-btn:           #077D67;
  --dig-btn-hover:     #066A57;
  --dig-btn-active:    #055848;

  /* Flater */
  --dig-white:         #FFFFFF;
  --dig-bg:            #FFFFFF;   /* sidebakgrunn */
  --dig-pale:          #E4F3EB;   /* lys mintflate / header */
  --dig-soft:          #D5EBDF;   /* CTA-bånd */
  --dig-border:        #C9E2D6;
  --dig-dark:          #0D211C;   /* footer / mørke flater */
  --dig-dark-2:        #14312A;
  --dig-mint-text:     #C8E8DA;   /* overskrifter på mørk flate (12,8:1) */

  /* Tekst */
  --dig-ink:           #14231F;   /* overskrifter */
  --dig-body:          #31473F;   /* brødtekst (9,6:1 på hvit) */
  --dig-muted:         #4C635A;   /* sekundærtekst (6,1:1 på hvit) */

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

  --text-hero:         clamp(34px, 3.6vw, 54px);
  --text-h2:           clamp(28px, 2.9vw, 42px);
  --text-h3:           20px;
  --text-body:         18px;
  --text-base:         16px;
  --text-tag:          13px;

  --leading-tight:     1.12;
  --leading-body:      1.6;

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

  --space-lg:          24px;
  --space-section:     clamp(72px, 9vw, 120px);

  --transition-base:   250ms cubic-bezier(0.2, 0.6, 0.2, 1);
  --shadow-card:       0 14px 40px rgba(13, 33, 28, 0.10);
  --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: 600; letter-spacing: -0.01em; }
h2 { font-size: var(--text-h2); font-weight: 600; letter-spacing: -0.01em; }
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); }

/* Sentrert seksjonsrytme (forside-seksjoner o.l.) */
.section > .wrap > h2 { text-align: center; margin-inline: auto; }
.section > .wrap > p { text-align: center; margin-inline: auto; }

:focus-visible { outline: 3px solid var(--dig-btn); 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 12px 0; z-index: 200; font-weight: 600; text-decoration: none;
}
.skip-link:focus-visible { left: 0; }

/* ── Pluss-ikon (tegnet SVG via maske, arver tekstfarge) ── */
.btn::after, .btn-ghost::after, .card__link::after {
  content: ""; width: 13px; height: 13px; flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path d="M7 1v12M1 7h12" stroke="black" stroke-width="2.2" stroke-linecap="round"/></svg>') center / contain no-repeat;
  mask: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 14 14"><path d="M7 1v12M1 7h12" stroke="black" stroke-width="2.2" stroke-linecap="round"/></svg>') center / contain no-repeat;
  transition: transform var(--transition-base);
}
.btn:hover::after, .btn-ghost:hover::after { transform: rotate(90deg); }

/* ── Navigasjon ── */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--dig-pale);
}
.nav__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px; min-height: 96px;
}
.nav__logo img { height: 60px; width: auto; }
.nav__links { display: flex; align-items: center; gap: 8px; list-style: none; margin-left: auto; }
.nav__links a {
  display: inline-block; padding: 10px 16px; 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-soft); }
.nav__links a[aria-current="page"] { font-weight: 700; }
.has-sub { position: relative; }
.has-sub > button {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; 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-soft); }
.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% + 10px); left: 0; min-width: 290px;
  background: var(--dig-white); border: 1px solid var(--dig-border);
  border-radius: 20px; box-shadow: var(--shadow-card);
  padding: 10px; list-style: none; display: none;
}
.has-sub[data-open] .sub { display: block; }
.sub a {
  display: block; padding: 9px 16px; border-radius: var(--radius-pill);
  font-size: 15.5px; font-weight: 500;
}

/* ── Knapper: pill-form ── */
.btn, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-body); font-size: 16px; font-weight: 600;
  padding: 16px 30px; border-radius: var(--radius-pill);
  text-decoration: none; border: 0; cursor: pointer;
  transition: background-color var(--transition-base), color var(--transition-base), transform var(--transition-base);
}
.btn { background: var(--dig-btn); color: #fff; }
.btn:hover { background: var(--dig-btn-hover); }
.btn:active { background: var(--dig-btn-active); transform: scale(0.98); }
.btn-ghost { background: var(--dig-pale); color: var(--dig-deep); }
.btn-ghost:hover { background: var(--dig-soft); }

.nav .btn { padding: 12px 24px; font-size: 15px; }

.nav__burger {
  display: none; margin-left: auto;
  width: 48px; height: 48px; border: 0;
  border-radius: var(--radius-pill); background: var(--dig-soft); cursor: pointer; font: inherit;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav__burger span { width: 20px; height: 2px; border-radius: 2px; background: var(--dig-ink); transition: transform var(--transition-base), opacity var(--transition-base); }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Hero (forside): fullbredde foto, sentrert hvit tekst ── */
.hero { position: relative; overflow: hidden; background: var(--dig-dark); }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: url("../bilder/2026_08_forside-hero.jpg") center 30% / cover no-repeat;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,20,17,0.50) 0%, rgba(8,20,17,0.55) 55%, rgba(8,20,17,0.64) 100%);
}
.hero__grid {
  position: relative; z-index: 1;
  max-width: 880px; margin: 0 auto; padding: clamp(48px, 6vw, 80px) 24px;
  min-height: clamp(560px, 100vh - 200px, 700px);
  display: grid; align-items: center; justify-items: center; text-align: center;
}
.hero h1 { color: #fff; font-size: clamp(28px, 2.8vw, 42px); }
.hero p { color: #E8F2ED; font-size: 19px; margin-top: 20px; max-width: 56ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; justify-content: center; }
.hero .btn-ghost { background: var(--dig-pale); color: var(--dig-deep); }
.hero .btn-ghost:hover { background: #fff; }

/* ── Mint-bånd: «Nyhet: Book online» på forsiden ── */
section[aria-labelledby="nyhet-h"] { background: var(--dig-soft); }

/* Vekslende flate: avdelingsseksjonen på lys mint (Bogerud-rytme) */
section[aria-labelledby="avd-h"] { background: var(--dig-pale); }

/* Fokusring med kontrast mot mørkt hero-foto */
.hero :focus-visible { outline-color: var(--dig-mint-text); }

/* ── Undersider: sidetopp ── */
.pagehead { background: var(--dig-pale); }
.pagehead .wrap { padding-top: clamp(44px, 6vw, 72px); padding-bottom: clamp(44px, 6vw, 72px); text-align: center; }
.crumbs { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; 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-muted); }
.pagehead p.lede { margin-top: 14px; font-size: 19px; color: var(--dig-body); margin-inline: auto; }

/* ── 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);
  overflow: hidden; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
}
a.card { text-decoration: none; color: inherit; }
.card:hover { transform: translateY(-4px); box-shadow: 0 20px 50px rgba(13, 33, 28, 0.16); }
.card__media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.card__body { padding: 24px 26px 28px; 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: myke mintkort med grønn «Les mer +» */
.card--service { background: var(--dig-pale); box-shadow: none; }
.card--service:hover { background: var(--dig-soft); box-shadow: none; }
.card--service .card__body { padding: 28px 28px 26px; gap: 8px; }
.card--service .card__body h3 { font-size: 19px; color: var(--dig-deep); }
.card--service .card__body p { font-size: 15.5px; color: var(--dig-body); }
.card__link {
  margin-top: auto; padding-top: 12px; font-weight: 600; font-size: 15.5px;
  color: var(--dig-deep); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.card:hover .card__link { text-decoration: underline; text-underline-offset: 3px; }

/* ── Avdelingskort ── */
.dept { background: var(--dig-white); box-shadow: var(--shadow-card); }
.dept .card__body { gap: 6px; }
.dept h2, .dept h3 { font-size: 22px; letter-spacing: 0; }
.dept address { font-style: normal; color: var(--dig-muted); font-size: 16px; }
.dept .tel { font-weight: 700; font-size: 24px; color: var(--dig-deep); text-decoration: none; margin-top: 6px; display: inline-block; }
.dept .tast { font-size: 14px; font-weight: 600; color: var(--dig-deep); background: var(--dig-pale); border-radius: var(--radius-pill); padding: 4px 14px; 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: 600; color: var(--dig-ink); margin-top: 10px; }
.hours dt:first-child { margin-top: 0; }
.hours .hours__group {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--dig-border);
  font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--dig-deep);
}
.hours dd { color: var(--dig-muted); }
.dept .note { font-size: 14.5px; color: var(--dig-muted); margin-top: 12px; }
.dept .btn { margin-top: 18px; 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; background: var(--dig-pale); position: sticky; top: 96px; }
.treat__media img { width: 100%; object-fit: cover; }
.treat__media figcaption { padding: 12px 18px; font-size: 13.5px; color: var(--dig-muted); }

.pricetable { width: 100%; border-collapse: collapse; background: #fff; border-radius: 20px; overflow: hidden; border: 1px solid var(--dig-border); }
.pricetable caption { text-align: left; font-weight: 600; 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: 20px 20px 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-deep); 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: 600; 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; justify-content: center; }
.chips a {
  display: inline-block; background: var(--dig-pale);
  padding: 11px 22px; border-radius: var(--radius-pill);
  font-size: 15px; font-weight: 600; text-decoration: none; color: var(--dig-deep);
  transition: background-color var(--transition-base), color var(--transition-base);
}
.chips a:hover { background: var(--dig-soft); }
.chips a[aria-current="page"] { background: var(--dig-btn); color: #fff; }

/* ── CTA-bånd ── */
.ctaband { background: var(--dig-soft); color: var(--dig-body); }
.ctaband .wrap { display: grid; justify-items: center; text-align: center; gap: 8px; padding-block: clamp(56px, 8vw, 88px); }
.ctaband h2 { color: var(--dig-ink); font-size: clamp(26px, 2.6vw, 38px); }
.ctaband p { color: var(--dig-body); margin-top: 4px; }
.ctaband__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 18px; }
.ctaband .btn-ghost { background: #fff; }
.ctaband .btn-ghost:hover { background: var(--dig-pale); }

/* ── Team ── */
.teamgroup + .teamgroup { margin-top: clamp(40px, 5vw, 64px); }
.teamgroup h2 { margin-bottom: 28px; font-size: clamp(22px, 2.1vw, 30px); text-align: center; }
.person { text-align: left; }
.person img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.person .card__body { padding: 18px 22px 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; margin-inline: auto; }
.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: mørk grønn ── */
.footer { background: var(--dig-dark); color: #E8F2ED; font-size: 15.5px; }
.footer .wrap { padding-block: clamp(56px, 8vw, 96px); display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 40px; }
.footer h3 { color: var(--dig-mint-text); font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.footer a { color: #E8F2ED; text-underline-offset: 3px; }
.footer a:hover { color: #fff; }
.footer .btn, .footer .btn:hover { color: #fff; text-decoration: none; }
.footer ul { list-style: none; display: grid; gap: 8px; }
.footer img { height: 46px; width: auto; margin-bottom: 18px; }
.footer address { font-style: normal; }
.footer p { color: #C9D9D2; }
.footer .wrap > div > p a, .footer address, .footer li { color: #C9D9D2; }
.footer__bottom { border-top: 1px solid var(--dig-dark-2); }
.footer__bottom .wrap { display: flex; justify-content: space-between; gap: 16px; padding-block: 24px; }
.footer__bottom p { color: #A9BFB6; }
.footer__bottom a { color: #C9D9D2; }
.footer :focus-visible { outline-color: var(--dig-mint-text); }

/* ── 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: var(--dig-pale); border-bottom: 1px solid var(--dig-border);
    flex-direction: column; align-items: stretch; padding: 16px 24px 24px; gap: 2px;
  }
  .nav__links.open { display: flex; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow-y: auto; }
  .nav__links a, .has-sub > button { width: 100%; text-align: left; justify-content: space-between; border-radius: 16px; }
  .sub { position: static; box-shadow: none; border: 0; background: transparent; padding: 0 0 6px 14px; min-width: 0; }
  .nav__inner { gap: 12px; padding: 0 16px; min-height: 80px; }
  .nav__burger { display: flex; order: 3; margin-left: 0; }
  .nav .btn { order: 2; margin-left: auto; padding: 10px 16px; font-size: 14px; white-space: nowrap; }
  .nav .btn::after { display: none; }
  .nav__logo img { height: 52px; }
  .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; }
  .nav__logo img { height: 44px; }
  .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; }
}
