/* Category pages (Animations, UI & Illustrations, VFX). Builds on home-redesign.css and project-redesign.css. */

.category-page .td-summary { max-width: 46rem; }

.category-page .td-section { gap: 22px; }

/* UI & Illustrations gallery */
.ui-artwork-section {
  display: flex;
  flex-direction: column;
  gap: clamp(22px, 3.5vw, 40px);
}
.ui-artwork-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
}
.ui-artwork-gallery button {
  display: block;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: clamp(12px, 1.8vw, 18px);
  background: #eee;
  box-shadow: 6px 6px 0 var(--coral);
  cursor: zoom-in;
  transition: transform .25s ease, box-shadow .25s ease;
}
.ui-artwork-gallery button:hover,
.ui-artwork-gallery button:focus-visible {
  transform: translateY(-3px);
  box-shadow: 6px 6px 0 var(--sun);
}
.ui-artwork-gallery img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Videos on category pages */
.ui-gallery-video,
.vfx-feature {
  width: min(100%, 860px);
  margin: 0 auto;
}
.ui-gallery-video video,
.vfx-feature video,
.vfx-gallery video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: clamp(18px, 3vw, 30px);
  background: #eee;
}
.ui-gallery-video video,
.vfx-feature video {
  box-shadow: clamp(8px, 1.4vw, 14px) clamp(8px, 1.4vw, 14px) 0 var(--coral);
}
.ui-gallery-video figcaption,
.vfx-feature figcaption {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.vfx-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
}
.vfx-gallery video {
  aspect-ratio: 550 / 309;
  object-fit: cover;
  border-radius: clamp(14px, 2vw, 20px);
}

/* UI image viewer (same behaviour as before, new colours) */
.ui-project-lightbox {
  width: min(96vw, 1800px);
  height: 96vh;
  max-width: min(96vw, 1800px);
  max-height: 96vh;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
}
.ui-project-lightbox:not([open]) { display: none; }
.ui-project-lightbox::backdrop { background: rgb(29 26 33 / 88%); }
.ui-lightbox-open,
.ui-lightbox-open body { overflow: hidden; }
.ui-project-lightbox img {
  position: fixed;
  top: 50%;
  left: 50%;
  display: block;
  width: 40vw;
  height: 40vh;
  max-width: 96vw;
  max-height: 96vh;
  margin: 0;
  border-radius: 14px;
  cursor: zoom-in;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
  transition: transform 180ms ease;
}
.ui-project-lightbox img.is-large-gallery-image { width: 68vw; height: 68vh; }
.ui-project-lightbox img.is-double-size-gallery-image { width: 80vw; height: 80vh; }
.ui-project-lightbox img.is-zoomed { cursor: zoom-out; transform: translate(-50%, -50%) scale(1.18); }
.ui-project-lightbox button {
  position: fixed;
  top: 18px;
  right: 22px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--coral);
  color: #fff;
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
  place-items: center;
}
.ui-project-lightbox button:hover { background: var(--sun); color: var(--outline); }
.ui-project-lightbox .ui-project-lightbox-prev,
.ui-project-lightbox .ui-project-lightbox-next { top: 50%; right: auto; transform: translateY(-50%); }
.ui-project-lightbox .ui-project-lightbox-prev { left: 22px; }
.ui-project-lightbox .ui-project-lightbox-next { right: 22px; left: auto; }

@media (max-width: 900px) {
  .ui-artwork-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .ui-artwork-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vfx-gallery { grid-template-columns: 1fr; }
  .ui-project-lightbox img.is-mobile-large-gallery-image { width: 68vw; height: 68vh; }
  .ui-project-lightbox img.is-mobile-medium-gallery-image { width: 48vw; height: 48vh; }
  .ui-project-lightbox img.is-mobile-second-row-third-image { width: 72vw; height: 72vh; }
  .ui-project-lightbox img.is-mobile-double-gallery-image { width: 80vw; height: 80vh; }
  .ui-project-lightbox .ui-project-lightbox-prev { left: 10px; }
  .ui-project-lightbox .ui-project-lightbox-next { right: 10px; }
}
@media (max-width: 440px) {
  .ui-artwork-gallery { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ui-artwork-gallery button { transition: none; }
}

/* Captions under videos: clear the pink offset shape with room to spare */
.ui-gallery-video figcaption,
.vfx-feature figcaption { margin-top: clamp(24px, 3vw, 32px); }
