/* ==========================================================================
   Portfolio (/work) — a Pinterest-style wall.
   Builds on /site.css (header, footer).
   With JS the pins are dealt into the shortest column, left to right, like
   Pinterest; without it, CSS columns lay them out top to bottom instead.
   ========================================================================== */

/* ---------- filter chips ---------- */
.g-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-8); width: min(100%, 1000px); }
.w3-chip-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--card);
  color: var(--ink); font: 500 15px/1 var(--font-sans); cursor: pointer;
  transition: background-color var(--dur-hover) var(--ease-hover), border-color var(--dur-hover) var(--ease-hover);
}
.w3-chip-btn span { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }
.w3-chip-btn:hover { background: var(--bg-soft); }
.w3-chip-btn[aria-pressed="true"] { border-color: var(--btn); background: var(--btn); color: var(--on-btn); }
.w3-chip-btn[aria-pressed="true"] span { color: color-mix(in srgb, var(--on-btn) 70%, transparent); }
.w3-chip-btn:focus-visible { outline: 2px solid var(--os-blue); outline-offset: 2px; }

/* ---------- lightbox ---------- */
.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #05070b; color: #fff;   /* the same in both themes: photos read best on near-black */
}
.lb::backdrop { background: transparent; }
.lb[open] { display: grid; place-items: center; }
.lb-fig { display: grid; justify-items: center; gap: var(--space-16); margin: 0; padding: var(--space-56) var(--space-72); max-width: 100%; box-sizing: border-box; }
.lb-img { display: block; width: auto; height: auto; max-width: min(100%, 1080px); max-height: calc(100dvh - 200px); border-radius: var(--radius-16); }
.lb figcaption { display: grid; justify-items: center; gap: 4px; text-align: center; }
.lb-cat { color: #ffffffa6; font: 600 11px/1.4 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.lb-title { font: 500 18px/1.4 var(--font-sans); }
.lb-svc { margin-top: 4px; display: inline-flex; align-items: center; gap: 6px; color: #fff; font: 500 14px/1.4 var(--font-sans); text-underline-offset: 3px; }
.lb-btn {
  position: absolute; width: 48px; height: 48px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: #ffffff1f; color: #fff; cursor: pointer;
  transition: background-color var(--dur-hover) var(--ease-hover);
}
.lb-btn:hover { background: #ffffff38; }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-prev { left: max(16px, env(safe-area-inset-left, 0px)); top: 50%; translate: 0 -50%; }
.lb-next { right: max(16px, env(safe-area-inset-right, 0px)); top: 50%; translate: 0 -50%; }
.lb-close { top: calc(16px + env(safe-area-inset-top, 0px)); right: max(16px, env(safe-area-inset-right, 0px)); }
.lb-count { position: absolute; top: calc(28px + env(safe-area-inset-top, 0px)); left: 50%; translate: -50% 0; margin: 0; color: #ffffffa6; font: 500 13px/1 var(--font-sans); font-variant-numeric: tabular-nums; }

/* ---------- a short opener: the wall is the page ---------- */
.wall-hero {
  padding: 140px var(--space-24) var(--space-40);
  background:
    radial-gradient(60% 80% at 15% 0%, color-mix(in srgb, var(--os-glass) 70%, transparent), transparent 70%),
    radial-gradient(50% 70% at 90% 10%, color-mix(in srgb, var(--os-lilac) 14%, transparent), transparent 70%),
    var(--bg);
}
.wall-hero-in { display: grid; justify-items: center; gap: var(--space-16); text-align: center; }
.wall-hero .w3-h1 { font-size: clamp(40px, 5vw, 64px); }
.wall-hero .lead { margin: 0; max-width: 34rem; color: var(--ink-2); font: 400 18px/1.7 var(--font-sans); text-wrap: pretty; }

/* ---------- filter bar sticks under the floating header ---------- */
.wall { padding: 0 var(--space-24) var(--space-140); background: var(--bg); }
.wall-bar {
  position: sticky; top: 84px; z-index: 20;
  display: flex; justify-content: center; margin: 0 calc(-1 * var(--space-24)); padding: var(--space-12) var(--space-24);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.wall-bar .g-filters { width: auto; max-width: 100%; }

/* ---------- the wall ---------- */
.pins {
  --gap: 16px;
  columns: 5 220px; column-gap: var(--gap);
  width: min(100%, 1600px); margin: var(--space-20) auto 0; padding: 0; list-style: none;
}
.pins > .pin { break-inside: avoid; margin-bottom: var(--gap); }
html.js .pins.is-laid { columns: auto; display: flex; align-items: flex-start; gap: var(--gap); }
.pin-col { flex: 1 1 0; min-width: 0; display: grid; gap: var(--gap); }
.pin[hidden] { display: none; }

/* image and video pins */
.pin-media {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius-16); background: var(--bg-soft);
  color: inherit; text-decoration: none;
}
.pin-media img, .pin-media video { display: block; width: 100%; height: auto; transition: scale .6s var(--ease-ui, ease); }
.pin-media::after {   /* Pinterest-style dim on hover */
  content: ""; position: absolute; inset: 0; background: #0000; transition: background-color var(--dur-hover) var(--ease-hover);
}
.pin-media:hover::after { background: #00000038; }
.pin-media:hover img, .pin-media:hover video { scale: 1.03; }
.pin-media:focus-visible { outline: 2px solid var(--os-blue); outline-offset: 3px; }
.pin-zoom {
  position: absolute; z-index: 1; right: 10px; bottom: 10px; width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 50%; background: #ffffffe6; color: #171717; opacity: 0; translate: 0 6px;
  transition: opacity var(--dur-hover) var(--ease-hover), translate var(--dur-hover) var(--ease-hover);
}
.pin-media:hover .pin-zoom, .pin-media:focus-visible .pin-zoom { opacity: 1; translate: 0 0; }
.pin-live {
  position: absolute; z-index: 1; left: 10px; top: 10px; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--radius-pill); background: #000000a6; color: #fff;
  font: 600 11px/1.4 var(--font-sans);
}
.pin-cap { display: grid; gap: 1px; margin: 8px 4px 0; }
.pin-cap b { color: var(--ink); font: 500 14px/1.4 var(--font-sans); }
.pin-cap span { color: var(--ink-3); font: 400 12px/1.4 var(--font-sans); }

/* review pins: the client's own words */
.pin-quote figure {
  margin: 0; padding: var(--space-20) var(--space-20) var(--space-16);
  border-radius: var(--radius-16); background: var(--exp-bg);
}
.pin-quote:nth-child(3n) figure { background: var(--money-bg); }
.pin-quote:nth-child(3n + 1) figure { background: color-mix(in srgb, var(--type-pink-soft) 80%, var(--card)); }
.q-mark { display: block; height: 28px; color: color-mix(in srgb, var(--ink) 30%, transparent); font: 700 52px/1 var(--font-sans); }
.pin-quote blockquote { margin: 0; color: var(--ink-card); font: 500 16px/1.65 var(--font-sans); }
.pin-quote figcaption {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: var(--space-16);
  color: #50555e; font: 400 12px/1.4 var(--font-sans);
}
.pin-quote .av { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: #ffffffb3; color: #171717; font-weight: 600; text-transform: uppercase; }
.pin-quote .who { color: #171717; font-weight: 600; }
.pin-quote .score { margin-left: auto; color: var(--type-amber-ink); font-weight: 600; }
.pin-quote .date { flex-basis: 100%; padding-left: 32px; color: #737373; }

/* the one "your site next" pin */
.pin-cta {
  display: grid; justify-items: start; gap: var(--space-12); padding: var(--space-28) var(--space-24);
  border-radius: var(--radius-16); background: var(--btn); color: var(--on-btn);
}
.cta-kind { margin: 0; color: color-mix(in srgb, var(--on-btn) 60%, transparent); font: 600 11px/1.4 var(--font-sans); letter-spacing: .08em; text-transform: uppercase; }
.cta-line { margin: 0; font: 600 24px/1.3 var(--font-sans); }
.pin-cta .w3-btn { background: var(--on-btn); color: var(--btn); }

.wall-empty { margin: var(--space-48) 0 0; color: var(--ink-3); text-align: center; }

/* lightbox video sits where the image does */
.lb-video { display: block; max-width: min(100%, 1200px); max-height: calc(100dvh - 200px); border-radius: var(--radius-16); background: #000; }
.lb-video[hidden], .lb-img[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pin-media img, .pin-media video, .pin-zoom { transition: none; }
}
@media (max-width: 640px) {
  .wall-hero { padding: 112px var(--space-16) var(--space-28); }
  .wall-hero .lead { font-size: 16px; }
  .wall { padding: 0 var(--space-12) var(--space-96); }
  .wall-bar { top: 76px; justify-content: flex-start; margin: 0 calc(-1 * var(--space-12)); padding: var(--space-10) var(--space-12); }
  .pins { --gap: 10px; columns: 2; }
  .pin-cap b { font-size: 13px; }
  .pin-quote figure { padding: var(--space-16) var(--space-14) var(--space-12); }
  .pin-quote blockquote { font-size: 14px; }
  .cta-line { font-size: 19px; }
  .pin-zoom { display: none; }
}

/* chips scroll sideways and the lightbox buttons drop to the bottom on a phone */
@media (max-width: 640px) {
  .g-filters { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .g-filters::-webkit-scrollbar { display: none; }
  .w3-chip-btn { flex-shrink: 0; height: 40px; padding: 0 14px; font-size: 14px; }
  .lb-fig { padding: var(--space-72) var(--space-16) var(--space-96); }
  .lb-img { max-height: calc(100dvh - 260px); }
  .lb-prev, .lb-next { top: auto; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); translate: none; }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
}
