.smp-facility-gallery {
  --facility-gallery-ink: #0e2e31;
  --facility-gallery-muted: #4b6a6c;
  --facility-gallery-surface: #fff;
  --facility-gallery-line: #dce6e8;
  --facility-gallery-deep: #0a4a50;
  --facility-gallery-teal: #0f766e;
  --facility-gallery-gold: #e8b84a;
  width: min(100%, 1140px);
  margin: 0 auto;
  padding: 0.8rem 0 0;
  color: var(--facility-gallery-ink);
  font-family: "Figtree", sans-serif;
}

.smp-facility-gallery .smp-album-photo-heading {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--facility-gallery-line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 24px rgb(10 46 49 / 6%);
}

.smp-facility-gallery .smp-album-photo-icon {
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(15 118 110 / 14%);
  border-radius: 17px;
  color: var(--facility-gallery-teal);
  background: #eaf5f3;
  font-size: 1.15rem;
}

.smp-facility-gallery .smp-album-photo-title {
  margin: 0;
  color: var(--facility-gallery-deep);
  font-family: "Figtree", sans-serif;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.smp-facility-gallery .gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  column-count: initial;
  column-gap: 1.25rem;
}

.smp-facility-gallery .smp-facility-gallery-link {
  display: block;
  min-width: 0;
  margin: 0;
  color: inherit;
  text-decoration: none;
  break-inside: initial;
}

.smp-facility-gallery .gallery .smp-facility-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  border: 1px solid var(--facility-gallery-line);
  border-radius: 16px;
  background: var(--facility-gallery-surface);
  box-shadow: 0 8px 20px rgb(10 46 49 / 10%);
  transition: box-shadow 0.2s, transform 0.2s;
}

.smp-facility-gallery .gallery .smp-facility-card::before,
.smp-facility-gallery .gallery .smp-facility-card::after {
  display: none;
}

.smp-facility-gallery .gallery .smp-facility-card img {
  display: block;
  flex: 0 0 auto;
  aspect-ratio: 4 / 3;
  width: 100%;
  height: auto;
  max-width: none;
  object-fit: cover;
  transition: transform 0.3s;
}

.smp-facility-gallery .gallery .smp-facility-card figcaption {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  width: 100%;
  max-width: none;
  padding: 0.85rem 1rem;
  transform: none;
  border-top: 1px solid var(--facility-gallery-line);
  color: var(--facility-gallery-ink);
  background: var(--facility-gallery-surface);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  overflow-wrap: anywhere;
}

.smp-facility-gallery .gallery .smp-facility-card figcaption::before,
.smp-facility-gallery .gallery .smp-facility-card figcaption::after {
  display: none;
}

.smp-facility-gallery .smp-facility-gallery-link:hover .smp-facility-card,
.smp-facility-gallery .smp-facility-gallery-link:focus-visible .smp-facility-card {
  box-shadow: 0 14px 28px rgb(10 46 49 / 18%);
  transform: translateY(-2px);
}

.smp-facility-gallery .smp-facility-gallery-link:hover img,
.smp-facility-gallery .smp-facility-gallery-link:focus-visible img {
  transform: scale(1.035);
}

.smp-facility-gallery .smp-facility-gallery-link:focus-visible {
  outline: 3px solid var(--facility-gallery-gold);
  outline-offset: 4px;
  border-radius: 18px;
}

.smp-facility-gallery .smp-facility-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 2rem;
  border: 1px dashed var(--facility-gallery-line);
  border-radius: 16px;
  color: var(--facility-gallery-muted);
  background: var(--facility-gallery-surface);
  text-align: center;
}

.smp-facility-gallery .smp-facility-divider {
  margin: 2rem 0 0;
  border-color: var(--facility-gallery-line);
}

.smp-facility-gallery .smp-album-return {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  float: right;
  margin-top: 1rem;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  color: #fff;
  background: var(--facility-gallery-teal);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s;
}

.smp-facility-gallery .smp-album-return:hover {
  color: #fff;
  background: var(--facility-gallery-deep);
}

.smp-facility-gallery .smp-album-return:focus-visible {
  outline: 3px solid var(--facility-gallery-gold);
  outline-offset: 3px;
}

.smp-facility-slider {
  --facility-gallery-ink: #0e2e31;
  --facility-gallery-line: #dce6e8;
  --facility-gallery-gold: #e8b84a;
}

.smp-facility-slider .mfp-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 4.5rem;
}

.smp-facility-slider .mfp-content {
  width: auto;
  max-width: 100%;
}

.smp-facility-slider .mfp-figure {
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--facility-gallery-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(0 0 0 / 38%);
}

.smp-facility-slider .mfp-figure::after {
  display: none;
}

.smp-facility-slider img.mfp-img {
  display: block;
  width: auto;
  max-width: min(calc(100vw - 9rem), 1200px);
  height: auto;
  max-height: calc(100vh - 150px) !important;
  padding: 0;
  object-fit: contain;
  animation: smp-facility-slide-fade 260ms ease-out both;
}

.smp-facility-slider .mfp-bottom-bar {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 0;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--facility-gallery-line);
  color: var(--facility-gallery-ink);
  background: #fff !important;
}

.smp-facility-slider .mfp-figure .mfp-bottom-bar .mfp-title {
  position: static;
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  transform: none;
  color: var(--facility-gallery-ink) !important;
  background: transparent !important;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  opacity: 1 !important;
  text-align: center;
}

.smp-facility-slider .mfp-title::before,
.smp-facility-slider .mfp-title::after {
  display: none;
}

.smp-facility-slider .mfp-arrow {
  position: absolute;
  top: 50%;
  width: 52px;
  height: 72px;
  z-index: 1047;
  margin-top: 0 !important;
  opacity: 0.9;
  transform: translateY(-50%);
}

.smp-facility-slider .mfp-arrow-left {
  left: 2rem;
}

.smp-facility-slider .mfp-arrow-right {
  right: 2rem;
}

.smp-facility-slider .mfp-arrow:hover {
  opacity: 1;
}

@keyframes smp-facility-slide-fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@media (max-width: 767.98px) {
  .smp-facility-gallery {
    padding-top: 0.5rem;
  }

  .smp-facility-gallery .smp-album-photo-heading {
    gap: 0.8rem;
    padding: 0.85rem;
    border-radius: 15px;
  }

  .smp-facility-gallery .smp-album-photo-icon {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 14px;
    font-size: 1rem;
  }

  .smp-facility-gallery .smp-album-photo-title {
    font-size: clamp(1.1rem, 4.5vw, 1.3rem);
  }

  .smp-facility-gallery .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem;
    column-gap: 0.85rem;
  }

  .smp-facility-gallery .gallery .smp-facility-card {
    border-radius: 12px;
  }

  .smp-facility-gallery .gallery .smp-facility-card figcaption {
    padding: 0.7rem 0.75rem;
    font-size: 0.8rem;
  }

  .smp-facility-slider .mfp-container {
    padding: 1.5rem 3rem;
  }

  .smp-facility-slider img.mfp-img {
    max-width: calc(100vw - 6rem);
    max-height: calc(100vh - 120px) !important;
  }

  .smp-facility-slider .mfp-arrow {
    width: 40px;
  }

  .smp-facility-slider .mfp-arrow-left {
    left: 1rem;
  }

  .smp-facility-slider .mfp-arrow-right {
    right: 1rem;
  }
}

@media (max-width: 420px) {
  .smp-facility-gallery .gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .smp-facility-gallery .smp-facility-card,
  .smp-facility-gallery .smp-facility-card img {
    transition: none;
  }

  .smp-facility-gallery .smp-facility-gallery-link:hover .smp-facility-card,
  .smp-facility-gallery .smp-facility-gallery-link:focus-visible .smp-facility-card {
    transform: none;
  }

  .smp-facility-gallery .smp-facility-gallery-link:hover img,
  .smp-facility-gallery .smp-facility-gallery-link:focus-visible img {
    transform: none;
  }

  .smp-facility-gallery .smp-album-return {
    transition: none;
  }

  .smp-facility-slider img.mfp-img {
    animation: none;
  }
}
