/* ============================================================
   Checkatrade Reviews Carousel — Front-end Styles
   ============================================================ */

:root {
  --ctr-accent: #00b140;
  --ctr-accent-dark: #008f33;
  --ctr-bg: #ffffff;
  --ctr-card-bg: #f9fafb;
  --ctr-border: #e5e7eb;
  --ctr-text: #1a1a2e;
  --ctr-muted: #6b7280;
  --ctr-star: #f59e0b;
  --ctr-radius: 16px;
  --ctr-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --ctr-transition: 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Wrapper */
.ctr-wrapper {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px 40px;
  color: var(--ctr-text);
  box-sizing: border-box;
}

/* ── Header ── */
.ctr-header {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--ctr-bg);
  border: 1px solid var(--ctr-border);
  border-radius: var(--ctr-radius);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: var(--ctr-shadow);
}

.ctr-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 180px;
}

.ctr-header-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ctr-text);
}

.ctr-header-score {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.ctr-score-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--ctr-accent);
  line-height: 1;
}

.ctr-score-denom {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ctr-muted);
}

.ctr-score-label {
  font-size: 0.8rem;
  color: var(--ctr-muted);
  margin-left: 6px;
  white-space: nowrap;
}

.ctr-profile-link {
  font-size: 0.85rem;
  color: var(--ctr-accent);
  text-decoration: none;
  font-weight: 600;
  border: 1.5px solid var(--ctr-accent);
  padding: 6px 14px;
  border-radius: 50px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.ctr-profile-link:hover {
  background: var(--ctr-accent);
  color: #fff;
}

/* ── Carousel ── */
.ctr-carousel {
  overflow: hidden;
  border-radius: var(--ctr-radius);
  position: relative;
}

.ctr-track {
  display: flex;
  transition: transform var(--ctr-transition);
  will-change: transform;
}

.ctr-slide {
  min-width: 100%;
  box-sizing: border-box;
  padding: 4px;
}

/* ── Card ── */
.ctr-card {
  background: var(--ctr-bg);
  border: 1px solid var(--ctr-border);
  border-radius: var(--ctr-radius);
  padding: 28px 32px;
  box-shadow: var(--ctr-shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ctr-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--ctr-accent);
}

/* ── Card Top Row ── */
.ctr-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.ctr-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ctr-accent);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.ctr-meta {
  flex: 1;
}

.ctr-reviewer {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ctr-text);
}

.ctr-location {
  font-size: 0.8rem;
  color: var(--ctr-muted);
  margin-top: 2px;
}

.ctr-rating-badge {
  background: var(--ctr-accent);
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 6px 12px;
  border-radius: 10px;
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.ctr-rating-badge span {
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.9;
}

/* ── Stars ── */
.ctr-stars {
  display: block;
  color: var(--ctr-star);
  font-size: 1.3rem;
  letter-spacing: 2px;
  margin-bottom: 16px;
}

/* ── Quote ── */
.ctr-quote {
  margin: 0 0 20px;
  padding: 0;
  border: none;
  position: relative;
  font-size: 1rem;
  line-height: 1.7;
  color: #374151;
}

.ctr-quote-mark {
  font-size: 3.5rem;
  line-height: 0;
  vertical-align: -0.4em;
  color: var(--ctr-accent);
  opacity: 0.3;
  font-family: Georgia, serif;
  margin-right: 4px;
}

/* ── Card Footer ── */
.ctr-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--ctr-border);
}

.ctr-work-type {
  font-size: 0.8rem;
  background: rgba(0, 177, 64, 0.1);
  color: var(--ctr-accent-dark);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
}

.ctr-date {
  font-size: 0.8rem;
  color: var(--ctr-muted);
}

/* ── Controls ── */
.ctr-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}

.ctr-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--ctr-border);
  background: var(--ctr-bg);
  color: var(--ctr-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.ctr-btn:hover {
  background: var(--ctr-accent);
  border-color: var(--ctr-accent);
  color: #fff;
  transform: scale(1.08);
}

.ctr-btn:focus-visible {
  outline: 2px solid var(--ctr-accent);
  outline-offset: 2px;
}

.ctr-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
}

.ctr-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ctr-border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.25s, transform 0.25s, width 0.25s;
}

.ctr-dot.active {
  background: var(--ctr-accent);
  width: 24px;
  border-radius: 5px;
  transform: none;
}

.ctr-dot:hover:not(.active) {
  background: var(--ctr-muted);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .ctr-card {
    padding: 20px 18px;
  }

  .ctr-header {
    padding: 14px 16px;
    gap: 10px;
  }

  .ctr-score-num {
    font-size: 1.6rem;
  }

  .ctr-header-title {
    font-size: 0.88rem;
  }

  .ctr-profile-link {
    width: 100%;
    text-align: center;
  }

  .ctr-quote {
    font-size: 0.94rem;
  }
}

/* ── No reviews ── */
.ctr-no-reviews {
  text-align: center;
  color: var(--ctr-muted);
  padding: 40px 20px;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .ctr-track { transition: none; }
  .ctr-btn   { transition: none; }
  .ctr-dot   { transition: none; }
}
