/* Tinker Shed Gallery page only. Loaded after site.css (see site.css for load order). */

/* ---------- Photo grids ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 0; padding: 0; list-style: none; }
.photo-tile { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-card); box-shadow: var(--shadow-card); background: #eee; cursor: zoom-in; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.photo-tile:hover img { transform: scale(1.04); }

/* ---------- Lightbox ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(17, 14, 12, .94); color: var(--white); overflow: hidden; }
.lightbox::backdrop { background: rgba(0, 0, 0, .5); }
.lightbox[open] { display: grid; place-items: center; }
.lb-figure { margin: 0; display: grid; justify-items: center; gap: 12px; padding: 64px 72px 24px; max-width: 100%; }
.lb-img { max-width: min(1100px, 100%); max-height: calc(100vh - 150px); width: auto; height: auto; object-fit: contain; border-radius: 12px; background: #222; }
.lightbox figcaption { font-size: var(--text-16); text-align: center; color: #f3efe9; max-width: 720px; }
.lb-count { display: inline-block; margin-left: 8px; color: #c9c2b8; font-weight: var(--weight-semibold); white-space: nowrap; }
.lb-btn { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--white); color: var(--color-heading); cursor: pointer; box-shadow: var(--shadow-lift); }
.lb-btn:hover { background: var(--tint-orange); color: var(--orange-ink); }
.lb-btn svg { width: 24px; height: 24px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-open { overflow: hidden; }

@media (max-width: 980px) {
  .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .photo-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .lb-figure { padding: 72px 12px 96px; }
  .lb-img { max-height: calc(100vh - 210px); }
  .lb-prev, .lb-next { top: auto; bottom: 20px; transform: none; }
  .lb-prev { left: calc(50% - 60px); }
  .lb-next { right: calc(50% - 60px); }
}
@media (prefers-reduced-motion: reduce) {
  .photo-tile img { transition: none; }
}
