.sm-gallery-page {
  --sm-gallery-navy: #172638;
  --sm-gallery-blue: #243b53;
  --sm-gallery-orange: #ef762f;
  --sm-gallery-silver: #c7cdd3;
  --sm-gallery-muted: #697586;
  width: 100%;
  overflow-x: clip;
  background: #ffffff;
  color: var(--sm-gallery-navy);
  font-family: "DM Sans", sans-serif;
}

.sm-gallery-page img {
  display: block;
  max-width: 100%;
}

/* HERO SECTION */

.sm-gallery-hero {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 75px 22px;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(14, 28, 43, 0.94), rgba(23, 38, 56, 0.79)),
    url("assets/images/gallery/gallery-banner.webp") center/cover no-repeat;
}

.sm-gallery-hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -180px;
  border: 1px solid rgba(239, 118, 47, 0.28);
  border-radius: 50%;
  box-shadow:
    0 0 0 45px rgba(239, 118, 47, 0.035),
    0 0 0 90px rgba(239, 118, 47, 0.025);
}

.sm-gallery-hero-content {
  width: 100%;
  max-width: 1150px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.sm-gallery-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #ff9a62;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 19px;
}

.sm-gallery-eyebrow::before,
.sm-gallery-eyebrow::after {
  content: "";
  width: 27px;
  height: 1px;
  background: var(--sm-gallery-orange);
}

.sm-gallery-hero h1 {
  color: #ffffff;
  font-family: "Outfit", sans-serif;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -1.8px;
  margin: 0 0 19px;
}

.sm-gallery-hero h1 span {
  color: var(--sm-gallery-orange);
}

.sm-gallery-hero p {
  max-width: 650px;
  margin: 0 auto;
  color: #d1d9e2;
  font-size: 15px;
  line-height: 1.85;
}

.sm-gallery-hero-line {
  width: 62px;
  height: 3px;
  margin: 28px auto 0;
  border-radius: 10px;
  background: var(--sm-gallery-orange);
}

/* GALLERY SECTION */

.sm-gallery-main {
  padding: 85px 22px 100px;
  background: #f5f7f9;
}

.sm-gallery-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
}

.sm-gallery-heading {
  text-align: center;
  margin-bottom: 42px;
}

.sm-gallery-heading h2 {
  font-family: "Outfit", sans-serif;
  font-size: clamp(27px, 3.5vw, 39px);
  line-height: 1.2;
  color: var(--sm-gallery-navy);
  margin: 0 0 12px;
  font-weight: 700;
}

.sm-gallery-heading p {
  margin: 0;
  color: var(--sm-gallery-muted);
  font-size: 14px;
  line-height: 1.7;
}

.sm-gallery-heading-line {
  display: block;
  width: 48px;
  height: 3px;
  border-radius: 5px;
  background: var(--sm-gallery-orange);
  margin: 18px auto 0;
}

/* FOUR COLUMN IMAGE GRID */

.sm-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 25px;
}

.sm-gallery-card {
  min-width: 0;
  background: #ffffff;
  border: 1px solid #e7ebef;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 5px 20px rgba(23, 38, 56, 0.045);
  transition:
    transform 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.sm-gallery-card:hover {
  transform: translateY(-7px);
  border-color: rgba(239, 118, 47, 0.5);
  box-shadow: 0 17px 35px rgba(23, 38, 56, 0.12);
}

.sm-gallery-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #ffffff;
}

.sm-gallery-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.55s ease;
}

.sm-gallery-card:hover .sm-gallery-image-wrap img {
  transform: scale(1.055);
}

.sm-gallery-image-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(17, 32, 48, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sm-gallery-card:hover .sm-gallery-image-overlay {
  opacity: 1;
}

.sm-gallery-zoom-icon {
  width: 49px;
  height: 49px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--sm-gallery-orange);
  color: #ffffff;
  font-size: 21px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  transform: scale(0.8);
  transition: transform 0.3s ease;
}

.sm-gallery-card:hover .sm-gallery-zoom-icon {
  transform: scale(1);
}

.sm-gallery-card-name {
  padding: 17px 12px;
  text-align: center;
  color: var(--sm-gallery-navy);
  font-family: "Outfit", sans-serif;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 600;
  background: #ffffff;
}

/* FULL SCREEN IMAGE VIEWER */

.sm-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 55px 25px;
  background: rgba(8, 17, 28, 0.96);
  backdrop-filter: blur(9px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.sm-gallery-lightbox.sm-gallery-open {
  opacity: 1;
  visibility: visible;
}

.sm-gallery-lightbox-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.94);
  transition: transform 0.35s ease;
}

.sm-gallery-lightbox.sm-gallery-open .sm-gallery-lightbox-content {
  transform: scale(1);
}

.sm-gallery-lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 5px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.4);
}

/* CLOSE BUTTON */

.sm-gallery-close {
  position: absolute;
  top: 22px;
  right: 25px;
  z-index: 2;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: Arial, sans-serif;
  font-size: 33px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition:
    background 0.3s ease,
    border-color 0.3s ease,
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.sm-gallery-close:hover {
  background: var(--sm-gallery-orange);
  border-color: var(--sm-gallery-orange);
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 0 25px rgba(239, 118, 47, 0.4);
}

.sm-gallery-close:focus-visible {
  outline: 3px solid #ffffff;
  outline-offset: 4px;
}

/* TABLET */

@media (max-width: 1050px) {
  .sm-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .sm-gallery-main {
    padding: 70px 22px 80px;
  }
}

/* MOBILE */

@media (max-width: 600px) {
  .sm-gallery-hero {
    min-height: 310px;
    padding: 65px 18px;
  }

  .sm-gallery-hero h1 {
    font-size: 39px;
    letter-spacing: -1px;
  }

  .sm-gallery-hero p {
    font-size: 13px;
    line-height: 1.8;
  }

  .sm-gallery-eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
  }

  .sm-gallery-main {
    padding: 55px 16px 65px;
  }

  .sm-gallery-heading {
    margin-bottom: 27px;
  }

  .sm-gallery-heading h2 {
    font-size: 28px;
  }

  .sm-gallery-heading p {
    font-size: 13px;
  }

  .sm-gallery-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .sm-gallery-card-name {
    padding: 15px 10px;
    font-size: 17px;
  }

  .sm-gallery-lightbox {
    padding: 65px 12px 20px;
  }

  .sm-gallery-close {
    width: 45px;
    height: 45px;
    top: 12px;
    right: 12px;
    font-size: 29px;
  }

  .sm-gallery-lightbox-image {
    max-width: 100%;
    max-height: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sm-gallery-page *,
  .sm-gallery-lightbox,
  .sm-gallery-lightbox-content {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
