/* ============================================================
   Bildebase — et flatt bildearkiv
   Palett: varm grafitt, papirhvitt, cyanotypisk blå.
   Typer: Bricolage Grotesque (display) + Archivo (UI og metadata)
   ============================================================ */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Bricolage Grotesque";
  src: url("../fonts/bricolage-latin-ext.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #121110;
  --bg-2: #1a1816;
  --bg-3: #232019;
  --line: #2d2823;
  --line-2: #211e1a;
  --fg: #f3f0e9;
  --fg-2: #b4ada1;
  --fg-3: #918a7e;
  --accent: #96b9d3;
  --accent-dim: rgba(150, 185, 211, 0.16);
  --gap: 14px;
  --row-h: 340px;
  --pad: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.6, 0.3, 1);
  --sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Bricolage Grotesque", var(--sans);
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, monospace;
  color-scheme: dark;
}

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

/* hidden-attributtet skal alltid vinne over display-regler */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--accent); color: #0c1014; }

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 10px 16px;
  background: var(--fg);
  color: var(--bg);
  z-index: 100;
}
.skip:focus { left: 12px; top: 12px; }

/* ---------- topplinje ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--line-2);
}

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 62px;
  padding-inline: var(--pad);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand-logo {
  height: 24px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
}
.brand-mark {
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 1px;
  transform: translateY(-1px);
  transition: transform 0.4s var(--ease);
}
.brand:hover .brand-mark { transform: translateY(-1px) rotate(45deg); }
.brand-count {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  color: var(--fg-3);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.bar-tools {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 32px);
  min-width: 0;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  transition: border-color 0.2s;
  min-width: 0;
}
.search:focus-within {
  border-color: var(--accent);
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
.search-icon { width: 14px; height: 14px; color: var(--fg-3); flex: 0 0 auto; transition: color 0.2s; }
.search:hover { border-color: #453d34; }
.search:focus-within .search-icon { color: var(--accent); }
#q {
  appearance: none;
  background: none;
  border: 0;
  padding: 8px 0;
  width: clamp(150px, 22vw, 280px);
  min-width: 0;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 13.5px;
  letter-spacing: -0.005em;
}
#q::placeholder { color: var(--fg-3); }
#q:focus { outline: none; }
#q::-webkit-search-decoration,
#q::-webkit-search-cancel-button { -webkit-appearance: none; }
.search-clear {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg-3);
  cursor: pointer;
}
.search-clear:hover { color: var(--fg); }
.search-clear svg { width: 12px; height: 12px; }

.density {
  display: flex;
  gap: 14px;
  padding-left: clamp(14px, 2vw, 28px);
  border-left: 1px solid var(--line);
}
.density button {
  position: relative;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--fg-3);
  font-size: 12px;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.2s;
}
.density button:hover { color: var(--fg-2); }
.density button.is-on { color: var(--fg); }
.density button.is-on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
}

/* ---------- album- og taggskinne ---------- */

.rail {
  display: flex;
  align-items: center;
  gap: 0;
  padding-inline: var(--pad);
  border-bottom: 1px solid var(--line-2);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* svak tone i høyrekanten viser at raden kan skyves */
  mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, #000 0, #000 calc(100% - 28px), transparent 100%);
}
.rail::-webkit-scrollbar { display: none; }

.rail-group { display: flex; align-items: center; gap: 22px; flex: 0 0 auto; }

.chip {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 15px 0 14px;
  border: 0;
  background: none;
  color: var(--fg-3);
  font-size: 12.5px;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}
.chip:hover { color: var(--fg-2); }
.chip .n {
  font-size: 10.5px;
  color: var(--fg-3);
  font-variant-numeric: tabular-nums;
  transition: color 0.2s;
}
.chip[aria-pressed="true"] { color: var(--fg); }
.chip:focus-visible {
  outline: none;
  box-shadow: inset 0 -2px 0 var(--accent), inset 2px 0 0 var(--accent), inset -2px 0 0 var(--accent);
}
.chip[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}
.chip[aria-pressed="true"] .n { color: var(--accent); }

.rail-sep {
  width: 1px;
  height: 14px;
  background: var(--line);
  flex: 0 0 auto;
  margin-inline: 22px;
}

.tag-chip {
  flex: 0 0 auto;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: none;
  color: var(--fg-3);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.tag-chip:hover { color: var(--fg); border-color: var(--fg-3); }
.tag-chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ---------- masthead ---------- */

main { padding-inline: var(--pad); }

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: end;
  gap: clamp(24px, 5vw, 80px);
  padding-block: clamp(34px, 5vw, 64px) clamp(22px, 3vw, 34px);
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.35rem, 5.6vw, 4.5rem);
  font-weight: 500;
  line-height: 0.94;
  letter-spacing: -0.038em;
  text-wrap: balance;
}

.lede {
  margin: 18px 0 0;
  max-width: 54ch;
  color: var(--fg-2);
  font-size: 15px;
  line-height: 1.62;
  text-wrap: pretty;
}

.query-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 0;
  color: var(--fg-2);
  font-size: 12.5px;
}
.query-note q { color: var(--fg); font-style: normal; }
.query-note .count { color: var(--fg-3); font-variant-numeric: tabular-nums; }
.query-note button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--fg-3);
  font-size: 12px;
  cursor: pointer;
}
.query-note button:hover { color: var(--fg); border-color: var(--fg-3); }

.facts {
  display: flex;
  margin: 0;
  flex-wrap: wrap;
  row-gap: 14px;
}
.facts > div {
  border-left: 1px solid var(--line);
  padding-left: 16px;
  margin-left: 16px;
}
.facts > div:first-child { border-left: 0; padding-left: 0; margin-left: 0; }
.facts dt {
  margin: 0;
  font-size: 10.5px;
  color: var(--fg-3);
  letter-spacing: 0.01em;
}
.facts dd {
  margin: 3px 0 0;
  font-size: 13px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- rutenett ---------- */

.grid {
  position: relative;
  min-height: 40vh;
  border-top: 1px solid var(--line);
  padding-top: calc(var(--gap) + 4px);
}

.rows { display: flex; flex-direction: column; gap: var(--gap); }
.row { display: flex; gap: var(--gap); width: 100%; }

.tile {
  position: relative;
  flex: 0 0 auto;
  display: block;
  overflow: hidden;
  background: var(--bg-2);
  background: var(--tile, var(--bg-2));
  contain: paint;
}
.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s var(--ease), transform 1s var(--ease);
}
.tile img.is-loaded { opacity: 1; }
.tile:hover img { transform: scale(1.035); }
.tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; z-index: 2; }

.cap {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 40px 12px 11px;
  background: linear-gradient(to top, rgba(9, 8, 7, 0.82), rgba(9, 8, 7, 0.34) 55%, transparent);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  pointer-events: none;
}
.tile:hover .cap,
.tile:focus-visible .cap { opacity: 1; transform: none; }

.cap-n {
  margin-right: 6px;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: rgba(251, 249, 245, 0.62);
}
.cap-t {
  display: flex;
  align-items: baseline;
  min-width: 0;
  color: #fbf9f5;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.cap-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cap-s {
  color: rgba(251, 249, 245, 0.66);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cap-s b {
  font-weight: 500;
  color: rgba(251, 249, 245, 0.88);
}

/* søkemodus: vis hvorfor bildet matcher */
.grid.is-search .cap { opacity: 1; transform: none; }
.grid.is-search .tile img { opacity: 0.94; }
.grid.is-search .tile:hover img { opacity: 1; }

/* kontaktark: tette fliser, zoom av, men hver ramme merkes som på et kontaktark */
body[data-density="sheet"] .tile:hover img { transform: none; }
body[data-density="sheet"] .cap {
  opacity: 1;
  transform: none;
  padding: 18px 7px 6px;
  background: linear-gradient(to top, rgba(9, 8, 7, 0.95), rgba(9, 8, 7, 0.62) 58%, transparent);
}
body[data-density="sheet"] .cap-t { font-size: 11px; font-weight: 400; }
body[data-density="sheet"] .cap-s { display: none; }
body[data-density="sheet"] .cap-n { font-size: 10.5px; color: rgba(251, 249, 245, 0.72); }

/* ---------- tomtilstand ---------- */

.state {
  padding: clamp(28px, 5vw, 56px) 0 80px;
  max-width: 62ch;
  color: var(--fg-2);
}
.state h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.state p { margin: 0 0 12px; font-size: 14px; }
.state code {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg);
}
.state pre {
  margin: 18px 0;
  padding: 16px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--accent);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--fg-2);
}

.state .muted { color: var(--fg-3); }
.state .hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
  font-size: 12.5px;
  color: var(--fg-3);
}
.state .linklike,
.query-note button.linklike {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--fg-2);
  font: inherit;
  cursor: pointer;
}
.state .linklike:hover { color: var(--fg); border-color: var(--fg-3); }

body[data-density="sheet"] .grid { padding-top: 3px; }


/* ---------- fritekstsider (markdown) ---------- */

.page-nav { display: flex; gap: 16px; }
.page-nav[hidden] { display: none; }
.page-link {
  position: relative;
  padding: 8px 0;
  color: var(--fg-3);
  font-size: 12.5px;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: color 0.2s;
}
.page-link:hover { color: var(--fg-2); }
.page-link[aria-current="page"] { color: var(--fg); }
.page-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 2px;
  background: var(--accent);
}

.page {
  max-width: 62ch;
  padding-block: clamp(8px, 1.6vw, 20px) 0;
}
.page > *:first-child { margin-top: 0; }
.page p,
.page li {
  color: var(--fg-2);
  font-size: 15.5px;
  line-height: 1.72;
  text-wrap: pretty;
}
.page p { margin: 0 0 1.15em; }
.page h2,
.page h3,
.page h4 {
  margin: 2.1em 0 0.55em;
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: var(--fg);
}
.page h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); }
.page h3 { font-size: 1.15rem; }
.page h1 { display: none; }
.page ul,
.page ol { margin: 0 0 1.2em; padding-left: 1.2em; }
.page li { margin-bottom: 0.4em; }
.page li::marker { color: var(--fg-3); }
.page blockquote {
  margin: 1.8em 0;
  padding-left: 18px;
  border-left: 1px solid var(--accent);
  color: var(--fg);
}
.page blockquote p {
  font-family: var(--display);
  font-size: 1.18rem;
  line-height: 1.45;
  color: var(--fg);
}
.page a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.page a:hover { color: var(--accent); }
.page img {
  display: block;
  width: 100%;
  height: auto;
  margin: 1.7em 0;
  background: var(--bg-2);
}
.page code {
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--fg);
}
.page pre {
  margin: 1.6em 0;
  padding: 14px 16px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  overflow-x: auto;
}
.page pre code { border: 0; background: none; padding: 0; font-size: 12.5px; line-height: 1.7; }
.page hr { margin: 2.4em 0; border: 0; border-top: 1px solid var(--line-2); }

/* ---------- footer ---------- */

.foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: clamp(48px, 7vw, 96px);
  padding: 22px var(--pad) 44px;
  border-top: 1px solid var(--line-2);
  color: var(--fg-3);
  font-size: 11.5px;
}
.foot p { margin: 0; }
.foot kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--fg-2);
}
.foot-build { font-variant-numeric: tabular-nums; }

/* ---------- bildeviser ---------- */

.lb {
  position: fixed;
  inset: 0;
  z-index: 60;
  width: 100%;
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: #0b0a09;
  color: var(--fg);
  font-family: var(--sans);
}
.lb::backdrop { background: rgba(7, 6, 5, 0.75); }
.lb[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  animation: lb-in 0.28s var(--ease);
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }

.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 54px;
  padding-inline: clamp(14px, 3vw, 28px);
  border-bottom: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--fg-2);
}
.lb-id { margin: 0; display: flex; gap: 8px; min-width: 0; }
.lb-id span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
.lb-id .sep { color: var(--line); }
.lb-tools { display: flex; align-items: center; gap: 18px; flex: 0 0 auto; }
.lb-counter { font-variant-numeric: tabular-nums; letter-spacing: 0.06em; color: var(--fg-2); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: none;
  color: var(--fg-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--line); }
.icon-btn svg { width: 13px; height: 13px; }

.lb-stage {
  --stage-pad: clamp(10px, 2.2vw, 26px);
  position: relative;
  min-height: 0;
  padding: 0;
  background: var(--stage, #0b0a09);
}
#lb-img {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  max-width: calc(100% - var(--stage-pad) * 2);
  max-height: calc(100% - var(--stage-pad) * 2);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 32px 90px -40px rgba(0, 0, 0, 0.95);
  animation: img-in 0.36s var(--ease);
}
@keyframes img-in {
  from { opacity: 0; transform: scale(0.994); }
  to { opacity: 1; transform: none; }
}

.lb-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(18, 17, 16, 0.7);
  color: var(--fg-2);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.lb-nav:hover { color: var(--fg); border-color: var(--fg-3); background: rgba(18, 17, 16, 0.94); }
.lb-nav.prev { left: clamp(8px, 1.6vw, 18px); }
.lb-nav.next { right: clamp(8px, 1.6vw, 18px); }
.lb-nav svg { width: 15px; height: 15px; }

.lb-foot {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  grid-template-areas:
    "info actions"
    "strip strip";
  gap: 12px clamp(24px, 4vw, 56px);
  padding: 14px clamp(14px, 3vw, 28px) 0;
  border-top: 1px solid var(--line-2);
}

.lb-info { grid-area: info; min-width: 0; }
.lb-info h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(18px, 2vw, 23px);
  font-weight: 500;
  letter-spacing: -0.022em;
  line-height: 1.15;
}
.lb-desc {
  margin: 7px 0 0;
  max-width: 66ch;
  color: var(--fg-2);
  font-size: 13px;
  line-height: 1.62;
  text-wrap: pretty;
}

.lb-tags { display: flex; flex-wrap: wrap; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
.lb-tags button {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: none;
  color: var(--fg-3);
  font-size: 10.5px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.lb-tags button:hover { color: var(--fg); border-color: var(--fg-3); }

.lb-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 16px;
  margin: 9px 0 0;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
}
.lb-meta > div { display: flex; gap: 6px; }
.lb-meta dt { margin: 0; color: var(--fg-3); }
.lb-meta dd { margin: 0; color: var(--fg-2); }
.lb-meta dd a {
  color: var(--fg-2);
  border-bottom: 1px solid var(--line);
  transition: color 0.2s, border-color 0.2s;
}
.lb-meta dd a:hover { color: var(--accent); border-color: var(--accent); }

.lb-actions {
  grid-area: actions;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: none;
  color: var(--fg-2);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn:hover { color: var(--fg); border-color: var(--fg-3); background: rgba(255, 255, 255, 0.03); }

.lb-strip {
  grid-area: strip;
  display: flex;
  gap: 5px;
  padding: 0 0 12px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.lb-strip button {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  height: 56px;
  padding: 0;
  border: 0;
  background: var(--bg-2);
  opacity: 0.42;
  cursor: pointer;
  transition: opacity 0.24s var(--ease);
}
.lb-strip button:hover { opacity: 0.8; }
.lb-strip button[aria-current="true"] { opacity: 1; }
.lb-strip button[aria-current="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.lb-strip img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- varsel ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  translate: -50% 12px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: #191715;
  color: var(--fg);
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s var(--ease), translate 0.24s var(--ease);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

/* ---------- responsivt ---------- */

@media (max-width: 1000px) {
  .masthead { grid-template-columns: minmax(0, 1fr); align-items: start; gap: 22px; }
  .facts > div:first-child { border-left: 1px solid var(--line); padding-left: 16px; }
}

@media (max-width: 720px) {
  :root { --pad: 16px; }
  .bar-inner { height: 56px; gap: 14px; }
  .brand-name { font-size: 16px; }
  .bar-tools { gap: 12px; flex: 1; justify-content: flex-end; }
  .search { flex: 1; min-width: 120px; }
  #q { width: 100%; font-size: 13px; }
  /* Visningstetthet er ekstra nyttig på touch, der hover-etiketter ikke finnes */
  .density { padding-left: 12px; }
  .density button { padding: 10px 0; }

  /* Touch-mål: minst 44 px der det er plass */
  .search-clear { width: 34px; height: 34px; }
  .icon-btn { width: 44px; height: 44px; }
  .tag-chip { padding: 10px 14px; font-size: 12px; }
  .btn { min-height: 44px; padding: 0 18px; }
  .lb-tags button { padding: 8px 12px; font-size: 11.5px; }
  .page-nav { gap: 12px; }
  .page-link { font-size: 12px; }
  .page { max-width: none; }
  .rail-group { gap: 18px; }
  .rail-sep { margin-inline: 16px; }
  .masthead { padding-block: 26px 18px; }
  h1 { font-size: clamp(2.1rem, 9.5vw, 3rem); }
  .lede { font-size: 13.5px; margin-top: 14px; }
  .facts > div { padding-left: 12px; margin-left: 12px; }
  .facts dt { font-size: 10px; }
  .facts dd { font-size: 12px; }

  .lb-bar { height: 48px; }
  .lb-tools { gap: 10px; }
  .lb-nav { display: none; }
  .lb-stage { padding: 8px; }
  .lb-foot {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "info" "actions" "strip";
    gap: 14px;
    padding-top: 14px;
  }
  .lb-info h2 { font-size: 19px; }
  .lb-desc { font-size: 12.5px; }
  .lb-meta { gap: 3px 14px; font-size: 10.5px; }
  .lb-strip button { width: 68px; height: 46px; }
  .btn { min-height: 38px; }
  .foot { margin-top: 40px; }
}

@media (max-width: 560px) {
  .bar-inner {
    flex-wrap: wrap;
    height: auto;
    padding-block: 9px;
    row-gap: 6px;
  }
  .brand { order: 1; }
  .page-nav { order: 2; margin-left: auto; }
  .bar-tools { order: 3; flex: 1 1 100%; justify-content: space-between; gap: 14px; }
  .search { flex: 1 1 auto; min-width: 0; }
  .masthead { padding-block: 22px 14px; }
  h1 { font-size: clamp(1.9rem, 10vw, 2.6rem); }
  .facts { row-gap: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
