/**
 * Rashaara Content Manager - Scoped Frontend Styles
 */

:root {
  --rcm-primary: var(--rashaara-primary, #fd5d5d);
  --rcm-dark: #2c3e50;
  --rcm-gray: #6c757d;
  --rcm-light: #f8f9fa;
  --rcm-border: rgba(0, 0, 0, 0.08);
}

/* Card Presentation */
.rcm-card {
  border: 1px solid var(--rcm-border);
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.rcm-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
}

.rcm-card-img-wrapper {
  position: relative;
  width: 100%;
  padding-top: 60%; /* 16:9 - 5:3 ratio */
  overflow: hidden;
  background: #f1f3f5;
}

.rcm-card-img-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.rcm-card:hover .rcm-card-img-wrapper img {
  transform: scale(1.05);
}

/* Subtle, polished fallback header when no featured image is uploaded */
.rcm-card-fallback-banner {
  position: relative;
  width: 100%;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  overflow: hidden;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.rcm-card-fallback-banner.banner-rcm_article {
  background: linear-gradient(135deg, #fff5f5 0%, #ffe3e3 100%);
  border-bottom: 2px solid #ffa8a8;
}

.rcm-card-fallback-banner.banner-rcm_newsletter {
  background: linear-gradient(135deg, #f0f7ff 0%, #dbeafe 100%);
  border-bottom: 2px solid #93c5fd;
}

.rcm-card-fallback-banner.banner-rcm_event {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-bottom: 2px solid #86efac;
}

.rcm-card-fallback-banner.banner-rcm_announcement {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border-bottom: 2px solid #fde68a;
}

.rcm-card-fallback-watermark {
  position: absolute;
  right: 15px;
  bottom: -10px;
  font-size: 4rem;
  opacity: 0.12;
  color: #000000;
  pointer-events: none;
}

.rcm-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.rcm-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  color: var(--rcm-gray);
}

.rcm-card-title {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.rcm-card-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.rcm-card-title a:hover {
  color: var(--rcm-primary);
}

.rcm-card-excerpt {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.rcm-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rcm-read-more {
  color: var(--rcm-primary);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.2s ease;
}

.rcm-read-more:hover {
  color: var(--rcm-primary);
  gap: 0.7rem;
}

/* Badges */
.rcm-badge {
  display: inline-block;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.badge-rcm-article {
  background-color: rgba(253, 93, 93, 0.12);
  color: #fd5d5d;
}

.badge-rcm-newsletter {
  background-color: rgba(13, 110, 253, 0.12);
  color: #0d6efd;
}

.badge-rcm-event {
  background-color: rgba(25, 135, 84, 0.12);
  color: #198754;
}

.badge-rcm-announcement {
  background-color: rgba(255, 193, 7, 0.25);
  color: #b78103;
}

/* Featured Star Badge */
.rcm-featured-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffc107;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  backdrop-filter: blur(4px);
  z-index: 2;
}

/* Filter Navigation */
.rcm-filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.rcm-filter-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
  color: #495057;
  text-decoration: none;
  transition: all 0.2s ease;
}

.rcm-filter-btn:hover,
.rcm-filter-btn.active {
  background: var(--rcm-primary);
  border-color: var(--rcm-primary);
  color: #ffffff;
}

/* Event Specific Styling */
.rcm-event-meta-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-left: 4px solid var(--rcm-primary);
  border-radius: 0 8px 8px 0;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.rcm-event-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.rcm-event-meta-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: #333333;
}

.rcm-event-meta-item i,
.rcm-event-meta-item svg {
  color: var(--rcm-primary);
  font-size: 1.1rem;
  margin-top: 3px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

/* Single Content Template Styling */
.rcm-single-article {
  max-width: 860px;
  margin: 0 auto;
}

.rcm-single-header {
  margin-bottom: 2.5rem;
}

.rcm-single-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.rcm-single-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  color: var(--rcm-gray);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.rcm-single-featured-img {
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 2.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.rcm-single-featured-img img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.rcm-single-content {
  font-size: 1.125rem;
  line-height: 1.8;
  color: #333333;
}

.rcm-single-content p {
  margin-bottom: 1.5rem;
}

.rcm-single-content h2,
.rcm-single-content h3,
.rcm-single-content h4 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.rcm-single-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.rcm-single-content figure {
  margin: 2rem 0;
}

.rcm-single-content figcaption {
  font-size: 0.875rem;
  color: #6c757d;
  text-align: center;
  margin-top: 0.5rem;
}

.rcm-single-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

@media (max-width: 768px) {
  .rcm-single-title {
    font-size: 1.85rem;
  }
  .rcm-single-content {
    font-size: 1rem;
  }
}
