:root {
  --bg: #fbfaf8;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --card: #ffffff;
  --border: #e6e3de;
  --accent: #2f5d8a;
  --tag-bg: #eef2f6;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --fg: #ececee;
    --muted: #9a9aa2;
    --card: #1c1c1f;
    --border: #2c2c31;
    --accent: #8db8e3;
    --tag-bg: #24303c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main, footer {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--accent); }

.hero { padding: 4rem 0 2rem; }
.intro {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}
.hero .photo {
  flex: none;
  display: block;
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--tag-bg);
}
@media (max-width: 30rem) {
  .intro { gap: 1rem; }
  .hero .photo { width: 5.5rem; height: 5.5rem; }
}
.hero h1 { margin: 0; font-size: 2.4rem; line-height: 1.15; }
.headline { margin: .6rem 0 0; font-size: 1.2rem; }
.muted { color: var(--muted); }

.links { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 1rem; }

h2 {
  margin: 2.5rem 0 1rem;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-intro { margin: -.5rem 0 1.25rem; }

.reveal .card {
  opacity: 0;
  transform: translateY(1.5rem);
  transition: opacity .6s ease-out, transform .6s cubic-bezier(.2, .7, .3, 1);
}
.reveal .card.in {
  opacity: 1;
  transform: none;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.25rem .75rem;
  margin-bottom: 1.75rem;
}
.card header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: .25rem 1rem;
}
.card h3 { margin: 0; font-size: 1.15rem; }
.card h3 a { color: inherit; text-decoration-color: var(--border); }
.card h3 a:hover { color: var(--accent); }
.card time { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.lead { margin: .5rem 0 0; font-weight: 500; }
.body p, .body ul { margin: .6rem 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: .5rem;
  margin: .9rem 0 .25rem;
}
.gallery.single { grid-template-columns: 1fr; }
.gallery figure { margin: 0; }
.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--tag-bg);
}
.gallery.single img { aspect-ratio: auto; max-height: 26rem; }
.gallery figcaption { margin-top: .25rem; font-size: .8rem; color: var(--muted); }

.gallery a { cursor: zoom-in; }

.lightbox {
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 1rem;
  border: 0;
  background: transparent;
}
.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox::backdrop { background: rgb(0 0 0 / .93); }
.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  margin: 0;
}
.lightbox img {
  max-width: 100%;
  max-height: calc(100% - 3rem);
  object-fit: contain;
  border-radius: 6px;
}
.lightbox figcaption { margin-top: .75rem; color: #ececee; font-size: .95rem; text-align: center; }
.lightbox .close {
  z-index: 1;
  position: fixed;
  top: .75rem;
  right: .75rem;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .15);
  color: #fff;
  cursor: pointer;
}
.lightbox .nav {
  z-index: 1;
  display: none;
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .15);
  color: #fff;
  cursor: pointer;
}
.lightbox.multiple .nav { display: grid; }
.lightbox .close,
.lightbox .nav { place-items: center; padding: 0; }
.lightbox .close { display: grid; }
.lightbox button svg {
  width: 1.4rem;
  height: 1.4rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lightbox .nav:disabled { visibility: hidden; }
.lightbox .prev { left: .75rem; }
.lightbox .next { right: .75rem; }
.lightbox .count { color: #9a9aa2; margin-left: .5rem; font-variant-numeric: tabular-nums; }
.lightbox .close:hover,
.lightbox .close:focus-visible,
.lightbox .nav:hover,
.lightbox .nav:focus-visible { background: rgb(255 255 255 / .3); }
/* Gi plass til pilene på bredere skjermer. */
@media (min-width: 40rem) {
  .lightbox.multiple { padding: 1rem 4.5rem; }
}

.tags { display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; padding: 0; margin: .75rem 0 .5rem; }
.tags li {
  background: var(--tag-bg);
  border-radius: 999px;
  padding: .1rem .65rem;
  font-size: .8rem;
}

footer { padding: 3rem 1rem; font-size: .85rem; text-align: center; }

html:has(.lightbox[open]) { overflow: hidden; }

/* JEDB i footeren: hover (mus) eller klikk/trykk (fokus) viser forklaringen. */
abbr[data-tip] { position: relative; text-decoration: underline dotted; cursor: pointer; }
abbr[data-tip]:focus { outline: none; }
abbr[data-tip]::after {
  content: attr(data-tip);
  display: none;
  position: absolute;
  bottom: 1.6em;
  left: 0;
  white-space: nowrap;
  padding: .3rem .6rem;
  border: 1px solid var(--border);
  border-radius: .4rem;
  background: var(--card);
  font-size: .85rem;
}
abbr[data-tip]:focus::after { display: block; }
@media (hover: hover) { abbr[data-tip]:hover::after { display: block; } }
