/* ═══════════════════════════════════════════════════
   GALLERY PAGE  ·  Maximus 3D Printing
   Page-specific styles — loaded after style.css
   ═══════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════
   GALLERY HEADER
   ════════════════════════════════════════════════ */
.gal-header {
  background: var(--off);
  background-image:
    radial-gradient(ellipse 900px 500px at 100% 0%, rgba(var(--yellow-rgb),0.14) 0%, transparent 60%);
  padding: clamp(40px, 6vw, 64px) 0 44px;
}

.gal-crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--fb);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--blue);
  margin-bottom: 24px;
  transition: gap 0.2s;
}
.gal-crumb:hover { gap: 12px; }

.gal-header-row {
  display: grid;
  grid-template-columns: 1.4fr auto;
  gap: 40px;
  align-items: end;
}
.gal-header-left h1 { margin-bottom: 14px; }
.gal-header-desc {
  font-size: 1rem;
  font-weight: 500;
  color: var(--muted-text);
  line-height: 1.75;
  max-width: 480px;
}

.gal-header-stats {
  display: flex;
  align-items: center;
  gap: 22px;
  padding-bottom: 4px;
}
.ghs-item { display: flex; flex-direction: column; gap: 2px; text-align: center; }
.ghs-item strong {
  font-family: var(--fd);
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--navy);
  line-height: 1;
}
.ghs-item span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ghs-sep { width: 1px; height: 34px; background: rgba(var(--navy-rgb),0.12); flex-shrink: 0; }

/* ════════════════════════════════════════════════
   TOOLBAR
   ════════════════════════════════════════════════ */
.gal { background: var(--white); padding: 44px 0 88px; }

.gal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: 30px;
  border-bottom: 1.5px solid rgba(var(--navy-rgb),0.08);
}
.gal-filters { margin-bottom: 0; }
.gal-count {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted-text);
  white-space: nowrap;
}
.gal-count strong { color: var(--navy); font-weight: 800; }

/* ════════════════════════════════════════════════
   MASONRY GRID
   ════════════════════════════════════════════════ */
.gal-masonry {
  column-count: 4;
  column-gap: 18px;
}
.gal-tile {
  display: block;
  position: relative;
  width: 100%;
  margin: 0 0 18px;
  padding: 0;
  border: none;
  border-radius: var(--r24);
  overflow: hidden;
  break-inside: avoid;
  cursor: zoom-in;
  background: var(--off);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.35s;
}
.gal-tile:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.gal-tile img {
  width: 100%;
  display: block;
  transition: transform 0.5s ease;
}
.gal-tile:hover img { transform: scale(1.06); }

/* Transparent-render tiles get a coloured canvas so they don't float on white */
.gal-tile--render {
  background: linear-gradient(160deg, var(--navy) 0%, var(--ink) 100%);
  background-image:
    linear-gradient(160deg, var(--navy) 0%, var(--ink) 100%),
    repeating-linear-gradient(45deg, rgba(var(--yellow-rgb),0.05) 0px, rgba(var(--yellow-rgb),0.05) 1px, transparent 1px, transparent 12px);
}
.gal-tile--render img { padding: 34px; box-sizing: border-box; }

.gt-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 18px;
  background: linear-gradient(to top, rgba(var(--navy-rgb),0.78) 0%, transparent 55%);
  opacity: 0;
  transition: opacity 0.3s;
  text-align: left;
}
.gal-tile:hover .gt-overlay { opacity: 1; }
.gt-cat {
  font-family: var(--fb);
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
}
.gt-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--white);
}

.gt-zoom {
  position: absolute;
  top: 14px; right: 14px;
  z-index: 2;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(var(--white-rgb),0.92);
  color: var(--navy);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.25s, transform 0.25s;
}
.gal-tile:hover .gt-zoom { opacity: 1; transform: scale(1); }

/* ════════════════════════════════════════════════
   LIGHTBOX
   ════════════════════════════════════════════════ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(var(--navy-rgb),0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.lightbox.open { opacity: 1; pointer-events: all; }

.lb-stage {
  max-width: 900px;
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lb-stage img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--r16);
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.lb-caption {
  margin-top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.lb-cat {
  font-family: var(--fb);
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(var(--yellow-rgb),0.12);
  padding: 4px 12px;
  border-radius: var(--pill);
}
.lb-title {
  font-family: var(--fd);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--white);
}

.lb-close {
  position: absolute;
  top: 22px; right: 24px;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(var(--white-rgb),0.08);
  border: none; cursor: pointer;
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.lb-close:hover { background: var(--yellow); color: var(--navy); }

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(var(--white-rgb),0.08);
  border: none; cursor: pointer;
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.lb-nav:hover { background: var(--yellow); color: var(--navy); }
.lb-prev { left: 20px; }
.lb-next { right: 20px; }

/* ════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .gal-masonry { column-count: 3; }
}
@media (max-width: 960px) {
  .gal-header-row { grid-template-columns: 1fr; gap: 20px; align-items: start; }
}
@media (max-width: 720px) {
  .gal-masonry { column-count: 2; column-gap: 12px; }
  .gal-tile { margin-bottom: 12px; }
  .gt-overlay { opacity: 1; background: linear-gradient(to top, rgba(var(--navy-rgb),0.82) 0%, transparent 65%); padding: 12px; }
  .gt-title { font-size: 0.85rem; }
  .gt-zoom { display: none; }
  .lb-nav { width: 40px; height: 40px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
@media (max-width: 480px) {
  .gal-masonry { column-count: 1; }
  .gal-toolbar { flex-direction: column; align-items: stretch; gap: 14px; }
}
