.af-classic-main .af-photo-gallery {
  position: relative;
  z-index: 1;
  padding-block: clamp(32px, 4.8vw, 64px);
  background: #fff;
}

.af-photo-gallery__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  margin-bottom: clamp(16px, 2.4vw, 28px);
}

.af-classic-main .af-photo-gallery h2 {
  margin: 0;
  font-size: clamp(30px, 3.4vw, 47px);
  text-wrap: balance;
}

.af-photo-gallery__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.af-photo-gallery__controls[hidden] { display: none; }

.af-photo-gallery__controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #a9c2ca;
  border-radius: 7px;
  background: #fff;
  color: var(--divi-blue, #19556c);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.af-photo-gallery__controls button:hover { background: #e8f1f3; }
.af-photo-gallery__arrow .af-icon { width: 20px; height: 20px; }
.af-photo-gallery__arrow--back .af-icon { transform: rotate(180deg); }
.af-photo-gallery__controls .af-photo-gallery__toggle { min-width: 72px; }

.af-photo-gallery :is(button, [tabindex]):focus-visible {
  outline: 2px solid var(--divi-blue, #19556c);
  outline-offset: 3px;
}

.af-photo-gallery__track {
  --gallery-gap: clamp(12px, 1.6vw, 24px);
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * var(--gallery-gap)) / 3);
  gap: var(--gallery-gap);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: #9ebcc6 #eef3f4;
  padding-bottom: 10px;
}

.af-photo-gallery figure {
  min-width: 0;
  margin: 0;
  scroll-snap-align: start;
}

.af-photo-gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  border-radius: 9px;
  background: #eef3f4;
  object-fit: cover;
  object-position: center 50%;
}

.af-photo-gallery figure:first-child img { object-position: center 63%; }

.af-photo-gallery figcaption {
  margin-top: 9px;
  color: var(--divi-blue, #19556c);
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 960px) {
  .af-photo-gallery__track { grid-auto-columns: calc((100% - var(--gallery-gap)) / 2); }
}

@media (max-width: 640px) {
  .af-photo-gallery__header { gap: 12px; }
  .af-photo-gallery__track { grid-auto-columns: 88%; }
}
