/* Inline + popup related posts (fc_related_post) — shared across themes */

.post-item-related {
  background: var(--bs-body-bg, var(--nl-surface, #fff));
  overflow: hidden;
  padding: 10px;
  width: 100%;
  border-radius: 16px;
}

.post-item-related .post-wrapper-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.post-item-related-title {
  margin-bottom: 5px;
  font-style: italic;
  padding-left: 5px;
  color: var(--text-color-light, var(--nl-muted, #6c757d));
  font-weight: 300;
}

.post-image-wrapper-related {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  flex-basis: 30%;
  flex-grow: 0;
  flex-shrink: 0;
  border-radius: 10px;
  min-width: 110px;
}

.post-image-wrapper-related .post-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  opacity: 1;
}

.post-item-related .post-content {
  flex: 1;
  min-width: 0;
  padding: 0 6px;
}

.post-item-related .post-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
}

.post-item-related .post-title a {
  color: inherit;
  text-decoration: none;
}

.post-item-related .post-excerpt a {
  color: var(--text-color, inherit);
  text-decoration: none;
}

@media (max-width: 576px) {
  .post-item-related .post-wrapper-row {
    flex-direction: column;
  }

  .post-image-wrapper-related {
    flex-basis: auto;
    width: 100%;
  }
}

/* Popup variants */
.post-item-related.popup {
  position: fixed;
  z-index: 1050;
  max-width: min(420px, calc(100vw - 24px));
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.post-item-related.popup.show {
  opacity: 1;
  pointer-events: auto;
}

.post-item-related.popup.center-bottom {
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
}

.post-item-related.popup.center-middle {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.post-item-related.popup.center-top {
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
}

.post-item-related.popup.left-bottom {
  left: 16px;
  bottom: 16px;
}

.post-item-related.popup.left-middle {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.post-item-related.popup.left-top {
  left: 16px;
  top: 16px;
}

.post-item-related.popup.right-bottom {
  right: 16px;
  bottom: 16px;
}

.post-item-related.popup.right-middle {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.post-item-related.popup.right-top {
  right: 16px;
  top: 16px;
}

.post-item-related.popup .fa-times {
  cursor: pointer;
  padding: 4px;
}
