/*
Theme Name: NWBK Årgang
Description: Redesign 2026 for Niels Wessel Bagges Kunstfond. Hver årgang får sin egen farve fra årets billede.
Version: 0.2.0
Requires at least: 6.5
Requires PHP: 8.1
Text Domain: nwbk
*/

:root {
  --bg: #ffffff;
  --ink: #141414;
  --muted: #5e5e5e;
  --line: #e2e2e2;
  --soft-bg: #f4f3f1;
  --y-ground: #2b1e17;
  --y-accent: #d39a62;
  --y-text: #f4ede6;
  --y-soft: #cdbfb2;
  --display: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --label: "Jost", "Futura", "Helvetica Neue", sans-serif;
  --gutter: clamp(16px, 4.4vw, 64px);
  --max: 1440px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e0f; --ink: #efefef; --muted: #a3a3a3; --line: #262626; --soft-bg: #18181a; color-scheme: dark;
  }
}
:root[data-theme="dark"] { --bg: #0e0e0f; --ink: #efefef; --muted: #a3a3a3; --line: #262626; --soft-bg: #18181a; color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--display); font-size: 17px; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 4px; }
:focus-visible { outline: 2px solid var(--y-accent); outline-offset: 3px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; left: 16px; top: 16px; width: auto; height: auto; clip: auto; z-index: 100; background: var(--bg); padding: 8px 12px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.label { font-family: var(--label); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); }

/* Header ------------------------------------------------------------- */
.site-header { border-bottom: 1px solid transparent; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 22px; }
.logo img { width: 161px; height: auto; }
.primary-nav { display: flex; align-items: center; gap: 6px; }
.primary-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 26px; }
.primary-nav a { font-weight: 500; font-size: 17px; padding: 10px 0; display: inline-block; }
.primary-nav .current-menu-item > a, .primary-nav .current-menu-ancestor > a, .primary-nav .current-category-ancestor > a, .primary-nav .current-post-ancestor > a { box-shadow: inset 0 -2px 0 currentColor; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; color: inherit; cursor: pointer; border-radius: 0; }
.icon-btn svg { width: 20px; height: 20px; }
.menu-btn { display: none; height: 44px; padding: 0 12px; border: 0; background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.search-panel { border-top: 1px solid var(--line); }
.search-panel form { display: flex; gap: 12px; padding-block: 16px; }
.search-panel input[type=search], .field { flex: 1; height: 52px; border: 0; border-bottom: 2px solid var(--ink); background: transparent; font: inherit; font-size: 24px; font-weight: 500; color: inherit; outline: none; padding: 0; }
.btn { height: 48px; padding: 0 20px; border: 2px solid var(--ink); background: none; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }

/* Dark header: the logo is inverted, inactive items step back, active item uses the year accent */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo img { filter: invert(1) hue-rotate(180deg); }
  :root:not([data-theme="light"]) .site-header { border-bottom-color: var(--line); }
  :root:not([data-theme="light"]) .primary-nav a { color: #b9b9b9; }
  :root:not([data-theme="light"]) .primary-nav .current-menu-item > a, :root:not([data-theme="light"]) .primary-nav .current-category-ancestor > a, :root:not([data-theme="light"]) .primary-nav .current-post-ancestor > a, :root:not([data-theme="light"]) .primary-nav .current-menu-ancestor > a { color: var(--y-accent); }
}
:root[data-theme="dark"] .logo img { filter: invert(1) hue-rotate(180deg); }
:root[data-theme="dark"] .site-header { border-bottom-color: var(--line); }
:root[data-theme="dark"] .primary-nav a { color: #b9b9b9; }
:root[data-theme="dark"] .primary-nav .current-menu-item > a, :root[data-theme="dark"] .primary-nav .current-category-ancestor > a, :root[data-theme="dark"] .primary-nav .current-post-ancestor > a, :root[data-theme="dark"] .primary-nav .current-menu-ancestor > a { color: var(--y-accent); }
.primary-nav a:hover { color: var(--ink); }

@media (max-width: 980px) {
  .menu-btn { display: inline-flex; align-items: center; }
  .primary-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 20px; flex-direction: column; align-items: stretch; z-index: 20; }
  .primary-nav.open { display: flex; }
  .primary-nav ul { flex-direction: column; gap: 0; }
  .primary-nav a { font-size: 26px; font-weight: 700; padding: 10px 0; display: block; border-bottom: 1px solid var(--line); }
  .site-header .wrap { position: relative; }
  .logo img { width: 115px; }
}

/* Year block (Årgang) ------------------------------------------------- */
.year-block { background: var(--y-ground); color: var(--y-text); }
.year-block a:hover { color: var(--y-accent); }
.year-accent { color: var(--y-accent); }
.cut { clip-path: polygon(0 0, calc(100% - var(--cut, 96px)) 0, 100% var(--cut, 96px), 100% 100%, 0 100%); }

/* Front page carousel: slides stack in one cell; the next one opens from the cut corner. */
.carousel { position: relative; }
.slides { display: grid; }
.slide { grid-area: 1 / 1; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; min-height: 560px; visibility: hidden; }
.slide.is-active, .slide.is-leaving { visibility: visible; }
.slide.is-active { z-index: 2; }
.slide.is-leaving { z-index: 1; }
.slide-text { grid-column: span 5; padding: 44px 0 40px 48px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.hero-year { font-weight: 800; font-size: clamp(96px, 14.5vw, 210px); line-height: .8; letter-spacing: -.05em; margin: 0 0 0 -.04em; }
.hero-year a:hover, .hero-title a:hover { text-decoration: none; color: inherit; }
.hero-title { font-weight: 800; font-size: clamp(40px, 4.6vw, 72px); line-height: .95; letter-spacing: -.04em; margin: 8px 0 0; text-wrap: balance; }
.hero-teaser { margin: 4px 0 0; font-size: 19px; line-height: 1.45; color: var(--y-soft); max-width: 36ch; }
.hero-names { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; font-size: 18px; }
.slide-more { margin-top: auto; font-weight: 500; }
.slide-figure { grid-column: 6 / span 7; margin: 0; position: relative; --cut: 140px; }
.slide-figure img { width: 100%; height: 100%; min-height: 560px; max-height: 640px; object-fit: cover; }
.slide-figure figcaption { position: absolute; right: 0; top: 0; width: 140px; padding: 14px 14px 0 0; text-align: right; font-size: 12px; line-height: 1.3; color: var(--y-soft); }

.carousel-nav { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.carousel-nav .arrow { flex: none; border: 1px solid var(--line); }
.carousel-nav .arrow:hover { border-color: var(--ink); }
.carousel-steps { flex: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; min-width: 0; }
.carousel-steps button { width: 100%; display: flex; flex-direction: column; gap: 7px; padding: 6px 0; border: 0; background: none; font: inherit; font-size: 13px; color: var(--muted); text-align: left; cursor: pointer; }
.step-bar { display: block; height: 4px; background: var(--y-ground); opacity: .22; transform-origin: left; transition: opacity .3s, transform .3s; }
.step-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carousel-steps button:hover .step-bar { opacity: .5; }
.carousel-steps button[aria-selected="true"] { color: var(--ink); font-weight: 700; }
.carousel-steps button[aria-selected="true"] .step-bar { opacity: 1; transform: scaleY(1.75); }
.carousel-count { flex: none; min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .step-bar { background: var(--y-accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .step-bar { background: var(--y-accent); } }

@keyframes nwbk-wipe { from { clip-path: polygon(100% 0, 100% 0, 100% 0); } to { clip-path: polygon(-100% 0, 100% 0, 100% 200%); } }
@keyframes nwbk-wipe-back { from { clip-path: polygon(0 100%, 0 100%, 0 100%); } to { clip-path: polygon(0 -100%, 200% 100%, 0 100%); } }
@keyframes nwbk-rise { from { opacity: 0; transform: translateY(18px); } }
@media (prefers-reduced-motion: no-preference) {
  .slide.is-entering { animation: nwbk-wipe .95s cubic-bezier(.75, 0, .2, 1) both; }
  .slide.is-entering.back { animation-name: nwbk-wipe-back; }
  .slide.is-entering .slide-text > * { animation: nwbk-rise .6s cubic-bezier(.2, .7, .2, 1) both; animation-delay: .38s; }
  .slide.is-entering .slide-text > :nth-child(2) { animation-delay: .46s; }
  .slide.is-entering .slide-text > :nth-child(3) { animation-delay: .54s; }
  .slide.is-entering .slide-text > :nth-child(4) { animation-delay: .62s; }
  .slide.is-entering .slide-figure img { animation: nwbk-zoom 1.4s cubic-bezier(.2, .7, .2, 1) both; }
}
@keyframes nwbk-zoom { from { transform: scale(1.06); } }
.slide-figure { overflow: hidden; }

.shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin-top: 36px; margin-bottom: 64px; }
.shortcuts a { display: flex; flex-direction: column; gap: 4px; border-top: 2px solid var(--ink); padding-top: 14px; }
.shortcuts strong { font-size: clamp(20px, 1.9vw, 26px); letter-spacing: -.01em; }
.shortcuts span { color: var(--muted); }
@media (max-width: 900px) {
  .slide { grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 0; align-content: start; }
  .slide:not(.is-active):not(.is-leaving) { display: none; }
  .slide-text { grid-column: auto; padding: 22px 20px 26px; order: 2; }
  .slide-figure { grid-column: auto; --cut: 64px; }
  .slide-figure img { min-height: 240px; max-height: 340px; }
  .slide-figure figcaption { width: 100px; font-size: 11px; padding: 8px 8px 0 0; }
  .hero-title { font-size: clamp(34px, 9vw, 48px); }
  .carousel-steps { display: flex; overflow-x: auto; scrollbar-width: none; gap: 10px; }
  .carousel-steps::-webkit-scrollbar { display: none; }
  .carousel-steps li { flex: none; width: 84px; }
  .carousel-count { display: none; }
  .shortcuts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .shortcuts a { border-top-width: 1px; padding-block: 14px; }
  .shortcuts strong { font-size: 22px; }
}

/* Recipient list ------------------------------------------------------ */
.list-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; padding-top: 24px; }
.page-title { margin: 0; font-weight: 800; font-size: clamp(48px, 7.2vw, 104px); line-height: .88; letter-spacing: -.045em; hyphens: manual; }
.search-box { display: flex; flex-direction: column; gap: 6px; width: min(380px, 100%); }
.year-nav-sentinel { height: 1px; margin-top: 39px; }
.year-nav { position: sticky; top: 0; z-index: 8; background: var(--bg); --bar-max: 150px; padding-top: 8px; transition: box-shadow .3s; }
.year-nav.is-stuck { --bar-max: 26px; box-shadow: 0 1px 0 var(--line), 0 12px 24px -18px rgba(0,0,0,.35); }
.year-bars { display: grid; grid-template-columns: repeat(var(--n, 23), minmax(0, 1fr)); gap: 6px; align-items: end; border-bottom: 1px solid var(--ink); }
.year-bars a { display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; text-align: center; text-decoration: none; }
.year-bars a .n { line-height: 1; transition: opacity .2s, height .3s; height: 12px; overflow: hidden; }
.year-bars a .bar { display: block; background: #d8d1ca; height: calc(var(--h) * var(--bar-max)); min-height: 3px; transition: height .45s cubic-bezier(.2, .7, .2, 1), background-color .45s; }
:root[data-theme="dark"] .year-bars a .bar { background: #3a3a3c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .year-bars a .bar { background: #3a3a3c; } }
.year-bars a:hover .bar { background: var(--muted); }
.year-bars a[aria-current="true"] { color: var(--ink); font-weight: 700; }
.year-bars a[aria-current="true"] .bar { background: var(--y-ground); }
:root[data-theme="dark"] .year-bars a[aria-current="true"] .bar { background: var(--y-accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .year-bars a[aria-current="true"] .bar { background: var(--y-accent); } }
.year-bars a .yr { padding-bottom: 8px; }
.year-nav.is-stuck .year-bars a:not([aria-current="true"]) .n { opacity: 0; height: 0; }
.year-nav.is-stuck .bars-legend { display: none; }
.bars-legend { display: flex; justify-content: space-between; margin-top: 8px; padding-bottom: 4px; }
.year-bars a.is-loading .bar { animation: nwbk-pulse .8s ease-in-out infinite alternate; }
@keyframes nwbk-pulse { to { opacity: .45; } }
@media (max-width: 700px) {
  .year-nav { --bar-max: 100px; }
  .year-nav.is-stuck { --bar-max: 22px; }
  .year-bars { overflow-x: auto; grid-template-columns: repeat(var(--n, 23), 34px); scrollbar-width: none; }
  .year-bars::-webkit-scrollbar { display: none; }
  .bars-legend span:nth-child(2) { display: none; }
}
/* Picking a year: the band opens from its cut corner, portraits follow one by one */
#aargang { scroll-margin-top: 96px; view-transition-name: aargang; }
::view-transition-old(aargang) { animation: .35s ease both nwbk-fade-out; }
::view-transition-new(aargang) { animation: .8s cubic-bezier(.75, 0, .2, 1) both nwbk-wipe; }
::view-transition-group(aargang) { animation-duration: .8s; }
@keyframes nwbk-fade-out { to { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: no-preference) {
  .year-band.entering .year-band-head .num { animation: nwbk-rise .6s .2s cubic-bezier(.2, .7, .2, 1) both; }
  .year-band.entering .people li { animation: nwbk-rise .55s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(.32s + var(--i, 0) * 55ms); }
}
@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }
.year-band { margin-top: 32px; padding: 36px 40px 40px; display: flex; flex-direction: column; gap: 28px; --cut: 64px; }
.year-band-head { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; }
.year-band-head .num { font-weight: 800; font-size: clamp(72px, 9vw, 120px); line-height: .8; letter-spacing: -.05em; }
.people { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; list-style: none; margin: 0; padding: 0; }
.people a { display: flex; gap: 14px; align-items: flex-end; }
.people img { width: 104px; height: 130px; object-fit: cover; flex: none; }
.people .ph { width: 104px; height: 130px; flex: none; }
.ph { display: grid; place-items: center; background: rgba(255,255,255,.1); color: var(--y-accent); font-weight: 800; font-size: 34px; letter-spacing: -.03em; }
.people span { font-size: 21px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
@media (max-width: 1100px) { .people { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .year-band { padding: 24px 20px; } .people { grid-template-columns: minmax(0, 1fr); gap: 14px; } .people img, .people .ph { width: 72px; height: 90px; } .people span { font-size: 19px; } }
.year-index { margin-top: 28px; }
.year-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 24px; border-top: 1px solid var(--line); padding-block: 18px; }
.year-row .num { font-weight: 800; font-size: 44px; line-height: .9; letter-spacing: -.04em; color: var(--muted); }
.year-row ul { list-style: none; margin: 0; padding: 0; columns: 4 200px; column-gap: 20px; font-size: 18px; font-weight: 500; }
.year-row li { break-inside: avoid; padding-block: 3px; }
@media (max-width: 900px) { .year-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } .year-row ul { columns: 2 140px; } }
.no-hits { padding: 24px 0; font-size: 20px; }
[hidden] { display: none !important; }

/* Artist page ---------------------------------------------------------- */
.artist-hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; min-height: 600px; }
.artist-portrait { grid-column: span 4; margin: 0; position: relative; --cut: 96px; }
.artist-portrait img { width: 100%; height: 100%; min-height: 600px; object-fit: cover; }
.artist-portrait figcaption { position: absolute; left: 16px; bottom: 14px; font-size: 12px; background: rgba(0,0,0,.45); padding: 2px 8px; color: #fff; }
.artist-intro { grid-column: 6 / span 7; padding: 48px 48px 44px 0; display: flex; flex-direction: column; gap: 22px; }
.artist-name { margin: 0; font-weight: 800; font-size: clamp(56px, 9.4vw, 136px); line-height: .84; letter-spacing: -.05em; overflow-wrap: anywhere; }
.facts { margin: auto 0 0; display: grid; grid-template-columns: auto minmax(0, 1.6fr) auto; column-gap: 36px; row-gap: 16px; gap: 16px; border-top: 1px solid rgba(255,255,255,.22); padding-top: 16px; }
.facts dt { font-family: var(--label); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--y-soft); }
.facts dd { margin: 0; font-size: 18px; }
.facts dd a { text-decoration: underline; display: block; }
.anchor-nav { display: flex; gap: 32px; border-bottom: 1px solid var(--line); font-weight: 500; position: sticky; top: 0; background: var(--bg); z-index: 5; }
.anchor-nav a { padding: 16px 0; color: var(--muted); }
.anchor-nav a.on { color: var(--ink); box-shadow: inset 0 -3px 0 var(--y-accent); }
#vaerker, #om, #aargang { scroll-margin-top: 72px; }
@media (max-width: 900px) {
  .artist-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .artist-portrait, .artist-intro { grid-column: auto; }
  .artist-portrait { --cut: 64px; }
  .artist-portrait img { min-height: 0; aspect-ratio: 4 / 5; max-height: 420px; }
  .artist-intro { padding: 20px 20px 24px; }
  .facts { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}
.works { margin-top: 48px; display: flex; flex-direction: column; gap: 64px; --row-h: min(640px, 72vh); }
.work-row { display: flex; gap: 24px; align-items: flex-start; width: 100%; max-width: min(100%, calc(min(var(--row-h), var(--hmax, 9999px)) * var(--sum) + 24px * (var(--count, 2) - 1))); }
.work-row.single { max-width: min(100%, calc(min(var(--row-h), var(--hmax, 9999px)) * var(--sum)), 75%); }
.works.per-3 { --row-h: min(460px, 60vh); gap: 48px; }
.works.per-3 .work-row { gap: 20px; }
.work-row.alt { align-self: flex-end; }
.work-row.single.alt { margin-right: 8.333%; }
.work-row:not(.alt).single { margin-left: 0; }
.works figure { margin: 0; display: flex; flex-direction: column; gap: 10px; flex: var(--ar) 1 0; min-width: 0; }
.works button { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.works img { width: 100%; height: auto; aspect-ratio: var(--ar); object-fit: cover; background: var(--soft-bg); }
.works figcaption { display: flex; gap: 14px; font-size: 15px; max-width: 62ch; }
.works figcaption .n { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .works { gap: 36px; }
  .work-row, .work-row.single { flex-direction: column; max-width: none; margin: 0 !important; gap: 36px; }
  .works figure { flex: none; width: 100%; }
}
.about { margin-top: 72px; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; border-top: 2px solid var(--ink); padding-top: 24px; }
.about h2 { grid-column: span 12; margin: 0; }
.about .lead { grid-column: span 7; margin: 0; font-size: clamp(24px, 2.4vw, 34px); font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.about .rest { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 14px; }
.about .rest p { margin: 0; }
@media (max-width: 900px) { .about .lead, .about .rest { grid-column: span 12; } }
.cohort { margin-top: 72px; padding: 28px 32px 32px; display: flex; flex-direction: column; gap: 20px; --cut: 48px; }
.cohort-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.cohort h2 { margin: 0; font-weight: 800; font-size: 44px; letter-spacing: -.04em; line-height: 1; }
.cohort ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 14px; }
.cohort ul a { display: flex; flex-direction: column; gap: 8px; }
.cohort ul img, .cohort ul .ph { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.cohort ul .ph { background: rgba(255,255,255,.08); }
.cohort ul span { font-size: 15px; font-weight: 700; line-height: 1.2; }
@media (max-width: 1100px) { .cohort ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cohort { padding: 20px; } .cohort ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cohort h2 { font-size: 30px; } }
.prev-next { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; margin-bottom: 72px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }

/* Pages: shared ----------------------------------------------------------- */
.tinted { --y-ink: var(--y-ground); }
:root[data-theme="dark"] .tinted { --y-ink: var(--y-accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tinted { --y-ink: var(--y-accent); } }
.page-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 24px; align-items: end; padding-top: 28px; padding-bottom: 36px; border-bottom: 2px solid var(--ink); }
.page-head.has-tabs { padding-top: 40px; }
.page-head .page-title { grid-column: span 7; }
.page-intro { grid-column: span 5; margin: 0; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.35; font-weight: 500; letter-spacing: -.01em; text-wrap: pretty; }
@media (max-width: 900px) { .page-head .page-title, .page-intro { grid-column: span 12; } }
.prose { font-size: 19px; line-height: 1.6; max-width: 66ch; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1em; }
.prose h2, .prose h3 { font-size: 24px; letter-spacing: -.015em; line-height: 1.2; margin: 1.6em 0 .5em; }
.prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose img { margin-block: 16px; }
.prose .lead { font-size: clamp(22px, 2vw, 28px); line-height: 1.3; font-weight: 500; letter-spacing: -.015em; }
.section-prose { margin-top: 32px; }
.prose-cols { max-width: none; columns: 2 340px; column-gap: 48px; margin-top: 56px; font-size: 18px; }
.prose-cols p { break-inside: avoid-column; }
.gallery-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-top: 72px; padding-top: 16px; border-top: 2px solid var(--ink); }
.gallery-head h2 { margin: 0; font-size: 32px; letter-spacing: -.03em; }
.gallery-head + .works { margin-top: 32px; }

/* Section tabs (siblings) */
.section-tabs { position: sticky; top: 0; z-index: 6; background: var(--bg); display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.section-tabs::-webkit-scrollbar { display: none; }
.section-tabs .tabs-root, .chapter-rail .tabs-root { flex: none; font-family: var(--label); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); padding: 16px 0; }
.section-tabs .tabs { display: flex; gap: 24px; }
.section-tabs .tabs a { flex: none; padding: 16px 0; color: var(--muted); font-weight: 500; white-space: nowrap; }
.section-tabs .tabs a:hover { color: var(--ink); text-decoration: none; }
.section-tabs .tabs a[aria-current] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--y-ink, var(--ink)); }

/* Section index: Samlingen, Om fonden */
.section-index { list-style: none; margin: 0 0 64px; padding: 0; }
.idx-row { border-bottom: 1px solid var(--line); }
.idx-link { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; padding-block: 28px; min-height: 160px; }
.idx-link:hover { text-decoration: none; }
.idx-n { align-self: start; padding-top: 14px; font-family: var(--label); font-size: 14px; letter-spacing: .1em; color: var(--muted); font-variant-numeric: tabular-nums; }
.idx-main { display: flex; flex-direction: column; gap: 10px; align-self: start; padding-top: 4px; }
.idx-title { font-weight: 800; font-size: clamp(40px, 5vw, 76px); line-height: .92; letter-spacing: -.045em; transition: color .25s; }
.idx-arrow { display: inline-block; font-weight: 500; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.idx-link:hover .idx-arrow { transform: translateX(10px); }
.idx-link:hover .idx-title { color: var(--y-ground); }
:root[data-theme="dark"] .idx-link:hover .idx-title { color: var(--y-accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .idx-link:hover .idx-title { color: var(--y-accent); } }
.idx-teaser { color: var(--muted); max-width: 46ch; font-size: 18px; line-height: 1.45; }
.idx-meta { color: var(--ink); }
.idx-media { display: grid; grid-template-columns: 1.5fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; height: 300px; justify-self: end; width: min(100%, 470px); }
.idx-img { overflow: hidden; background: var(--soft-bg); }
.idx-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.idx-img-0 { grid-row: span 2; --cut: 56px; }
.idx-img-1 img { transition-delay: .04s; } .idx-img-2 img { transition-delay: .08s; }
.idx-link:hover .idx-img img { transform: scale(1.05); }
.idx-row.media-1 .idx-media { grid-template-columns: 1fr; width: 220px; }
.idx-row.media-1 .idx-img-0 { grid-row: span 2; }
.idx-row.media-2 .idx-img-1 { grid-row: span 2; }
.section-about { margin: 0 0 80px; padding-top: 16px; border-top: 2px solid var(--ink); }
.section-about h2 { margin: 0 0 24px; color: var(--muted); }
.section-about .prose-cols { margin-top: 0; }
.idx-row:not(.has-media) .idx-link { grid-template-columns: 80px minmax(0, 1fr); min-height: 0; }
.idx-row:not(.has-media) .idx-title { font-size: clamp(32px, 3.6vw, 52px); }
.idx-chapters { list-style: none; margin: -8px 0 0; padding: 0 0 32px 104px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; }
.idx-chapters a { display: flex; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-weight: 500; }
.idx-chapters .n { color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 900px) {
  .idx-link { grid-template-columns: minmax(0, 1fr); gap: 14px; padding-block: 22px; }
  .idx-n { padding-top: 0; }
  .idx-media { order: -1; justify-self: stretch; width: 100%; height: 220px; }
  .idx-row:not(.has-media) .idx-link { grid-template-columns: minmax(0, 1fr); }
  .idx-chapters { padding-left: 0; grid-template-columns: minmax(0, 1fr); }
}

/* Collection pages */
.col-hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; min-height: 560px; margin-top: 20px; }
.col-intro { grid-column: span 6; padding: 44px 0 40px 48px; display: flex; flex-direction: column; gap: 20px; }
.col-title { margin: 0; font-weight: 800; font-size: clamp(56px, 8.4vw, 136px); line-height: .84; letter-spacing: -.05em; hyphens: auto; }
.col-lead { margin: 0; font-size: clamp(19px, 1.6vw, 23px); line-height: 1.4; max-width: 34ch; color: var(--y-text); }
.col-jump { margin-top: auto; font-weight: 500; }
.col-figure { grid-column: 7 / span 6; margin: 0; position: relative; --cut: 120px; display: flex; flex-direction: column; }
.col-figure button { flex: 1; padding: 0; border: 0; background: none; cursor: zoom-in; display: block; min-height: 0; }
.col-figure img { width: 100%; height: 100%; max-height: 640px; object-fit: cover; }
.col-figure figcaption { padding: 10px 48px 14px 0; font-size: 13px; color: var(--y-soft); display: flex; gap: 10px; }
@media (max-width: 900px) {
  .col-hero { grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 0; }
  .col-intro { grid-column: auto; padding: 22px 20px 26px; order: 2; }
  .col-figure { grid-column: auto; --cut: 56px; }
  .col-figure img { max-height: 420px; }
  .col-figure figcaption { padding: 8px 20px 0; }
}
.next-card { display: flex; align-items: stretch; justify-content: space-between; gap: 24px; margin: 72px 0 72px; background: var(--y-ground); color: var(--y-text); min-height: 180px; clip-path: polygon(0 0, calc(100% - 48px) 0, 100% 48px, 100% 100%, 0 100%); }
.next-card:hover { text-decoration: none; }
.next-text { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: 24px 32px; }
.next-text .label { color: var(--y-soft); }
.next-title { font-weight: 800; font-size: clamp(32px, 4vw, 60px); letter-spacing: -.04em; line-height: .95; }
.next-title span { display: inline-block; transition: transform .3s; }
.next-card:hover .next-title span { transform: translateX(10px); }
.next-img { width: 220px; flex: none; }
.next-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 560px) { .next-img { width: 110px; } .next-text { padding: 18px 20px; } }

/* Biography chapters */
.chapter-rail { position: sticky; top: 0; z-index: 6; background: var(--bg); display: flex; align-items: stretch; gap: 20px; border-bottom: 1px solid var(--line); }
.chapter-rail ol { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; flex: 1; min-width: 0; }
.chapter-rail a { display: flex; flex-direction: column; gap: 2px; padding: 12px 0 11px; color: var(--muted); box-shadow: inset 0 3px 0 var(--line); height: 100%; }
.chapter-rail a:hover { color: var(--ink); text-decoration: none; box-shadow: inset 0 3px 0 var(--muted); }
.chapter-rail a[aria-current] { color: var(--ink); box-shadow: inset 0 3px 0 var(--y-ink); }
.chapter-rail .n { font-family: var(--label); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.chapter-rail .t { font-size: 13px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chapter-rail .tabs-root { padding-top: 15px; }
@media (max-width: 900px) {
  .chapter-rail { overflow-x: auto; scrollbar-width: none; }
  .chapter-rail ol { grid-auto-columns: 112px; }
  .chapter-rail .tabs-root { display: none; }
}
.chapter-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; padding-top: 48px; padding-bottom: 40px; border-bottom: 2px solid var(--ink); align-items: end; }
.chapter-no { grid-column: span 3; font-weight: 800; font-size: clamp(80px, 13vw, 200px); line-height: .78; letter-spacing: -.06em; color: var(--y-ink); font-variant-numeric: tabular-nums; }
.chapter-head > div:last-child { grid-column: 4 / span 9; display: flex; flex-direction: column; gap: 16px; }
.chapter-head .page-intro { max-width: 40ch; }
@media (max-width: 900px) { .chapter-no, .chapter-head > div:last-child { grid-column: span 12; } .chapter-no { font-size: 72px; } .chapter-head { padding-top: 28px; gap: 12px; } }
.chapter-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin-top: 44px; margin-bottom: 64px; }
.chapter-body .prose { grid-column: 4 / span 6; }
.chapter-body.no-figs .prose { grid-column: 4 / span 7; }
.chapter-figs { grid-column: 10 / span 3; display: flex; flex-direction: column; gap: 28px; }
.chapter-figs figure { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.chapter-figs figure:first-child { --cut: 40px; }
.chapter-figs button { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; }
.chapter-figs img { width: 100%; height: auto; }
.chapter-figs figcaption { font-size: 13px; line-height: 1.4; color: var(--muted); }
@media (max-width: 1100px) { .chapter-body .prose { grid-column: 1 / span 8; } .chapter-figs { grid-column: 9 / span 4; } .chapter-body.no-figs .prose { grid-column: 1 / span 9; } }
@media (max-width: 760px) { .chapter-body .prose, .chapter-figs, .chapter-body.no-figs .prose { grid-column: span 12; } .chapter-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
.toc { list-style: none; margin: 0 0 32px; padding: 0; border-top: 2px solid var(--ink); counter-reset: none; }
.toc a { display: grid; grid-template-columns: 80px minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: baseline; padding: 20px 0; border-bottom: 1px solid var(--line); }
.toc a:hover { text-decoration: none; }
.toc .n { font-weight: 800; font-size: 28px; letter-spacing: -.03em; color: var(--y-ink); font-variant-numeric: tabular-nums; }
.toc .t { font-weight: 700; font-size: clamp(22px, 2.2vw, 32px); letter-spacing: -.025em; line-height: 1.1; }
.toc a:hover .t { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 2px; }
.toc .x { color: var(--muted); font-size: 16px; }
@media (max-width: 760px) { .toc a { grid-template-columns: 52px minmax(0, 1fr); } .toc .x { grid-column: 2; } }
.chapter-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 80px; }
.chapter-pager a { display: flex; flex-direction: column; gap: 10px; padding: 22px 0; border-top: 2px solid var(--ink); }
.chapter-pager a:hover { text-decoration: none; }
.chapter-pager .next { text-align: right; align-items: flex-end; }
.chapter-pager .t { font-weight: 800; font-size: clamp(24px, 2.8vw, 40px); letter-spacing: -.035em; line-height: 1; }
.chapter-pager a:hover .t { color: var(--y-ink); }
.chapter-pager .label { color: var(--muted); }
@media (max-width: 560px) { .chapter-pager { grid-template-columns: minmax(0, 1fr); } .chapter-pager .next { text-align: left; align-items: flex-start; } }

/* Press releases */
.press-hero { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; min-height: 520px; margin-top: 8px; }
.press-figure { grid-column: span 6; margin: 0; position: relative; --cut: 96px; }
.press-figure button { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; width: 100%; height: 100%; }
.press-figure img { width: 100%; height: 100%; min-height: 520px; max-height: 640px; object-fit: cover; }
.press-figure figcaption { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 5px 8px; max-width: 80%; }
.press-intro { grid-column: 7 / span 6; padding: 48px 48px 44px 0; display: flex; flex-direction: column; gap: 22px; }
.press-hero.no-figure { min-height: 0; --cut: 64px; clip-path: polygon(0 0, calc(100% - 64px) 0, 100% 64px, 100% 100%, 0 100%); }
.press-hero.no-figure .press-intro { grid-column: span 12; padding: 40px 48px; }
.press-title { margin: 0; font-weight: 800; font-size: clamp(44px, 5.6vw, 92px); line-height: .9; letter-spacing: -.045em; text-wrap: balance; }
.press-intro .facts { margin-top: auto; }
@media (max-width: 900px) {
  .press-hero { grid-template-columns: minmax(0, 1fr); gap: 0; min-height: 0; }
  .press-figure { grid-column: auto; --cut: 56px; }
  .press-figure img { min-height: 240px; max-height: 380px; }
  .press-intro, .press-hero.no-figure .press-intro { grid-column: auto; padding: 22px 20px 26px; }
}
.article-body { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 24px; margin-top: 48px; margin-bottom: 48px; }
.article-body .content { grid-column: span 7; min-width: 0; }
.article-body aside { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 28px; }
@media (max-width: 900px) { .article-body .content, .article-body aside { grid-column: span 12; } }
.side-block h2 { margin: 0 0 10px; }
.side-block ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.side-block li a, .side-block li span { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); }
.side-block li .d { display: block; padding: 0; border: 0; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.person-link { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.press-list { list-style: none; margin: 32px 0 72px; padding: 0; border-top: 2px solid var(--ink); }
.press-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding-block: 18px; border-bottom: 1px solid var(--line); }
.press-list .date { color: var(--muted); font-variant-numeric: tabular-nums; }
.press-list .t { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.press-list .chip { width: 44px; height: 44px; background: linear-gradient(var(--y-ground) 58%, var(--y-accent) 58%); clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
@media (max-width: 600px) { .press-list li { grid-template-columns: minmax(0, 1fr) auto; } .press-list .date { grid-column: 1 / -1; } }
.board { list-style: none; margin: 48px 0 80px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 32px; }
.board li { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
.board img { width: 180px; aspect-ratio: 4 / 5; object-fit: cover; }
.board h2 { margin: 0 0 6px; font-size: 26px; letter-spacing: -.01em; }
@media (max-width: 800px) { .board { grid-template-columns: minmax(0, 1fr); } .board li { grid-template-columns: 110px minmax(0, 1fr); } .board img { width: 110px; } }

/* Footer -------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 24px; }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 22px 40px; color: var(--muted); font-size: 15px; }
.site-footer nav { display: flex; gap: 20px; }

/* Lightbox ------------------------------------------------------------ */
.lightbox { border: 0; padding: 0; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; background: rgba(10, 10, 10, .94); color: #f2f2f2; }
.lightbox::backdrop { background: rgba(0,0,0,.6); }
.lightbox-inner { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.lightbox-top { display: flex; justify-content: flex-end; padding: 12px; }
.lightbox-stage { display: flex; align-items: center; justify-content: center; padding: 0 64px; min-height: 0; }
.lightbox-stage img { max-height: 100%; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.lightbox-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px 24px; }
.lightbox .icon-btn { color: #f2f2f2; border: 1px solid #444; }
@media (prefers-reduced-motion: no-preference) { .works img, .people img { transition: opacity .2s; } }
