/* ================================================================
   CharityJournal Sustainability & Ratings Slider — v1.2.0
   File: wp-content/mu-plugins/cj-slider-assets/slider.css
   ================================================================ */

/* ── Fonts (same as the main sustainability plugin) ── */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600&family=DM+Sans:wght@300;400;500&display=swap');

:root {
  --cj-sl-green:      #1a4d2e;
  --cj-sl-green-mid:  #2d7a47;
  --cj-sl-gold:       #b8913a;
  --cj-sl-gold-lt:    #e8d5a0;
  --cj-sl-cream:      #faf8f4;
  --cj-sl-border:     #ddd8cc;
  --cj-sl-muted:      #6b6560;
  --cj-sl-text:       #1c1c1c;
  --cj-sl-card-w:     270px;     /* card width on desktop */
  --cj-sl-gap:        16px;      /* gap between cards */
  --cj-sl-radius:     10px;
  --cj-sl-speed:      0.45s;
}

/* ── Section wrapper ── */
.cj-sl-section {
  font-family: 'DM Sans', sans-serif;
  margin: 32px 0;
  position: relative;
}

/* ── Header row (title + controls) ── */
.cj-sl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.cj-sl-section-title {
  font-family: 'Playfair Display', serif !important;
  font-size: 22px !important;
  font-weight: 600 !important;
  color: var(--cj-sl-green) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  line-height: 1.2 !important;
}

/* ── Controls row (prev / dots / next / more) ── */
.cj-sl-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cj-sl-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--cj-sl-border);
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--cj-sl-green);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  line-height: 1;
  padding: 0;
}

.cj-sl-btn:hover {
  background: var(--cj-sl-green);
  border-color: var(--cj-sl-green);
  color: #fff;
}

.cj-sl-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ── Dot indicators ── */
.cj-sl-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.cj-sl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cj-sl-border);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.cj-sl-dot.active {
  background: var(--cj-sl-green);
  transform: scale(1.3);
}

/* ── "More →" link ── */
.cj-sl-more {
  font-size: 12px;
  font-weight: 500;
  color: var(--cj-sl-muted) !important;
  text-decoration: none !important;
  margin-left: 4px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--cj-sl-border);
  background: #fff;
}

.cj-sl-more:hover {
  color: #fff !important;
  background: var(--cj-sl-green);
  border-color: var(--cj-sl-green);
}

/* ── Card type accent stripe along top edge ── */
.cj-sl-card--sust {
  border-top: 3px solid var(--cj-sl-green);
}

.cj-sl-card--rating {
  border-top: 3px solid #0d5c63;
}

/* Ratings badge uses teal to distinguish from sustainability gold */
.cj-sl-card--rating .cj-sl-cat-badge {
  background: #0d5c63;
}

/* ── Overflow mask ── */
.cj-sl-track-wrap {
  overflow: hidden;
  position: relative;
  /* Subtle fade at the right edge */
  -webkit-mask-image: linear-gradient(to right, #000 85%, transparent 100%);
          mask-image: linear-gradient(to right, #000 85%, transparent 100%);
}

/* ── The scrolling track ── */
.cj-sl-track {
  display: flex;
  gap: var(--cj-sl-gap);
  will-change: transform;
  transition: transform var(--cj-sl-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Individual card ── */
.cj-sl-card {
  flex: 0 0 var(--cj-sl-card-w);
  width: var(--cj-sl-card-w);
  background: #fff;
  border: 1px solid var(--cj-sl-border);
  border-radius: var(--cj-sl-radius);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.cj-sl-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(26, 77, 46, 0.13);
}

.cj-sl-card-link {
  display: block;
  text-decoration: none !important;
  color: inherit !important;
  height: 100%;
}

/* ── Thumbnail area ── */
.cj-sl-thumb {
  position: relative;
  height: 155px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--cj-sl-green) 0%, #0f2e1a 100%);
}

.cj-sl-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.cj-sl-card:hover .cj-sl-thumb img {
  transform: scale(1.05);
}

.cj-sl-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--cj-sl-green) 0%, #0f2e1a 100%);
}

/* ── Category badge (top-left on thumb) ── */
.cj-sl-cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 3px;
  background: var(--cj-sl-gold);
  color: #fff;
  pointer-events: none;
}

/* ── Score badge (bottom-right on thumb) ── */
.cj-sl-score {
  position: absolute;
  bottom: 10px;
  right: 10px;
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  pointer-events: none;
  min-width: 42px;
}

.cj-sl-grade {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
}

.cj-sl-pts {
  font-size: 10px;
  color: rgba(255,255,255,0.85);
  margin-top: 2px;
}

.cj-sl-pts small {
  font-size: 8px;
  opacity: 0.75;
}

/* ── Card body ── */
.cj-sl-body {
  padding: 13px 14px 14px;
}

.cj-sl-title {
  font-family: 'Playfair Display', serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--cj-sl-text) !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
  border: none !important;
  line-height: 1.4 !important;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cj-sl-meta {
  font-size: 11px !important;
  color: var(--cj-sl-muted) !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ── Empty state ── */
.cj-slider-empty {
  background: var(--cj-sl-cream);
  border: 1px dashed var(--cj-sl-border);
  border-radius: var(--cj-sl-radius);
  padding: 24px;
  font-size: 14px;
  color: var(--cj-sl-muted);
}

/* ── Progress bar (autoplay indicator, runs under the track) ── */
.cj-sl-progress {
  height: 2px;
  background: var(--cj-sl-border);
  border-radius: 2px;
  margin-top: 12px;
  overflow: hidden;
  display: none;
}

.cj-sl-section[data-autoplay="true"] .cj-sl-progress {
  display: block;
}

.cj-sl-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cj-sl-green-mid), var(--cj-sl-gold));
  border-radius: 2px;
}

/* ── Touch / swipe hint (fade-in arrows on mobile) ── */
@media (hover: none) {
  .cj-sl-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
  }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   RESPONSIVE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* Tablet: narrower cards */
@media (max-width: 1024px) {
  :root {
    --cj-sl-card-w: 230px;
  }
}

/* Mobile: full-width single card */
@media (max-width: 640px) {
  :root {
    --cj-sl-card-w: calc(100vw - 40px);
  }

  .cj-sl-track-wrap {
    -webkit-mask-image: none;
            mask-image: none;
  }

  .cj-sl-section-title {
    font-size: 18px !important;
  }
}