/* Blueprint da Cadeia de Valor — visualizações próprias desta página.
   Reaproveita exclusivamente os tokens de design definidos em site.css
   (cores, fontes, espaçamento, raio, sombra). Classes prefixadas com cv- */

/* ---------- Sprite de ícones (SVG inline, nunca fonte de ícone) ----------
   Um único <svg> com <symbol>s fica oculto no início do <body>; cada uso
   é um <svg class="cv-icon"><use href="#cv-i-..."></use></svg>. Evita
   repetir os mesmos paths dezenas de vezes ao longo da página. */

.cv-icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.cv-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Faixa-resumo (hero da seção Contexto) ---------- */

.cv-ribbon {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-4);
  align-items: center;
  background: linear-gradient(135deg, var(--peers-blue) 0%, #0b2559 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0;
  color: var(--peers-white);
}

.cv-ribbon__stat {
  text-align: center;
  padding-right: var(--space-4);
  border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.cv-ribbon__stat-num {
  display: block;
  font-family: var(--font-secondary);
  font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 2.9rem);
  color: var(--peers-lime);
  line-height: 1;
}

.cv-ribbon__stat-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--peers-blue-04);
  margin-top: 6px;
  max-width: 108px;
  line-height: 1.35;
}

.cv-ribbon__lanes {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}

.cv-ribbon__lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.cv-ribbon__lane-name {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 0.8rem;
}

.cv-ribbon__lane-meta {
  font-size: 0.68rem;
  color: var(--peers-blue-04);
  white-space: nowrap;
}

.cv-ribbon__track {
  position: relative;
  height: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cv-ribbon__track::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  height: 2px;
  transform: translateY(-50%);
}

.cv-ribbon__lane--core .cv-ribbon__track::before {
  background: var(--peers-lime);
  opacity: 0.55;
}

.cv-ribbon__lane--core .cv-ribbon__track span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--peers-lime);
}

.cv-ribbon__lane--comercial .cv-ribbon__track::before {
  background: none;
  border-top: 2px dashed rgba(0, 184, 217, 0.55);
}

.cv-ribbon__lane--comercial .cv-ribbon__track span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--info-main);
}

.cv-ribbon__lane--corporativo .cv-ribbon__track::before {
  background: var(--peers-serene);
  opacity: 0.45;
  height: 3px;
}

.cv-ribbon__lane--corporativo .cv-ribbon__track span {
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: var(--peers-serene);
}

.cv-ribbon__track span {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* ---------- Grid de contexto (3 faixas) ---------- */

.cv-context-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin: var(--space-3) 0;
}

.cv-context-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--grey-50);
  border: 1px solid var(--grey-300);
  border-top: 3px solid var(--peers-blue);
  border-radius: var(--radius-lg);
  padding: var(--space-2);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.cv-context-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.cv-context-card--comercial {
  border-top-color: var(--info-main);
}

.cv-context-card--corporativo {
  border-top-color: var(--peers-blue-02);
}

.cv-context-card__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv-context-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: var(--peers-serene-02);
  color: var(--peers-blue);
}

.cv-context-card--comercial .cv-context-card__icon {
  background: rgba(0, 184, 217, 0.12);
  color: var(--info-main);
}

.cv-context-card--corporativo .cv-context-card__icon {
  background: var(--grey-200);
  color: var(--peers-blue-02);
}

.cv-context-card__icon .cv-icon {
  width: 17px;
  height: 17px;
}

.cv-context-card__eyebrow {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey-500);
}

.cv-context-card h3 {
  font-family: var(--font-secondary);
  font-size: 1rem;
  font-weight: 800;
  color: var(--peers-blue);
  margin: 0;
  line-height: 1.25;
}

.cv-context-card p {
  font-size: 0.82rem;
  color: var(--grey-700);
  line-height: 1.55;
  margin: 0;
  flex: 1;
}

.cv-context-card__cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--grey-300);
}

.cv-context-card__cta-label {
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--info-main);
}

.cv-context-card__cta-count {
  font-size: 0.7rem;
  color: var(--grey-500);
  white-space: nowrap;
}

/* ---------- Selo de faixa (sequencial / paralelo / suporte) ---------- */

.cv-lane-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 8px;
}

.cv-lane-badge .cv-icon {
  width: 12px;
  height: 12px;
}

.cv-lane-badge--core {
  background: var(--peers-lime-02);
  color: #4a5a00;
}

.cv-lane-badge--comercial {
  background: rgba(0, 184, 217, 0.14);
  color: #006680;
}

.cv-lane-badge--corporativo {
  background: var(--grey-200);
  color: var(--peers-blue-02);
}

/* ---------- Trilha de faixas (colunas de estágio/frente/pilar) ---------- */

.cv-track-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  margin-top: var(--space-2);
  padding: 4px 24px 12px 4px;
}

.cv-track {
  display: grid;
  gap: 10px;
  align-items: start;
}

.cv-track--cols-7 {
  grid-template-columns: repeat(7, minmax(180px, 1fr));
}

.cv-track--cols-6 {
  grid-template-columns: repeat(6, minmax(190px, 1fr));
}

.cv-track--core {
  gap: 16px;
}

.cv-stage {
  position: relative;
  background: var(--grey-50);
  border: 1px solid var(--grey-300);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

/* Seta de conector -- só entre estágios da faixa Core (fluxo sequencial).
   Comercial e Corporativo não recebem: são frentes paralelas / pilares de
   suporte, não uma sequência, e a ausência do conector já comunica isso.
   Fica a cavaleiro da borda entre os dois cards (metade sobre cada um) em
   vez de solta no meio do gap -- um ::after sem stacking context próprio
   (position:relative sem z-index no .cv-stage) some atrás do próximo card
   quando fica inteiramente dentro da faixa vazia do gap. */
.cv-track--core .cv-stage:not(:last-child)::after {
  content: "\2192";
  position: absolute;
  top: 50%;
  right: -11px;
  width: 22px;
  height: 22px;
  transform: translate(0, -50%);
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--peers-lime);
  color: var(--peers-blue);
  border-radius: 50%;
  box-shadow: var(--shadow-md);
  font-family: var(--font-secondary);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
}

.cv-stage__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 10px;
  background: var(--peers-blue);
  color: var(--peers-white);
  font-family: var(--font-secondary);
  font-weight: 700;
  font-size: 0.76rem;
  line-height: 1.25;
  border-radius: 7px 7px 0 0;
}

.cv-stage__body {
  border-radius: 0 0 7px 7px;
  overflow: hidden;
}

.cv-stage__num {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--peers-lime);
  color: var(--peers-blue);
  font-size: 0.68rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cv-stage__icon {
  flex: 0 0 auto;
  color: var(--peers-blue-04);
}

.cv-stage__title small {
  display: block;
  font-weight: 600;
  opacity: 0.85;
  font-size: 0.68rem;
}

.cv-stage__body {
  padding: 4px 10px 8px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cv-activity {
  padding: 7px 0 7px 12px;
  border-bottom: 1px solid var(--grey-200);
  border-left: 2px solid var(--grey-300);
  font-size: 0.76rem;
  color: var(--grey-800);
  line-height: 1.35;
  transition: border-left-color 0.15s ease, background 0.15s ease;
}

.cv-activity:last-child {
  border-bottom: none;
}

.cv-activity:hover {
  border-left-color: var(--peers-lime);
  background: var(--peers-serene-02);
}

.cv-source {
  margin-top: var(--space-2);
  font-size: 0.74rem;
  color: var(--grey-500);
  border-top: 1px dashed var(--grey-300);
  padding-top: 8px;
}

/* ---------- Entrada suave ao rolar (só decorativa; sem fallback JS) ---------- */

@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    @keyframes cv-rise-in {
      from {
        opacity: 0;
        transform: translateY(14px);
      }
    }

    .cv-stage,
    .cv-context-card {
      animation: cv-rise-in 0.5s ease backwards;
      animation-timeline: view(inline);
      animation-range: entry;
    }
  }
}

/* ---------- Modo Apresentação -- ajustes específicos desta página ---------- */

.pmode-stage .cv-stage,
.pmode-stage .cv-context-card {
  animation: none !important;
}

.pmode-stage .cv-ribbon {
  padding: clamp(10px, 2vh, 18px) clamp(14px, 2vw, 26px);
  gap: clamp(14px, 2.4vw, 28px);
}

.pmode-stage .cv-ribbon__stat-num {
  font-size: clamp(1.7rem, 3.6vh, 2.4rem);
}

.pmode-stage .cv-context-grid {
  margin: clamp(8px, 1.6vh, 16px) 0;
}

.pmode-stage .cv-track-wrap {
  margin-top: clamp(6px, 1.2vh, 12px);
}

/* ---------- Responsivo ---------- */

@media (max-width: 860px) {
  .cv-context-grid {
    grid-template-columns: 1fr;
  }

  .cv-ribbon {
    grid-template-columns: 1fr;
  }

  .cv-ribbon__stat {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0 0 var(--space-2);
    margin-bottom: 2px;
  }

  .cv-ribbon__stat-label {
    max-width: none;
    margin: 4px auto 0;
  }
}
