/*
 * case.css — estilos de páginas de caso
 * Depende de: tokens.css, base.css, components.css
 */

/* ── CASO: layout general ── */
.case-hero {
  padding-block: var(--space-16) var(--space-12);
  border-bottom: 1px solid var(--border);
}
.case-hero-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.case-hero-label a {
  color: var(--blue-text);
  text-decoration: none;
}
.case-hero-label a:hover { text-decoration: underline; }
.case-hero-label span { color: var(--border); }

.case-title {
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-6);
}
.case-subtitle {
  font-size: var(--text-xl);
  color: var(--muted);
  max-width: 55ch;
  margin-bottom: var(--space-8);
}
.case-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border);
}
.case-meta-item {}
.case-meta-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: var(--space-1);
  letter-spacing: 0.04em;
}
.case-meta-value {
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--black);
}

/* ── CIFRAS CLAVE ── */
.cifras-section {
  padding-block: var(--space-16);
  border-bottom: 1px solid var(--border);
}
.cifras-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-6);
}
.cifra-item {
  padding: var(--space-6);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.cifra-num {
  font-family: var(--font-mono);
  font-size: var(--text-5xl);
  font-weight: var(--weight-bold);
  color: var(--blue);
  line-height: 1;
  margin-bottom: var(--space-2);
}
.cifra-label {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: 1.4;
}

/* ── ÍNDICE ── */
.case-index {
  position: sticky;
  top: 60px;
  padding: var(--space-6);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: none;
}
.case-index-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
}
.case-index-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.case-index-list a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--muted);
  text-decoration: none;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
}
.case-index-list a:hover {
  background: var(--surface-raised);
  color: var(--black);
}
.case-index-list a.active {
  background: var(--surface-raised);
  color: var(--black);
  font-weight: var(--weight-medium);
}
.index-num {
  color: var(--blue);
  flex-shrink: 0;
}

/* ── LAYOUT CASO: 2 columnas en desktop ── */
.case-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-16);
  padding-block: var(--space-16);
  padding-bottom: calc(var(--space-24) + 60px);
}
@media (min-width: 1024px) {
  .case-layout {
    grid-template-columns: 220px 1fr;
    align-items: start;
  }
  .case-index { display: block; }
}

/* ── SECCIONES DEL CASO ── */
.case-section {
  padding-bottom: var(--space-16);
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.case-section:last-child { border-bottom: none; }

.case-section-num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--blue);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-3);
  display: block;
}
.case-section-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}
.case-body {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: var(--leading-loose);
  max-width: 65ch;
}
.case-body p { margin-bottom: var(--space-5); }
.case-body p:last-child { margin-bottom: 0; }

/* ── CONTEXTO ABSA ── */
.absa-note {
  margin-top: var(--space-6);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--blue);
  font-size: var(--text-sm);
  color: var(--muted);
  font-style: italic;
}

/* ── IMAGEN PLACEHOLDER ── */
.img-placeholder {
  width: 100%;
  background: var(--surface-raised);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-12);
  margin-block: var(--space-8);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--muted);
  text-align: center;
}
.img-placeholder strong {
  color: var(--black);
  display: block;
  margin-bottom: var(--space-1);
}

/* ── PERSONAS GRID ── */
.personas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  margin-block: var(--space-8);
}
@media (min-width: 640px) {
  .personas-grid { grid-template-columns: repeat(3, 1fr); }
}
.persona-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-xs);
}
.persona-role {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--blue-text);
  margin-bottom: var(--space-3);
  letter-spacing: 0.04em;
}
.persona-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-4);
}
.persona-goal {
  font-size: var(--text-sm);
  color: var(--muted);
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.persona-needs {
  font-size: var(--text-sm);
  color: var(--muted);
}
.persona-needs li {
  list-style: disc;
  list-style-position: inside;
  margin-bottom: var(--space-2);
}

/* ── INSIGHTS ── */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-block: var(--space-8);
}
.insight-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-5);
  padding: var(--space-5) var(--space-6);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.insight-num {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--blue);
  min-width: 28px;
  flex-shrink: 0;
}
.insight-text {
  font-size: var(--text-base);
  color: var(--black);
  line-height: var(--leading-normal);
}

/* ── 4 MODOS ── */
.modos-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-block: var(--space-8);
}
.modo-card {
  padding: var(--space-6);
  border-radius: var(--radius-lg);
  border: 1.5px solid;
}
.modo-card--analyze  { border-color: #4285F4; background: rgba(66,133,244,0.04); }
.modo-card--simulate { border-color: #34A853; background: rgba(52,168,83,0.04); }
.modo-card--check    { border-color: #FBBC04; background: rgba(251,188,4,0.04); }
.modo-card--training { border-color: #EA4335; background: rgba(234,67,53,0.04); }
.modo-name {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-3);
}
.modo-card--analyze  .modo-name { color: #1967D2; }
.modo-card--simulate .modo-name { color: #188038; }
.modo-card--check    .modo-name { color: #B06000; }
.modo-card--training .modo-name { color: #C5221F; }
.modo-desc {
  font-size: var(--text-sm);
  color: var(--muted);
  line-height: var(--leading-normal);
}

/* ── APRENDIZAJES ── */
.learnings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-block: var(--space-8);
}
.learning-item {
  padding: var(--space-6);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--yellow);
}
.learning-title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  margin-bottom: var(--space-2);
}
.learning-body {
  font-size: var(--text-base);
  color: var(--muted);
  line-height: var(--leading-normal);
}

/* ── CTA CIERRE ── */
.case-cta {
  padding: var(--space-16);
  background: var(--black);
  border-radius: var(--radius-lg);
  text-align: center;
  margin-top: var(--space-16);
}
.case-cta-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--white);
  margin-bottom: var(--space-4);
}
.case-cta-sub {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.6);
  margin-bottom: var(--space-8);
  max-width: 40ch;
  margin-inline: auto;
}

/* ══════════════════════════════════════════════════════════
 * IMÁGENES REALES DEL CASO — agregado 2026-10-16
 * Sustituyen a .img-placeholder (que se conserva arriba para
 * los casos aún sin imágenes). No modifica reglas existentes.
 * ══════════════════════════════════════════════════════════ */
.case-figure,
.case-gallery {
  display: block;
  margin-block: var(--space-8);
}
.case-figure img,
.case-gallery img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-raised);   /* evita hueco blanco mientras carga */
}
/* Capturas verticales: no ocupan toda la columna */
.case-figure--portrait {
  max-width: 420px;
}
/* Galería: fila de altura uniforme. Cada <picture> crece en
   proporción a su relación de aspecto (--ar = ancho/alto),
   así imágenes de formatos distintos quedan a la misma altura. */
.case-gallery {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
}
.case-gallery > picture {
  flex: var(--ar, 1) 1 0;
  min-width: 0;
}
/* Galería mixta (horizontal + vertical): en móvil se apila,
   porque a 390px la captura vertical quedaría en ~100px de ancho. */
@media (max-width: 639px) {
  .case-gallery--stack { flex-direction: column; align-items: center; }
  .case-gallery--stack > picture { flex: none; width: 100%; }
  .case-gallery--stack > .is-portrait { max-width: 260px; }
}
