/* Grunnstiler – desktop og felles layout */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--safe-top) + 0.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: clip;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 100% 70% at 0% -10%, var(--teal-glow), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 0%, rgba(18, 53, 73, 0.06), transparent 50%),
    var(--bg);
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

button {
  font: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  position: fixed;
  left: max(1rem, var(--safe-left));
  top: max(0.5rem, var(--safe-top));
  z-index: 200;
  width: auto;
  height: auto;
  padding: 0.55rem 0.85rem;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
}

/* —— Toppstripe —— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: var(--safe-top);
  background: rgba(244, 241, 235, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.85rem max(1.25rem, var(--safe-right)) 0.85rem max(1.25rem, var(--safe-left));
}

.edition {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 1rem;
  font-size: 0.92rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
  color: var(--teal);
}

.nav-cta {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--navy);
  color: #fff !important;
}

.nav-cta:hover {
  background: var(--navy-deep);
  color: #fff !important;
}

/* —— Hero —— */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) max(1.25rem, var(--safe-right)) 2rem max(1.25rem, var(--safe-left));
}

.eyebrow {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 4.8vw, 3.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-lead {
  margin: 1.1rem 0 0;
  max-width: 34rem;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--teal);
  font-weight: 500;
}

.hero-cover {
  margin: 0;
  justify-self: center;
  width: min(100%, 18.2rem);
}

.hero-cover img {
  width: 100%;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
}

/* —— Seksjoner —— */
.toc,
.forord,
.buy {
  max-width: var(--content-max);
  margin: 0 auto;
  padding-inline: max(1.25rem, var(--safe-left)) max(1.25rem, var(--safe-right));
}

.section-head {
  margin-bottom: 1.5rem;
}

.section-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}

.section-head h2 {
  margin: 0;
  max-width: 34rem;
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  line-height: 1.15;
  text-wrap: balance;
}

/* —— Innholdsfortegnelse —— */
.toc {
  padding-block: 2.5rem;
}

.toc-hint {
  margin: 0.65rem 0 0;
  max-width: 32rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.toc-intro {
  margin: 0 0 1.25rem;
  max-width: 38rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
}

.toc-accordion {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-width: 42rem;
}

.toc-group {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--paper);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.toc-group[open] {
  border-color: rgba(26, 154, 143, 0.35);
  box-shadow: var(--shadow);
}

.toc-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: var(--touch-min);
  padding: 0.85rem 1.15rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.toc-group-title::-webkit-details-marker {
  display: none;
}

.toc-group-title::after {
  content: "";
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.toc-group[open] .toc-group-title {
  color: var(--teal);
  border-bottom: 1px solid var(--border);
  background: rgba(217, 240, 238, 0.35);
}

.toc-group[open] .toc-group-title::after {
  transform: rotate(-135deg) translateY(-0.1rem);
}

.toc-sublist {
  margin: 0;
  padding: 0.65rem 1.15rem 1rem 1.35rem;
  list-style: none;
}

.toc-sublist li {
  position: relative;
  padding: 0.42rem 0 0.42rem 1rem;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.4;
  border-bottom: 1px solid rgba(18, 53, 73, 0.06);
}

.toc-sublist li:last-child {
  border-bottom: 0;
}

.toc-sublist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.95rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--teal);
  opacity: 0.65;
}

.toc-leaf {
  margin: 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--paper);
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--navy);
}

/* —— Forord —— */
.forord {
  padding-block: 2.5rem 3rem;
}

.forord-layout {
  display: grid;
  grid-template-columns: minmax(0, 16rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.forord-text p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.forord-quote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.35rem;
  border-left: 4px solid var(--teal);
  border-radius: 0 12px 12px 0;
  background: var(--teal-soft);
}

.forord-quote p {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  line-height: 1.45;
  color: var(--navy);
}

.forord-quote footer {
  margin-top: 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-style: normal;
  color: var(--muted);
}

.forord-signoff {
  font-weight: 600;
  color: var(--navy) !important;
}

/* —— Kjøp boka —— */
.buy {
  padding-block: 2.5rem 4rem;
}

.buy-inner {
  max-width: 42rem;
  padding: clamp(1.75rem, 4vw, 2.5rem);
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.buy-inner .section-label {
  margin-bottom: 0.35rem;
}

.buy-inner h2 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  line-height: 1.15;
  text-wrap: balance;
}

.buy-lead {
  margin: 0 0 1.5rem;
  max-width: 36rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.65;
}

.buy-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.buy-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: 14px;
  background: var(--teal-soft);
  border: 1px solid rgba(26, 154, 143, 0.18);
}

.buy-card--print {
  background: rgba(18, 53, 73, 0.05);
  border-color: var(--border);
}

.buy-card-label {
  margin: 0;
  font-size: 1.05rem;
  color: var(--navy);
}

.buy-card-hint {
  margin: 0;
  flex: 1;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.buy-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--touch-min);
  margin-top: 0.35rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.buy-card-link:hover {
  background: var(--navy-deep);
  transform: translateY(-1px);
}

.buy-card--print .buy-card-link {
  background: var(--teal);
}

.buy-card--print .buy-card-link:hover {
  background: #15857c;
}

/* —— Kjøp-popup —— */
body.buy-dialog-open {
  overflow: hidden;
}

.buy-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: max(1rem, var(--safe-top)) max(1rem, var(--safe-right))
    max(1rem, var(--safe-bottom)) max(1rem, var(--safe-left));
}

.buy-dialog[hidden] {
  display: none;
}

.buy-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 53, 73, 0.45);
}

.buy-dialog-panel {
  position: relative;
  width: min(100%, 24rem);
  padding: 1.5rem 1.35rem 1.25rem;
  border-radius: calc(var(--radius) - 2px);
  background: var(--paper);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.buy-dialog-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--navy);
  text-wrap: balance;
}

.buy-dialog-text {
  margin: 0 0 1.25rem;
  color: var(--ink-soft);
  font-size: 0.98rem;
  line-height: 1.6;
}

.buy-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6rem;
  min-height: var(--touch-min);
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.buy-dialog-close:hover {
  background: var(--navy-deep);
}

/* —— Footer —— */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding: 1.25rem max(1.25rem, var(--safe-right)) calc(1.25rem + var(--safe-bottom)) max(1.25rem, var(--safe-left));
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer a {
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
