/* ==========================================================
   Success Stories Cards — CSS only (HTML untouched)
   Palette: #0A66C2 (primary blue) / #D94C4B (accent red)
   ========================================================== */

.cst-container {
  --cst-blue: #0A66C2;
  --cst-red: #D94C4B;
  --cst-blue-tint: #EAF2FB;
  --cst-blue-line: #D3E3F5;
  --cst-ink: #14233B;
  --cst-muted: #66758A;
  --cst-gap: clamp(16px, 2.2vw, 28px);
  --cst-radius: 22px;

  width: 100%;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.cst-container *,
.cst-container *::before,
.cst-container *::after {
  box-sizing: border-box;
}

/* ---------- Grid ---------- */
.cst-grid {
  display: grid;
  grid-template-columns: repeat(var(--cst-cols, 3), minmax(0, 1fr));
  gap: var(--cst-gap);
}

/* ---------- Card ---------- */
.cst-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 10px 10px 20px;
  background: linear-gradient(180deg, #ffffff 0%, var(--cst-blue-tint) 100%);
  border: 1px solid var(--cst-blue-line);
  border-radius: var(--cst-radius);
  box-shadow: 0 10px 28px rgba(10, 102, 194, 0.10);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.cst-card:hover {
  box-shadow: 0 16px 36px rgba(10, 102, 194, 0.16);
  transform: translateY(-3px);
}

/* decorative circle, bottom-right */
.cst-card::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: -64px;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: rgba(10, 102, 194, 0.08);
  pointer-events: none;
}

/* ---------- Video ---------- */
.cst-video-box {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #0d2a4d;
  isolation: isolate;
}

.cst-video-box img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.cst-video-box:hover img {
  transform: scale(1.05);
}

.cst-video-box:focus-visible {
  outline: 3px solid var(--cst-red);
  outline-offset: 3px;
}

/* "Video" pill badge */
.cst-video-box::before {
  content: "Video";
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 7px 14px 7px 34px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  color: var(--cst-ink);
  background:
    #fff
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230A66C2'><path d='M4 4h10a2 2 0 012 2v2.5l4-2.5v12l-4-2.5V18a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2z'/></svg>")
    no-repeat 12px center / 16px;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

/* Play button */
.cst-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(48px, 14%, 62px);
  aspect-ratio: 1;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -50%);
  transition: transform 0.2s ease, background 0.2s ease;
}

.cst-play-button svg {
  width: 38%;
  height: 38%;
  margin-left: 3px;
  fill: var(--cst-blue);
  transition: fill 0.2s ease;
}

.cst-video-box:hover .cst-play-button,
.cst-video-box:focus-visible .cst-play-button {
  transform: translate(-50%, -50%) scale(1.08);
  background: var(--cst-red);
}

.cst-video-box:hover .cst-play-button svg,
.cst-video-box:focus-visible .cst-play-button svg {
  fill: #fff;
}

/* Placeholder when no thumbnail */
.cst-video-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  background: linear-gradient(135deg, #0d2a4d, var(--cst-blue));
}

.cst-video-placeholder svg {
  width: 34px;
  height: 34px;
}

/* ---------- Client info ---------- */
.cst-card-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 10px;
}

.cst-avatar {
  flex: 0 0 56px;
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--cst-blue);
  border-radius: 50%;
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--cst-blue-line);
}

.cst-client-details {
  flex: 1 1 auto;
  min-width: 0;
}

.cst-client-name {
  margin: 0 0 3px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--cst-ink);
  overflow-wrap: anywhere;
}

/* role + company stacked, separator hidden */
.cst-client-role {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.4;
}

.cst-role-separator {
  display: none;
}

.cst-designation {
  color: var(--cst-muted);
}

.cst-company {
  font-weight: 600;
  color: var(--cst-blue);
}


/* ── Lightbox Overlay ────────────────────────────────────────────────────────── */
.cst-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    padding: 60px 20px 20px;
    box-sizing: border-box;
}

.cst-lightbox.active {
    display: flex;
    animation: cstFadeIn 0.2s ease;
}

@keyframes cstFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.cst-lightbox-inner {
    position: relative;
    width: 100%;
    max-width: 900px;
    background: #000000;
    border-radius: 8px;
    overflow: visible;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.cst-lightbox-media-wrap {
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    background: #000000;
}

.cst-lightbox-media {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
}

.cst-lightbox-media iframe,
.cst-lightbox-media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.cst-lightbox-close {
    position: absolute;
    top: -46px;
    right: 0;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
    z-index: 10;
    line-height: 1;
    padding: 0;
    outline: none;
}

.cst-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.05);
}

/* ---------- Responsive ---------- */

/* Large tablets / small laptops: cap at 3 columns */
@media (max-width: 1100px) {
  .cst-grid {
    grid-template-columns: repeat(min(var(--cst-cols, 3), 3), minmax(0, 1fr));
  }
}

/* Tablets: 2 columns */
@media (max-width: 860px) {
  .cst-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phones: 1 column */
@media (max-width: 560px) {
  .cst-grid {
    grid-template-columns: 1fr;
  }

  .cst-card {
    border-radius: 18px;
  }

  .cst-avatar {
    flex-basis: 50px;
    width: 50px;
    height: 50px;
    font-size: 16px;
  }

  .cst-client-name {
    font-size: 16px;
  }
}

/* Touch devices: no hover lift */
@media (hover: none) {
  .cst-card:hover {
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cst-card,
  .cst-video-box img,
  .cst-play-button,
  .cst-play-button svg {
    transition: none;
  }
}


.cst-container {
  --cst-star: #F5A623;          /* swap to var(--cst-red) to stay strictly on-palette */
  --cst-star-empty: #D3E3F5;
}
 
.cst-rating-row {
  position: relative;           /* sits above the decorative circle */
  z-index: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: -4px;             /* tighten the card's 16px gap after the header */
  padding: 0 10px;
}
 
/* Star wrapper, if the function outputs one */
.cst-rating-row .cst-stars,
.cst-rating-row .cst-star-wrap,
.cst-rating-row .cst-rating-stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
 
/* Each star SVG */
.cst-rating-row svg {
  flex: 0 0 auto;
  display: block;
  width: 18px;
  height: 18px;
  fill: var(--cst-star-empty);
  stroke: none;
}
 
/* Filled stars — common class patterns */
.cst-rating-row svg.cst-star-filled,
.cst-rating-row svg.cst-star--filled,
.cst-rating-row svg.is-filled,
.cst-rating-row svg.filled,
.cst-rating-row svg.full,
.cst-rating-row .cst-star-filled svg,
.cst-rating-row .is-filled svg,
.cst-rating-row .filled svg {
  fill: var(--cst-star);
}
 
/* Empty stars — explicit, wins over filled if both classes exist */
.cst-rating-row svg.cst-star-empty,
.cst-rating-row svg.cst-star--empty,
.cst-rating-row svg.empty,
.cst-rating-row .cst-star-empty svg,
.cst-rating-row .empty svg {
  fill: var(--cst-star-empty);
}
 
/* Fallback: if stars are plain, classless SVGs, treat them all as filled.
   Remove this block if your empty stars have no class. */
.cst-rating-row svg:not([class]) {
  fill: var(--cst-star);
}
 
/* Number pill: "5/5" */
.cst-rating-number {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  color: #0A66C2;
  background: #fff;
  border: 1px solid #D3E3F5;
  border-radius: 999px;
}
 
/* Phones */
@media (max-width: 560px) {
  .cst-rating-row svg {
    width: 16px;
    height: 16px;
  }
 
  .cst-rating-number {
    font-size: 11.5px;
    padding: 3px 10px;
  }
}