/* Shared styles for individual work pages (burst.html and the rest).
   Edit here once and every work page updates. */
:root {
  --wall: #ffffff;
  --ink: #1c1c1c;
  --quiet: #6b6b68;
  --ph: #e4e4e1;
  --ph-alt: #d3d3ce;
  --pad: clamp(1rem, 1.3vw, 1.25rem);
}

/* Dark mode: true black background, follows the visitor's device setting */
@media (prefers-color-scheme: dark) {
  :root {
    --wall: #000000;
    --ink: #ecece9;
    --quiet: #9a9a95;
    --ph: #2d2d2b;
    --ph-alt: #363633;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font-family: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(1rem, 1.35vw, 1.5rem);
  font-weight: 500;
  letter-spacing: 0em;
  line-height: 1.2;
}
a { color: inherit; }
a:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* Header and footer share one design (see _includes/header.html) */
.bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: baseline;
  gap: 0.75rem 1.5rem;
  padding: 1.1rem var(--pad) 0;
}
header.bar { margin-bottom: clamp(3rem, 10vw, 9rem); }
footer.bar { padding-bottom: 1.5rem; }
.bar a { text-decoration: none; }
.bar a:hover { text-decoration: underline; text-underline-offset: 4px; }
.bar .site-name { text-decoration: underline; text-underline-offset: 4px; }
/* Shop, Info, Instagram: same font as the name, one size smaller */
.bar a:not(.site-name) { font-size: 0.875em; }
.nav-end { display: flex; justify-content: space-between; }
.contact { text-align: right; }
/* Small screens: each item on its own line */
@media (max-width: 40rem) {
  .bar { grid-template-columns: 1fr; gap: 0.5rem; }
  .bar .site-name { margin-bottom: 0.3rem; } /* extra room under the underlined name */
  .nav-end { display: contents; }
  .contact { text-align: left; }
}

/* Small screens only: footer items line up flush right (wide screens match the header) */
@media (max-width: 40rem) {
  footer.bar, footer.bar .contact { text-align: right; }
}

/* Images take two thirds; details line up under the third nav column */
.work {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pad) 1.5rem;
  padding: 0 var(--pad) 3rem;
  align-items: start;
}
.images { grid-column: 1 / span 2; display: grid; gap: var(--pad); }
.images img, .images .ph { width: 100%; height: auto; display: block; }
.images .ph { aspect-ratio: 3 / 2; background: var(--ph); }
.video { position: relative; width: 100%; aspect-ratio: var(--ratio, 16 / 9); background: var(--ph); }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.details {
  grid-column: 3;
  position: sticky;
  top: var(--pad);
  max-height: calc(100vh - 2 * var(--pad));
  overflow-y: auto;
}
@media (max-width: 50rem) {
  .work { grid-template-columns: 1fr; }
  .details { grid-column: 1; position: static; max-height: none; overflow: visible; margin-bottom: 1.5rem; }
  /* On narrow screens the text sits under the first image, before the rest */
  .images { display: contents; }
  .images > :first-child { order: 0; }
  .details { order: 1; }
  .images > :not(:first-child) { order: 2; }
}
.details h1 { font-size: inherit; font-weight: 500; margin: 0 0 0.25rem; }
.details p { margin: 0; }
.quiet { color: var(--quiet); }
.desc { margin-top: 1.25rem !important; max-width: 32rem; }
.buy { margin-top: 1.75rem; }
.button {
  display: inline-block;
  background: var(--ink);
  color: var(--wall);
  padding: 0.7rem 1.25rem;
  text-decoration: none;
}
.button:hover { opacity: 0.85; }

/* Homepage grid (used by index.html) */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--pad);
  padding: 0 var(--pad) 5rem;
}
@media (max-width: 40rem) {
  .grid { grid-template-columns: 1fr; }
}
.tile {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  text-decoration: none;
}
.tile img, .tile .ph { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .ph { background: var(--ph); }
.tile .ph.alt { background: var(--ph-alt); }

/* Title appears on hover or keyboard focus */
.label {
  position: absolute;
  inset: auto 0 0 0;
  padding: 3rem var(--pad) var(--pad);
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
}
.tile:hover .label, .tile:focus-visible .label { opacity: 1; }
.tile:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.meta { display: block; opacity: 0.8; }
@media (prefers-reduced-motion: reduce) { .label { transition: none; } }

/* Rollover: the next photo fades in on hover (wide screens with a mouse only) */
.tile .hover { display: none; }
@media (min-width: 40rem) and (hover: hover) {
  .tile .hover {
    display: block;
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .tile:hover .hover, .tile:focus-visible .hover { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .tile .hover { transition: none; } }

/* Touch screens: press and hold a homepage image to see its rollover photo and title
   (see touch-preview.js) */
.tile { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.tile img { pointer-events: none; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.tile.is-touched .hover { display: block; position: absolute; inset: 0; opacity: 1; }
.tile.is-touched .label { opacity: 1; }
