.tharaphoto-single-couple-gallery {
  --tp-gallery-gap: 6px;
  --tp-gallery-row-height: 180px;
  display: grid;
  gap: var(--tp-gallery-gap);
  margin: 0;
}

.tharaphoto-single-couple-gallery.mode-mosaic {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item {
  grid-column: span 3;
}

.tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item.is-landscape {
  grid-column: span 4;
}

.tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item.is-portrait {
  grid-column: span 2;
}

.tharaphoto-single-couple-gallery.mode-tile {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tharaphoto-single-couple-gallery.mode-masonry {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 1px;
  row-gap: 1px;
  column-gap: var(--tp-gallery-gap);
  grid-auto-flow: row dense;
  align-items: start;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.tharaphoto-single-couple-gallery.mode-justified {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
}

.tharaphoto-single-couple-gallery.mode-justified .tp-single-gallery-item {
  flex: 0 0 auto;
  width: auto;
  height: var(--tp-gallery-row-height);
}

.tharaphoto-single-couple-gallery.mode-masonry .tp-single-gallery-item {
  height: auto;
  margin-bottom: var(--tp-gallery-masonry-gap-adjust, 0px);
}

.tharaphoto-single-couple-gallery .tp-single-gallery-item {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: #eceae4;
}

.tharaphoto-single-couple-gallery:not(.mode-masonry) .tp-single-gallery-item {
  min-height: var(--tp-gallery-row-height);
}

.tharaphoto-single-couple-gallery.mode-tile .tp-single-gallery-item {
  aspect-ratio: 4 / 3;
}

.tharaphoto-single-couple-gallery .tp-single-gallery-item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.tharaphoto-single-couple-gallery.mode-masonry .tp-single-gallery-item img {
  height: auto;
  object-fit: initial;
}

.tharaphoto-single-couple-gallery.mode-justified .tp-single-gallery-item img {
  height: 100%;
  object-fit: cover;
}

.tharaphoto-single-couple-gallery.mode-masonry .tp-single-gallery-item.is-landscape img {
  transform: scale(1.15);
  transform-origin: center center;
}

.tharaphoto-single-couple-gallery .tp-single-gallery-item figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.66);
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
}

.tharaphoto-random-gallery-link-wrap {
  margin: 18px 0 8px;
  text-align: center;
}

.tharaphoto-random-gallery-link {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid #365870;
  background: #c1d4e2;
  color: #365870;
  text-decoration: none;
  text-transform: uppercase;
  font-family: "Jost", sans-serif;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.tharaphoto-random-gallery-link:hover,
.tharaphoto-random-gallery-link:focus {
  filter: saturate(110%);
  transform: scale(1.03);
}

body.single-couple .entry-content > p,
body.single-couple .entry-content .et_pb_text_inner p {
  text-align: left;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
}

@media (max-width: 1024px) {
  .tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item,
  .tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item.is-landscape,
  .tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item.is-portrait {
    grid-column: span 4;
  }

  .tharaphoto-single-couple-gallery.mode-tile {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tharaphoto-single-couple-gallery.mode-masonry {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item,
  .tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item.is-landscape,
  .tharaphoto-single-couple-gallery.mode-mosaic .tp-single-gallery-item.is-portrait {
    grid-column: span 6;
  }

  .tharaphoto-single-couple-gallery.mode-tile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tharaphoto-single-couple-gallery.mode-masonry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .tharaphoto-single-couple-gallery.mode-justified {
    display: block;
  }

  .tharaphoto-single-couple-gallery.mode-justified .tp-single-gallery-item {
    width: 100% !important;
    height: auto !important;
    flex-basis: auto !important;
    margin-bottom: var(--tp-gallery-gap);
  }

  .tharaphoto-single-couple-gallery.mode-justified .tp-single-gallery-item:last-child {
    margin-bottom: 0;
  }

  .tharaphoto-single-couple-gallery.mode-justified .tp-single-gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }

  body.single-couple .tharaphoto-single-couple-gallery {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    margin-left: calc(50% - 50vw + 10px) !important;
    margin-right: calc(50% - 50vw + 10px) !important;
  }

  body.single-couple .tharaphoto-single-couple-gallery.type-engagement.mode-justified {
    gap: var(--tp-gallery-gap);
  }

  body.single-couple .tharaphoto-single-couple-gallery.type-engagement.mode-justified .tp-single-gallery-item {
    min-height: 0 !important;
    margin: 0 0 var(--tp-gallery-gap) !important;
    padding: 0 !important;
    background: transparent;
    line-height: 0;
  }

  body.single-couple .tharaphoto-single-couple-gallery.type-engagement.mode-justified .tp-single-gallery-item:last-child {
    margin-bottom: 0 !important;
  }

  body.single-couple .tharaphoto-single-couple-gallery.type-engagement.mode-justified .tp-single-gallery-item img {
    display: block;
    width: 100%;
    height: auto !important;
  }
}
