/* gallery.css
   The /gallery/ page: a filterable grid of all be creative work.

   Matched to the live look (white, quiet, Open Sans body with Poppins
   headings). The single-image zoom reuses the case-studies overlay classes
   (cs-overlay / cs-ov-zoom / cs-zoom-*), so casestudies.css is loaded too and
   this file only styles the page: intro, filter bar, grid, and the apparel
   links panel. */

:root {
  --gal-ink: #111;
  --gal-muted: rgba(0, 0, 0, 0.6);
  --gal-line: rgba(0, 0, 0, 0.14);
  --gal-accent: rgb(65, 105, 225);
  --gal-frame: #fafafa;
}

.gal-wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) clamp(16px, 4vw, 40px) clamp(64px, 9vw, 120px);
  font-family: "Open Sans", Arial, sans-serif;
  color: var(--gal-ink);
}

/* ---------- intro ---------- */

.gal-intro { max-width: 640px; margin-bottom: clamp(28px, 4vw, 44px); }

.gal-intro h1 {
  font-family: "Poppins", "Open Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 14px;
}

/* A short red rule under the title, echoing the case-study logo glow accent. */
.gal-intro h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin-top: 18px;
  background: var(--gal-accent);
}

.gal-intro p {
  font-size: clamp(15px, 1.5vw, 17px);
  line-height: 1.6;
  color: var(--gal-muted);
  margin: 0;
}

/* ---------- filter bar ---------- */

.gal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(18px, 3vw, 34px);
  margin-bottom: clamp(28px, 4vw, 40px);
  padding-bottom: 22px;
  border-bottom: 1px solid var(--gal-line);
}

/* Text-only filters: no outline, no fill. The selected one turns red and
   glows; the rest sit quiet until hovered. */
.gal-chip {
  border: 0;
  background: none;
  color: var(--gal-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 10px 2px;
  min-height: 44px;
  cursor: pointer;
  transition: color 180ms ease, text-shadow 180ms ease;
}

.gal-chip:hover { color: var(--gal-ink); }

.gal-chip[aria-pressed="true"] {
  color: var(--gal-accent);
  text-shadow: 0 0 16px rgba(65, 105, 225, 0.55), 0 0 4px rgba(65, 105, 225, 0.35);
}

.gal-chip .gal-count {
  font-weight: 400;
  opacity: 0.65;
  margin-left: 6px;
}

.gal-chip:focus-visible { outline: 2px solid var(--gal-ink); outline-offset: 4px; }

/* ---------- grid ---------- */

.gal-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(18px, 2.4vw, 32px);
}

/* display:grid above outranks the UA [hidden] rule, so hiding the grid needs
   an explicit override (used when Apparel is active or a filter is empty). */
.gal-grid[hidden] { display: none; }

@media (max-width: 1000px) { .gal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 680px) { .gal-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 340px) { .gal-grid { grid-template-columns: 1fr; } }

.gal-grid li { margin: 0; }

/* A tile fades in when its filter selects it, staggered by index. */
.gal-tile {
  border: 0;
  background: none;
  padding: 0;
  width: 100%;
  cursor: pointer;
  display: block;
  animation: gal-in 360ms ease both;
}

.gal-tile .frame {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--gal-frame);
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.gal-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 320ms ease;
}

.gal-tile:hover img,
.gal-tile:focus-visible img { transform: scale(1.04); }

.gal-tile:focus-visible { outline: 2px solid var(--gal-ink); outline-offset: 3px; }

.gal-tile .gal-cap {
  display: block;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--gal-muted);
}

.gal-tile .gal-tag {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gal-accent);
}

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

/* ---------- apparel: a workflow, not a grid ---------- */

.gal-apparel {
  padding: clamp(28px, 5vw, 52px);
  background: var(--gal-frame);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  max-width: 680px;
}

.gal-apparel-h {
  font-family: "Poppins", "Open Sans", sans-serif;
  font-weight: 700;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.15;
  margin: 0 0 10px;
}

.gal-apparel-intro {
  margin: 0 0 28px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--gal-muted);
  max-width: 56ch;
}

.gal-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; }

.gal-steps li { display: flex; align-items: flex-start; }

.gal-step-body { padding-top: 3px; }
.gal-step-body p { margin: 0; font-size: 15px; line-height: 1.55; }

.gal-apparel-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--gal-accent);
  text-decoration: none;
  transition: color 180ms ease;
}

.gal-apparel-link:hover,
.gal-apparel-link:focus-visible {
  color: var(--gal-accent);
  text-decoration: underline;
}


/* ---------- empty state ---------- */

.gal-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--gal-muted);
  font-size: 15px;
}

/* ---------- no-JS fallback ---------- */

.gal-nojs {
  padding: 20px 22px;
  background: var(--gal-frame);
  border: 1px solid var(--gal-line);
  border-radius: 6px;
  font-size: 14px;
  color: var(--gal-muted);
}

@media (prefers-reduced-motion: reduce) {
  .gal-tile { animation: none; }
  .gal-tile img { transition: none; }
  .gal-tile:hover img { transform: none; }
}
