/* ==========================================================================
   HOUSE OF PRACHAR: the Work archive (/work/) and case-study media.
   Added 2026-11-04 with the admin panel. Built on home.css + pages.css parts.
   ========================================================================== */

/* ---------- filter bar: sticky under the navbar; each row of pills scrolls sideways on small screens ---------- */
.work-head { padding-bottom: var(--s-7); }
.w-filter { position: sticky; top: 61px; z-index: 40; background: var(--veil); backdrop-filter: blur(6px); border-block: 1px solid var(--rule); }
.w-filter__in { display: grid; gap: var(--s-2); padding-block: var(--s-3); }
.w-filter__row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); align-items: center; gap: var(--s-4); }
.w-filter__label { color: var(--text-soft); }
.w-filter__chips { display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.w-filter__chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: .55em; min-height: 2.5rem; padding: 0 1.05em;
        border: 1px solid var(--rule); border-radius: var(--r-pill); font: 500 .875rem/1 var(--f-sans); text-decoration: none; white-space: nowrap;
        transition: background var(--d-base) var(--ease-out), color var(--d-base) var(--ease-out), border-color var(--d-base) var(--ease-out); }
.chip:hover, .chip:focus-visible { border-color: var(--ink); }
.chip:active { transform: translateY(1px); }
.chip[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.chip__n { font-size: .75rem; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.chip[aria-current] .chip__n { color: var(--sheet); opacity: .75; }
.chip--empty:not([aria-current]) { color: var(--text-soft); border-style: dashed; }

/* ---------- archive grid: rhythm from size classes (gridSizes in src/render/work.js and lib/work-filter.js) ---------- */
.w-archive { padding-top: var(--s-6); }
.w-archive__count { margin-bottom: var(--s-7); color: var(--text-soft); }
.w-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-9) var(--gutter); align-items: start; }
.w-card { position: relative; grid-column: span 4; }
.w-card[hidden] { display: none; }
.w-card--l { grid-column: span 7; }
.w-card--w { grid-column: span 8; }
.w-card--s { grid-column: span 5; }
.w-card--h { grid-column: span 6; }
.w-card__media { aspect-ratio: 4 / 3; }
.w-card--l .w-card__media, .w-card--w .w-card__media { aspect-ratio: 16 / 10; }
.w-card--s .w-card__media { aspect-ratio: 4 / 5; }
.w-card--h .w-card__media { aspect-ratio: 3 / 2; }
.w-card--s .t-shape--arch { width: 86%; }
.w-card--l .w-card__h, .w-card--w .w-card__h { font-size: clamp(1.75rem, 1.1rem + 1.9vw, 2.75rem); max-width: 22ch; }
.w-card__sector { margin-top: var(--s-3); color: var(--text-soft); }
.w-card__blank { display: grid; place-items: center; background: var(--paper-deep); font: italic 400 var(--fs-h3)/1 var(--f-serif); color: var(--text-soft); }
/* Covers: newsprint (black and white) until hovered or focused, then the work in colour. Settings → Work covers. */
.w-grid--newsprint .story__link:hover .story__media img,
.w-grid--newsprint .story__link:focus-visible .story__media img { filter: grayscale(0) contrast(1.02); }

.w-empty { display: grid; gap: var(--s-4); justify-items: start; max-width: 36rem; padding: var(--s-7) 0 var(--s-4); border-top: 3px double var(--ink); }
.w-empty[hidden] { display: none; }
.w-empty__h { font: 400 var(--fs-h2)/1.04 var(--f-serif); letter-spacing: var(--track-head); }
.w-empty__text { font: 400 var(--fs-lead)/1.4 var(--f-serif); color: var(--text-soft); }

/* ---------- clients: names (or logos) in a ruled table ---------- */
.clients__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
                 overflow: hidden; border-top: 3px double var(--ink); border-bottom: 1px solid var(--rule); }
.clients__item { display: grid; place-items: center; min-height: 7.5rem; padding: var(--s-5); box-shadow: 1px 1px 0 var(--rule); text-align: center; }
.clients__item a { display: grid; place-items: center; width: 100%; height: 100%; text-decoration: none; }
.clients__item img { width: auto; max-width: 80%; max-height: 3.5rem; object-fit: contain; filter: grayscale(1) contrast(1.1); opacity: .85;
                     transition: filter var(--d-base) var(--ease-out), opacity var(--d-base) var(--ease-out); }
.clients__item a:hover img, .clients__item a:focus-visible img { filter: none; opacity: 1; }
.clients__name { font: 400 clamp(1.3rem, 1rem + 1vw, 1.85rem)/1.15 var(--f-serif); letter-spacing: -.01em; }
.clients__item a:hover .clients__name { font-style: italic; }

/* ---------- closing call: the page's one dark band ---------- */
.w-cta__in { display: grid; gap: var(--s-5); justify-items: start; }
.w-cta__h { font-size: var(--fs-h1); max-width: 16ch; }
.w-cta__h em { color: var(--fire); }
.w-cta .t-lead { max-width: 40ch; opacity: .8; }

/* ---------- case study: later text runs line up with the first reading column; media goes wide ---------- */
.case__more { padding-block: var(--s-6) 0; }
.case__more .case__prose { grid-column: 5 / span 8; position: relative; }
.case__body .prose { position: relative; }
.case__meta dd a { text-decoration-color: var(--press); }
.case__live { justify-self: start; margin-top: var(--s-3); }
.case__media { display: grid; gap: var(--s-8); padding-block: var(--s-9) var(--s-4); }
.case__media + .case__media { padding-top: var(--s-6); }

.media { display: grid; gap: var(--gutter); }
.media--two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.media--three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.media--grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; max-width: 60rem; width: 100%; margin-inline: auto; }
.media--grid .media__frame { aspect-ratio: 1; }
.media--grid .media__frame img { height: 100%; object-fit: cover; }
.media__item { display: grid; gap: var(--s-3); align-content: start; margin: 0; }
.media__frame { display: block; overflow: hidden; background: var(--paper-deep); }
.media__frame img { width: 100%; height: auto; }
.media__cap { font: 400 var(--fs-small)/1.45 var(--f-sans); color: var(--text-soft); }
/* a website, in a browser window */
.media__item--browser { gap: 0; border: 1px solid var(--ink); background: var(--sheet); }
.media__bar { display: flex; align-items: center; height: 2.4rem; padding-inline: var(--s-4); border-bottom: 1px solid var(--ink); }
.media__url { flex: 1; max-width: 24rem; margin-inline: auto; padding: .25em 1em; border: 1px solid var(--rule); border-radius: var(--r-pill);
              font: 500 .75rem/1.4 var(--f-sans); color: var(--text-soft); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media__url:empty { visibility: hidden; }
.media__item--browser .media__cap { padding: var(--s-3) var(--s-4); border-top: 1px solid var(--rule); }
/* posts and reels, on a phone */
.media__item--phone .media__frame { border: 9px solid var(--ink); border-radius: 2.4rem; }
.media--full .media__item--phone, .media--two .media__item--phone { max-width: 24rem; width: 100%; margin-inline: auto; }
.media--phone.media--three { gap: clamp(1rem, 3vw, 3rem); }
.media--grid.media--phone .media__frame { border-width: 0; border-radius: 0; }
/* film: a poster that becomes the player on click (no YouTube or Vimeo code loads until then) */
.media__video { gap: var(--s-3); margin: 0; }
.video { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); }
.video__poster { position: absolute; inset: 0; display: grid; place-items: center; text-decoration: none; }
.video__poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .82;
                     transition: opacity var(--d-base) var(--ease-out), transform var(--d-slow) var(--ease-out); }
.video__poster:hover img, .video__poster:focus-visible img { opacity: 1; transform: scale(1.02); }
.video__btn { position: relative; }
.video iframe, .video__file { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video__file { object-fit: contain; background: var(--ink); }
.video__file[data-loop] { object-fit: cover; }
.prose--article .media { margin-block: 1.6em; max-width: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .w-filter { position: relative; top: 0; }
  .w-filter__row { grid-template-columns: minmax(0, 1fr); gap: var(--s-2); }
  .w-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-8) var(--gutter); }
  .w-card, .w-card--h { grid-column: span 1; }
  .w-card--l, .w-card--w, .w-card--s { grid-column: 1 / -1; }
  .w-card--s .w-card__media { aspect-ratio: 4 / 3; }
  .w-card--s .t-shape--arch { width: 70%; aspect-ratio: 4 / 5; }
  .case__more .case__prose { grid-column: 1 / -1; }
  .media--three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .w-grid { grid-template-columns: minmax(0, 1fr); }
  .w-card, .w-card--h { grid-column: 1 / -1; }
  .media--two, .media--three { grid-template-columns: minmax(0, 1fr); }
  .media--grid { gap: 2px; }
}
