/* YAS Clinic gallery — v4.11 */
.gallery-page .inner-hero {
  min-height: 680px;
}

.gallery-section {
  overflow: clip;
}

.gallery-head {
  align-items: end;
}

.gallery-intro {
  max-width: 470px;
  color: var(--muted);
  font-size: 13px;
  line-height: 2.1;
}

.gallery-intro p {
  margin: 0;
}

.gallery-intro span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 16px;
  padding: 0 13px;
  border: 1px solid #0b18221a;
  border-radius: 999px;
  background: #fff;
  color: var(--teal-500);
  font-size: 10px;
  font-weight: 800;
}

.clinic-gallery {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 390px;
  gap: 22px;
  margin-top: 62px;
}

.gallery-card {
  min-width: 0;
  margin: 0;
}

.gallery-card-1,
.gallery-card-4 {
  grid-column: span 7;
}

.gallery-card-2,
.gallery-card-3 {
  grid-column: span 5;
}

.gallery-card > button {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 26px;
  background: var(--navy-950);
  color: #fff;
  text-align: right;
  cursor: zoom-in;
  box-shadow: 0 35px 85px -58px #07141e;
}

.gallery-card > button::after {
  content: "";
  position: absolute;
  inset: 13px;
  z-index: 2;
  border: 1px solid #ffffff26;
  border-radius: 18px;
  pointer-events: none;
  transition: border-color .35s ease, inset .35s ease;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s cubic-bezier(.2,.8,.2,1), filter .5s ease;
}

.gallery-card-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 35%, #07141ed9 100%),
    linear-gradient(90deg, #07141e24, transparent 55%);
}

.gallery-card-copy {
  position: absolute;
  right: 34px;
  bottom: 31px;
  z-index: 3;
  display: grid;
  gap: 8px;
  max-width: calc(100% - 100px);
}

.gallery-card-copy small {
  color: var(--teal-300);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1px;
}

.gallery-card-copy b {
  font-size: clamp(17px, 2vw, 24px);
  line-height: 1.6;
}

.gallery-card-expand {
  position: absolute;
  top: 31px;
  left: 31px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid #ffffff42;
  border-radius: 50%;
  background: #07141e52;
  color: var(--teal-200);
  font-size: 19px;
  backdrop-filter: blur(12px);
  transition: color .3s ease, background .3s ease, transform .3s ease;
}

.gallery-card > button:hover img {
  transform: scale(1.045);
  filter: saturate(1.05) contrast(1.02);
}

.gallery-card > button:hover::after {
  inset: 9px;
  border-color: #83f5e870;
}

.gallery-card > button:hover .gallery-card-expand {
  color: var(--navy-950);
  background: var(--teal-300);
  transform: rotate(-8deg);
}

.gallery-card > button:focus-visible {
  outline: 3px solid var(--amber-400);
  outline-offset: 4px;
}

.gallery-empty {
  margin-top: 55px;
}

.gallery-cta {
  border-top: 1px solid #83f5e81f;
}

.gallery-lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #050d13f7;
  color: #fff;
}

.gallery-lightbox::backdrop {
  background: #02080dde;
  backdrop-filter: blur(10px);
}

.gallery-lightbox[open] {
  display: grid;
  place-items: center;
}

.gallery-lightbox-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1440px, 100%);
  height: 100%;
  padding: 22px 30px 30px;
}

.gallery-lightbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  border-bottom: 1px solid #ffffff17;
}

.gallery-lightbox-top > div {
  display: flex;
  align-items: center;
  gap: 18px;
}

.gallery-lightbox-top span {
  color: var(--teal-300);
  font: 700 10px/1 monospace;
}

.gallery-lightbox-top b {
  font-size: 14px;
}

.gallery-lightbox-top > button,
.gallery-lightbox-nav {
  border: 1px solid #ffffff24;
  border-radius: 50%;
  background: #ffffff0a;
  color: #fff;
  transition: color .25s ease, background .25s ease, border-color .25s ease;
}

.gallery-lightbox-top > button {
  width: 43px;
  height: 43px;
  font-size: 27px;
}

.gallery-lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 24px 80px 0;
}

.gallery-lightbox-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 145px);
  border-radius: 18px;
  object-fit: contain;
  box-shadow: 0 35px 100px #0009;
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 52px;
  height: 52px;
  translate: 0 -50%;
  font-size: 34px;
}

.gallery-lightbox-nav.previous {
  right: 8px;
}

.gallery-lightbox-nav.next {
  left: 8px;
}

.gallery-lightbox-top > button:hover,
.gallery-lightbox-nav:hover,
.gallery-lightbox-top > button:focus-visible,
.gallery-lightbox-nav:focus-visible {
  border-color: var(--teal-300);
  background: var(--teal-300);
  color: var(--navy-950);
  outline: none;
}

body.gallery-lightbox-open {
  overflow: hidden;
}

@media (max-width: 900px) {
  .gallery-page .inner-hero {
    min-height: auto;
  }

  .clinic-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 330px;
  }

  .gallery-card-1,
  .gallery-card-2,
  .gallery-card-3,
  .gallery-card-4 {
    grid-column: span 1;
  }

  .gallery-lightbox-stage {
    padding-inline: 64px;
  }
}

@media (max-width: 640px) {
  .gallery-head {
    align-items: start;
  }

  .gallery-intro {
    max-width: none;
  }

  .clinic-gallery {
    grid-template-columns: 1fr;
    grid-auto-rows: 300px;
    gap: 14px;
    margin-top: 40px;
  }

  .gallery-card > button {
    border-radius: 19px;
  }

  .gallery-card > button::after {
    inset: 9px;
    border-radius: 13px;
  }

  .gallery-card-copy {
    right: 24px;
    bottom: 22px;
  }

  .gallery-card-expand {
    top: 22px;
    left: 22px;
    width: 40px;
    height: 40px;
  }

  .gallery-lightbox-shell {
    padding: 12px 14px 18px;
  }

  .gallery-lightbox-top {
    min-height: 58px;
  }

  .gallery-lightbox-top > div {
    display: grid;
    gap: 5px;
  }

  .gallery-lightbox-top b {
    font-size: 12px;
  }

  .gallery-lightbox-stage {
    padding: 16px 0 76px;
  }

  .gallery-lightbox-stage img {
    max-height: calc(100dvh - 175px);
    border-radius: 13px;
  }

  .gallery-lightbox-nav {
    top: auto;
    bottom: 10px;
    translate: none;
    width: 47px;
    height: 47px;
  }

  .gallery-lightbox-nav.previous {
    right: calc(50% - 58px);
  }

  .gallery-lightbox-nav.next {
    left: calc(50% - 58px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-card img,
  .gallery-card > button::after,
  .gallery-card-expand {
    transition: none;
  }
}
