/* Gallery — a lookbook wall: real rooms and the Mashhad showroom in a masonry of rounded
   frames; the opening photo stands in the brand's arched niche. Tokens only. */

.gallery {
  display: grid;
  gap: 0;
}

/* CSS columns keep each photo at its own shape (no cropping) without any JS. */
.gallery__wall {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 1;
  column-gap: 1.25rem;
}

@media (min-width: 700px) {
  .gallery__wall {
    columns: 2;
  }
}

@media (min-width: 1100px) {
  .gallery__wall {
    columns: 3;
    column-gap: 1.5rem;
  }
}

.gallery__item {
  break-inside: avoid;
  margin-block-end: 1.25rem;
}

.gallery__figure {
  display: grid;
  gap: 0.55rem;
  margin: 0;
}

.gallery__frame {
  display: block;
  overflow: hidden;
  border: 0.35rem solid var(--color-surface-elevated);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-sage) 24%, var(--color-surface));
  box-shadow: var(--shadow);
}

/* Opening photo: the arched niche, like the home hero and product pages. */
.gallery__item:first-child .gallery__frame {
  border-radius: 50% 50% var(--radius-lg) var(--radius-lg) / 30% 30% var(--radius-lg) var(--radius-lg);
}

.gallery__image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Without JS, <noscript> carries the real photo: hide its waiting twin. */
@media (scripting: none) {
  .gallery__image[data-gallery-photo] {
    display: none;
  }
}

.gallery__figure:hover .gallery__image {
  transform: scale(1.025);
}

.gallery__caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  padding-inline: 0.3rem;
}

.gallery__text {
  color: var(--color-text);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.6;
}

.gallery__link {
  color: var(--color-accent-warm);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--color-accent-warm) 35%, transparent);
  text-underline-offset: 0.3em;
  white-space: nowrap;
}

.gallery__link:hover,
.gallery__link:focus-visible {
  text-decoration-color: currentColor;
}

.gallery__outro {
  display: grid;
  gap: 0.6rem;
  justify-items: center;
  max-width: 40rem;
  margin: clamp(1.5rem, 4vw, 2.5rem) auto 0;
  text-align: center;
}

.gallery__outro-title {
  margin: 0;
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
}

.gallery__outro-body {
  margin: 0;
  color: var(--color-muted);
  line-height: 1.85;
}

.gallery__outro-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.35rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .gallery__image {
    transition: none;
  }

  .gallery__figure:hover .gallery__image {
    transform: none;
  }
}
