.gallery {
  display: flex;
  flex-direction: column;
  padding: var(--space-6) var(--space-6) var(--space-7);
}

.gallery__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin: 0 0 var(--space-5);
}
.gallery__see-all {
  flex: none;
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  text-transform: uppercase;
  letter-spacing: var(--label-spacing);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: var(--border-w) solid var(--primary);
  padding-bottom: 1px;
}
.gallery__see-all:hover {
  color: var(--primary);
}

.gallery__carousel {
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}
.gallery__stage {
  position: relative;
}
.gallery__track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}
.gallery__track::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}
.gallery__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
}

.gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: var(--border-w-bold) solid var(--border);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition-press);
}
.gallery__arrow:active {
  transform: translateY(-50%) scale(0.94);
}
.gallery__arrow:disabled {
  opacity: 0.4;
  cursor: default;
}
.gallery__arrow--prev {
  left: -16px;
}
.gallery__arrow--next {
  right: -16px;
}

.gallery__dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.gallery__dot {
  width: 11px;
  height: 11px;
  padding: 0;
  border: var(--border-w) solid var(--border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background 0.12s ease;
}
.gallery__dot--on {
  background: var(--primary);
}

.gallery-card {
  overflow: hidden;
  background: var(--surface-raised);
  border: var(--border-w-bold) solid var(--border);
  border-radius: var(--radius-lg);
}
.gallery-card__portrait {
  position: relative;
  aspect-ratio: 16 / 11;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: var(--border-w-bold) solid var(--border);
  color: var(--on-color);
}
.gallery-card__portrait--fill-1 {
  background: var(--fill-1);
}
.gallery-card__portrait--fill-2 {
  background: var(--fill-2);
}
.gallery-card__portrait--fill-3 {
  background: var(--fill-3);
}
.gallery-card__portrait--fill-4 {
  background: var(--fill-4);
}
.gallery-card__portrait--fill-5 {
  background: var(--fill-5);
}
.gallery-card__portrait--fill-6 {
  background: var(--fill-6);
}
.gallery-card__initial {
  font-family: var(--font-display);
  font-size: 76px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
}
.gallery-card__image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-card__quote {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 30px 16px 14px;
  background: linear-gradient(to top, rgba(43, 28, 16, 0.85), transparent);
  color: #fff;
  font-family: var(--font-body);
  font-style: italic;
  font-weight: var(--fw-medium);
  font-size: 15px;
  line-height: 1.4;
  /* Keep the overlay from swallowing the portrait on long quotes. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card__info {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
}
.gallery-card__name {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--fs-title);
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 2px;
}
.gallery-card__meta {
  font-family: var(--font-mono);
  font-size: var(--fs-body-s);
  color: var(--text-muted);
  margin: 0;
}
.gallery-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: 10px;
}
.gallery-card__actions {
  display: flex;
}
.gallery-card__actions .button {
  width: 100%; /* block on mobile */
}

.gallery__empty {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: var(--space-6);
  text-align: center;
  background: var(--surface-raised);
  border: var(--border-w) dashed var(--border);
  border-radius: var(--radius-lg);
}
.gallery__empty-text {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text-muted);
  margin: 0;
}

@media (min-width: 721px) {
  /* --bp-md */
  .gallery-card__initial {
    font-size: 86px;
  }
  .gallery-card__actions {
    justify-content: flex-end;
  }
  .gallery-card__actions .button {
    width: auto;
  }
}
