/* ==============================
   PHOTO GALLERY PAGE
   TrailWatch UK
============================== */

.gallery-hero__content {
  max-width: 880px;
}

.gallery-section-label {
  margin: 0 0 16px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

/* Main gallery */

.gallery-page {
  padding: 104px 0;
  overflow-x: clip;
  background:
    radial-gradient(circle at 88% 6%, rgba(143, 191, 77, 0.16), transparent 30%),
    linear-gradient(180deg, #f4f7f0 0%, #ffffff 100%);
}

.gallery-head {
  max-width: 920px;
  margin-bottom: 46px;
}

.gallery-head h2,
.gallery-info h2,
.gallery-cta h2 {
  margin: 0;
  color: #101410;
  font-size: clamp(42px, 5.8vw, 82px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.gallery-head p,
.gallery-info p,
.gallery-cta p {
  max-width: 760px;
  margin: 24px 0 0;
  color: #556052;
  font-size: 18px;
  line-height: 1.7;
}

.gallery-collage {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 230px;
  gap: 18px;
}

.gallery-item {
  position: relative;
  min-width: 0;
  width: 100%;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(11, 61, 44, 0.14);
  border-radius: 28px;
  background: #06140f;
  box-shadow: 0 18px 44px rgba(6, 20, 15, 0.08);
  cursor: zoom-in;
  appearance: none;
}

.gallery-item--large {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item--wide {
  grid-column: span 2;
}

.gallery-item--tall {
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition:
    transform 0.45s ease,
    filter 0.45s ease;
}

.gallery-item::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, transparent 38%, rgba(2, 5, 4, 0.78) 100%),
    radial-gradient(circle at 80% 18%, rgba(199, 229, 109, 0.16), transparent 32%);
  opacity: 0.86;
  transition: opacity 0.3s ease;
}

.gallery-item span {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: calc(100% - 36px);
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  color: #07140f;
  background: linear-gradient(135deg, #c7e56d, #8fbf4d);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.gallery-item:hover img,
.gallery-item:focus-visible img {
  transform: scale(1.08);
  filter: saturate(1.08) contrast(1.05);
}

.gallery-item:hover::before,
.gallery-item:focus-visible::before {
  opacity: 0.62;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--accent-strong);
  outline-offset: 4px;
}

/* Info block */

.gallery-info {
  padding: 104px 0;
  overflow-x: clip;
  background: #06140f;
}

.gallery-info__box {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 46px;
  align-items: start;
  padding: 44px;
  border: 1px solid rgba(199, 229, 109, 0.18);
  border-radius: 36px;
  color: #ffffff;
  background:
    radial-gradient(circle at 90% 12%, rgba(199, 229, 109, 0.22), transparent 30%),
    linear-gradient(135deg, #06140f 0%, #0b3d2c 100%);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.24);
}

.gallery-info .gallery-section-label {
  color: var(--accent-strong);
}

.gallery-info h2 {
  color: #ffffff;
}

.gallery-info p {
  color: rgba(255, 255, 255, 0.74);
}

.gallery-info__cards {
  display: grid;
  gap: 16px;
}

.gallery-info__cards article {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.07);
}

.gallery-info__cards strong {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #07140f;
  background: var(--accent-strong);
  font-size: 15px;
  font-weight: 900;
}

.gallery-info__cards h3 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 21px;
  letter-spacing: -0.03em;
}

.gallery-info__cards p {
  margin: 0;
  color: rgba(255, 255, 255, 0.70);
  font-size: 16px;
  line-height: 1.55;
}

/* CTA */

.gallery-cta {
  padding: 104px 0;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(143, 191, 77, 0.16), transparent 28%),
    #f4f7f0;
}

.gallery-cta__inner {
  max-width: 920px;
}

.gallery-cta .gallery-section-label {
  color: var(--primary);
}

.gallery-cta p {
  margin-left: auto;
  margin-right: auto;
}

.gallery-cta__actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

/* Lightbox */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 34px;
  background: rgba(2, 5, 4, 0.86);
  backdrop-filter: blur(16px);
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox__figure {
  position: relative;
  width: min(100%, 1120px);
  margin: 0;
  border-radius: 30px;
  overflow: hidden;
  background: #020504;
  box-shadow: 0 34px 100px rgba(0, 0, 0, 0.44);
}

.gallery-lightbox__figure img {
  width: 100%;
  max-height: calc(100svh - 160px);
  object-fit: contain;
  background: #020504;
}

.gallery-lightbox__figure figcaption {
  padding: 18px 22px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(6, 20, 15, 0.92);
  font-size: 16px;
  font-weight: 800;
}

.gallery-lightbox__close {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 205;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(199, 229, 109, 0.28);
  border-radius: 50%;
  color: #ffffff;
  background:
    radial-gradient(circle at 30% 18%, rgba(199, 229, 109, 0.28), transparent 30%),
    #06140f;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.gallery-lightbox__nav {
  position: fixed;
  top: 50%;
  z-index: 205;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(199, 229, 109, 0.28);
  border-radius: 50%;
  background: linear-gradient(135deg, #c7e56d, #8fbf4d);
  box-shadow: 0 18px 44px rgba(2, 5, 4, 0.28);
  transform: translateY(-50%);
  cursor: pointer;
}

.gallery-lightbox__nav img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.gallery-lightbox__nav--prev {
  left: 24px;
}

.gallery-lightbox__nav--next {
  right: 24px;
}

/* Responsive */

@media (max-width: 1120px) {
  .gallery-collage {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-info__box {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .gallery-collage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 210px;
  }

  .gallery-item--large,
  .gallery-item--wide,
  .gallery-item--tall {
    grid-column: span 1;
    grid-row: span 1;
  }

  .gallery-lightbox {
    padding: 18px;
  }

  .gallery-lightbox__figure {
    border-radius: 22px;
  }

  .gallery-lightbox__nav {
    top: auto;
    bottom: 18px;
    transform: none;
  }

  .gallery-lightbox__nav--prev {
    left: 18px;
  }

  .gallery-lightbox__nav--next {
    right: 18px;
  }
}

@media (max-width: 640px) {
  .gallery-page,
  .gallery-info,
  .gallery-cta {
    padding: 72px 0;
  }

  .gallery-head h2,
  .gallery-info h2,
  .gallery-cta h2 {
    font-size: clamp(38px, 12vw, 58px);
    letter-spacing: -0.055em;
  }

  .gallery-collage {
    grid-template-columns: 1fr;
    grid-auto-rows: 260px;
    gap: 14px;
  }

  .gallery-info__box {
    padding: 28px;
    border-radius: 28px;
  }

  .gallery-info__cards article {
    grid-template-columns: 1fr;
  }

  .gallery-cta__actions {
    display: grid;
  }

  .gallery-cta__actions .home-btn {
    width: 100%;
  }

  .gallery-lightbox__close {
    top: 14px;
    right: 14px;
    width: 48px;
    height: 48px;
  }

  .gallery-lightbox__figure img {
    max-height: calc(100svh - 180px);
  }
}

@media (max-width: 420px) {
  .gallery-head p,
  .gallery-info p,
  .gallery-cta p {
    font-size: 16px;
  }

  .gallery-item span {
    left: 14px;
    right: 14px;
    bottom: 14px;
    max-width: calc(100% - 28px);
    white-space: normal;
  }
}