/* ============================================
   SINGLE GALLERY PAGE — Full-Page Scroll Design
   Loaded only on singular gallery post type
   ============================================ */


body.single-gallery .main-header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: transparent !important;
}

body.single-gallery .main-header .main-nav a,
body.single-gallery .main-header .menutext {
  color: #fff !important;
}

body.single-gallery .main-header .main-nav a {
  font-family: "Lato", sans-serif;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: 1px !important;
  line-height: 1.2 !important;
  text-transform: uppercase;
}

@media only screen and (min-width: 64.063em) and (max-width: 90em) {
  body.single-gallery .main-header .main-nav a {
    font-size: 12px !important;
  }
}

@media only screen and (min-width: 90em) {
  body.single-gallery .main-header .main-nav a {
    font-size: clamp(12px, calc(6.86px + 0.357vw), 16px) !important;
  }
}

@media screen and (max-width: 640px) {
  body.single-gallery .mobile-nav li a {
    font-size: 12px;
    letter-spacing: normal;
    line-height: normal;
  }
}

body.single-gallery .hamburger .bar {
  background: #fff !important;
}

body.single-gallery .main-header .logo-container .main-logo img {
  height: auto;
}

@media screen and (max-width: 59.999em) {
  body.single-gallery .main-header .logo-container .main-logo img {
    width: 160px !important;
    max-width: 160px !important;
  }
}

body.single-gallery .main-header .main-nav,
body.single-gallery .main-header:not(.active) .main-nav,
body.single-gallery .main-header.active .main-nav {
  opacity: 0 !important;
  transition: opacity 0.4s ease !important;
  pointer-events: none;
}

body.single-gallery .main-header.active .main-nav {
  opacity: 1 !important;
  pointer-events: auto;
}

@media screen and (min-width: 641px) and (max-width: 59.999em) {
  body.single-gallery .main-header {
    padding: 0 63px !important;
  }

  body.single-gallery .main-header > .display-flex {
    flex-direction: column !important;
    justify-content: flex-start;
    align-items: center !important;
  }

  body.single-gallery .main-header .logo-container {
    align-self: center;
    margin-left: 0;
    margin-right: 0;
    text-align: center;
  }

  body.single-gallery .main-header .logo-container .main-logo img {
    margin: 26px auto !important;
  }

  body.single-gallery .main-header .main-nav,
  body.single-gallery .main-header.active .main-nav {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    max-width: none;
    height: auto;
    margin: 0 !important;
    float: none !important;
    position: relative;
    left: auto;
    transform: none;
  }

  body.single-gallery .main-header .main-nav ul,
  body.single-gallery .main-header.active .main-nav ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    width: auto !important;
    margin: 0 0 24px !important;
    padding: 0 !important;
    gap: clamp(10px, 1.8vw, 24px);
  }

  body.single-gallery .main-header .main-nav li,
  body.single-gallery .main-header.active .main-nav li {
    margin: 0 !important;
    white-space: nowrap;
  }
}

@media screen and (min-width: 60em) {
  body.single-gallery .main-header .main-nav,
  body.single-gallery .main-header.active .main-nav {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: auto !important;
    max-width: none;
    height: 100px;
    margin: 0 !important;
    float: none !important;
    justify-self: center;
    position: relative;
    left: clamp(-12px, -0.5vw, -6px);
    transform: none;
  }

  body.single-gallery .main-header .main-nav ul,
  body.single-gallery .main-header.active .main-nav ul {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    width: auto !important;
    margin: -36px 0 0 !important;
    padding: 0 !important;
    gap: clamp(16px, 2.5vw, 48px);
  }

  body.single-gallery .main-header .main-nav li,
  body.single-gallery .main-header.active .main-nav li {
    margin: 0 !important;
    white-space: nowrap;
  }
}

body.single-gallery .main-header .main-nav {
  margin-bottom: 0 !important;
  align-self: center;
}

body.single-gallery .main-header .main-nav ul {
  align-items: center;
}

body.single-gallery .hamburger-menu-container {
  display: flex !important;
}

body.single-gallery .main-header .menutext {
  display: none !important;
}

body.single-gallery.sg-past-hero .main-header {
  opacity: 0 !important;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

body.single-gallery.sg-past-hero .main-header .logo-container,
body.single-gallery.sg-past-hero .main-header .main-logo,
body.single-gallery.sg-past-hero .main-header .main-nav,
body.single-gallery.sg-past-hero .main-header .hamburger-menu-container {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

body.single-gallery.sg-mobile-menu-open .main-header {
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media screen and (max-width: 640px) {
  body.single-gallery.sg-mobile-menu-open .main-header {
    top: var(--mobile-menu-height, 336px) !important;
  }

  body.single-gallery.sg-mobile-menu-open .main-header .logo-container,
  body.single-gallery.sg-mobile-menu-open .main-header .main-nav {
    visibility: hidden;
  }
}

body.single-gallery .main-header {
  transition: opacity 0.35s ease, top 0.3s ease;
}

body.single-gallery {
  overflow: hidden;
}

.sg-scroll {
  position: fixed;
  inset: 0;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  z-index: 0;
}

body.lightbox-open .sg-scroll {
  overflow: hidden;
  pointer-events: none;
}

.sg-slide {
  position: relative;
  height: 100vh;
  height: calc(var(--vh, 1vh) * 100);
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.sg-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.sg-bg--mobile {
  display: none;
}

@media screen and (max-width: 640px) {
  .sg-bg--mobile {
    display: block;
  }

  .sg-slide--hero .sg-bg:not(.sg-bg--mobile) {
    display: none;
  }
}

.sg-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--sg-hero-overlay, 0.40));
  pointer-events: none;
  z-index: 1;
}

.sg-hero-content {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  padding: 0 clamp(40px, 7vw, 120px) 0 clamp(36px, 4.2vw, 120px) !important;
  z-index: 2;
  pointer-events: auto;
  -webkit-user-select: text;
  user-select: text;
}

.sg-client {
  display: block;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: clamp(8px, 0.54vw, 12px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 14px;
  text-align: left;
}

.sg-title {
  font-family: 'Tenor Sans', serif;
  font-weight: 400;
  font-size: clamp(14px, 1.52vw, 34px);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: #fff;
  margin: 0;
  text-align: left;
}

.sg-slide--gallery {
  background: #fff;
}

.sg-slide--gallery .sg-bg {
  top: 52px;
  right: clamp(32px, 5vw, 80px);
  bottom: 80px;
  left: clamp(32px, 5vw, 80px);
  background-size: contain;
  background-position: center top;
  background-color: transparent;
}

@media screen and (max-width: 640px) {
  .sg-slide--gallery .sg-bg {
    background-position: center center;
  }
}

.sg-slide--desc .sg-bg {
  bottom: 125px;
}

.sg-top-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 clamp(20px, 4vw, 64px);
  padding-top: 2rem;
  padding-bottom: 3rem;
  z-index: 2;
  background: #fff;
}

.sg-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Lato', sans-serif;
  font-weight: 700;
  font-size: clamp(8px, calc(0.63vw - 1px), 13px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #666666;
  text-decoration: none;
  transition: opacity 0.2s ease;
  padding: 8px 0;
  cursor: pointer;
  pointer-events: all;
}

.sg-back:hover {
  color: #111;
  opacity: 0.7;
}

.sg-back svg {
  flex-shrink: 0;
  width: 16px;
  height: 10px;
  stroke: #666666;
}

.sg-desc-wrap {
  position: absolute;
  bottom: 52px;
  left: 0;
  right: 0;
  background: #fff;
  padding: 20px clamp(24px, 8vw, 100px) 14px;
  z-index: 2;
  overflow-y: auto;
  pointer-events: auto;
  cursor: default;
}

.sg-desc {
  font-family: 'Lato', sans-serif;
  font-size: clamp(11px, 0.76vw, 17px);
  font-weight: 400;
  line-height: 1.8;
  color: #444;
  letter-spacing: 0.01em;
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.sg-desc::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: rgba(0, 0, 0, 0.25);
  margin: 0 auto 12px;
}

.sg-desc p {
  margin: 0;
}

.sg-desc p + p {
  margin-top: 8px;
}

/* ── Down arrow ─────────────────────────────────────────────────
   Two SVG variants are inlined via PHP:
     $arrow_white — hero slide (white circle + white arrow)
     $arrow_dark  — gallery slides (light grey circle + dark grey arrow)
   On mobile every slide uses white, overridden below.
   ─────────────────────────────────────────────────────────────── */

.sg-arrow {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none !important;
  background-color: transparent !important;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-bottom: 0;
  z-index: 3;
  opacity: 1;
  transition: none;
  pointer-events: all;
  box-shadow: none !important;
  outline: none;
}

.sg-arrow:hover,
.sg-arrow:focus,
.sg-arrow:active {
  opacity: 1;
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none;
}

.sg-arrow svg {
  display: block;
  width: 44px;
  height: 44px;
}

.sg-slide--desc .sg-arrow {
  bottom: 14px;
}

/* ── Mobile ─────────────────────────────────────────────────────
   Gallery V16 mobile design:
   - All slides: full-bleed vertical image, no extra text
   - Logo + hamburger visible on every slide
   - Arrow always white (always over image)
   ─────────────────────────────────────────────────────────────── */
@media screen and (max-width: 640px) {

  /* Gallery slides: full-bleed, no white background */
  .sg-slide--gallery {
    background: #000;
  }

  .sg-slide--gallery .sg-bg {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    background-size: cover !important;
    background-position: center center !important;
  }

  /* Hide "Back to Gallery" bar on mobile */
  .sg-top-ui {
    display: none !important;
  }

  /* Keep header (logo + hamburger) visible on all slides */
  body.single-gallery.sg-past-hero .main-header {
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  body.single-gallery.sg-past-hero .main-header .logo-container,
  body.single-gallery.sg-past-hero .main-header .main-logo,
  body.single-gallery.sg-past-hero .main-header .hamburger-menu-container {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* White arrow on all slides (always over image) */
  .sg-slide--gallery .sg-arrow circle {
    stroke: #ffffff;
  }

  .sg-slide--gallery .sg-arrow path {
    stroke: #ffffff;
  }

  /* Hero text: readable sizes on narrow viewport */
  .sg-client {
    font-size: 10px;
  }

  .sg-title {
    font-size: clamp(18px, 5vw, 26px);
  }
}

/* ── Lightbox ───────────────────────────────────────────────── */

.tiles-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #fff;
  align-items: center;
  justify-content: center;
}

.tiles-lightbox.is-open {
  display: flex;
}

.tiles-lightbox__progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.1);
  z-index: 3;
}

.tiles-lightbox__progress .swiper-pagination-progressbar-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: #111;
  transform-origin: left center;
  transform: translate3d(0, 0, 0) scaleX(0) scaleY(1);
}

.tiles-lightbox__img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 80px;
  box-sizing: border-box;
}

.tiles-lightbox__img {
  max-width: 80%;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.tiles-lightbox__close {
  position: absolute;
  top: 28px;
  right: 28px;
  background: none;
  border: none;
  color: #111;
  cursor: pointer;
  padding: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tiles-lightbox__close svg {
  fill: #111;
  display: block;
  width: 13px;
  height: 13px;
}

.tiles-lightbox__close:hover {
  transform: scale(1.25);
  background: transparent !important;
  background-color: transparent !important;
}

.tiles-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  padding: 0;
  border: none;
  background: transparent;
  color: #111;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  z-index: 3;
}

.tiles-lightbox__nav svg {
  width: 18px;
  height: 32px;
}

.tiles-lightbox__prev { left: 16px; }
.tiles-lightbox__next { right: 16px; }

.tiles-lightbox__nav:hover,
.tiles-lightbox__nav:focus,
.tiles-lightbox__close:focus {
  background: transparent !important;
  background-color: transparent !important;
  color: #111;
}

@media screen and (min-width: 640px) {
  .tiles-lightbox__prev { left: 32px; }
  .tiles-lightbox__next { right: 32px; }
}

@media screen and (max-width: 767px) {
  .tiles-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .tiles-lightbox__nav svg {
    width: 16px;
    height: 28px;
  }

  .tiles-lightbox__prev { left: 6px; }
  .tiles-lightbox__next { right: 6px; }

  .tiles-lightbox__img-wrap {
    padding: 0 42px;
  }

  .tiles-lightbox__img {
    max-width: 100%;
    max-height: 88vh;
  }
}