/* ============================================================
   Layerwright Studio — portfolio gallery (v5.4)
   The figurines are shot white on black, so they sit on black
   everywhere: the tiles, the viewer and the stills. The page
   around them keeps the brand's navy / white / paper rhythm.
   Used by gallery.php and the gallery strip on the landing page.
   ============================================================ */

[hidden]{ display:none !important; }

/* ---- the drag-to-spin viewer ---- */
.spin{
  position:relative; background:#000; overflow:hidden;
  aspect-ratio:4/5; width:100%;
  cursor:grab; touch-action:pan-y; user-select:none; -webkit-user-select:none;
  outline:none;
}
.spin.is-dragging{ cursor:grabbing; }
.spin:focus-visible{ box-shadow:0 0 0 2px #000, 0 0 0 4px var(--gold,#B78645); }
.spin canvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }
/* the first frame, as a real picture with alt text: shows at once, and is what search engines see */
.spin-poster, .spin-poster img{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.spin-poster img{ object-fit:contain; }
.spin-hint{
  position:absolute; left:50%; bottom:14px; transform:translateX(-50%);
  display:inline-flex; align-items:center; gap:8px;
  padding:7px 13px; border-radius:999px;
  background:rgba(13,43,58,.78); color:#F1F5F6; border:1px solid rgba(183,134,69,.55);
  font:600 .72rem/1 var(--body,"Libre Franklin",Arial,sans-serif); letter-spacing:.12em; text-transform:uppercase;
  pointer-events:none; transition:opacity .4s ease;
}
.spin-hint svg{ color:#D3A05E; }
.spin.touched .spin-hint{ opacity:0; }
.spin-load{
  position:absolute; left:0; right:0; bottom:0; height:2px;
  background:#B78645; transform-origin:left; transform:scaleX(0);
  transition:transform .2s linear, opacity .5s ease .3s;
}
.spin.is-ready .spin-load{ opacity:0; }

/* ---- tiles ---- */
.pf-grid{
  display:grid; gap:18px;
  grid-template-columns:repeat(auto-fill, minmax(220px, 1fr));
}
@media (max-width:520px){ .pf-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px; } }
.pf-tile{ display:block; text-decoration:none; color:inherit; }
.pf-tile .pf-pic{
  position:relative; aspect-ratio:4/5; background:#000; overflow:hidden;
  border:1px solid var(--card-line,#215064);
}
.pf-tile img{
  width:100%; height:100%; object-fit:contain; display:block;
  transition:transform .5s cubic-bezier(.2,.7,.2,1);
}
.pf-tile:hover img, .pf-tile:focus-visible img{ transform:scale(1.035); }
.pf-tile:focus-visible{ outline:2px solid var(--gold,#B78645); outline-offset:3px; }
.pf-tile picture{ display:block; width:100%; height:100%; }
.pf-tile .pf-name{
  margin:10px 0 0; font-weight:400; overflow-wrap:break-word; font-family:var(--display,"Rozha One",Georgia,serif);
  font-size:1.15rem; line-height:1.15; color:var(--text,#0D2B3A);
}
.pf-tile .pf-kind{
  margin-top:3px; font-size:.68rem; font-weight:600; letter-spacing:.18em; text-transform:uppercase;
  color:var(--text-2,#54707E);
}
.pf-badge{
  position:absolute; top:10px; right:10px;
  padding:4px 8px; border-radius:2px;
  background:rgba(13,43,58,.85); color:#D3A05E; border:1px solid rgba(183,134,69,.5);
  font:700 .66rem/1 var(--body,"Libre Franklin",Arial,sans-serif); letter-spacing:.12em;
}

/* ---- the strip on the landing page ---- */
.pf-strip{ margin-top:clamp(48px,6vw,72px); }
.pf-strip .pf-strip-head{ display:flex; align-items:end; justify-content:space-between; gap:16px; flex-wrap:wrap; margin-bottom:22px; }
.pf-strip .pf-strip-head h3{ font-family:var(--display,"Rozha One",Georgia,serif); font-weight:400; font-size:clamp(1.4rem,3vw,1.8rem); line-height:1.1; margin-top:12px; }
.pf-strip-body{ display:grid; gap:18px; grid-template-columns:minmax(0,5fr) minmax(0,7fr); align-items:start; }
.pf-strip-body > *{ min-width:0; }
.pf-strip-body .pf-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); gap:14px; }
.pf-feature figcaption{ margin-top:10px; font-size:.9rem; color:var(--text-2,#54707E); }
.pf-feature figcaption b{ color:var(--text,#0D2B3A); font-family:var(--display,"Rozha One",Georgia,serif); font-weight:400; font-size:1.15rem; margin-right:6px; }
.pf-feature{ margin:0; }
.pf-feature figcaption a{ color:var(--accent-text,#8A6531); font-weight:600; text-decoration:none; }
.pf-feature figcaption a:hover{ text-decoration:underline; }
@media (max-width:820px){
  .pf-strip-body{ grid-template-columns:minmax(0,1fr); }
  .pf-strip-body .pf-grid{
    display:grid; grid-auto-flow:column; grid-auto-columns:minmax(150px, 42%);
    grid-template-columns:none; overflow-x:auto; scroll-snap-type:x mandatory; padding-bottom:6px;
    -webkit-overflow-scrolling:touch;
  }
  .pf-strip-body .pf-grid .pf-tile{ scroll-snap-align:start; }
}

/* ---- gallery.php page ---- */
.pf-page section.band{ background:var(--surface); color:var(--text); padding-block:clamp(44px,6vw,80px); }
.pf-intro h1{ font-family:var(--display); font-weight:400; font-size:clamp(2.1rem,6vw,3.4rem); line-height:1.04; margin:16px 0 0; }
.pf-intro p.lead{ margin-top:16px; max-width:56ch; color:var(--text-2); font-size:1.06rem; }
.pf-count{ margin-top:22px; font-size:.75rem; letter-spacing:.2em; text-transform:uppercase; color:var(--accent-text); font-weight:600; }

.pf-piece{ display:grid; gap:clamp(22px,4vw,48px); grid-template-columns:minmax(0,7fr) minmax(0,5fr); align-items:start; }
/* minmax(0, …) and min-width:0 let each column shrink to the screen; without them a long
   row of thumbnails sets the column's width and the page scrolls sideways on a phone (v5.5) */
.pf-piece > *{ min-width:0; }
@media (max-width:860px){ .pf-piece{ grid-template-columns:minmax(0,1fr); } }
.pf-stage{ position:relative; max-width:100%; }
.pf-still-pic{ display:block; }
.pf-stage .pf-still{ aspect-ratio:4/5; background:#000; width:100%; height:auto; display:block; object-fit:contain; }
/* the thumbnails wrap onto more rows instead of running off the side */
.pf-thumbs{ display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.pf-thumbs button{
  flex:0 0 auto; width:64px; aspect-ratio:4/5; padding:0; border:1px solid var(--card-line); background:#000;
  cursor:pointer; position:relative; overflow:hidden;
}
@media (max-width:520px){
  .pf-thumbs{ display:grid; grid-template-columns:repeat(auto-fill, minmax(52px, 1fr)); gap:6px; }
  .pf-thumbs button{ width:auto; }
}
.pf-thumbs button img{ width:100%; height:100%; object-fit:contain; display:block; }
.pf-thumbs button[aria-current="true"]{ border-color:var(--gold); box-shadow:inset 0 0 0 1px var(--gold); }
.pf-thumbs .pf-360{
  display:flex; align-items:center; justify-content:center; color:#D3A05E;
  font:700 .72rem/1 var(--body); letter-spacing:.08em;
}
.pf-meta h1{ font-family:var(--display); font-weight:400; font-size:clamp(2rem,5vw,3rem); line-height:1.05; margin:14px 0 0; }
.pf-meta .pf-subject{ margin-top:8px; font-size:.78rem; font-weight:600; letter-spacing:.14em; text-transform:uppercase; color:var(--text-2); }
.pf-meta .pf-cap{ margin-top:16px; color:var(--text-2); white-space:pre-line; }
.pf-meta .pf-facts{ margin:22px 0 0; padding:0; list-style:none; border-top:1px solid var(--line); }
.pf-meta .pf-facts li{ display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px 12px; padding:11px 0; border-bottom:1px solid var(--line); font-size:.92rem; }
.pf-meta .pf-facts b{ text-align:right; margin-left:auto; }
.pf-meta .pf-facts span{ color:var(--text-2); }
.pf-meta .hero-ctas{ margin-top:26px; display:flex; flex-wrap:wrap; gap:12px; }
.pf-meta .pf-fine{ margin-top:12px; font-size:.82rem; color:var(--text-2); }
.pf-nav{ display:flex; flex-wrap:wrap; justify-content:space-between; gap:12px; margin-top:28px; font-size:.9rem; }
.pf-nav span{ min-width:0; overflow-wrap:break-word; }
.pf-nav a{ color:var(--accent-text); text-decoration:none; font-weight:600; }
.pf-nav a:hover{ text-decoration:underline; }

.pf-empty{ text-align:center; padding-block:30px; color:var(--text-2); }
.pf-empty h2{ color:var(--text); margin-bottom:12px; }
