/* ─── AILP Related Posts Box — Frontend Styles ──────────────────────────────── */

/* ── Container ────────────────────────────────────────────────────────────── */
.ailp-related-box {
  margin: 2.5em 0;
  padding: 0;
  clear: both;
  font-family: inherit;
}

/* ── Box Title ────────────────────────────────────────────────────────────── */
.ailp-related-title {
  font-size: 1.05em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin: 0 0 1em;
  padding: 0 0 .6em;
  border-bottom: 2px solid #e5e7eb;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ailp-related-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 1em;
  background: #7c3aed;
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── List reset ───────────────────────────────────────────────────────────── */
.ailp-related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Each item ────────────────────────────────────────────────────────────── */
.ailp-related-item {
  margin: 0;
  padding: 0;
  border-bottom: 1px solid #f3f4f6;
}

.ailp-related-item:last-child {
  border-bottom: none;
}

/* ── Link ─────────────────────────────────────────────────────────────────── */
.ailp-related-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 4px;
  text-decoration: none !important;
  color: inherit !important;
  transition: background .15s;
  border-radius: 6px;
}

.ailp-related-link:hover {
  background: rgba(124, 58, 237, .04);
}

/* ── Thumbnail ────────────────────────────────────────────────────────────── */
.ailp-related-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 56px;
  overflow: hidden;
  border-radius: 6px;
  background: #f3f4f6;
}

.ailp-related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s ease;
}

.ailp-related-link:hover .ailp-related-thumb img {
  transform: scale(1.05);
}

/* ── Meta block ───────────────────────────────────────────────────────────── */
.ailp-related-meta {
  flex: 1;
  min-width: 0;
}

.ailp-related-item-title {
  display: block;
  font-size: .95em;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.4;
  transition: color .15s;
  /* Clamp to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ailp-related-link:hover .ailp-related-item-title {
  color: #7c3aed;
}

.ailp-related-date {
  display: block;
  font-size: .8em;
  color: #9ca3af;
  margin-top: 4px;
}

.ailp-related-excerpt {
  font-size: .82em;
  color: #6b7280;
  margin: 4px 0 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ════════════════════════════════════════════════
   PURPLE STYLE
═════════════════════════════════════════════════ */
.ailp-related--purple {
  background: linear-gradient(135deg, #faf5ff 0%, #f5f3ff 100%);
  border: 1px solid #ede9fe;
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 2px 12px rgba(124,58,237,.08);
}

.ailp-related--purple .ailp-related-title {
  color: #5b21b6;
  border-bottom-color: #ede9fe;
}

.ailp-related--purple .ailp-related-title::before {
  background: #7c3aed;
}

.ailp-related--purple .ailp-related-item {
  border-bottom-color: #ede9fe;
}

.ailp-related--purple .ailp-related-link:hover {
  background: rgba(124,58,237,.06);
}

.ailp-related--purple .ailp-related-link:hover .ailp-related-item-title {
  color: #6d28d9;
}

.ailp-related--purple .ailp-related-item-title {
  color: #3b0764;
}

/* ════════════════════════════════════════════════
   RESPONSIVE
═════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .ailp-related-thumb {
    width: 60px;
    height: 48px;
  }

  .ailp-related-item-title {
    font-size: .88em;
  }

  .ailp-related-link {
    padding: 12px 2px;
  }
}

/* ── Accessibility ────────────────────────────────────────────────────────── */
.ailp-related-link:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}
