/* DMX-like single post related blocks */

.single-post .entry-content.single-page {
  margin-bottom: 14px;
}

.tggd-single-catalog,
.tggd-single-related-posts {
  margin: 18px 0 0;
  border: 1px solid #dce7f3;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}

.tggd-single-section-title {
  margin: 0 0 10px;
  color: #0d2848;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 800;
}

.tggd-single-catalog-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 4);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.tggd-single-catalog-item {
  border: 1px solid #ebf1f8;
  border-radius: 12px;
  background: #fcfdff;
  text-decoration: none;
  color: #1b3f67;
  display: block;
  overflow: hidden;
  scroll-snap-align: start;
}

.tggd-single-catalog-item:hover {
  border-color: #bfd5eb;
  box-shadow: 0 8px 18px rgba(13, 40, 72, 0.08);
}

.tggd-single-catalog-item__thumb {
  display: block;
  background: #f3f7fc;
}

.tggd-single-catalog-item__thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}

.tggd-single-catalog-item__meta {
  display: block;
  padding: 8px;
}

.tggd-single-catalog-item__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 700;
}

.tggd-single-catalog-item__sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.35;
  color: #eb0707;
}

.tggd-single-catalog-item__sub .amount,
.tggd-single-catalog-item__sub ins,
.tggd-single-catalog-item__sub del {
  color: inherit;
  text-decoration: none;
}

.tggd-single-related-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 4);
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
}

.tggd-single-related-card {
  border: 1px solid #ebf1f8;
  border-radius: 12px;
  background: #fcfdff;
  overflow: hidden;
  scroll-snap-align: start;
}

.tggd-single-related-card__thumb {
  display: block;
}

.tggd-single-related-card__thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.tggd-single-related-card__meta {
  padding: 9px;
}

.tggd-single-related-card__title {
  color: #18395d;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 700;
}

.tggd-single-related-card__title:hover {
  color: #1d4f83;
  text-decoration: underline;
}

.tggd-single-related-card__excerpt {
  margin: 6px 0 0;
  color: #4a6380;
  font-size: 16px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tggd-single-related-keywords {
  margin-top: 12px;
  color: #1c416a;
  font-size: 16px;
  line-height: 1.6;
}

.tggd-single-related-keywords__label {
  font-weight: 700;
  margin-right: 4px;
}

.tggd-single-related-keywords a {
  color: #285ab6;
  text-decoration: none;
}

.tggd-single-related-keywords a:hover {
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .tggd-single-catalog-rail {
    grid-auto-columns: calc((100% - 24px) / 3);
  }

  .tggd-single-related-rail {
    grid-auto-columns: calc((100% - 24px) / 3);
  }
}

@media (max-width: 768px) {
  .tggd-single-catalog,
  .tggd-single-related-posts {
    border-radius: 12px;
    padding: 10px;
  }

  .tggd-single-section-title {
    margin-bottom: 8px;
    font-size: 20px;
  }

  .tggd-single-catalog-rail {
    grid-auto-columns: 72%;
    gap: 10px;
  }

  .tggd-single-related-rail {
    grid-auto-columns: 72%;
    gap: 10px;
  }

  .tggd-single-related-keywords {
    font-size: 14px;
  }
}
