/* O PROBLEMA — split layout + editorial 3D coverflow */

/* ── Two-column split (desktop / iPad landscape) ───────── */
.problema-split {
  margin-bottom: 1.25rem;
}

.sec-problema .problema-copy h2 {
  text-wrap: balance;
}

.problema-copy .sec-problema-lead {
  margin-bottom: 0;
}

/* ── Coverflow ─────────────────────────────────────────── */
.problema-coverflow {
  --cf-perspective: 1600px;
  --cf-card-w: clamp(220px, 19vw, 290px);
  --cf-card-min-h: 220px;
  --cf-tilt: 0;
  --cf-side-tilt: 0;
  --cf-gap: 5;
  --cf-depth: 240;
  --cf-dim: 0.35;
  --cf-dur: 0.6s;
  --cf-ease: cubic-bezier(0.22, 1, 0.36, 1);

  position: relative;
  width: 100%;
  margin-bottom: 0;
  outline: none;
  overflow: visible;
}

.problema-coverflow:focus-visible {
  outline: 2px solid rgba(98, 84, 191, 0.45);
  outline-offset: 4px;
  border-radius: 4px;
}

.problema-coverflow__viewport {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: var(--cf-perspective);
  overflow: visible;
  padding: 0.75rem 2.75rem;
}

.problema-coverflow__stage {
  position: relative;
  width: var(--cf-card-w);
  min-height: var(--cf-card-min-h);
  transform-style: preserve-3d;
  overflow: visible;
}

.problema-coverflow__card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cf-card-w);
  min-height: var(--cf-card-min-h);
  box-sizing: border-box;
  padding: 1.125rem 1rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(98, 84, 191, 0.15);
  background-color: #080812;
  background-image:
    linear-gradient(145deg, rgba(98, 84, 191, 0.06) 0%, transparent 55%),
    linear-gradient(160deg, #080812 0%, #12101f 48%, var(--navy-mid) 100%);
  box-shadow:
    6px 12px 24px -12px rgba(23, 22, 50, .14),
    10px 22px 48px -26px rgba(23, 22, 50, .24);
  transform-style: preserve-3d;
  transform-origin: center center;
  transition:
    transform var(--cf-dur) var(--cf-ease),
    opacity var(--cf-dur) var(--cf-ease),
    border-color var(--cf-dur) var(--cf-ease),
    box-shadow var(--cf-dur) var(--cf-ease);
  cursor: pointer;
  overflow: visible;
  z-index: 1;
}

.problema-coverflow__card[aria-current="true"] {
  border-color: rgba(98, 84, 191, 0.45);
  box-shadow: 0 12px 40px rgba(98, 84, 191, 0.12);
  background-color: #080812;
  background-image:
    linear-gradient(145deg, rgba(98, 84, 191, 0.1) 0%, transparent 55%),
    linear-gradient(160deg, #080812 0%, #141228 45%, #2a2848 100%);
  cursor: default;
  z-index: 2;
}

.problema-coverflow__card[aria-current="true"] .problema-coverflow__icon-badge {
  background: rgba(98, 84, 191, 0.14);
  border-color: rgba(98, 84, 191, 0.35);
}

.problema-coverflow__card[aria-hidden="true"] {
  pointer-events: none;
  opacity: 0;
}

/* Before JS init */
.problema-coverflow:not(.problema-coverflow--ready) .problema-coverflow__card:not(:first-child) {
  opacity: 0;
  pointer-events: none;
}

.problema-coverflow:not(.problema-coverflow--ready) .problema-coverflow__card:first-child {
  transform: translate(-50%, -50%);
}

/* Card head: icon badge */
.problema-coverflow__card-head {
  margin-bottom: 0.75rem;
}

.problema-coverflow__icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid rgba(98, 84, 191, 0.25);
  background: rgba(98, 84, 191, 0.08);
}

.problema-coverflow__icon {
  display: block;
  flex-shrink: 0;
  color: var(--teal-l);
}

.problema-coverflow__card h3 {
  color: rgba(255, 255, 255, 0.97);
  margin: 0 0 0.5rem;
}

.problema-coverflow__card p {
  margin: 0 0 0.75rem;
  color: rgba(255, 255, 255, 0.78);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}

.problema-coverflow__accent {
  display: block;
  width: 40px;
  height: 1px;
  background: rgba(98, 84, 191, 0.35);
}

.problema-coverflow__dim {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  transition: opacity var(--cf-dur) var(--cf-ease);
  pointer-events: none;
  border-radius: inherit;
}

.problema-coverflow__card:not([aria-current="true"]) .problema-coverflow__dim {
  opacity: var(--cf-dim);
}

/* Indicator: dots + count */
.problema-coverflow__indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 0;
}

.problema-coverflow__dots {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.problema-coverflow__dot {
  width: 6px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(27, 26, 64, 0.15);
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.problema-coverflow__dot.is-active {
  background: var(--teal);
  transform: scale(1.15);
}

.problema-coverflow__dot:focus-visible {
  outline: 2px solid rgba(98, 84, 191, 0.45);
  outline-offset: 2px;
}

/* iPad landscape — tighter cards */
@media (max-width: 1024px) and (min-width: 835px) {
  .problema-coverflow {
    --cf-perspective: 1400px;
    --cf-card-w: clamp(200px, 24vw, 260px);
    --cf-card-min-h: 210px;
    --cf-gap: 3.5;
  }
}

/* Portrait / mobile — stack layout */
@media (max-width: 834px) {
  .problema-split {
    margin-bottom: 1rem;
  }

  .problema-copy .sec-problema-lead {
    margin-bottom: 0;
  }

  .problema-coverflow {
    --cf-perspective: 1100px;
    --cf-card-w: min(86vw, 280px);
    --cf-card-min-h: 200px;
    --cf-tilt: 0;
    --cf-side-tilt: 0;
    --cf-gap: 3.5;
    --cf-depth: 80;
  }

  .problema-coverflow__viewport {
    padding: 0.5rem 1.5rem;
  }

  .problema-coverflow__card {
    padding: 1rem 0.9375rem 0.9375rem;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .problema-coverflow {
    --cf-dur: 0.01ms;
    --cf-tilt: 0;
    --cf-side-tilt: 0;
    --cf-depth: 0;
  }

  .problema-coverflow__card,
  .problema-coverflow__dim {
    transition: opacity 0.15s ease;
  }
}
