/* Portfolio styles — /work/ and /work/<industry>/ only.
 *
 * Deliberately NOT in seo.css. That stylesheet is loaded by every one of the
 * ~16,500 generated pages and is cache-busted by a ?v= in _base.ejs; adding
 * rules to it means either bumping that version — which changes the bytes of
 * every page and re-dates the whole sitemap (SEO invariant 7) — or shipping
 * rules that returning visitors never receive. That second thing is what
 * happened: the portfolio grid and lightbox went into seo.css without a version
 * bump, so a cached stylesheet left the modal rendering as a block at the foot
 * of the page.
 *
 * Twelve pages need these rules. Keeping them here means this file can be
 * versioned on its own and the other 16,500 pages never change.
 *
 * Do not merge this back into seo.css.
 */

/* ── /work/ portfolio ────────────────────────────────────────────────────────
   The gallery on /work/ and the three-card grid on /work/<industry>/.

   Every poster is normalised to 9:16 by scripts/lib/showcase-encode.js — a 4:5
   carousel slide is centre-cropped to the same frame — so the grid can assume
   one aspect ratio and never reflows between a video card and a carousel card.
   Hover previews are preload="none" in the markup and cost nothing until a
   pointer enters the card; the reduced-motion rule below stops them entirely. */

.work-grid-section { padding: 8px 0 40px; }

.work-filter {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 24px;
}
.work-chip {
  font: inherit; font-size: 0.82rem; font-weight: 600;
  color: var(--muted); background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 14px; cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.work-chip:hover { color: var(--text); border-color: var(--orange); }
.work-chip.is-active {
  color: #0A0A0A; background: var(--orange); border-color: var(--orange);
}

.work-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.work-card[hidden] { display: none; }

.work-media {
  position: relative; display: block; overflow: hidden;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg-card2); aspect-ratio: 9 / 16;
}
.work-media img,
.work-media video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.work-media video { opacity: 0; transition: opacity .2s; }
.work-media:hover video,
.work-media:focus-visible video { opacity: 1; }
.work-media:hover { border-color: var(--orange); }

.work-badge {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  font-size: 0.66rem; font-weight: 700; letter-spacing: .02em;
  color: var(--text); background: rgba(10,10,10,0.78);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 9px; backdrop-filter: blur(4px);
}

.work-caption {
  font-size: 0.82rem; color: var(--muted); line-height: 1.45;
  margin: 9px 2px 0;
}

.work-note { font-size: 0.85rem; color: var(--muted); margin-top: 20px; }
.work-note a { color: var(--orange-light); }

.work-prose { padding: 8px 0 24px; }
.work-prose h2 { margin-top: 28px; }
.work-prose p { color: var(--muted); line-height: 1.7; }

.work-index { list-style: none; padding: 0; margin: 12px 0 0; }
.work-index li {
  font-size: 0.9rem; color: var(--muted);
  padding: 7px 0; border-bottom: 1px solid var(--border);
}
.work-index a { color: var(--text); font-weight: 600; }

@media (max-width: 640px) {
  .work-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

/* A hover preview is decoration. Never autoplay it for someone who asked for
   less motion — same rule the homepage showcase follows. */
@media (prefers-reduced-motion: reduce) {
  .work-media video { display: none; }
}

/* Music credits — where the CC BY obligation is actually discharged. Quiet, but
   it must stay visible: hiding a licence credit defeats the point of having it. */
.work-credits { padding: 8px 0 24px; }
.work-credits p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.work-credits ul { list-style: none; padding: 0; margin: 12px 0 0; }
.work-credits li {
  font-size: 0.8rem; color: var(--muted);
  padding: 5px 0; border-bottom: 1px solid var(--border);
}

/* ── Post lightbox ───────────────────────────────────────────────────────────
   Opening a post in place. The cards remain real anchors to the media file, so
   this is an enhancement over a working no-JS fallback, not a replacement for
   one. It never touches history — Escape and the close button are the way out. */

body.wlb-open { overflow: hidden; }

.wlb { position: fixed; inset: 0; z-index: 1000; display: flex;
       align-items: center; justify-content: center; padding: 24px; }
.wlb[hidden] { display: none; }
.wlb-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.82);
                backdrop-filter: blur(3px); }

.wlb-panel {
  position: relative; z-index: 1; display: flex; flex-direction: column;
  max-width: min(420px, 92vw); max-height: 92vh;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden;
}

.wlb-close {
  position: absolute; top: 6px; right: 10px; z-index: 3;
  width: 34px; height: 34px; font: inherit; font-size: 1.5rem; line-height: 1;
  color: var(--text); background: rgba(10,10,10,0.6);
  border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
}
.wlb-close:hover { border-color: var(--orange); color: var(--orange-light); }

.wlb-stage { position: relative; background: #000; display: flex;
             align-items: center; justify-content: center; min-height: 200px; }
.wlb-video, .wlb-img { display: block; max-width: 100%; max-height: 72vh;
                       width: auto; height: auto; }

.wlb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; font: inherit; font-size: 1.6rem; line-height: 1;
  color: var(--text); background: rgba(10,10,10,0.55);
  border: 1px solid var(--border); border-radius: 50%; cursor: pointer;
}
.wlb-prev { left: 8px; } .wlb-next { right: 8px; }
.wlb-nav:hover { border-color: var(--orange); }
.wlb-count {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  font-size: 0.72rem; font-weight: 600; color: var(--text);
  background: rgba(10,10,10,0.7); border-radius: 999px; padding: 3px 10px;
}

.wlb-meta { padding: 14px 16px 16px; }
.wlb-badge {
  display: inline-block; font-size: 0.66rem; font-weight: 700;
  color: var(--muted); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px 9px; margin-bottom: 8px;
}
.wlb-caption { font-size: 0.9rem; color: var(--text); line-height: 1.5; margin: 0; }
.wlb-credit  { font-size: 0.74rem; color: var(--muted); margin: 8px 0 0; }
.wlb-credit[hidden] { display: none; }

@media (max-width: 640px) {
  .wlb { padding: 10px; }
  .wlb-panel { max-width: 100%; }
}
