/* ==========================================================================
   Wall label — single-work gallery
   Change the look here: accent, wall tone, fonts, sizes.
   ========================================================================== */

:root {
  --ink: #111111;
  --paper: #F2F0EB;
  --muted: #9C978E;       /* secondary text on dark */
  --muted-ink: #57534C;   /* secondary text on the paper label */
  --line: #3A3A3A;
  --accent: #F2C14E;
  --wall: #1A1A1A;        /* the "wall" behind each work */

  --display: 'Anton', Impact, 'Arial Narrow', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --gutter: clamp(20px, 5.5vw, 80px);
  --stage-h: clamp(360px, 62vh, 720px);
  --stage-pad: clamp(16px, 3vw, 40px);
  --label-w: 340px;
  --thumb-h: 110px;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
}

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

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

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

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 10;
  padding: 10px 16px; background: var(--accent); color: var(--ink); text-decoration: none;
}
.skip-link:focus { top: 16px; }

.page {
  max-width: 1600px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
}

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

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  border-bottom: 3px solid var(--paper);
}

.brand {
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
}

.counter {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1;
}
.counter-current { color: var(--accent); }

.site-nav {
  justify-self: end;
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.site-nav a { text-decoration: none; padding: 12px 0; }

/* Viewer ------------------------------------------------------------------ */

.viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--label-w);
  gap: clamp(24px, 4.5vw, 64px);
  align-items: center;
  padding: 40px 0;
}

.stage {
  height: var(--stage-h);
  padding: var(--stage-pad);
  background: var(--wall);
  touch-action: pan-y;          /* horizontal swipes go to the gallery */
}

.stage-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The media box takes the work's own aspect ratio (--ar = width / height)
   and is scaled to fit the stage without cropping. */
.media {
  position: relative;
  margin: 0;
  aspect-ratio: var(--ar);
  width: min(100%, calc((var(--stage-h) - 2 * var(--stage-pad)) * var(--ar)));
  outline: 1px solid #2E2E2E;
  container-type: inline-size;
  animation: media-in 0.3s ease both;
}

.media img,
.media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.media video { background: #000; cursor: pointer; }

@keyframes media-in { from { opacity: 0; } to { opacity: 1; } }

.media-error {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line);
}
.media.has-error { outline: none; }

/* Video controls ------------------------------------------------------------ */

.vcontrols {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 10px;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
}

.vc-btn {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: var(--accent);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.vc-mute {
  min-width: 0;
  padding: 0 4px;
  background: transparent;
  color: var(--paper);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.vc-time { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

.vc-seek {
  --progress: 0%;
  flex: 1;
  min-width: 40px;
  height: 44px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.vc-seek::-webkit-slider-runnable-track {
  height: 3px;
  background: linear-gradient(to right, var(--accent) var(--progress), var(--line) var(--progress));
}
.vc-seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px; margin-top: -4.5px;
  border-radius: 50%;
  background: var(--paper);
}
.vc-seek::-moz-range-track { height: 3px; background: var(--line); }
.vc-seek::-moz-range-progress { height: 3px; background: var(--accent); }
.vc-seek::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: var(--paper); }

/* Narrow videos (e.g. 9:16 on a small screen): drop the less important bits. */
@container (max-width: 300px) { .vc-time { display: none; } }
@container (max-width: 200px) { .vc-mute { display: none; } }

/* Wall label --------------------------------------------------------------- */

.label-col { display: flex; flex-direction: column; gap: 20px; }

.label {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  background: var(--paper);
  color: var(--ink);
}
.label a:hover { color: #7A5A12; }

.label-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.label-no { color: var(--muted-ink); }
.label-kind {
  padding: 3px 8px;
  border: 1px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.label-kind.is-video { background: var(--ink); color: var(--paper); }

.label-title {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(34px, 3.1vw, 44px);
  line-height: 1;
  text-transform: uppercase;
}

.label-meta { margin: 0; display: flex; flex-direction: column; }
.label-meta span:empty { display: none; }

.label-rule { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--ink); }

.label-text { margin: 0; font-size: 13px; line-height: 1.7; }
.label-text:empty { display: none; }

.label-inquire { align-self: flex-start; padding: 6px 0; }
.label-inquire[hidden] { display: none; }

.pager { display: flex; gap: 8px; }
.pager-btn {
  flex: 1;
  height: 48px;
  border: 1px solid var(--paper);
  background: transparent;
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}
.pager-btn:hover { border-color: var(--accent); color: var(--accent); }
.pager-btn--primary { border-color: var(--accent); background: var(--accent); color: var(--ink); }
.pager-btn--primary:hover { color: var(--ink); filter: brightness(1.08); }

/* Filmstrip ----------------------------------------------------------------- */

.strip { border-top: 1px solid var(--line); }

.strip-list {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 24px 0 32px;
  display: grid;
  grid-template-columns: repeat(var(--count, 8), minmax(0, 1fr));
  gap: 16px;
}

.strip-item {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: var(--thumb-h);
}

.thumb-inner {
  position: relative;
  display: block;
  aspect-ratio: var(--ar);
  width: min(100%, calc(var(--thumb-h) * var(--ar)));
  outline: 1px solid var(--line);
  opacity: 0.6;
  transition: opacity 0.15s ease;
}
.thumb-inner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-inner.is-empty { background: #2A2A2A; }

.strip-item:hover .thumb-inner { opacity: 0.9; }
.strip-item[aria-current="true"] .thumb-inner { opacity: 1; outline: 3px solid var(--accent); outline-offset: 3px; }

.thumb-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--ink);
  color: var(--paper);
}

.strip-meta { display: flex; justify-content: space-between; gap: 8px; }
.strip-num { color: var(--muted); }
.strip-item[aria-current="true"] .strip-num { color: var(--accent); }
.strip-num { flex: none; }
.strip-title { min-width:0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.strip-item[aria-current="true"] .strip-title { color: var(--paper); }

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

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.noscript { padding: 24px var(--gutter); color: var(--muted); }

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1100px) {
  :root { --label-w: 300px; }
  .strip-list {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 120px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .strip-list > li { scroll-snap-align: start; }
}

@media (max-width: 860px) {
  :root { --stage-h: clamp(280px, 60vh, 560px); --thumb-h: 80px; }
  .viewer { grid-template-columns: minmax(0, 1fr); padding: 20px 0 28px; }
  .pager { order: -1; }                 /* keep Prev / Next right under the work */
  .strip-list { grid-auto-columns: 96px; gap: 12px; }
}

@media (max-width: 600px) {
  .site-header { grid-template-columns: 1fr auto; padding: 12px 0 0; }
  .site-nav { grid-column: 1 / -1; justify-self: start; }
  .label { padding: 22px; }
  .site-footer { flex-direction: column; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .media { animation: none; }
  .thumb-inner { transition: none; }
}
