/* Museumshjelpen AS — designsystem
   Papir, jernoksidrødt og arkivsverte. Ingen eksterne avhengigheter. */

:root {
  --paper:       #fbf8f3;
  --paper-2:     #f3ede2;
  --surface:     #ffffff;
  --ink:         #1c1a17;
  --ink-2:       #443f38;
  --muted:       #6d6558;
  --rule:        #e2d9ca;
  --rule-soft:   #eee7db;
  --accent:      #9a3b22;
  --accent-dark: #7a2c17;
  --accent-soft: #f7ece6;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;

  --wrap: 1180px;
  --prose: 68ch;
  --radius: 3px;
  --shadow: 0 1px 2px rgba(28, 26, 23, .05),
            0 8px 24px -12px rgba(28, 26, 23, .18);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-dark); }

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -.008em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: .7rem 1.1rem;
  z-index: 200;
}
.skip:focus { left: .5rem; top: .5rem; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

/* ---------- Topplinje ---------- */

.topbar {
  background: var(--ink);
  color: #cfc8bc;
  font-size: .82rem;
  letter-spacing: .01em;
}
.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.6rem;
  justify-content: flex-end;
  padding-block: .5rem;
}
.topbar a { color: #e8e1d5; text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 248, 243, .92);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  min-height: 74px;
}
.site-header .nav { min-width: 0; }

.brand {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.brand__name {
  font-family: var(--serif);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: .005em;
}
.brand__suffix {
  font-family: var(--sans);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: .55rem;
  background: none;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
  padding: .5rem .8rem;
  cursor: pointer;
}
.nav-toggle__bars {
  display: inline-block;
  width: 17px;
  height: 2px;
  background: currentColor;
  position: relative;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 17px;
  height: 2px;
  background: currentColor;
}
.nav-toggle__bars::before { top: -5px; }
.nav-toggle__bars::after  { top: 5px; }

.nav ul {
  display: flex;
  align-items: center;
  /* Får menyen likevel ikke plass, brytes den til ny linje
     i stedet for å skyve siden sidelengs. */
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(.5rem, 1.4vw, 1.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  display: block;
  color: var(--ink-2);
  text-decoration: none;
  font-size: .905rem;
  padding: .35rem 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.nav a:hover { color: var(--accent); }
.nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

/* Brytepunktet er i em, ikke px: em i media queries følger brukerens
   valgte standardskrift. Har brukeren satt 20px skrift, slår menyen
   over til hamburger allerede ved 1480px – nettopp fordi menyen da
   er tilsvarende bredere. Med px-brytepunkt sprakk den ut av siden. */
@media (max-width: 74em) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow);
    display: none;
  }
  .nav[data-open="true"] { display: block; }
  .nav ul {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: .5rem clamp(1.1rem, 4vw, 2.5rem) 1.1rem;
  }
  .nav li + li { border-top: 1px solid var(--rule-soft); }
  .nav a {
    padding: .8rem 0;
    font-size: 1rem;
    border-bottom: none;
    border-left: 3px solid transparent;
    padding-left: .75rem;
  }
  .nav a[aria-current="page"] { border-left-color: var(--accent); }
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  background: #241f19;
  color: #fff;
  overflow: hidden;
}
.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Holder hovedbygningen på Ledaal i bildet også når det beskjæres. */
  object-position: 62% 52%;
  opacity: .55;
}
@media (max-width: 46em) {
  .hero__img { object-position: 74% 46%; }
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
              rgba(24, 20, 16, .72) 0%,
              rgba(24, 20, 16, .55) 45%,
              rgba(24, 20, 16, .82) 100%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  padding-block: clamp(4.5rem, 13vw, 8.5rem);
  max-width: 46rem;
}
.hero h1 {
  color: #fff;
  font-size: clamp(2.3rem, 6vw, 3.9rem);
  margin-bottom: 1.1rem;
}
.hero__lead {
  font-size: clamp(1.08rem, 2.1vw, 1.32rem);
  line-height: 1.6;
  color: #ede7dd;
  margin: 0 0 2rem;
  max-width: 38rem;
}
.eyebrow {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.hero .eyebrow { color: #e5a88f; }

.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; }

.btn {
  display: inline-block;
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  padding: .78rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background-color .18s ease, color .18s ease,
              border-color .18s ease;
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn--ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, .5);
}
.btn--ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.btn--outline {
  color: var(--accent);
  border-color: var(--rule);
  background: var(--surface);
}
.btn--outline:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ---------- Seksjoner ---------- */

.section { padding-block: clamp(3.5rem, 8vw, 6rem); }
.section--tint { background: var(--paper-2); }
.section--rule { border-top: 1px solid var(--rule); }

.section__head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section__head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); }
.section__head p {
  color: var(--ink-2);
  font-size: 1.08rem;
  margin: 1rem 0 0;
}

/* ---------- Tjenestekort ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.75rem 1.6rem;
  text-decoration: none;
  color: inherit;
  transition: border-color .18s ease, transform .18s ease,
              box-shadow .18s ease;
}
.card:hover {
  border-color: #cdbfa9;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.card__num {
  font-family: var(--serif);
  font-size: .95rem;
  color: var(--accent);
  margin-bottom: .9rem;
  letter-spacing: .04em;
}
.card h3 { font-size: 1.28rem; margin-bottom: .6rem; }
.card p {
  color: var(--muted);
  font-size: .97rem;
  margin: 0 0 1.4rem;
  line-height: 1.62;
}
.card__more {
  margin-top: auto;
  color: var(--accent);
  font-size: .92rem;
  font-weight: 600;
}
.card:hover .card__more { color: var(--accent-dark); }

/* ---------- Nøkkeltall ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}
.fact { background: var(--paper); padding: 1.9rem 1.5rem; }
.fact__n {
  font-family: var(--serif);
  font-size: clamp(2.1rem, 4.6vw, 2.9rem);
  line-height: 1;
  color: var(--accent);
  display: block;
  margin-bottom: .55rem;
}
.fact__t {
  font-size: .93rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ---------- Om-seksjon ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.portrait {
  border-radius: var(--radius);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.portrait-caption {
  font-size: .86rem;
  color: var(--muted);
  margin-top: .8rem;
  font-style: italic;
}

/* ---------- Sidetopp (undersider) ---------- */

.pagehead {
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
  padding-block: clamp(2.75rem, 7vw, 4.5rem);
}
.pagehead h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  max-width: 20ch;
}
.pagehead__lead {
  margin: 1.2rem 0 0;
  font-size: 1.13rem;
  color: var(--ink-2);
  max-width: 52ch;
  line-height: 1.65;
}

.crumbs {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); text-decoration: underline; }
.crumbs span { padding-inline: .45rem; }

/* ---------- Brødtekst ---------- */

.prose { max-width: var(--prose); font-size: 1.08rem; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.35rem; color: var(--ink-2); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin: 3rem 0 1.25rem;
  padding-top: 2.2rem;
  border-top: 1px solid var(--rule);
}
.prose h3 { font-size: 1.22rem; margin: 2.4rem 0 .75rem; }
.prose ul, .prose ol {
  margin: 0 0 1.35rem;
  padding-left: 1.35rem;
  color: var(--ink-2);
}
.prose li + li { margin-top: .5rem; }
.prose li::marker { color: var(--accent); }

.prose .lead {
  font-size: 1.22rem;
  line-height: 1.6;
  color: var(--ink);
  font-family: var(--serif);
}

figure { margin: clamp(2.2rem, 5vw, 3rem) 0; }
figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--rule);
}
figcaption {
  font-size: .88rem;
  color: var(--muted);
  margin-top: .75rem;
  line-height: 1.55;
  padding-left: .9rem;
  border-left: 2px solid var(--accent);
}

.figure--wide { max-width: 980px; }

/* Faktaboks i brødtekst */
.callout {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.35rem 1.5rem;
  font-size: 1rem;
}
.callout p { color: var(--ink); margin: 0 0 .7rem; }
.callout > :last-child { margin-bottom: 0; }

/* Publikasjonsliste */
.pubs { list-style: none; margin: 0; padding: 0; max-width: 78ch; }
.pubs li {
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-2);
  font-size: 1.02rem;
  line-height: 1.6;
}
.pubs li:first-child { border-top: 1px solid var(--rule-soft); }
.pubs .author { color: var(--ink); font-weight: 600; }
.pubs .title { font-style: italic; }

/* Kontaktkort */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  max-width: 900px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem;
}
.contact-card h2 {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .7rem;
}
.contact-card p { margin: 0; font-size: 1.06rem; line-height: 1.55; }
.contact-card a { text-decoration: none; }
.contact-card a:hover { text-decoration: underline; }

/* ---------- Neste-lenker ---------- */

.morelinks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.morelink {
  display: block;
  padding: 1.2rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color .18s ease, background-color .18s ease;
}
.morelink:hover { border-color: var(--accent); color: var(--ink); }
.morelink span {
  display: block;
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .35rem;
}
.morelink strong { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }

/* ---------- CTA-band ---------- */

.cta {
  background: var(--ink);
  color: #f1ebe1;
  padding-block: clamp(3rem, 7vw, 4.75rem);
}
.cta h2 { color: #fff; font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.cta p {
  color: #c8c0b3;
  max-width: 46ch;
  margin: 1rem 0 2rem;
  font-size: 1.06rem;
}
.cta a.btn--primary { background: var(--accent); border-color: var(--accent); }
.cta a.btn--ghost { color: #fff; border-color: rgba(255,255,255,.45); }

/* ---------- Footer ---------- */

.site-footer {
  background: #16130f;
  color: #a49b8d;
  font-size: .93rem;
  padding-block: clamp(2.75rem, 6vw, 4rem) 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 3.5rem);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

.site-footer h2 {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #7d7466;
  margin-bottom: 1rem;
}
.site-footer .brand__name { color: #f3ede3; }
.site-footer .brand { margin-bottom: 1rem; }
.site-footer p { margin: 0 0 .5rem; line-height: 1.6; }
.site-footer a { color: #ddd4c6; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .55rem; }
.colophon {
  margin-top: clamp(2.25rem, 5vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid #2b251e;
  color: #776e60;
  font-size: .86rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  justify-content: space-between;
}

/* ---------- 404 ---------- */

.notfound { padding-block: clamp(4rem, 12vw, 8rem); text-align: center; }
.notfound h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 1rem; }
.notfound p { color: var(--ink-2); max-width: 46ch; margin: 0 auto 2rem; }
.notfound .btn-row { justify-content: center; }

@media print {
  .site-header, .topbar, .site-footer, .cta, .nav-toggle, .morelinks { display: none; }
  body { background: #fff; font-size: 11pt; }
  a { color: #000; }
}
