/* =====================================================================
   W.I. Freight — Gallery page
   Scoped under .wifg so the old page CSS can't clash.
   ===================================================================== */

.wifg {
  --wg-primary: var(--color-primary, #2e3192);
  --wg-accent: var(--color-secondary, #be0119);
  --wg-ink: #14163a;
  --wg-muted: #5f6380;
  --wg-line: rgba(20, 22, 58, .08);
  --wg-font: "Grotesk", "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --wg-ease: cubic-bezier(.2, .8, .2, 1);

  display: block;
  background: #f5f6fb;
  color: var(--wg-ink);
}
.wifg *, .wifg *::before, .wifg *::after { box-sizing: border-box; }
.wifg *:not(.bi) { font-family: var(--wg-font); }
.wifg a { text-decoration: none; }

.wg-container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- Hero ---------- */
.wg-hero {
  position: relative;
  overflow: hidden;
  padding: 3.5rem 0 4.5rem;
  color: #fff;
  text-align: center;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(255, 255, 255, .14), transparent 60%),
    radial-gradient(600px 300px at -10% 110%, rgba(190, 1, 25, .35), transparent 60%),
    linear-gradient(135deg, var(--wg-primary) 0%, #1d1f6b 100%);
}
.wg-hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
  pointer-events: none;
}
.wg-hero .wg-container { position: relative; z-index: 1; }
.wg-crumbs {
  display: inline-flex; align-items: center; gap: .5rem;
  margin-bottom: 1.1rem;
  padding: .35rem .85rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  font-size: .85rem;
  color: rgba(255, 255, 255, .75);
}
.wg-crumbs a { color: rgba(255, 255, 255, .9); }
.wg-crumbs a:hover { color: #fff; }
.wg-crumbs .bi { font-size: .7rem; }
.wg-hero h1 {
  margin: 0 0 .75rem;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.08;
  color: #fff;
}
.wg-hero p {
  margin: 0 auto 1.5rem;
  max-width: 34rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
}
.wg-stats { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }
.wg-stats span {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .45rem .95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .25);
  font-size: .9rem;
  color: #fff;
}

/* ---------- Body ---------- */
.wg-body { padding: 2.5rem 0 5rem; }

.wg-filter {
  display: flex; justify-content: center; flex-wrap: wrap; gap: .5rem;
  margin: -4.6rem auto 2.25rem;
  position: relative; z-index: 2;
  width: max-content; max-width: 100%;
  padding: .4rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 18px 36px -20px rgba(20, 22, 58, .4);
}
.wg-filter button {
  display: inline-flex; align-items: center; gap: .5rem;
  height: 42px;
  padding: 0 1.15rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--wg-ink);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.wg-filter button span {
  min-width: 24px; height: 22px;
  padding: 0 7px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: rgba(46, 49, 146, .08);
  color: var(--wg-primary);
  font-size: .75rem;
}
.wg-filter button:hover { background: rgba(46, 49, 146, .06); }
.wg-filter button.is-active { background: var(--wg-primary); color: #fff; }
.wg-filter button.is-active span { background: rgba(255, 255, 255, .2); color: #fff; }

/* Grid: 4 per row on computers, 3 on small laptops/tablets, 2 on phones */
.wg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.wg-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;            /* every tile the same shape */
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #e3e5f0;
  cursor: zoom-in;
  box-shadow: 0 14px 30px -22px rgba(20, 22, 58, .5);
  transform: translateZ(0);
  animation: wg-in .5s var(--wg-ease) both;
}
.wg-item.wg-video { cursor: pointer; }
.wg-item[hidden] { display: none; }
.wifg .wg-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--wg-ease);
}
.wg-item:hover img { transform: scale(1.06); }
.wg-shade {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14, 16, 44, .55), transparent 55%);
  opacity: 0;
  transition: opacity .3s;
}
.wg-item:hover .wg-shade, .wg-video .wg-shade { opacity: 1; }
.wg-zoom {
  position: absolute; right: 12px; bottom: 12px;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--wg-primary);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s var(--wg-ease);
}
.wg-item:hover .wg-zoom, .wg-item:focus-visible .wg-zoom { opacity: 1; transform: none; }
.wg-play {
  position: absolute; left: 50%; top: 50%;
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--wg-accent);
  color: #fff;
  font-size: 2rem;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, .25), 0 14px 30px -10px rgba(0, 0, 0, .6);
  transition: transform .25s var(--wg-ease);
}
.wg-play .bi { margin-left: 4px; line-height: 1; }
.wg-item:hover .wg-play { transform: translate(-50%, -50%) scale(1.1); }
.wg-badge {
  position: absolute; left: 12px; top: 12px;
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: var(--wg-ink);
  font-size: .78rem;
  font-weight: 700;
}
.wg-badge .bi { color: #ff0033; }
.wg-item:focus-visible { outline: 3px solid rgba(46, 49, 146, .55); outline-offset: 3px; }

@keyframes wg-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.wg-empty {
  max-width: 420px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: 24px;
  background: #fff;
  color: var(--wg-muted);
}
.wg-empty .bi { font-size: 2.5rem; color: var(--wg-primary); }
.wg-empty h2 { margin: .75rem 0 .4rem; font-size: 1.4rem; color: var(--wg-ink); }

/* ---------- Lightbox ---------- */
.wg-lightbox {
  position: fixed; inset: 0;
  z-index: 2000;
  display: grid;
  grid-template-columns: 72px 1fr 72px;
  align-items: center;
}
.wg-lightbox[hidden] { display: none; }
@keyframes wg-fade { from { opacity: 0; } to { opacity: 1; } }
.wg-lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 12, 34, .7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
/* fade the controls in (not the backdrop's parent, or the blur would stop working) */
.wg-lb-top, .wg-lb-btn { animation: wg-fade .25s ease both; }
.wg-lb-top {
  position: absolute; top: 0; left: 0; right: 0;
  z-index: 2;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
}
.wg-lb-count { color: rgba(255, 255, 255, .8); font-size: .95rem; font-weight: 600; }
.wg-lb-btn {
  position: relative; z-index: 2;
  display: grid; place-items: center;
  width: 48px; height: 48px;
  margin: 0 auto;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.wg-lb-btn:hover { background: rgba(255, 255, 255, .25); }
.wg-lb-btn:focus-visible { outline: 3px solid rgba(255, 255, 255, .6); outline-offset: 2px; }
.wg-lb-top .wg-lb-btn { margin: 0; }
.wg-lb-prev { grid-column: 1; }
.wg-lb-next { grid-column: 3; }
.wg-lb-stage {
  position: relative; z-index: 1;
  grid-column: 2; grid-row: 1;
  display: grid; place-items: center;
  height: 100vh;
  padding: 76px 0 40px;
  touch-action: pan-y;
}
/* the site makes every <img> 100% wide; undo that here so photos keep their shape */
.wifg .wg-lb-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 116px);
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8);
  animation: wg-zoom .3s var(--wg-ease) both;
}
@keyframes wg-zoom { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.wg-lb-video {
  width: min(100%, calc((100vh - 116px) * 16 / 9));
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8);
  animation: wg-zoom .3s var(--wg-ease) both;
}
/* the site sets a fixed size on every iframe, so override it here */
.wifg .wg-lb-video iframe { display: block; width: 100% !important; height: 100% !important; border: 0; }

/* ---------- Lightbox: counter pill, bigger controls, thumbnail strip (22 Oct 2026) ---------- */
.wg-lightbox { --wg-gold: #f6c343; --wg-strip: 112px; }
.wg-lb-backdrop { background: rgba(10, 14, 22, .82); }
.wg-lb-top { justify-content: center; padding: 18px 20px; pointer-events: none; }
.wg-lb-top > * { pointer-events: auto; }
.wg-lb-count { padding: .45rem 1.1rem; border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .75); font-size: .95rem; font-weight: 600; letter-spacing: .02em; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.wg-lb-count b { color: var(--wg-gold); font-weight: 800; }
.wg-lb-top .wg-lb-btn[data-close] { position: absolute; right: 20px; top: 16px; }
.wg-lb-btn { width: 54px; height: 54px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .1); font-size: 1.3rem; }
.wg-lb-btn:hover { background: rgba(255, 255, 255, .22); transform: scale(1.06); }
.wg-lb-stage { padding: 80px 0 calc(var(--wg-strip) + 18px); }
.wifg .wg-lb-stage img { max-height: calc(100vh - 80px - var(--wg-strip) - 18px); border-radius: 16px; }
.wg-lb-video { width: min(100%, calc((100vh - 80px - var(--wg-strip) - 18px) * 16 / 9)); }

.wg-lb-thumbs {
  position: absolute; z-index: 2; left: 50%; bottom: 14px;
  display: flex; gap: 12px;
  width: min(1360px, calc(100% - 40px));
  max-width: max-content;
  transform: translateX(-50%);
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 18px;
  background: rgba(255, 255, 255, .05);
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent;
  animation: wg-fade .3s ease both;
}
.wg-lb-thumbs[hidden] { display: none; }
.wg-lb-thumbs::-webkit-scrollbar { height: 6px; }
.wg-lb-thumbs::-webkit-scrollbar-thumb { border-radius: 6px; background: rgba(255, 255, 255, .25); }
.wg-lb-thumb {
  position: relative; flex: 0 0 auto;
  width: 112px; height: 78px; padding: 0;
  border: 2px solid transparent; border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  overflow: hidden; cursor: pointer;
  opacity: .55;
  transition: opacity .2s, transform .2s, border-color .2s;
}
.wifg .wg-lb-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wg-lb-thumb:hover { opacity: .9; }
.wg-lb-thumb.is-active { opacity: 1; border-color: var(--wg-gold); box-shadow: 0 0 0 3px rgba(246, 195, 67, .25); }
.wg-lb-thumb:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.wg-lb-thumb.is-video::after { content: "\25B6"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1rem; text-shadow: 0 2px 8px rgba(0, 0, 0, .6); background: rgba(0, 0, 0, .25); }

html.wg-lock, html.wg-lock body { overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .wg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .wg-container { padding: 0 16px; }
  .wg-hero { padding: 2.5rem 0 4.25rem; }
  .wg-hero p { font-size: 1rem; }
  .wg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
  .wg-item { border-radius: 14px; }
  .wg-play { width: 50px; height: 50px; font-size: 1.6rem; }
  .wg-badge { font-size: .7rem; left: 8px; top: 8px; }
  .wg-zoom { display: none; }
  .wg-filter button { height: 38px; padding: 0 .85rem; font-size: .9rem; }

  .wg-lightbox { grid-template-columns: 1fr; --wg-strip: 78px; }
  .wg-lb-stage { grid-column: 1; padding: 68px 10px calc(var(--wg-strip) + 14px); }
  .wifg .wg-lb-stage img { max-height: calc(100vh - 68px - var(--wg-strip) - 14px); border-radius: 12px; }
  .wg-lb-top { padding: 14px 16px; }
  .wg-lb-top .wg-lb-btn[data-close] { right: 12px; top: 10px; }
  .wg-lb-btn { width: 44px; height: 44px; font-size: 1.1rem; }
  .wg-lb-prev, .wg-lb-next { position: absolute; top: 50%; margin-top: -22px; grid-column: auto; background: rgba(10, 14, 22, .55); }
  .wg-lb-prev { left: 8px; }
  .wg-lb-next { right: 8px; }
  .wg-lb-thumbs { bottom: 10px; gap: 8px; padding: 6px; border-radius: 14px; width: calc(100% - 20px); }
  .wg-lb-thumb { width: 72px; height: 52px; border-radius: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .wifg *, .wifg *::before, .wifg *::after { animation: none !important; transition-duration: .01ms !important; }
}
