/* ==========================================================
   UTTARAKHAND TRAILS PHOTO GALLERY
   Copy this CSS to the bottom of the theme's css/main.css file.
   ========================================================== */

.utpg-gallery,
.utpg-gallery * {
  box-sizing: border-box;
}

.utpg-gallery {
  --utpg-navy: #032f52;
  --utpg-blue: #075a9c;
  --utpg-orange: #e75b12;
  --utpg-white: #ffffff;
  --utpg-muted: #5c6d7e;
  --utpg-line: #dce6ed;
  width: min(100% - 30px, 1180px);
  margin: 60px auto;
  color: #172638;
  font-family: inherit;
}

.utpg-gallery__heading {
  max-width: 850px;
  margin: 0 auto 31px;
  text-align: center;
}

.utpg-gallery__eyebrow {
  display: inline-block;
  margin-bottom: 9px;
  color: var(--utpg-orange);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: goldenrod;
}

.utpg-gallery__heading h2 {
  margin: 0 0 12px;
  color: var(--utpg-navy);
  font-size: clamp(30px, 4.5vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.7px;
}

.utpg-gallery__heading p {
  margin: 0;
  color: var(--utpg-muted);
  font-size: 17px;
  line-height: 1.65;
}

.utpg-gallery__grid {
  display: grid;
  grid-auto-rows: 230px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.utpg-gallery__item {
  position: relative;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  background: #d9e5ed;
  box-shadow: 0 9px 25px rgba(3, 47, 82, .08);
}

.utpg-gallery__item--featured {
  grid-column: span 2;
  grid-row: span 2;
}

.utpg-gallery__item--wide {
  grid-column: span 2;
}

.utpg-gallery__open {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: var(--utpg-white);
  font: inherit;
  text-align: left;
  cursor: zoom-in;
}

.utpg-gallery__open:focus-visible {
  outline: 4px solid #ffbd5a;
  outline-offset: -4px;
}

.utpg-gallery__open img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s cubic-bezier(.2, .65, .3, 1);
}

.utpg-gallery__open:hover img,
.utpg-gallery__open:focus-visible img {
  transform: scale(1.055);
}

.utpg-gallery__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(1, 25, 45, .88) 0%, rgba(1, 25, 45, .26) 45%, transparent 72%);
  pointer-events: none;
}

.utpg-gallery__caption {
  position: absolute;
  z-index: 1;
  right: 60px;
  bottom: 19px;
  left: 19px;
  text-shadow: 0 2px 7px rgba(0, 0, 0, .45);
}

.utpg-gallery__caption small {
  display: block;
  margin-bottom: 4px;
  color: #ffd28e;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  line-height: 1.2;
  text-transform: uppercase;
}

.utpg-gallery__caption strong {
  display: block;
  color: #fff;
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 800;
  line-height: 1.17;
}

.utpg-gallery__plus {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .75);
  border-radius: 50%;
  background: rgba(3, 47, 82, .55);
  color: #fff;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transition: background .2s ease, transform .2s ease;
}

.utpg-gallery__open:hover .utpg-gallery__plus,
.utpg-gallery__open:focus-visible .utpg-gallery__plus {
  background: var(--utpg-orange);
  transform: rotate(90deg);
}

/* Lightbox */
.utpg-lightbox {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: none;
  padding: 24px;
  align-items: center;
  justify-content: center;
}

.utpg-lightbox.is-open {
  display: flex;
}

.utpg-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 14, 26, .92);
  backdrop-filter: blur(8px);
}

.utpg-lightbox__panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(1100px, 100%);
  max-height: calc(100vh - 48px);
  grid-template-columns: 58px minmax(0, 1fr) 58px;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: #071b2b;
  box-shadow: 0 25px 80px rgba(0, 0, 0, .55);
}

.utpg-lightbox__media {
  display: flex;
  min-height: 260px;
  max-height: calc(100vh - 190px);
  grid-column: 2;
  align-items: center;
  justify-content: center;
  background: #03111c;
}

.utpg-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 190px);
  object-fit: contain;
}

.utpg-lightbox__nav,
.utpg-lightbox__close {
  margin: 0;
  border: 0;
  color: #fff;
  cursor: pointer;
}

.utpg-lightbox__nav {
  display: grid;
  width: 58px;
  min-height: 100%;
  padding: 0;
  place-items: center;
  align-self: stretch;
  background: #071b2b;
  font-size: 30px;
  transition: background .2s ease;
}

.utpg-lightbox__nav:hover,
.utpg-lightbox__nav:focus-visible {
  background: var(--utpg-orange);
}

.utpg-lightbox__nav--previous {
  grid-column: 1;
  grid-row: 1;
}

.utpg-lightbox__nav--next {
  grid-column: 3;
  grid-row: 1;
}

.utpg-lightbox__close {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  width: 43px;
  height: 43px;
  padding: 0 0 4px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .65);
  border-radius: 50%;
  background: rgba(3, 17, 28, .72);
  font-size: 31px;
  line-height: 1;
}

.utpg-lightbox__close:hover,
.utpg-lightbox__close:focus-visible {
  background: var(--utpg-orange);
}

.utpg-lightbox__details {
  display: flex;
  min-width: 0;
  padding: 18px 22px;
  grid-column: 1 / -1;
  grid-row: 2;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #fff;
}

.utpg-lightbox__label {
  display: block;
  margin-bottom: 3px;
  color: var(--utpg-orange);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
}

.utpg-lightbox__title {
  margin: 0 0 3px;
  color: var(--utpg-navy);
  font-size: 21px;
  line-height: 1.2;
}

.utpg-lightbox__description {
  margin: 0;
  color: var(--utpg-muted);
  font-size: 14px;
  line-height: 1.45;
}

.utpg-lightbox__count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 99px;
  background: #edf4f8;
  color: var(--utpg-navy);
  font-size: 13px;
  font-weight: 800;
}

body.utpg-no-scroll {
  overflow: hidden !important;
}

@media (max-width: 800px) {
  .utpg-gallery__grid {
    grid-auto-rows: 210px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .utpg-gallery__item--featured {
    grid-column: span 2;
    grid-row: span 2;
  }

  .utpg-lightbox {
    padding: 14px;
  }

  .utpg-lightbox__panel {
    max-height: calc(100vh - 28px);
    grid-template-columns: 48px minmax(0, 1fr) 48px;
  }

  .utpg-lightbox__nav {
    width: 48px;
  }
}

@media (max-width: 560px) {
  .utpg-gallery {
    width: min(100% - 24px, 1180px);
    margin: 42px auto;
  }

  .utpg-gallery__heading {
    margin-bottom: 23px;
  }

  .utpg-gallery__heading h2 {
    font-size: 32px;
  }

  .utpg-gallery__heading p {
    font-size: 15px;
  }

  .utpg-gallery__grid {
    display: grid;
    grid-auto-rows: auto;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .utpg-gallery__item,
  .utpg-gallery__item--featured,
  .utpg-gallery__item--wide {
    height: auto;
    min-height: 0;
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
    border-radius: 13px;
  }

  .utpg-gallery__caption {
    right: 54px;
    bottom: 15px;
    left: 15px;
  }

  .utpg-gallery__caption strong {
    font-size: 19px;
  }

  .utpg-gallery__plus {
    right: 13px;
    bottom: 13px;
    width: 34px;
    height: 34px;
  }

  .utpg-lightbox {
    padding: 0;
  }

  .utpg-lightbox__panel {
    width: 100%;
    max-height: 100vh;
    min-height: 100vh;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    grid-template-rows: minmax(0, 1fr) auto;
    border: 0;
    border-radius: 0;
  }

  .utpg-lightbox__media {
    min-height: 0;
    max-height: calc(100vh - 132px);
  }

  .utpg-lightbox__image {
    max-height: calc(100vh - 132px);
  }

  .utpg-lightbox__nav {
    width: 44px;
    font-size: 25px;
  }

  .utpg-lightbox__close {
    top: 11px;
    right: 11px;
    width: 39px;
    height: 39px;
  }

  .utpg-lightbox__details {
    padding: 14px 15px;
  }

  .utpg-lightbox__description {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .utpg-gallery__open img,
  .utpg-gallery__plus {
    transition: none;
  }
}

/* Remove WordPress-generated spacing inside gallery cards. */
.utpg-gallery__item {
    background: transparent !important;
}

.utpg-gallery__open {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    line-height: 0 !important;
}

.utpg-gallery__open br {
    display: none !important;
}

.utpg-gallery__open p {
    display: contents !important;
    margin: 0 !important;
    padding: 0 !important;
}

.utpg-gallery__open img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: cover !important;
}

.utpg-gallery__caption,
.utpg-gallery__caption strong {
    line-height: 1.17 !important;
}

.utpg-gallery__caption small {
    line-height: 1.2 !important;
}


/* Hide duplicate empty buttons created by WordPress formatting */
.utpg-gallery__item > .utpg-gallery__open:empty {
    display: none !important;
}

/* Ensure the real image button fills the gallery card */
.utpg-gallery__item > .utpg-gallery__open:has(img) {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

/* Force restored photographs to remain visible */
.utpg-gallery__item img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 1 !important;
    visibility: visible !important;
    object-fit: cover !important;
}