.p-references {
  padding-top: 50px;
}

.p-references-holder {
  margin-top: 30px;
}

.category-children-wrapper {
  margin-top: 12px;
}

.category-children-holder {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.references-load-more-holder {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.references-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 15px;
  border: 1px solid var(--primary-color);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--primary-color);
  font: inherit;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    opacity 0.25s ease;
}

.references-load-more:hover {
  background: var(--primary-color);
  color: var(--white);
}

.references-load-more[hidden] {
  display: none;
}

.p-references-posts-holder {
  display: none;
  grid-template-columns: 1fr;
  gap: 20px;
}

.p-references-active-posts {
  display: grid;
}

.hidden-swiper-posts {
  display: none;
}

.reference-post {
  position: relative;
  width: 100%;
  min-height: 320px;
  padding: 0;
  border: 0;
  font: inherit;
  color: inherit;
  border-radius: 24px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14);
}

.reference-post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--timing-function);
  will-change: transform;
  transform: translate3d(0px, 0px, 0.0001px);
}

.reference-post:hover .reference-post-image img {
  transform: scale(1.02) translate3d(0px, 0px, 0.0001px);
}

.reference-post-content {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  color: #fff;
}

.reference-post-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}

.reference-post-content .mini-titlke {
  margin: 0;
  color: #fff;
}

.reference-gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(0, 0, 0, 0.96);
}

.reference-gallery-modal.is-open {
  display: block;
}

.reference-gallery-modal__backdrop {
  position: absolute;
  inset: 0;
}

.reference-gallery-modal__panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: clamp(16px, 3vw, 32px);
}

.reference-gallery-modal__header {
  position: relative;
  z-index: 3;
  max-width: 720px;
  margin-bottom: 18px;
  color: #fff;
}

.reference-gallery-modal__eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.72;
}

.reference-gallery-modal__title {
  margin: 0;
  color: #fff;
}

.reference-gallery-modal__close {
  position: absolute;
  top: clamp(16px, 3vw, 32px);
  right: clamp(16px, 3vw, 32px);
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.reference-gallery-swiper {
  position: relative;
  flex: 1;
  min-height: 0;
  width: 100%;
}

.reference-gallery-swiper .swiper-wrapper {
  align-items: center;
}

.reference-gallery-slide {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 80%;
}

.reference-gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.reference-gallery-button {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  cursor: pointer;
  backdrop-filter: blur(14px);
}

.reference-gallery-button-prev {
  left: clamp(16px, 3vw, 32px);
}

.reference-gallery-button-next {
  right: clamp(16px, 3vw, 32px);
}

.reference-gallery-button svg {
  display: block;
}

.reference-gallery-pagination {
  bottom: -50px;
}

.reference-gallery-pagination .swiper-pagination-bullet {
  background: #fff;
}

.reference-gallery-modal.is-single .reference-gallery-button,
.reference-gallery-modal.is-single .reference-gallery-pagination {
  display: none;
}

body.reference-gallery-open {
  overflow: hidden;
}

@media only screen and (min-width: 768px) {
  .p-references-posts-holder {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media only screen and (min-width: 992px) {
  .p-references {
    padding-top: 100px;
  }

  .p-references-holder {
    margin-top: 50px;
  }

  .reference-post {
    min-height: 380px;
  }

  .references-load-more {
    padding: 10px 20px;
  }
}

@media only screen and (min-width: 1200px) {
  .reference-post {
    min-height: 420px;
  }
}

@media only screen and (min-width: 1600px) {
  .reference-post {
    min-height: 470px;
  }
}

@media (max-width: 767px) {
  .reference-gallery-button {
    display: none;
  }

  .reference-gallery-modal__header {
    margin-bottom: 12px;
    padding-right: 64px;
  }
}
