/* ═══════════════════════════ GALLERY ═══════════════════════════ */
.gallery {
  background: var(--yellow);
  padding: 96px 64px 110px;
  position: relative;
}
.gallery > .zigzag-top { --divider-color: var(--pink); }

/* This page's footer follows the yellow gallery, not the pink portfolio
   list on the homepage, so its lead-in zig-zag needs the matching color. */
body.portfolio-page footer > .zigzag-top { --divider-color: var(--yellow); }

.gallery-inner { max-width: 1320px; margin: 0 auto; }

.gallery-headline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(32px, 4.45vw, 64px);
  color: var(--purple);
  text-align: center;
  margin-bottom: 56px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 12px;
  background: var(--ink);
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.35s var(--ease-quart-out), box-shadow 0.35s var(--ease-quart-out);
}

/* Project title label — mirrors .modal-tag (styles.css) */
.gallery-label {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  background: var(--purple);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
@media (hover: hover) {
  .gallery-item:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(21, 18, 31, 0.22); }
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 900px) {
  .gallery { padding-left: 24px; padding-right: 24px; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .gallery-headline { margin-bottom: 40px; }
}

@media (max-width: 600px) {
  .gallery { padding-left: 20px; padding-right: 20px; padding-top: 72px; padding-bottom: 88px; }
  .gallery-grid { grid-template-columns: 1fr; gap: 14px; }
}
