/*
 * Stylesheet for the Mid Related Posts plugin
 *
 * The goal of this stylesheet is to make the related posts section stand out
 * against dark themes without clashing with a site’s existing colour palette.
 * We use a light background, subtle glow and warm colours that complement
 * the accent colours seen on many blog themes.
 */

.rpm-related-posts {
  margin: 2em 0;
  padding: 1.5em;
  border-radius: 8px;
  /* Light background to contrast against dark themes */
  background: #fffbe6;
  border: 2px solid #D8C4A4;
  /* Glowing effect to draw attention */
  box-shadow: 0 0 12px rgba(216, 196, 164, 0.8), 0 0 6px rgba(216, 196, 164, 0.6);
  animation: rpmGlow 4s ease-in-out infinite alternate;
}

@keyframes rpmGlow {
  0% {
    box-shadow: 0 0 10px rgba(216, 196, 164, 0.8), 0 0 4px rgba(216, 196, 164, 0.6);
  }
  100% {
    box-shadow: 0 0 20px rgba(205, 54, 54, 0.8), 0 0 8px rgba(205, 54, 54, 0.6);
  }
}

/* Title styling */
.rpm-related-posts .rpm-title {
  margin-top: 0;
  margin-bottom: 0.75em;
  font-size: 1.5em;
  font-weight: 600;
  color: #cd3636;
}

/* Ordered list resets */
/*
 * Reset default numbering and prepare our own numbered list.
 * We use CSS counters for numbering and style each number via nth-child selectors.
 */
.rpm-related-posts .rpm-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rpm-counter;
}

/* Each list item increments the counter and draws a separator line below. */
.rpm-related-posts .rpm-post-list .rpm-post-item {
  position: relative;
  padding-left: 2em;
  margin: 0.5em 0;
  font-size: 1.1em;
  font-weight: 500;
  color: #2c3e50;
  border-bottom: 1px solid rgba(44, 62, 80, 0.2);
}

/* Remove border on last item */
.rpm-related-posts .rpm-post-list .rpm-post-item:last-child {
  border-bottom: none;
}

/* Use a pseudo-element to display the counter before each item */
.rpm-related-posts .rpm-post-list .rpm-post-item::before {
  counter-increment: rpm-counter;
  content: counter(rpm-counter);
  font-weight: 700;
  position: absolute;
  left: 0;
  top: 0;
  line-height: 1.5;
  width: 1.5em;
  text-align: center;
}

/* Colour the numbers using nth-child selectors. Feel free to add more colours as needed. */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(1)::before { color: #cd3636; } /* red */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(2)::before { color: #3498db; } /* blue */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(3)::before { color: #27ae60; } /* green */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(4)::before { color: #9b59b6; } /* purple */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(5)::before { color: #e67e22; } /* orange */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(6)::before { color: #16a085; } /* teal */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(7)::before { color: #f39c12; } /* yellow */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(8)::before { color: #e74c3c; } /* crimson */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(9)::before { color: #2980b9; } /* dark blue */
.rpm-related-posts .rpm-post-list .rpm-post-item:nth-child(10)::before { color: #8e44ad; } /* dark purple */

/* Link styles */
.rpm-related-posts .rpm-post-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.rpm-related-posts .rpm-post-link:hover {
  color: #cd3636;
  text-decoration: underline;
}