/* Home page "work" section: before/after comparison, project gallery, videos. */

.demo-note { display: inline-block; margin: 0 0 28px; padding: 8px 14px; background: #fff7e0; border-inline-start: 4px solid var(--gold); font-size: .95rem; color: var(--ink); }
.work__sub { font-size: 1.45rem; margin: 56px 0 8px; padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.work__sub:first-of-type { margin-top: 0; }
.work__hint { color: var(--ink-2); margin: 12px 0 20px; }

/* Before / after. The component is always LTR so the handle math is the same in every language. */
.ba-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.ba { margin: 0; }
.ba__frame { --pos: 50%; position: relative; direction: ltr; aspect-ratio: 3 / 4; overflow: hidden; background: var(--mist); border: 1px solid var(--line); }
.ba__frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba__before { clip-path: inset(0 0 0 var(--pos)); } /* "before" shows to the right of the handle */
.ba__line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.ba__line::after { content: "‹ ›"; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: var(--ink); font: 700 1.1rem/1 var(--font-body); box-shadow: 0 2px 8px rgba(0,0,0,.35); }
.ba__tag { position: absolute; bottom: 12px; padding: 4px 12px; background: rgba(38,41,47,.85); color: #fff; font-weight: 700; font-size: .95rem; pointer-events: none; }
.ba__tag--before { right: 12px; }
.ba__tag--after { left: 12px; }
.ba__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.ba__frame:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }
.ba figcaption { margin-top: 10px; font-weight: 700; }
.ba figcaption span { display: block; font-weight: 400; color: var(--ink-2); font-size: .98rem; }

/* Gallery */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 20px; }
.filters button { min-height: 44px; padding: 8px 18px; border: 1px solid var(--silver); background: #fff; color: var(--ink); font: 600 1rem var(--font-body); cursor: pointer; }
.filters button:hover { border-color: var(--ink); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.shots { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 210px; grid-auto-flow: dense; gap: 12px; }
.shots li[hidden] { display: none; }
.shots .is-wide { grid-column: span 2; }
.shots .is-tall { grid-row: span 2; }
.shot { position: relative; display: block; width: 100%; height: 100%; overflow: hidden; background: var(--mist); color: #fff; text-decoration: none; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.shot:hover img, .shot:focus-visible img { transform: scale(1.04); }
.shot span { position: absolute; inset-inline: 0; bottom: 0; padding: 28px 14px 10px; background: linear-gradient(transparent, rgba(0,0,0,.72)); font-weight: 700; font-size: .98rem; }

/* Lightbox (native dialog) */
.lightbox { width: min(96vw, 1200px); max-width: none; max-height: 94vh; padding: 0; border: 0; background: #14161a; color: #fff; }
.lightbox::backdrop { background: rgba(0,0,0,.82); }
.lightbox img { width: 100%; max-height: calc(94vh - 64px); object-fit: contain; background: #14161a; }
.lightbox__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; min-height: 64px; }
.lightbox__bar p { margin: 0; font-weight: 700; }
.lightbox__btns { display: flex; gap: 8px; }
.lightbox button { min-width: 48px; min-height: 48px; padding: 0 14px; border: 1px solid #5a606b; background: transparent; color: #fff; font: 700 1rem var(--font-body); cursor: pointer; }
.lightbox button:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.lightbox :focus-visible { outline-color: #fff; }

/* Videos: vertical (9:16) clips, three across; a swipeable row on phones */
.vids { display: grid; grid-template-columns: repeat(3, minmax(0, 300px)); justify-content: start; gap: 24px; margin-top: 20px; }
.vid { margin: 0; }
.vid video { width: 100%; aspect-ratio: 9 / 16; display: block; background: #14161a; object-fit: cover; }
.vid figcaption { margin-top: 8px; font-weight: 700; }
.vid figcaption span { display: block; font-weight: 400; color: var(--ink-2); font-size: .95rem; }

@media (max-width: 940px) {
  .ba-grid { grid-template-columns: 1fr 1fr; gap: 14px 10px; }
  .ba figcaption { font-size: .95rem; }
  .ba figcaption span { font-size: .85rem; }
  .ba__tag { bottom: 8px; padding: 2px 8px; font-size: .8rem; }
  .ba__tag--before { right: 8px; }
  .ba__tag--after { left: 8px; }
  .shots { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 150px; gap: 8px; }
}
@media (max-width: 640px) {
  .vids { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 72%; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 10px; }
  .vid { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .shot img { transition: none; }
  .shot:hover img, .shot:focus-visible img { transform: none; }
}
