/* =============================================================
   TABS.CSS — Navegación por pestañas de OncoLens
   Depende de los tokens definidos en :root dentro de style.css.
   Cárgalo SIEMPRE después de style.css.
   ============================================================= */

/* El sitio pasó de scroll-snap de una sola página a navegación por
   pestañas: desactivamos el snap y dejamos que cada .sec respire
   según su contenido en vez de forzar 100vh. */
html { scroll-snap-type: none; }

.sec, .sec-alt {
  scroll-snap-align: none;
  scroll-snap-stop: normal;
  min-height: 0;
}

/* ---------- Barra de pestañas ---------- */
.tabs-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 4px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 64px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs-bar::-webkit-scrollbar { display: none; }

.tab-btn {
  position: relative;
  flex-shrink: 0;
  padding: 20px 22px;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--ink-soft); }

.tab-btn[aria-selected="true"] { color: var(--ink); }

.tab-btn[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
}

.tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

@media (max-width: 720px) {
  .tabs-bar { padding: 0 24px; }
  .tab-btn { padding: 16px 14px; font-size: 13.5px; }
}

/* Los enlaces del <nav> superior y del footer ahora también actúan
   como disparadores de pestañas (data-tab), en vez de anclas #id */
.nav-links button[data-tab],
.foot-nav-links button[data-tab] {
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}

/* ---------- Paneles ----------
   La visibilidad la controla el atributo nativo [hidden] (así el
   panel "Qué es" se ve aunque el JS tarde en cargar o falle).
   data-state solo dispara la animación de entrada. */

.tab-panel-intro { padding-top: 56px; }

@media (prefers-reduced-motion: no-preference) {
  .tab-panel[data-state="active"] { animation: tab-fade-in 0.35s ease; }
}

@keyframes tab-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .tab-panel[data-state="active"] { animation: none; }
}

/* ---------- Subcabecera (para dividir contenido dentro de una pestaña) ---------- */
.subsec-head {
  max-width: 720px;
  margin: 80px 0 32px;
}

.subsec-head .sec-tag { margin-bottom: 14px; }

.subsec-head h3 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.sec > .subsec-head:first-child { margin-top: 0; }

/* ---------- FAQ (acordeón) ---------- */
.faq {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.faq-item { background: var(--bg); }

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-icon {
  flex-shrink: 0;
  position: relative;
  width: 18px;
  height: 18px;
}

.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--ink-soft);
  transition: transform 0.2s ease;
}

.faq-icon::before { top: 8px; left: 1px; width: 16px; height: 1.5px; }
.faq-icon::after { top: 1px; left: 8px; width: 1.5px; height: 16px; }

.faq-item[open] .faq-icon::after { transform: scaleY(0); }

.faq-item p {
  padding: 0 28px 24px;
  max-width: 760px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* ---------- Embed de video ---------- */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 780px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--ink);
}

.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-caption {
  max-width: 780px;
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-faint);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .subsec-head { margin: 56px 0 24px; }
}
