/* ============================================================
   Scalable project gallery + lightbox
   Used by service-page "work" sections and the /work page.
   Grid flows to any number of projects; each card opens a
   lightbox carousel of that project's images.
   ============================================================ */

.gal2-grid {
  margin-top: 2.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.proj-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 20px 40px -32px rgba(28, 43, 74, 0.4);
  transition: transform .25s ease, box-shadow .25s ease;
}
.proj-card:hover,
.proj-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 28px 50px -28px rgba(28, 43, 74, 0.55);
  outline: none;
}
.proj-card:focus-visible { box-shadow: 0 0 0 3px rgba(199,164,77,0.55), 0 28px 50px -28px rgba(28,43,74,0.55); }

.proj-cover { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.proj-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.proj-card:hover .proj-cover img { transform: scale(1.05); }

.proj-type {
  position: absolute; top: .7rem; left: .7rem; z-index: 2;
  font-size: .64rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--navy); background: rgba(216, 185, 104, 0.95);
  border-radius: 999px; padding: .3rem .7rem;
}
.proj-flag {
  position: absolute; top: .7rem; right: .7rem; z-index: 2;
  font-size: .58rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: #fff; background: rgba(28, 43, 74, 0.82);
  border-radius: 999px; padding: .3rem .6rem;
}
.proj-count {
  position: absolute; bottom: .7rem; right: .7rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 600; color: #fff;
  background: rgba(22, 34, 60, 0.72); border-radius: 999px; padding: .3rem .6rem;
}
.proj-count svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.proj-meta { padding: 1.05rem 1.15rem 1.25rem; display: flex; flex-direction: column; }
/* min-height reserves two lines so hood/blurb align across cards in a row */
.proj-title { font-family: 'Hedvig Letters Serif', serif; font-size: 1.12rem; line-height: 1.3; min-height: 2.6em; color: var(--navy); }
.proj-hood { margin-top: .45rem; display: inline-flex; align-items: center; gap: .35rem; font-size: .82rem; color: var(--navy); }
.proj-hood svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.proj-blurb { margin-top: .6rem; font-size: .9rem; line-height: 1.5; color: var(--navy-soft); }

.gal2-more { margin-top: 1.8rem; }
.gal2-more a {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold-deep); text-decoration: none;
}
.gal2-more a svg { transition: transform .25s; }
.gal2-more a:hover svg { transform: translateX(4px); }

.gal2-empty { margin-top: 1.4rem; font-size: .9rem; color: var(--navy-faint); }

/* placeholder "next / yours?" tiles (non-clickable) */
.proj-card.is-soon { cursor: default; background: var(--cream-2); border-style: dashed; box-shadow: none; }
.proj-card.is-soon:hover { transform: none; box-shadow: none; }
.proj-cover--art { display: grid; place-items: center; background: rgba(28, 43, 74, 0.035); }
.proj-cover--art .soon-art { width: 46px; height: 46px; fill: none; stroke: var(--navy-faint); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- on-card photo carousel (injected by card-carousel.js) ---------- */
.pc-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.92); color: var(--navy);
  font-size: 1.25rem; line-height: 1; display: grid; place-items: center;
  cursor: pointer; box-shadow: 0 8px 18px -8px rgba(28,43,74,0.5);
  opacity: 0; transition: opacity .2s, background .2s;
}
.pc-prev { left: .6rem; }
.pc-next { right: .6rem; }
.proj-card:hover .pc-nav,
.proj-card:focus-within .pc-nav { opacity: 1; }
.pc-nav:hover { background: #fff; }
/* touch devices: arrows always visible and sized to a 44px tap target */
@media (hover: none) { .pc-nav { opacity: 1; width: 44px; height: 44px; } }
.pc-dots {
  position: absolute; bottom: .75rem; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; gap: .34rem;
}
.pc-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.55); box-shadow: 0 1px 4px rgba(22,34,60,0.35); transition: background .2s; }
.pc-dots i.on { background: #fff; }

/* ---------- service hero slideshow (driven by page-service.js) ---------- */
/* First image stays in flow (keeps the box height), the rest stack on top
   and crossfade via .on. */
.js-hero-slides { position: relative; }
.js-hero-slides img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .9s ease; }
.js-hero-slides img:first-child { position: relative; }
.js-hero-slides img:not(:first-child) { position: absolute; inset: 0; }
.js-hero-slides img.on { opacity: 1; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200; display: none;
  align-items: center; justify-content: center; padding: 2rem;
  background: rgba(22,34,60,0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; animation: lbFade .25s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes lbPop { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
.lb-modal {
  width: min(72vw, 1320px); aspect-ratio: 16 / 9; max-height: 90vh;
  background: #fff; border-radius: 22px; overflow: hidden; position: relative;
  display: grid; grid-template-columns: 1.62fr 1fr;
  box-shadow: 0 60px 120px -40px rgba(16,34,60,0.7);
  animation: lbPop .3s cubic-bezier(.2,.7,.3,1);
}
.lb-gal { position: relative; background: #111; }
.lb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-info { padding: clamp(1.3rem, 2vw, 1.9rem); display: flex; flex-direction: column; gap: .7rem; overflow: hidden; }
.lb-type { align-self: flex-start; width: max-content; font-size: .62rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--navy-3); background: rgba(199,164,77,0.92); padding: .34rem .72rem; border-radius: 999px; }
.lb-title { font-family: 'Hedvig Letters Serif', Georgia, serif; font-weight: 400; line-height: 1.05; font-size: clamp(1.5rem, 2.4vw, 2rem); color: var(--navy); }
.lb-hood { display: flex; align-items: center; gap: .4rem; color: var(--gold-deep); font-size: .9rem; font-weight: 600; }
.lb-hood svg { width: 14px; height: 14px; flex: none; }
.lb-desc { color: var(--navy-soft); line-height: 1.6; font-size: .98rem; }
.lb-foot { margin-top: .6rem; display: flex; flex-direction: column; gap: .7rem; }
.lb-specs { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.lb-srow { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .5rem .1rem; border-bottom: 1px solid var(--border); }
.lb-sk { font-size: .7rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--navy-faint); }
.lb-sv { font-family: 'Hedvig Letters Serif', Georgia, serif; font-size: 1.1rem; color: var(--navy); }
.lb-srow.hl .lb-sv { color: var(--gold-deep); font-size: 1.28rem; }
.lb-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.lb-thumbs img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .55; border: 2px solid transparent; transition: opacity .2s, border-color .2s; }
.lb-thumbs img.on { opacity: 1; border-color: var(--gold); }
.lb-close { position: absolute; top: 1rem; right: 1rem; z-index: 8; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,0.92); color: var(--navy); font-size: 1.5rem; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(28,43,74,0.5); transition: transform .2s; }
.lb-close:hover { transform: rotate(90deg); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 6; width: 44px; height: 44px; border-radius: 50%; border: none; background: rgba(255,255,255,0.85); color: var(--navy); font-size: 1.6rem; line-height: 1; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 24px -10px rgba(28,43,74,0.5); transition: background .2s; }
.lb-nav:hover { background: #fff; }
.lb-prev { left: 1rem; } .lb-next { right: 1rem; }
.lb-count { position: absolute; left: 1rem; bottom: 1rem; z-index: 6; font-size: .72rem; font-weight: 600; color: #fff; background: rgba(22,34,60,0.55); padding: .28rem .6rem; border-radius: 999px; }
.lb-nextproj { margin-top: auto; align-self: flex-end; display: inline-flex; align-items: center; gap: .4rem; font: inherit; font-size: .82rem; font-weight: 600; letter-spacing: .01em; color: var(--navy); background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: .5rem .95rem; cursor: pointer; transition: background .2s, border-color .2s, gap .2s; }
.lb-nextproj:hover { background: var(--navy); border-color: var(--navy); color: #fff; gap: .6rem; }
.lb-nextproj span { transition: transform .2s; }
.lb-nextproj:hover span { transform: translateX(2px); }
@media (max-width: 860px) {
  .lb-modal { grid-template-columns: 1fr; aspect-ratio: auto; width: 94vw; max-height: 92vh; overflow: auto; }
  .lb-gal { aspect-ratio: 16 / 9; }
  .lb-info { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) { .proj-card, .proj-cover img, .gal2-more a svg { transition: none; } }
