/* =========================
   GALLERY PAGE
========================= */

.gallery-page {
  background: #ffffff;
  color: var(--secondary-900);
}

/* =========================
   HERO
========================= */

.gallery-hero {
  padding: calc(var(--navbar-height) + 4rem) 0 clamp(2.5rem, 5vw, 4rem);
  background: #ffffff;
}

.gallery-hero__container,
.gallery-section__container {
  width: min(100% - (var(--page-padding) * 2), var(--container-width-lg));
  margin: 0 auto;
}

.gallery-hero__container {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(340px, 0.52fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.gallery-hero__content {
  min-width: 0;
}

.gallery-hero__title {
  max-width: 850px;
  margin: 0;
  color: var(--secondary-900);
  font-family: var(--font-heading);
  font-size: clamp(2.7rem, 5.4vw, 5.1rem);
  line-height: 0.98;
  letter-spacing: -0.065em;
  text-wrap: balance;
}

.gallery-hero__text {
  max-width: 760px;
  margin: 1.25rem 0 0;
  color: var(--color-text-soft);
  font-size: clamp(1rem, 1.2vw, 1.1rem);
  line-height: 1.8;
  font-weight: 550;
}

.gallery-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.8rem;
}

.gallery-hero__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 52px;
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.94rem;
  font-weight: 850;
  transition:
    transform var(--transition-fast),
    background var(--transition-normal),
    border-color var(--transition-normal),
    box-shadow var(--transition-normal);
}

.gallery-hero__btn svg {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}

.gallery-hero__btn--primary {
  background: var(--primary-700);
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

.gallery-hero__btn--primary:hover {
  background: var(--primary-800);
  transform: translateY(-2px);
}

.gallery-hero__btn--secondary {
  border: 1px solid var(--stone-200);
  background: #ffffff;
  color: var(--secondary-900);
  box-shadow: var(--shadow-xs);
}

.gallery-hero__btn--secondary:hover {
  background: var(--stone-50);
  border-color: var(--stone-300);
  transform: translateY(-2px);
}

/* =========================
   HERO CARDS
========================= */

.gallery-hero__panel {
  display: grid;
  gap: 1rem;
}

.gallery-hero__card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1.15rem;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-3xl);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.gallery-hero__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: var(--primary-50);
  color: var(--primary-700);
  line-height: 0;
}

.gallery-hero__icon svg {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  stroke-width: 2.35;
}

.gallery-hero__card > div > span {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-hero__card strong {
  display: block;
  color: var(--secondary-900);
  font-size: 1rem;
  line-height: 1.45;
  font-weight: 850;
}

/* =========================
   GALLERY SECTION
========================= */

.gallery-section {
  padding: 0 0 var(--section-padding);
  background: #ffffff;
}

.gallery-section__header {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.45fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: end;
  margin-bottom: 1.5rem;
}

.gallery-section__title {
  max-width: 760px;
  margin: 0;
  color: var(--secondary-900);
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
  text-wrap: balance;
}

.gallery-section__header p {
  margin: 0;
  color: var(--color-text-soft);
  font-size: 1rem;
  line-height: 1.75;
  font-weight: 550;
}

/* =========================
   GRID
========================= */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 250px;
  gap: 1rem;
}

.gallery-card {
  position: relative;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-3xl);
  background: var(--stone-100);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  isolation: isolate;
  transition:
    transform var(--transition-normal),
    box-shadow var(--transition-normal),
    opacity var(--transition-normal);
}

.gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.gallery-card--large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-card--wide {
  grid-column: span 2;
}

.gallery-card--tall {
  grid-row: span 2;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.7s ease,
    filter var(--transition-normal);
}

.gallery-card:hover img {
  transform: scale(1.06);
  filter: saturate(1.04) contrast(1.04);
}

.gallery-card__overlay {
  position: absolute;
  inset: auto 1rem 1rem 1rem;
  z-index: 2;
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  border-radius: var(--radius-2xl);
  background: rgba(6, 17, 32, 0.72);
  color: #ffffff;
  text-align: left;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.gallery-card__overlay small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-card__overlay strong {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

/* =========================
   CTA
========================= */

.gallery-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 1.25rem;
  padding: 1.25rem;
  border: 1px solid var(--stone-200);
  border-radius: var(--radius-3xl);
  background: var(--secondary-900);
  color: #ffffff;
  box-shadow: var(--shadow-secondary);
}

.gallery-cta span {
  display: block;
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.84rem;
  font-weight: 750;
}

.gallery-cta strong {
  display: block;
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.2;
}

.gallery-cta__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-full);
  background: var(--primary-700);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 850;
  transition:
    background var(--transition-normal),
    transform var(--transition-fast);
}

.gallery-cta__btn:hover {
  background: var(--primary-800);
  transform: translateY(-2px);
}

.gallery-cta__btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* =========================
   LIGHTBOX
========================= */

.gallery-page-lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 3vw, 2rem);
  background: rgba(4, 12, 24, 0.94);
}

.gallery-page-lightbox.is-open {
  display: grid;
}

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

.gallery-page-lightbox__content {
  width: min(100%, 980px);
  max-height: calc(100dvh - 4rem);
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.85rem;
  color: #ffffff;
}

.gallery-page-lightbox__top {
  display: grid;
  gap: 0.25rem;
  text-align: center;
}

.gallery-page-lightbox__top span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  font-weight: 850;
}

.gallery-page-lightbox__top strong {
  color: #ffffff;
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.gallery-page-lightbox__image {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(72dvh, 760px);
  object-fit: contain;
  justify-self: center;
  border-radius: var(--radius-2xl);
  background: rgba(255, 255, 255, 0.06);
}

.gallery-page-lightbox figcaption {
  max-width: 760px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
  font-weight: 550;
}

.gallery-page-lightbox__close,
.gallery-page-lightbox__arrow {
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
  cursor: pointer;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition:
    background var(--transition-normal),
    transform var(--transition-fast);
}

.gallery-page-lightbox__close:hover,
.gallery-page-lightbox__arrow:hover {
  background: var(--primary-700);
}

.gallery-page-lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 48px;
  height: 48px;
}

.gallery-page-lightbox__arrow {
  position: static;
  width: 52px;
  height: 52px;
}

.gallery-page-lightbox__close svg,
.gallery-page-lightbox__arrow svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.4;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1100px) {
  .gallery-hero__container {
    grid-template-columns: 1fr;
  }

  .gallery-hero__panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-section__header {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .gallery-hero {
    padding-top: calc(var(--navbar-height-mobile) + 3rem);
  }

  .gallery-hero__title {
    font-size: clamp(2.4rem, 11vw, 3.5rem);
  }

  .gallery-hero__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .gallery-hero__btn,
  .gallery-cta__btn {
    width: 100%;
  }

  .gallery-hero__panel {
    grid-template-columns: 1fr;
  }

  .gallery-hero__card {
    grid-template-columns: 48px minmax(0, 1fr);
    border-radius: var(--radius-2xl);
  }

  .gallery-hero__icon {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .gallery-hero__icon svg {
    width: 22px;
    height: 22px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }

  .gallery-card,
  .gallery-card--large,
  .gallery-card--wide,
  .gallery-card--tall {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }

  .gallery-card__overlay {
    inset: auto 0.85rem 0.85rem 0.85rem;
    padding: 0.9rem;
    border-radius: var(--radius-xl);
  }

  .gallery-cta {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-2xl);
  }

  .gallery-page-lightbox {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
    gap: 0.85rem;
    padding: 4.75rem 1rem 1rem;
    overflow-y: auto;
  }

  .gallery-page-lightbox__content {
    width: 100%;
    max-height: none;
    gap: 0.75rem;
  }

  .gallery-page-lightbox__top {
    text-align: left;
  }

  .gallery-page-lightbox__top strong {
    font-size: 1.45rem;
  }

  .gallery-page-lightbox__image {
    width: 100%;
    max-height: 58dvh;
    border-radius: var(--radius-xl);
  }

  .gallery-page-lightbox figcaption {
    text-align: left;
    font-size: 0.9rem;
  }

  .gallery-page-lightbox__close {
    top: 1rem;
    right: 1rem;
    width: 46px;
    height: 46px;
  }

  .gallery-page-lightbox__arrow {
    position: fixed;
    top: auto;
    bottom: 1rem;
    width: 46px;
    height: 46px;
  }

  .gallery-page-lightbox__arrow--prev {
    left: 1rem;
  }

  .gallery-page-lightbox__arrow--next {
    right: 1rem;
  }
}