/* "Briefing" design: tokens, base, and components for the redesigned home page. */

/* ── Tokens ── */
:root {
  --bg: #0e1012;
  --panel: #15181b;
  --line: rgba(230, 233, 236, 0.12);
  --line-strong: rgba(230, 233, 236, 0.26);
  --text: #e8eaec;
  --text-2: #c4c8cd;
  --muted: #9ba1a8;
  --signal: #f06a43;
  --signal-soft: rgba(240, 106, 67, 0.5);
  --good: #4fae74;

  --sans: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;

  --wrap: 80rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4, p, figure { margin: 0; }

a {
  color: inherit;
  text-decoration-color: var(--signal-soft);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
a:hover { color: var(--signal); text-decoration-color: var(--signal); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
label:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.mono {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hl { color: var(--signal); font-weight: 600; }

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

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--text);
  border-radius: 2px;
  background: var(--text);
  color: var(--bg);
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--signal); border-color: var(--signal); color: var(--bg); }
.btn svg { width: 0.95rem; height: 0.95rem; }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { background: transparent; color: var(--signal); border-color: var(--signal); }

.btn:disabled,
.btn.is-disabled {
  background: transparent;
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

/* ── Top bar ── */
.topbar { background: var(--panel); border-bottom: 1px solid var(--line); }

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 2rem;
  min-height: 3.25rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.brand { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.01em; text-decoration: none; }

.topnav { display: flex; gap: 1.75rem; }
.topnav a { color: var(--text-2); text-decoration: none; }
.topnav a:hover { color: var(--signal); }
.topnav a[aria-current="page"] { color: var(--text); }

/* ── Status bar ── */
.statusbar { border-bottom: 1px solid var(--line); color: var(--muted); }

.statusbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 2rem;
  min-height: 2.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.statusbar b { font-weight: 500; color: var(--text); }

.status-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.5rem;
  border-radius: 50%;
  background: var(--signal);
  vertical-align: 0.08em;
}

/* ── Flash messages ── */
.flash {
  margin-top: 1.5rem;
  padding: 0.9rem 1.15rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  color: var(--text);
}

/* ── Cover ── */
.cover {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 3rem 5rem;
  align-items: end;
  padding-top: clamp(3rem, 7vw, 5.5rem);
  padding-bottom: 2.5rem;
}

.eyebrow { margin-bottom: 1.25rem; color: var(--signal); }

.cover h1 {
  max-width: 13ch;
  font-size: clamp(2.75rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.cover-lede {
  max-width: 40ch;
  margin-top: 1.75rem;
  font-size: clamp(1.1rem, 1.6vw, 1.3rem);
  line-height: 1.5;
  color: var(--text-2);
}

.cover-action { margin-top: 1.5rem; }

.toc { border-top: 1px solid var(--line-strong); padding-top: 1rem; }
.toc .mono { margin-bottom: 0.5rem; color: var(--muted); }
.toc ol { list-style: none; margin: 0; padding: 0; }

.toc a {
  display: flex;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text-2);
}
.toc a:hover { color: var(--text); }
.toc a span { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); padding-top: 0.1rem; min-width: 1.5rem; }

/* ── Exhibits ── */
.exhibit-caption {
  display: flex;
  gap: 1rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted);
}
.exhibit-caption .mono { flex: none; color: var(--text-2); padding-top: 0.1rem; }

.hero-grid {
  display: grid;
  grid-template-columns: 5fr 8fr;
  gap: 0.75rem;
}

.hero-side { display: grid; gap: 0.75rem; align-content: start; }

.hero-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.hero-panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-side .hero-panel:first-child { aspect-ratio: 3386 / 1146; }
.hero-side .hero-panel:last-child { aspect-ratio: 4000 / 1848; }

.verdict {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  padding: 0.3rem;
  background: rgba(14, 16, 18, 0.82);
  border-radius: 2px;
}

.verdict svg { width: 1.15rem; height: 1.15rem; padding: 0.2rem; border-radius: 2px; color: var(--bg); }
.verdict-good svg { background: var(--good); }
.verdict-bad svg { background: var(--signal); }

/* ── Sections ── */
.sec {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 1.5rem 3.5rem;
  margin-top: clamp(4rem, 8vw, 6rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line-strong);
}

.sec-label { align-self: start; }
.sec-num { display: block; color: var(--signal); margin-bottom: 0.6rem; }

.sec-label h2 {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.sec-body { min-width: 0; }

.subhead { margin: 3rem 0 1rem; color: var(--muted); }
.subhead:first-child { margin-top: 0; }

.prose { max-width: 44rem; font-size: 1.0938rem; line-height: 1.75; color: var(--text-2); }
.prose p + p { margin-top: 1.3em; }
.prose strong { color: var(--text); font-weight: 600; }

/* 01 Definition */
.definition-text {
  max-width: 22ch;
  font-size: clamp(1.9rem, 4vw, 3.1rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

/* ── 02 Effects ── */
.effect {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 3rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}
.effect:first-child { padding-top: 0.25rem; border-top: 0; }
.effect:last-child { padding-bottom: 0; }

.effect-num { display: block; margin-bottom: 0.6rem; color: var(--signal); }

.effect h3 {
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.effect-lead {
  margin-top: 1rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

.effect-text p { margin-top: 1rem; font-size: 1.03rem; line-height: 1.7; color: var(--text-2); }
.effect-text .effect-lead { color: var(--text); font-size: 1.2rem; line-height: 1.4; }

.effect-tags { margin-top: 1.75rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.effect-tags .mono { display: block; margin-bottom: 0.65rem; color: var(--muted); }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.45rem; list-style: none; margin: 0; padding: 0; }

.tag-list li {
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--text-2);
}

.media-stack { display: grid; gap: 0.85rem; align-content: start; }

.media-stack a,
.evidence {
  display: block;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.15s ease;
}
.media-stack a:hover,
a.evidence:hover { border-color: var(--line-strong); }
.media-stack img { width: 100%; height: auto; }

/* Screenshots of white documents are shown as dark pages: light text, amber highlights.
   The link still opens the original image. */
.media-stack .evidence-doc img { filter: invert(0.9) hue-rotate(180deg); }

/* A screenshot with thin white page margins down its sides */
.media-stack .evidence-trim img { clip-path: inset(0 0.7%); }

.media-note {
  padding-left: 0.9rem;
  border-left: 2px solid var(--line-strong);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-2);
}

/* ── 03 References ── */
.ref-columns { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 3rem 3.5rem; }

.ref-group h3 { margin-bottom: 0.9rem; color: var(--muted); font-weight: 500; }

.ref-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }

.ref-list li {
  padding: 0.8rem 0.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 1rem;
  line-height: 1.45;
}

.ref-list a { font-weight: 600; text-decoration: none; }
.ref-list a:hover { text-decoration: underline; }

/* Dated entries carry on from the list above, in the same row style, with the date over the title */
.ref-list-dated { border-top: 0; }
.ref-list-dated li { display: grid; gap: 0.2rem; }

.ref-date { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* ── 04 Situation ── */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem 3rem; align-items: start; }

.figure-panel { border: 1px solid var(--line); background: var(--panel); }
.figure-panel img { width: 100%; height: auto; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid var(--line);
}

.stat { padding: 1.1rem 1.15rem 1.2rem; }
.stat + .stat { border-left: 1px solid var(--line); }

.stat dt {
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat dd { margin: 0.5rem 0 0; font-size: 0.875rem; line-height: 1.45; color: var(--muted); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 2.5rem; }

.pair-panel { border: 1px solid var(--line); background: var(--panel); }

.pair-panel .mono {
  display: block;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}

.pair-panel img { width: 100%; height: auto; }

/* ── 05 Testimonials ── */
.question {
  margin: 3rem 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.question:first-child { margin-top: 0; }

.testimony-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }

.testimony { padding: 1.15rem 1.25rem 1.25rem; border: 1px solid var(--line); background: var(--panel); }

.testimony-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
}

.testimony-head img { width: 1.5rem; height: auto; flex: none; }
.testimony-head b { font-weight: 500; color: var(--text); }

.testimony-text { font-size: 0.98rem; line-height: 1.7; color: var(--text-2); }

/* Long testimonials are clamped (only when scripting is available) and can be expanded */
.js .testimony-text { position: relative; max-height: 13.6em; overflow: hidden; }
.js .testimony.is-clamped .testimony-text::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4em;
  background: linear-gradient(to bottom, rgba(21, 24, 27, 0), var(--panel));
}
.js .testimony.is-open .testimony-text { max-height: none; }
.js .testimony.is-open .testimony-text::after { display: none; }

.testimony-toggle {
  display: none;
  margin-top: 0.9rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--signal);
  cursor: pointer;
}
.testimony.is-clamped .testimony-toggle { display: inline-block; }
.testimony-toggle:hover { color: var(--text); }

.sec-action { margin-top: 2rem; }

/* ── 06 Photos ── */
.album + .album { margin-top: 3.5rem; }

.album-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-strong);
}

.album-head h3 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.album-head .mono { color: var(--muted); white-space: nowrap; }

.album-badge {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 2px;
  color: var(--bg);
}
.album-badge svg { width: 0.85rem; height: 0.85rem; }
.album-badge.is-bad { background: var(--signal); }

/* A mosaic: the first photo is large, the rest fill in around it */
.album-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.album-item {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color 0.15s ease;
}
.album-item:first-child { grid-column: span 2; grid-row: span 2; }
.album-item:hover { border-color: var(--text-2); }

.album-item .media-thumbnail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.album-item:hover .media-thumbnail { transform: scale(1.03); }

/* Collapsed (only when scripting is available): the large photo plus four more */
.js .album:not(.is-open) .album-item:nth-child(n + 6) { display: none; }

.album-toggle { margin-top: 1rem; }

.album-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3rem;
  height: 3rem;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(14, 16, 18, 0.78);
  color: var(--text);
}
.album-play svg { width: 1.1rem; height: 1.1rem; margin-left: 0.15rem; }

.album-empty { padding: 1rem 0; color: var(--muted); }

/* ── 07 Share ── */
.notice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0.35rem 1.25rem;
  max-width: 44rem;
  margin-top: 1.5rem;
  padding: 0.9rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--signal);
  background: var(--panel);
}
.notice .mono { color: var(--signal); }
.notice p { font-size: 0.975rem; color: var(--text-2); }

/* Upload form (shown only while uploads are open) */
.form-panel { padding: 1.5rem; border: 1px solid var(--line); background: var(--panel); }

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.5rem 2rem;
  margin-top: 1.5rem;
}

.field { margin-bottom: 1.25rem; }

.field-label { display: block; margin-bottom: 0.45rem; color: var(--text-2); }
.field-hint { margin-bottom: 0.6rem; font-size: 0.925rem; color: var(--muted); }

.field input[type="text"] {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.field input[type="text"]::placeholder { color: var(--muted); }
.field input[type="text"]:focus { border-color: var(--text-2); }

/* Kept focusable (not display: none) so the browser can show "please choose a file" */
.field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#photo_thumbnail { border: 1px solid var(--line); }

#map { height: 320px; border: 1px solid var(--line); background: var(--bg); }

/* Submissions: a shared map beside the photo cards */
.submissions { margin-top: 2.5rem; }

.submissions-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 0.75rem;
  align-items: start;
  margin-top: 0.75rem;
}
.submissions-layout.no-map { grid-template-columns: minmax(0, 1fr); }
.submissions-layout.no-map .submissions-map-wrap { display: none; }

.submissions-map {
  height: min(34rem, calc(100vh - 3rem));
  border: 1px solid var(--line);
  background: var(--panel);
}

.submissions-map-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 1rem;
  text-align: center;
  font-size: 0.925rem;
  color: var(--muted);
}

.submission-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.no-map .submission-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.submission {
  border: 1px solid var(--line);
  background: var(--panel);
  scroll-margin: 1.5rem;
  transition: border-color 0.15s ease;
}
.submission.is-active { border-color: var(--signal); }

.submission-photo { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.submission-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.submission-num {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  background: var(--signal);
  color: var(--bg);
  font-weight: 500;
}
.submission.is-active .submission-num { background: var(--text); }

.submission-body { padding: 0.85rem 1rem 1rem; font-size: 0.95rem; line-height: 1.5; color: var(--text-2); }
.submission-body p + p { margin-top: 0.4rem; }
.submission-body strong { color: var(--text); font-weight: 600; }

.submission-actions { display: flex; flex-wrap: wrap; gap: 0.35rem 1.1rem; padding-top: 0.5rem; font-size: 0.75rem; }
.submission-actions a { color: var(--muted); text-decoration: none; }
.submission-actions a:hover { color: var(--signal); }

.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--signal);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); }

.page-end { height: 6rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ── Sticky section labels on wide screens ── */
@media (min-width: 1024px) {
  .sec-label { position: sticky; top: 1.5rem; }
  .submissions-map-wrap { position: sticky; top: 1.5rem; }
}

/* ── Tablet ── */
@media (max-width: 1023px) {
  .cover { grid-template-columns: minmax(0, 1fr); }
  .toc { max-width: 28rem; }

  .sec { grid-template-columns: minmax(0, 1fr); }

  .ref-columns,
  .split,
  .upload-form,
  .submissions-layout { grid-template-columns: minmax(0, 1fr); }

  .submissions-map { height: 22rem; }
  .submission-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

/* ── Phone ── */
@media (max-width: 720px) {
  .topnav { gap: 1.1rem; }

  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
  .hero-side { gap: 0.5rem; }
  .hero-main { aspect-ratio: 4 / 5; }

  .exhibit-caption { flex-direction: column; gap: 0.25rem; }

  .prose { font-size: 1.0313rem; }

  .effect { grid-template-columns: minmax(0, 1fr); padding: 2rem 0; }
  .effect h3 { font-size: 1.45rem; }
  .effect-text .effect-lead { font-size: 1.1rem; }

  .stat dt { font-size: 1.5rem; }

  .pair { gap: 0.5rem; }

  .testimony-grid { grid-template-columns: minmax(0, 1fr); }

  .album + .album { margin-top: 2.75rem; }
  .album-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .album-item:first-child { grid-row: auto; }

  .notice { grid-template-columns: minmax(0, 1fr); }
  .form-panel { padding: 1.1rem; }
  .submissions-map { height: 18rem; }
  .submission-list,
  .no-map .submission-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
  .submission-body { padding: 0.7rem 0.75rem 0.8rem; font-size: 0.9rem; }
}
