.doctor-gallery {
  --gallery-columns: 4;
  position: relative;
  padding: 40px;
  background: #292929;
}
.doctor-gallery__track {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.doctor-gallery__track::-webkit-scrollbar { display: none; }
.doctor-gallery__photo {
  display: block;
  flex: 0 0 calc((100% + 20px) / min(var(--gallery-columns), var(--gallery-count)) - 20px);
  aspect-ratio: 1;
  overflow: hidden;
  scroll-snap-align: start;
  cursor: zoom-in;
}
.doctor-gallery__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.doctor-gallery__photo:hover img { transform: scale(1.1); }
.doctor-gallery__photo:focus-visible, .doctor-gallery__track:focus-visible {
  outline: 3px solid #1876c9;
  outline-offset: -3px;
}
.doctor-gallery__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(17,17,17,.6);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}
.doctor-gallery__arrow[hidden] { display: none; }
.doctor-gallery__arrow--previous { left: 24px; }
.doctor-gallery__arrow--next { right: 24px; }
body.doctor-lightbox-open { overflow: hidden; }
.doctor-lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 48px 60px 144px;
  border: 0;
  background: transparent;
  color: #fff;
  box-sizing: border-box;
}
.doctor-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.doctor-lightbox::backdrop { background: rgba(17,17,17,.7); }
.doctor-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  touch-action: pan-y pinch-zoom;
  cursor: zoom-in;
}
.doctor-lightbox--zoomed[open] { overflow: auto; align-items: flex-start; justify-content: flex-start; }
.doctor-lightbox--zoomed .doctor-lightbox__image { max-width: none; max-height: none; flex-shrink: 0; cursor: zoom-out; }
.doctor-lightbox--no-thumbnails { padding-bottom: 48px; }
.doctor-lightbox__tools { display: flex; }
.doctor-lightbox button[hidden], .doctor-lightbox__thumbnails[hidden] { display: none; }
.doctor-lightbox__thumbnails {
  position: absolute;
  bottom: 16px;
  left: 60px;
  right: 60px;
  display: flex;
  justify-content: safe center;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
}
.doctor-lightbox .doctor-lightbox__thumbnails button {
  flex: 0 0 auto;
  width: 72px;
  height: 96px;
  padding: 0;
  opacity: .65;
}
.doctor-lightbox .doctor-lightbox__thumbnails button[aria-current="true"] { opacity: 1; outline: 2px solid #fff; outline-offset: -2px; }
.doctor-lightbox__thumbnails img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.doctor-lightbox__toolbar {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}
.doctor-lightbox button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}
.doctor-lightbox button:hover { background: rgba(255,255,255,.15); }
.doctor-lightbox button:focus-visible { outline: 2px solid #fff; }
.doctor-lightbox .doctor-lightbox__close { font-size: 36px; }
.doctor-lightbox__previous, .doctor-lightbox__next { position: absolute; top: calc(50% - 22px); }
.doctor-lightbox__previous { left: 12px; }
.doctor-lightbox__next { right: 12px; }
@media (max-width: 1023px) { .doctor-gallery { --gallery-columns: 3; } }
@media (max-width: 767px) {
  .doctor-gallery { --gallery-columns: 1; }
  .doctor-lightbox { padding: 60px 44px 112px; }
  .doctor-lightbox--no-thumbnails { padding-bottom: 60px; }
  .doctor-lightbox__toolbar { padding: 6px; }
  .doctor-lightbox__thumbnails { left: 44px; right: 44px; }
  .doctor-lightbox .doctor-lightbox__thumbnails button { width: 48px; height: 68px; }
  .doctor-lightbox__previous { left: 0; }
  .doctor-lightbox__next { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .doctor-gallery__photo img { transition: none; }
}
