/* =========================================================
   Shared card-gallery + lightbox styles (graphite theme).
   Used by work/pos/, work/bottle/, work/product/ (and reusable
   for future sections). Class names are generic: .gallery-*
   ========================================================= */

:root {
  --bg: #22252a;
  --surface: #2b2f36;
  --surface-2: #333843;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --ink: #eceef1;
  --ink-dim: #c6cad1;
  --muted: #949ba6;
  --accent: #5e9bff;
  --radius: 14px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body.gallery-page {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.02em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ---------- shell ---------- */
.gallery-wrap { max-width: var(--maxw); margin: 0 auto; padding: 88px 24px 96px; }

.gallery-back {
  position: fixed; top: 20px; left: 20px; z-index: 20;
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); font-size: 18px; transition: background .2s, transform .2s;
}
.gallery-back:hover { background: var(--surface-2); transform: translateY(-1px); }

.gallery-crumbs { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.gallery-crumbs a:hover { color: var(--accent); }
.gallery-crumbs span { margin: 0 8px; opacity: .5; }
.gallery-crumbs #crumb-tail { margin: 0; opacity: 1; }
.gallery-crumbs #crumb-tail span { margin: 0 8px; opacity: .5; }

/* ---------- header ---------- */
.gallery-head { max-width: 760px; margin-bottom: 40px; }
.gallery-kicker {
  margin: 0 0 14px; font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent);
}
.gallery-head h1 {
  margin: 0 0 16px; font-size: clamp(34px, 6vw, 54px); font-weight: 700;
  line-height: 1.05; letter-spacing: -0.03em;
}
.gallery-sub { margin: 0; font-size: 17px; color: var(--muted); max-width: 640px; }

/* ---------- grid ---------- */
.gallery-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}

.gallery-card {
  margin: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .2s, transform .2s, background .2s;
}
.gallery-card:hover { border-color: var(--line-strong); transform: translateY(-3px); }

.gallery-card__hero {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
  cursor: zoom-in; background: #1b1d21;
}

.gallery-card__body { padding: 16px 18px 18px; }
.gallery-card__name { font-size: 17px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.01em; }
.gallery-card__tag { font-size: 12px; color: var(--accent); margin: 0 0 10px; }
.gallery-card__line { font-size: 13.5px; color: var(--ink-dim); margin: 0; }

.gallery-card__thumbs { display: flex; gap: 6px; padding: 0 18px 16px; }
.gallery-card__thumbs img {
  width: 44px; height: 44px; object-fit: cover; border-radius: 6px;
  cursor: zoom-in; border: 1px solid var(--line); opacity: .8; transition: opacity .15s, border-color .15s;
}
.gallery-card__thumbs img:hover { opacity: 1; border-color: var(--line-strong); }

/* drawings, boxes and tall UI screens: show the whole image instead of cropping to a square */
.gallery-card--contain .gallery-card__hero { object-fit: contain; background: #fff; }
.gallery-card--contain .gallery-card__thumbs img { object-fit: contain; background: #fff; opacity: 1; }
.gallery-card__more { align-self: center; font-size: 12px; color: var(--muted); padding-left: 4px; }

/* ---------- footer ---------- */
.gallery-foot {
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.gallery-foot a:hover { color: var(--accent); }

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 500; background: rgba(10, 11, 13, .92);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
.lb img { max-width: 100%; max-height: 86vh; border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lb__close, .lb__prev, .lb__next {
  position: fixed; appearance: none; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink); border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center;
  cursor: pointer; font-size: 18px;
}
.lb__close { top: 20px; right: 20px; }
.lb__prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb__next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb__close:hover, .lb__prev:hover, .lb__next:hover { background: var(--surface-2); }
.lb__count {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--muted);
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .gallery-wrap { padding: 76px 16px 72px; }
  .gallery-grid { grid-template-columns: 1fr; }
  .lb__prev, .lb__next { width: 38px; height: 38px; }
}
