.gallery-story-page {
  background: rgb(242, 240, 235);
  color: rgb(23, 49, 72);
}

html.gallery-lightbox-page-locked {
  overflow: hidden !important;
  overscroll-behavior: none;
}

body.gallery-lightbox-page-locked {
  position: fixed;
  inset: var(--gallery-lightbox-scroll-y, 0) 0 auto;
  width: 100%;
  height: 100%;
  overflow: hidden !important;
  overscroll-behavior: none;
}

.gallery-lightbox {
  position: relative;
  width: min(1180px, calc(100% - 28px));
  max-width: none;
  height: min(92dvh, 900px);
  max-height: 92dvh;
  margin: auto;
  padding: 20px 76px 42px;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(10, 21, 29, 0.96);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  overscroll-behavior: contain;
}

.gallery-lightbox::backdrop {
  background: rgba(3, 12, 18, 0.82);
  backdrop-filter: blur(7px);
}

.gallery-lightbox form {
  z-index: 5;
  right: 14px;
  top: 12px;
}

.gallery-lightbox__stage {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 12px;
}

.gallery-lightbox .gallery-lightbox__stage img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-height: 0;
  border-radius: 10px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-lightbox__counter {
  color: rgba(255, 255, 255, 0.9);
  font: 500 15px/1.2 "Aboreto", sans-serif;
  letter-spacing: 0.08em;
}

.gallery-lightbox__nav {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 50px;
  height: 64px;
  padding: 0 0 5px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font: 300 46px/1 Arial, sans-serif;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-lightbox__nav:hover,
.gallery-lightbox__nav:focus-visible {
  background: rgb(35, 137, 201);
  transform: translateY(-50%) scale(1.06);
}

.gallery-lightbox__prev { left: 14px; }
.gallery-lightbox__next { right: 14px; }

/* A natív fókuszkeret egyes böngészőkben egymásba csúszó téglalapként
   rajzolódott ki a galéria bezárógombja mögött. */
.gallery-story-page ~ .legacy-site-footer + .lightbox form button,
.lightbox form button {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  outline: 0;
  background: #fff;
  color: rgb(35, 137, 201);
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.2);
  -webkit-tap-highlight-color: transparent;
}

.lightbox form button:focus,
.lightbox form button:active {
  outline: 0;
}

.lightbox form button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 0 0 6px rgba(35, 137, 201, 0.62);
}

.gallery-story-hero {
  min-height: 720px;
}

.gallery-story-hero .lake-story-hero__media {
  object-position: center 52%;
}

.gallery-story-hero__shade {
  background:
    linear-gradient(180deg, rgba(16, 34, 48, 0.24), rgba(16, 34, 48, 0.82)),
    linear-gradient(90deg, rgba(16, 34, 48, 0.35), transparent 78%);
}

.gallery-story-hero__content {
  max-width: 1040px;
}

.gallery-story-hero__content > p:last-child {
  max-width: 1000px;
  font-size: 17px;
  font-style: normal;
  line-height: 1.75;
}

.gallery-collections {
  padding: 92px 0 105px;
  background: rgb(242, 240, 235);
}

.gallery-collection {
  padding: 0 0 76px;
  margin: 0 0 76px;
  border-bottom: 1px solid rgba(23, 49, 72, 0.2);
}

.gallery-collection:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: 0;
}

.gallery-collection h2 {
  margin: 0 0 34px;
  color: rgb(23, 49, 72);
  font: 400 clamp(27px, 3.4vw, 44px)/1.15 "Aboreto", sans-serif;
  letter-spacing: 0.045em;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.gallery-collection__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gallery-photo {
  min-width: 0;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #d7d4ce;
  cursor: zoom-in;
  box-shadow: 0 7px 22px rgba(23, 49, 72, 0.12);
}

.gallery-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s ease, filter 0.42s ease;
}

.gallery-photo:hover img,
.gallery-photo:focus-visible img {
  transform: scale(1.045);
  filter: saturate(1.08);
}

.gallery-collection:not(.is-expanded) .gallery-photo:nth-child(n + 9) {
  display: none;
}

.gallery-more {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 230px;
  min-height: 48px;
  margin: 34px auto 0;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: rgb(35, 137, 201);
  color: #fff;
  cursor: pointer;
  font: 500 14px/1 "Aboreto", sans-serif;
  letter-spacing: 0.04em;
  transition: transform 0.25s ease, background 0.25s ease;
}

.gallery-more:hover,
.gallery-more:focus-visible {
  transform: translateY(-2px);
  background: rgb(0, 97, 153);
}

@media (max-width: 850px) {
  .gallery-story-hero {
    min-height: 650px;
  }
  .gallery-collection__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery-lightbox {
    width: calc(100% - 12px);
    height: 94dvh;
    max-height: 94dvh;
    padding: 56px 10px 18px;
    border-radius: 14px;
  }
  .gallery-lightbox form { right: 9px; top: 7px; }
  .gallery-lightbox__stage { gap: 8px; }
  .gallery-lightbox__nav {
    top: auto;
    bottom: 10px;
    width: 48px;
    height: 48px;
    padding-bottom: 4px;
    background: rgba(35, 137, 201, 0.78);
    font-size: 38px;
    transform: none;
  }
  .gallery-lightbox__nav:hover,
  .gallery-lightbox__nav:focus-visible { transform: scale(1.04); }
  .gallery-lightbox__prev { left: 10px; }
  .gallery-lightbox__next { right: 10px; }
  .gallery-lightbox__counter { padding-bottom: 9px; font-size: 17px; }
  .gallery-story-hero {
    min-height: 690px;
  }
  .gallery-story-hero__content {
    padding: 92px 0 64px;
  }
  .gallery-story-hero__content > p:last-child {
    font-size: 16px;
    line-height: 1.68;
  }
  .gallery-story-hero__content br {
    display: none;
  }
  .gallery-collections {
    padding: 68px 0 78px;
  }
  .gallery-collection {
    padding-bottom: 58px;
    margin-bottom: 58px;
  }
  .gallery-collection h2 {
    margin-bottom: 25px;
    font-size: clamp(25px, 7.5vw, 32px);
    line-height: 1.25;
  }
  .gallery-collection__grid {
    gap: 9px;
  }
  .gallery-collection:not(.is-expanded) .gallery-photo:nth-child(n + 5) {
    display: none;
  }
  .gallery-more {
    width: min(100%, 280px);
    margin-top: 26px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-photo img,
  .gallery-more {
    transition: none;
  }
}
