/* =========================================================
   S & I DENTAL CLINIC — GALLERY PAGE
   gallery-page.css → styling for the standalone Gallery page
   (gallery.html) only.

   NOTE: This file is intentionally separate from css/gallery.css,
   which powers the locked homepage gallery preview section and
   its shared lightbox. Nothing here touches those selectors.
   ========================================================= */

/* =========================================================
   1. GALLERY INTRODUCTION
   ========================================================= */
.si-gallery-page__intro {
  padding-top: calc(var(--header-height) + 2rem);
  padding-bottom: 0;
}

.si-gallery-page__intro .section-header {
  margin-bottom: 0;
}

.si-gallery-page__intro .eyebrow {
  margin-top: 0.5rem;
  font-size: 1rem;
}

.si-gallery-page__intro h1 {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: clamp(2rem, 3.2vw, 3rem);
}

/* =========================================================
   2. GALLERY GRID SECTION
   ========================================================= */
.si-gallery-page__gallery {
  padding-top: var(--space-xl);
}

/* =========================================================
   GALLERY GRID
   ========================================================= */
.si-gallery-page__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

/* =========================================================
   GALLERY ITEM
   ========================================================= */
.si-gallery-page__item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  background: var(--color-cream);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.si-gallery-page__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.65s cubic-bezier(0.2, 0.65, 0.25, 1);
}

.si-gallery-page__item:hover, .si-gallery-page__item:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.si-gallery-page__item:hover img, .si-gallery-page__item:focus-visible img {
  transform: scale(1.045);
}

.si-gallery-page__item:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

/* =========================================================
   REDUCED MOTION
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  .si-gallery-page__item, .si-gallery-page__item img {
    transition: none;
  }

  .si-gallery-page__item:hover, .si-gallery-page__item:focus-visible {
    transform: none;
  }

  .si-gallery-page__item:hover img, .si-gallery-page__item:focus-visible img {
    transform: none;
  }
}

/* =========================================================
   3. GALLERY LIGHTBOX
   ========================================================= */
.si-gallery-page-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(17, 35, 28, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.si-gallery-page-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.si-gallery-page-lightbox__content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(1100px, 100%);
  max-height: 90vh;
  transform: translateY(8px) scale(0.985);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.3s ease;
}

.si-gallery-page-lightbox.is-open .si-gallery-page-lightbox__content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.si-gallery-page-lightbox__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  background: var(--color-cream);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.30);
}

.si-gallery-page-lightbox__close {
  position: absolute;
  top: -0.75rem;
  right: -0.75rem;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(247, 243, 234, 0.22);
  border-radius: 50%;
  background: rgba(23, 60, 46, 0.94);
  color: var(--color-warm-white);
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.si-gallery-page-lightbox__close:hover {
  background-color: var(--color-forest);
  border-color: rgba(var(--rgb-gold), 0.45);
  transform: rotate(4deg) scale(1.04);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.24);
}

.si-gallery-page-lightbox__close:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

.si-gallery-page-lightbox__close svg {
  width: 18px;
  height: 18px;
}

@media (prefers-reduced-motion: reduce) {
  .si-gallery-page-lightbox,
  .si-gallery-page-lightbox__content,
  .si-gallery-page-lightbox__close {
    transition: none;
  }
}

/* =========================================================
   4. FINAL CTA SECTION
   ========================================================= */
.si-gallery-page__cta .section-header {
  margin-top: -3rem;
  margin-bottom: var(--space-lg);
}

.si-gallery-page__cta-actions {
  justify-content: center;
}

.section-header h2 {
  color: var(--color-gold);
}

/* =========================================================
   TABLET
   ========================================================= */
@media (max-width: 900px) {
  .si-gallery-page__intro {
    padding-top: calc(var(--header-height) + 1.5rem);
  }

  .si-gallery-page__gallery {
    padding-top: var(--space-lg);
  }

  .si-gallery-page__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
  }

  .si-gallery-page-lightbox__content {
    max-height: 88vh;
  }
}

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 575px) {
  .si-gallery-page__intro {
    padding-top: calc(var(--header-height) + 1.25rem);
  }

  .si-gallery-page__intro .eyebrow {
    font-size: 1rem;
  }

  .si-gallery-page__intro h1 {
    white-space: nowrap;
    font-size: clamp(1.15rem, 4.8vw, 1.75rem);
    letter-spacing: -0.025em;
  }

  .si-gallery-page__gallery {
    padding-top: var(--space-md);
  }

  .si-gallery-page__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .si-gallery-page__item {
    border-radius: 14px;
  }

  .si-gallery-page__item:hover, .si-gallery-page__item:focus-visible {
    transform: translateY(-2px);
  }

  .si-gallery-page-lightbox {
    padding: 0.75rem;
  }

  .si-gallery-page-lightbox__content {
    width: 100%;
    max-height: 88vh;
  }

  .si-gallery-page-lightbox__image {
    max-width: 100%;
    max-height: 84vh;
    border-radius: 14px;
  }

  .si-gallery-page-lightbox__close {
    top: -0.5rem;
    right: -0.25rem;
    width: 36px;
    height: 36px;
  }

  .si-gallery-page-lightbox__close svg {
    width: 16px;
    height: 16px;
  }

  .si-gallery-page__cta-actions {
    width: 100%;
  }
}

/* =========================================================
   VERY SMALL MOBILE
   ========================================================= */
@media (max-width: 380px) {
  .si-gallery-page__grid {
    gap: 0.5rem;
  }

  .si-gallery-page__item {
    border-radius: 12px;
  }

  .si-gallery-page-lightbox {
    padding: 0.5rem;
  }

  .si-gallery-page-lightbox__image {
    max-height: 82vh;
    border-radius: 12px;
  }

  .si-gallery-page-lightbox__close {
    top: -0.35rem;
    right: 0;
    width: 34px;
    height: 34px;
  }
}

/* =========================================================
   5. CTA / FOOTER SEPARATOR
   ========================================================= */
.si-gallery-page__footer-separator {
  width: 100%;
  height: 2px;
  background-color: var(--color-gold);
}

/* =========================================================
   FOOTER
   ========================================================= */
.si-footer {
  background-color: var(--color-forest);
  color: rgba(247, 243, 234, 0.8);
  padding-top: var(--space-xl);
}

.si-footer__grid {
  display: grid;
  grid-template-columns: 1.3fr 0.8fr 1fr 1fr;
  gap: var(--space-xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid rgba(247, 243, 234, 0.12);
}

.si-footer__brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: var(--space-sm);
}

.si-footer__brand img {
  height: 42px;
  width: auto;
}

.si-footer__brand span {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-warm-white);
}

.si-footer p {
  color: rgba(247, 243, 234, 0.7);
  font-size: 1.02rem;
}

.si-footer__tagline {
  margin-top: var(--space-sm);
  font-family: var(--font-display);
  font-style: italic;
  color: var(--color-soft-gold);
  font-size: 1.18rem;
}

.si-footer__social {
  display: flex;
  gap: 0.65rem;
  margin-top: var(--space-md);
}

.si-footer__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(247, 243, 234, 0.2);
  transition:
    background-color var(--transition-fast),
    border-color var(--transition-fast),
    transform var(--transition-fast);
}

.si-footer__social a svg {
  width: 18px;
  height: 18px;
  color: var(--color-warm-white);
}

.si-footer__social a:hover {
  background-color: var(--color-gold);
  border-color: var(--color-gold);
  transform: translateY(-3px);
}

.si-footer h4 {
  color: var(--color-warm-white);
  font-size: 1.1rem;
  font-family: var(--font-body);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: var(--space-md);
}

.si-footer__links {
  display: grid;
  gap: 0.8rem;
  font-size: 1.02rem;
}

.si-footer__links a:hover {
  color: var(--color-soft-gold);
}

.si-footer__contact {
  display: grid;
  gap: 0.9rem;
}

.si-footer__contact li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  font-size: 1.02rem;
}

.si-footer__contact li svg {
  width: 18px;
  height: 18px;
  color: var(--color-soft-gold);
  flex-shrink: 0;
  margin-top: 0.2em;
}

.si-footer__contact a:hover {
  color: var(--color-soft-gold);
}

.si-footer__hours-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1rem;
  padding-block: 0.4rem;
}

.si-footer__hours-row span:first-child {
  color: rgba(247, 243, 243, 0.6);
}

.si-footer__hours-row span:last-child {
  color: var(--color-warm-white);
  font-weight: 600;
}

.si-footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: var(--space-md);
  font-size: 0.9rem;
  color: rgba(247, 243, 243, 0.55);
}

/* =========================================================
   FOOTER — TABLET (≤ 900px)
   ========================================================= */
@media (max-width: 900px) {
  .si-footer__grid {
    grid-template-columns: 1fr 1fr;
    row-gap: var(--space-xl);
  }

  .si-footer__grid > div:first-child {
    grid-column: 1 / -1;
  }
}

/* =========================================================
   FOOTER — MOBILE (≤ 575px)
   ========================================================= */
@media (max-width: 575px) {
  .si-footer {
    padding-top: var(--space-lg);
    text-align: center;
  }

  .si-footer__grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .si-footer__grid > div:first-child {
    grid-column: 1;
  }

  .si-footer__brand {
    justify-content: center;
  }

  .si-footer__social {
    justify-content: center;
    gap: 0.9rem;
  }

  /* Explore links laid out horizontally instead of stacked */
  .si-footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1.1rem;
  }

  .si-footer__contact {
    justify-items: center;
  }

  .si-footer__contact li {
    align-items: center;
    text-align: center;
  }

  .si-footer__contact li:first-child {
    flex-direction: column;
    gap: 0.3rem;
  }

  .si-footer__hours-row {
    justify-content: center;
    gap: 0.5rem;
    padding-block: 0;
    margin-bottom: 0;
  }

  /* Kill the leftover space below the hours row before the divider */
  .si-footer__grid > div:last-child {
    margin-bottom: calc(var(--space-lg) * -1);
  }

  .si-footer__bottom {
    flex-direction: column;
    gap: 0.4rem;
    text-align: center;
  }
}
