.content-block.grid-gallery-section > .inner-block > .padding {
  display: grid;
  grid-template-columns: auto 1fr;
}

.content-block.grid-gallery-section > .inner-block > .padding > .content {
  padding-left: var(--main-padding);
  padding-right: var(--main-padding);
  max-width: var(--inner-container-width);
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
}

.grid-gallery-section .content {
  min-height: calc(14rem * 2 + 10px + 40px);
}

/* Gallery Filter Menu */
.content-area.custom-acf-page .content-block > .inner-block > .padding > .content.has-nav-menu:has(.grid-gallery-menu) {
  border-bottom: 1px solid var(--main-highlight-color-transparent);
}
.grid-gallery-menu .menu-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.grid-gallery-menu .menu-container .menu-wrapper {
  display: none;
}

.grid-gallery-menu .menu-container h2 {
  margin: 0;
  margin-bottom: 0.5rem;
}

.grid-gallery-menu ul.menu {
  position: relative;
}

.grid-gallery-menu ul.menu li.menu-item button {
  border: 0;
  background-color: transparent;
  font-family: inherit;
  text-transform: uppercase;
  font-weight: 500;
  padding: 1em 1em 1.5em;
  cursor: pointer;
  border-bottom: 4px solid transparent;
  transition: border-bottom 0.3s ease-in-out;
}

.grid-gallery-menu ul.menu li.menu-item button.active {
  border-bottom: 4px solid var(--main-highlight-color);
}

@media (750px <= width) {
  .content.has-nav-menu ul.menu {
    gap: 1em;
  }
}

/* Filter Pills */
.filter-pill__container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  margin-right: calc(-1 * var(--main-padding));
}

.filter-pill__container button {
  padding: 0.25em 0.75em;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--main-highlight-color-transparent);
  background-color: #fff;
  border: 1px solid var(--main-highlight-color-transparent);
  border-radius: 1em;
  cursor: pointer;
  transition: all 0.3s ease-in-out;
  box-shadow: 2px 2px 3px rgba(225, 225, 225, 0.75);
}

.filter-pill__container button.active {
  background-color: var(--main-highlight-color);
  color: #fff;
}

/* Gallery Filter Menu END */

.text-section.grid-gallery-text-section:not(.no-body) h2 {
  margin-bottom: 1rem;
}

.text-section.grid-gallery-text-section .text-inner {
  margin-left: calc(-1 * var(--main-padding));
  margin-right: calc(-1 * var(--main-padding));
  padding-left: var(--main-padding);
  padding-right: var(--main-padding);
  padding-bottom: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--main-highlight-color-transparent);
}

.text-section.grid-gallery-text-section .text-inner p:first-child {
  margin-top: 0;
}

/* Gallery */
.grid-gallery-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 14rem;
  gap: 10px;
  height: auto;
  overflow: hidden;
}

.grid-gallery__item:not(:has([data-expanded='true'])) {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  border-radius: 10px;
  cursor: pointer;
}

.grid-gallery__item.visible:nth-child(3n-2 of .grid-gallery__item.visible),
.grid-gallery__item.single:nth-child(3n-2 of .grid-gallery__item.single) {
  grid-row: span 2;
}

.grid-gallery__item-content {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.5s ease-in-out;
}

.grid-gallery__item-content img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 19/ 12;
  object-fit: cover;
  transition: transform 0.5s ease-in-out;
}

.grid-gallery__item:hover .grid-gallery__item-content img {
  transform: scale(1.05);
}

/* modal */
.grid-gallery__modal {
  height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease-in-out;
}

.grid-gallery__modal[aria-hidden='false'] {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(220, 220, 220, 0.5);
  backdrop-filter: blur(10px);
  opacity: 1;
  z-index: 99999;
}

body:has(.grid-gallery__modal[aria-hidden='false']),
body.finish-loading:has(.grid-gallery__modal[aria-hidden='false']) {
  height: 100%;
  overflow: hidden !important;
}

.grid-gallery__modal[aria-hidden='true'] {
  opacity: 0;
  z-index: -1;
  pointer-events: none;
}

.grid-gallery__modal[aria-hidden='true'] button {
  display: none;
}

.grid-gallery__modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.grid-gallery__modal-header {
  position: absolute;
  top: 2rem;
  width: 100%;
  display: flex;
  justify-content: end;
  gap: 1rem;
  align-items: center;
}

.grid-gallery__modal-header h3 {
  margin-top: 0;
}

.grid-gallery__modal-slider-container {
  position: relative;
  height: 55dvh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.grid-gallery__modal-slider {
  touch-action: pan-y;
  overflow: hidden;
}

.grid-gallery__modal-slider .modal-img {
  width: 100%;
  max-width: 90vw;
  height: auto;
  object-fit: cover;
  aspect-ratio: 19 / 12;
  border-radius: 18px;
}

.grid-gallery__modal-slider-container .pagination-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
  transform: translateX(-50%);
}

.grid-gallery__modal-slider-container .pagination-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 10px;
  background-color: #aaa;
  border: none;
}

.grid-gallery__modal-slider-container .pagination-dots .dot.active {
  background-color: #fff;
}

.grid-gallery__modal-slider-controls button.slider-control {
  position: absolute;
  top: 50%;
  width: 1rem;
  height: 2rem;
  background-color: transparent;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: 0;
  opacity: 0.5;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity 0.3s ease-in-out;
}

.grid-gallery__modal-close {
  position: absolute;
  top: 2rem;
  left: 0;
  width: 100%;
  text-align: right;
  border: none;
  background-color: transparent;
  cursor: pointer;
}

.grid-gallery__modal-slider-controls button:hover {
  opacity: 1;
}

.grid-gallery__modal-slider-controls button.slider-control.prev {
  background-image: url(../img/carat-left-white.svg);
  left: 0;
}

.grid-gallery__modal-slider-controls button.slider-control.next {
  background-image: url(../img/carat-right-white.svg);
  right: 0;
}

.grid-gallery__modal-slider-controls button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.content-block:has(.grid-gallery__modal[aria-hidden='false']) {
  position: static;
}
/* modal END */

@media (width < 1200px) {
  .grid-gallery-container {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: 7rem;
  }

  .grid-gallery__item.visible:nth-child(3n-2 of .grid-gallery__item.visible),
  .grid-gallery__item.single:nth-child(3n-2 of .grid-gallery__item.single) {
    grid-row: span 1;
  }

  .grid-gallery__item.visible:nth-child(12n + 2 of .grid-gallery__item.visible),
  .grid-gallery__item.visible:nth-child(12n + 7 of .grid-gallery__item.visible),
  .grid-gallery__item.single:nth-child(6n - 4 of .grid-gallery__item.single),
  .grid-gallery__item.single:nth-child(6n - 2 of .grid-gallery__item.single) {
    grid-row: span 2;
    grid-column: span 2;
  }

  .content-area .content-block:not(.heading-with-sidebar-section) .inner-block > .padding > .sidebar {
    display: none;
  }
}

@media (750px <= width) {
}

@media (1200px <= width) {
  .content-block.grid-gallery-section > .inner-block > .padding > .content {
    padding-left: var(--side-bar-width);
    padding-right: var(--side-bar-width);
  }

  .grid-gallery__modal-slider-container {
    overflow: visible;
  }

  .grid-gallery__modal-slider {
    aspect-ratio: auto;
  }

  .grid-gallery__modal-slider .modal-img {
    max-width: 50rem;
  }

  .grid-gallery__modal-slider-controls .pagination-dots {
    bottom: -8rem;
  }

  .grid-gallery__modal-close {
    top: -4rem;
  }

  .grid-gallery__modal-slider-controls button.slider-control {
    padding: 2rem;
    background-size: 1rem;
  }

  .grid-gallery__modal-slider-controls button.slider-control.prev {
    background-image: url(../img/carat-left-blue.svg);
    left: -4rem;
  }

  .grid-gallery__modal-slider-controls button.slider-control.next {
    background-image: url(../img/carat-right-blue.svg);
    right: -4rem;
  }
}

@media (1920px <= width) {
  .grid-gallery__modal-slider .modal-img {
    width: 70vw;
    max-width: 70rem;
  }

  .grid-gallery__modal-close {
    top: calc(70vw * (12 / 19) * -0.2);
  }
}
