/*
 * Block: cy/redesign-cpv-core
 * Direction E — Solution Switcher
 *
 * Layout: 3-column editorial grid shared across every block in the section.
 *   col 1 (cpv-e-col-num): 56px  — step counter / index
 *   col 2 (cpv-e-col-label): 260px — section label / card title
 *   col 3 (cpv-e-col-body): minmax(0, 1fr) — body copy
 *
 * Colour tokens reuse the existing CPV design system.
 */

/* ── Section shell ─────────────────────────────────────────────────────── */

.cpv-core--switcher {
  background: var(--color-light-warm);
  /* No bottom padding: the partner-quote band sits flush against the next
     section (Your Business Outcomes), so there's no light-warm strip between
     the quotes and the outcomes' sand background. */
  padding: 88px 0 0;
}

/* ── Problem stage — a calm "intro" card (lighter than the switcher's gradient
 *    card below it): subtle sand surface, soft border + shadow, same dot-grid
 *    motif. Sets up the rhythm: problem (calm) → solution (vibrant) → CISO. ── */

.cpv-e-stage {
  width: min(100% - 48px, var(--cpv-container));
  margin: 0 auto 40px;
  position: relative;
  overflow: hidden;
  background: var(--color-sand-50, #f7f6f2);
  border: 1px solid var(--color-sand-300, #d8d5cc);
  border-radius: 24px;
  box-shadow: 0 30px 70px -55px rgba(9, 48, 85, 0.28);
  padding: 56px 64px; /* symmetric — content aligns with the switcher card below */
}

/* Subtle dot-grid texture, masked to fade top & bottom. */
.cpv-e-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(45, 43, 36, 0.06) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 110px, #000 calc(100% - 55px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 110px, #000 calc(100% - 55px), transparent 100%);
}

.cpv-e-stage > * {
  position: relative;
  z-index: 1;
}

/* ── "How Cynomi Changes" wrapper — heading + pills + card, all on the
 *    page's container grid so content lines up with the Problem above. ── */

.cpv-changes {
  width: min(100% - 48px, var(--cpv-container));
  margin: 0 auto;
}

/* Section header lives INSIDE the card (eyebrow + heading), fused to the
 * switcher below by a hairline divider so heading + tabs read as ONE section.
 * Inset 36px to share the switcher's left edge (card padding 28 + 36 = 64). */
.cpv-changes-card__head {
  padding: 6px 36px 0;
  margin-bottom: 34px;
}

.cpv-changes-card__head .cpv-eyebrow {
  display: block;
  margin-bottom: 12px;
}

.cpv-changes-card__head .cpv-changes-title {
  margin: 0;
  max-width: none;
  text-align: left;
}

/* Background card: a subtle sand zone (softer than the old stark white).
 * Holds the switcher only (pills + panel + dots) now — the CISO band moved
 * out to its own `.cpv-ciso` section below. */
.cpv-changes-card {
  /* Sand → light-blue wash (Figma update): sand-50 fading to the brand
     bright blue at low opacity. No new tokens — existing shades + opacity. */
  background: linear-gradient(110deg,
    var(--color-sand-50, #f7f6f2) 0%,
    var(--color-sand-50, #f7f6f2) 38%,
    rgba(0, 111, 231, 0.13) 100%);
  border-radius: 24px;
  border: 1px solid var(--color-sand-300, #d8d5cc); /* subtle stroke on the outermost card */
  box-shadow: 0 30px 70px -55px rgba(9, 48, 85, 0.3);
  padding: 40px 28px; /* reduced horizontal padding */
  box-sizing: border-box;
  position: relative; /* positioning context for the decorative number + texture */
  overflow: hidden;   /* clip the dot-grid texture to the rounded card */
}

/* Subtle dot-grid texture inside the card — the same motif as Business
 * Outcomes, for visual consistency. Very low contrast + masked top & bottom
 * so the pills and copy stay perfectly legible. */
.cpv-changes-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(45, 43, 36, 0.08) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 150px, #000 calc(100% - 70px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 150px, #000 calc(100% - 70px), transparent 100%);
}

/* Keep the header + switcher above the texture. */
.cpv-changes-card__head,
.cpv-changes-card .cpv-sw-card {
  position: relative;
  z-index: 1;
}

/* ── Editorial grid: label + body (the old empty number column is gone so
 *    content aligns flush-left with the rest of the page). ─────────────── */

.cpv-e-row {
  display: grid;
  /* Match the switcher panel's columns so the Problem body lines up with the
     paragraphs inside the card. */
  grid-template-columns: 300px minmax(0, 1fr);
  column-gap: 48px;
  align-items: start;
}

/* The numbered index column is no longer used — keep it removed everywhere. */
.cpv-e-col-num {
  display: none;
}

/* ── Problem section ───────────────────────────────────────────────────── */

.cpv-e-problem .cpv-eyebrow {
  display: block;
  margin-bottom: 10px;
}

.cpv-e-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500; /* consistent medium weight — no bold display type */
  font-size: clamp(30px, 3.2vw, 40px); /* canonical section-title scale (page-wide) */
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--color-sand-800, #2d2b24);
}

.cpv-e-problem .cpv-e-col-body p {
  margin: 0;
  /* Standard body size — consistent with the switcher / CISO / outcomes copy. */
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-sand-700, #3c3a30);
  text-wrap: pretty;
}

.cpv-e-problem .cpv-e-col-body p + p {
  margin-top: 18px;
}

/* ── Horizontal rule ───────────────────────────────────────────────────── */

.cpv-e-rule {
  border: none;
  border-top: 1px solid var(--cpv-line);
  margin: 52px 0;
}

/* ── Transparent inner card ────────────────────────────────────────────
 * Wraps the pills + switcher panel + dots. Transparent, but shares the navy
 * card's horizontal inset (36px) so the pills and panel text align exactly
 * with the text inside the navy CISO card below. */
.cpv-sw-card {
  position: relative; /* anchor the big faint step number to the switcher body */
  padding: 0 36px;
}

/* ── Pill-tab strip ────────────────────────────────────────────────────── */

.cpv-sw-tabs {
  margin-bottom: 40px; /* more separation between the pills and the panel title */
}

/* Segmented-control "track" holding the tabs — reads as one switcher, not a
 * row of buttons. Hugs its content; wraps within the card on small screens. */
.cpv-sw-strip {
  display: flex;            /* full-width track: its edges align with the panel below */
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  background: rgba(45, 43, 36, 0.05);
  border: 1px solid rgba(45, 43, 36, 0.06);
  border-radius: 14px;
}

/* Tab inside the track: plain text + number, no border or fill (not a button). */
.cpv-sw-tab {
  appearance: none;
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 8px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-sand-700, #3c3a30);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.cpv-sw-tab-num {
  font-size: 11px;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--color-sand-600, #5c584c); /* sand tone instead of navy-muted */
  transition: color 0.18s;
}

.cpv-sw-tab:hover {
  color: var(--brand-bright-blue, #006fe7);
  background: rgba(0, 111, 231, 0.06);
}

/* Active tab = raised "paper" chip with blue text (the selected segment). */
.cpv-sw-tab.is-active {
  background: #fff;
  color: var(--brand-bright-blue, #006fe7);
  box-shadow: 0 1px 2px rgba(9, 48, 85, 0.12), 0 0 0 1px rgba(45, 43, 36, 0.05);
}

.cpv-sw-tab.is-active .cpv-sw-tab-num {
  color: var(--brand-bright-blue, #006fe7);
}

/* ── Switcher stage (panel area inside the capabilities card) ──────────── */

.cpv-sw-stage {
  /* Grid stacking: every panel shares one cell, so the height is fixed to
     the tallest (longest) panel and never jumps between tabs. */
  position: relative; /* anchors the decorative number to the panel block */
  display: grid;
}

.cpv-sw-panel {
  grid-area: 1 / 1;            /* all panels stack in the same cell */
  display: grid;
  /* Title | body | a reserved right-hand channel for the big step number,
     so the copy never overlaps it (the number lives in col 3). */
  grid-template-columns: 300px minmax(0, 1fr) clamp(96px, 11%, 136px);
  column-gap: 48px;
  align-items: start;
  opacity: 0;
  visibility: hidden;
  /* No transform on the panel itself — a transform would make it the
     containing block for its ::before (the decorative number) mid-transition,
     causing the number to slide into place. Panel only fades. */
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              visibility 0.7s;
  pointer-events: none;
}

.cpv-sw-panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* The body copy carries the gentle slide-up. The title column and the
   decorative number only cross-fade (via the panel's opacity) — no position
   animation — so the titles match the number's clean crossfade. */
.cpv-sw-panel > .cpv-e-col-body {
  transform: translateY(8px);
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.cpv-sw-panel.is-active > .cpv-e-col-body {
  transform: none;
}

/* Large faint step index — centred in its own reserved right-hand channel
   (grid col 3) so the body copy never overlaps it. */
.cpv-sw-panel::before {
  content: "0" attr(data-sw-panel);
  position: absolute;
  top: 50%;
  right: 0;   /* sits in the reserved right channel, clear of the copy */
  transform: translateY(-50%);
  z-index: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 108px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: rgba(60, 58, 48, 0.13); /* faint sand tone — a touch more present now it's clear */
  pointer-events: none;
}

.cpv-sw-panel .cpv-e-col-num {
  display: none;
}

.cpv-sw-panel h3 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  /* Feature-level title — one step below the 40px section titles: display
     family, medium weight, bright-blue highlight. */
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 30px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--brand-bright-blue, #006fe7); /* blue highlight on titles */
}

.cpv-sw-panel p {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--color-sand-700, #3c3a30);
  max-width: 64ch;
  text-wrap: pretty;
}

/* ── Progress dots ─────────────────────────────────────────────────────── */

.cpv-sw-dots-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding-left: 4px;
}

.cpv-sw-dots-label {
  display: none; /* "Step" word removed */
}

.cpv-sw-dots {
  display: flex;
  gap: 6px;
}

.cpv-sw-dot {
  width: 28px;
  height: 3px;
  background: var(--color-sand-300, #d8d5cc);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, width 0.2s;
  border-radius: 2px;
}

.cpv-sw-dot.is-active {
  background: var(--brand-bright-blue, #006fe7);
  width: 40px;
}

.cpv-sw-dot:hover {
  background: var(--cpv-navy-muted, #8b94a0);
}

/* ── CISO Intelligence — standalone navy band ───────────────────────────
 * Its own section below the switcher (no longer nested inside the gradient
 * card). The wrapper matches `.cpv-changes` width so the navy band's outer
 * edges line up with the gradient card above; the top margin separates the
 * two now-distinct sections. */

.cpv-ciso {
  width: min(100% - 48px, var(--cpv-container));
  margin: 56px auto 0;
}

.cpv-e-ciso-inner {
  position: relative;
  overflow: hidden;
  /* Clean navy tonal gradient (same navy palette as the home "5 Problems"
     band) instead of a bright-blue glow — layered navy, not a spotlight. */
  background: linear-gradient(145deg,
    var(--color-navy-800, #10407C) 0%,
    var(--color-dark-navy, #093055) 52%,
    var(--color-navy-900, #003064) 100%);
  border: 1px solid rgba(200, 254, 182, 0.10); /* faint mint hairline (mint @10%) */
  border-radius: 24px; /* match the gradient card's radius above */
  /* 64px sides put the heading + body on the same left edge as the switcher
     text and the "How Cynomi Changes" title above. */
  padding: 48px 64px;
  box-shadow: 0 30px 70px -55px rgba(9, 48, 85, 0.45);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  column-gap: 48px;
  align-items: start;
  color: #fff;
}

/* (Removed the bright-blue radial glow — replaced by the navy tonal gradient
   above, matching the home "5 Problems" band's clean layered-navy look.) */

.cpv-e-ciso-inner .cpv-e-col-label,
.cpv-e-ciso-body {
  position: relative;
  z-index: 1;
}

.cpv-e-ciso-inner .cpv-e-heading {
  color: #fff;
  /* Callout/feature heading (matches the switcher panel titles, one step below
     the 40px standalone section titles) — fits the navy card's side column. */
  font-size: clamp(24px, 2.5vw, 30px);
}

/* Page name accent inside the navy CISO heading (e.g. "Security Program
 * Management"). Repeats per page via the page title. */
.cpv-accent-green {
  color: var(--brand-mint-green, #c8feb6);
}

.cpv-e-ciso-body p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5; /* tighter leading for the navy card body */
  color: rgba(246, 245, 242, 0.84);
  text-wrap: pretty;
}

.cpv-e-ciso-body p + p {
  margin-top: 18px;
}

/* ── Responsive: ≤ 860px collapse grid to single column ────────────────── */

@media (max-width: 860px) {
  .cpv-sw-panel,
  .cpv-e-ciso-inner {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  .cpv-changes-card {
    padding: 24px 20px;
  }

  .cpv-changes-card__head {
    padding: 4px 28px 0; /* match the switcher's mobile inset */
    margin-bottom: 22px;
  }

  .cpv-sw-strip {
    justify-content: flex-start; /* pack tabs left when the track wraps */
  }

  .cpv-e-stage {
    padding: 36px 28px; /* card padding on mobile */
  }

  .cpv-sw-panel::before {
    display: none; /* single column has no room for the number's channel — the dots carry the step */
  }

  .cpv-e-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .cpv-e-col-num {
    display: none;
  }

  .cpv-e-stage {
    margin-bottom: 32px;
  }

  .cpv-ciso {
    margin-top: 40px;
  }

  .cpv-e-ciso-inner {
    padding: 32px 24px;
  }

  .cpv-sw-card {
    padding: 0 28px; /* match the navy card's reduced horizontal inset */
  }
}

@media (max-width: 600px) {
  .cpv-sw-tab {
    font-size: 13px;
    padding: 9px 14px;
  }
}


/* ─── Partner-quote rotator: cross-fade between quotes ─────────────────────
 * Replaces the shared hard display:none↔grid swap. All quotes stack in one
 * grid cell (.cpv-quote-stage) so the container keeps a stable height; the
 * active quote fades/lifts in while the previous fades out. The rotator JS is
 * unchanged — it still just toggles .is-active every 5.5s. Scoped to the
 * rotator variant so single-quote layouts are unaffected. The `.cmo-js`
 * prefix matches the shared `.cmo-js .cpv-partner-quote--rotator
 * .cpv-quote-item{display:none}` rule and out-specifies it (0,4,0 > 0,3,0),
 * and is correct semantically — the cross-fade only applies once the
 * rotator JS is running. */

/* Partner quotes: dark sand instead of dark navy, matching the rest of the
 * page (quote → sand-800, attribution → sand-700, name → sand-800). The
 * `__inner` selector raises specificity over the base `.cpv-partner-quote
 * blockquote` rule in the shared stylesheet. */
.cpv-partner-quote .cpv-partner-quote__inner blockquote {
  color: var(--color-sand-800, #2d2b24);
}

.cpv-partner-quote .cpv-partner-quote__inner p {
  color: var(--color-sand-700, #3c3a30);
}

.cpv-partner-quote .cpv-partner-quote__inner p strong {
  color: var(--color-sand-800, #2d2b24);
}

.cmo-js .cpv-partner-quote--rotator .cpv-quote-stage {
  display: grid;
  cursor: pointer; /* click anywhere to advance to the next quote */
}

.cmo-js .cpv-partner-quote--rotator .cpv-quote-stage > .cpv-quote-item {
  grid-area: 1 / 1;            /* stack every quote in the same cell */
  display: grid;              /* override shared `display: none` */
  border-top: 0;
  padding-top: 0;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.cmo-js .cpv-partner-quote--rotator .cpv-quote-stage > .cpv-quote-item.is-active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .cmo-js .cpv-partner-quote--rotator .cpv-quote-stage > .cpv-quote-item {
    transition: none;
    transform: none;
  }
}
