/* ==========================================================================
   SANAPP — Estilos de las nuevas páginas públicas (Enfermedades, Gestión del
   Estrés, Actividad Física, Institucional, Contacto). Reutiliza los tokens de
   landing.css (:root). Cargar SIEMPRE después de landing.css.
   ========================================================================== */

/* --- Navbar con varios destinos: gap más compacto + link activo --- */
.navbar-nav--site {
  gap: 28px;
}
.navbar-nav--site a.active {
  color: var(--sanapp-blue);
}
.navbar-nav--site a.active::after {
  width: 100%;
}
@media (max-width: 1080px) and (min-width: 769px) {
  .navbar-nav--site {
    gap: 18px;
  }
  .navbar-nav--site a {
    font-size: 0.95rem;
  }
}

/* --- Cabecera de página (hero compacto) --- */
.web-hero {
  background: linear-gradient(135deg, var(--bg-blue) 0%, #EAF6FF 100%);
  padding: 140px 0 70px;
  text-align: center;
}
.web-hero .container {
  max-width: 820px;
}
.web-hero-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--sanapp-blue);
  margin-bottom: 12px;
}
.web-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.web-hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0 auto;
  max-width: 640px;
}

/* --- Sección genérica de contenido --- */
.web-section {
  padding: 70px 0;
}
.web-section.alt {
  background: var(--bg-light);
}

/* --- Grilla de tarjetas (temas / instituciones) --- */
.web-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.web-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  text-decoration: none;
  color: inherit;
  height: 100%;
}
.web-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.web-card-media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-blue);
  overflow: hidden;
}
.web-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.web-card-media .web-card-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--sanapp-blue);
  opacity: 0.5;
}
.web-card-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.web-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.web-card-excerpt {
  font-size: 0.98rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
  flex: 1;
}
.web-card-cta {
  font-weight: 700;
  color: var(--sanapp-blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --- Badges --- */
.web-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--bg-blue);
  color: var(--sanapp-blue-dark);
}
.web-badge.basico       { background: #E0F7F1; color: #2E9E8F; }
.web-badge.intermedio   { background: #FFF3E0; color: #E67E22; }
.web-badge.experto      { background: #FADDE1; color: #D94E72; }

/* --- Detalle de tema --- */
.web-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--sanapp-blue);
  margin-bottom: 28px;
  text-decoration: none;
}
.web-detail {
  max-width: 880px;
  margin: 0 auto;
}
.web-detail h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.web-detail-pro {
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 28px;
}
.web-detail-image {
  width: 100%;
  border-radius: var(--radius-md);
  margin-bottom: 30px;
  box-shadow: var(--shadow-md);
}
.web-prose {
  font-size: 1.08rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.web-prose p { margin-bottom: 1.1em; }
.web-prose h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.4em 0 0.5em;
}
.web-prose h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1.2em 0 0.4em;
}
.web-prose h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1em 0 0.4em;
}
.web-prose ul,
.web-prose ol {
  margin: 0 0 1.1em 1.4em;
  padding: 0;
}
.web-prose ul { list-style: disc; }
.web-prose ol { list-style: decimal; }
.web-prose li { margin-bottom: 0.4em; }
.web-prose a {
  color: var(--sanapp-blue);
  font-weight: 600;
  text-decoration: underline;
}
.web-prose a:hover { color: var(--sanapp-blue-dark); }
.web-prose strong, .web-prose b { color: var(--text-primary); font-weight: 700; }
.web-prose blockquote {
  margin: 1.2em 0;
  padding: 4px 0 4px 20px;
  border-left: 4px solid var(--sanapp-blue-light);
  color: var(--text-primary);
  font-style: italic;
}
.web-prose hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 1.6em 0;
}

/* --- Embeds de video (16:9 responsivo) --- */
.web-interview {
  margin-top: 44px;
}
.web-interview h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.web-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: #000;
}
.web-embed iframe,
.web-embed video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* --- Actividad Física: niveles + grilla de videos --- */
.web-level + .web-level {
  margin-top: 56px;
}
.web-level-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}
.web-level-head h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
}
.web-video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 26px;
}
.web-video-card {
  border: 0;
  padding: 0;
  text-align: left;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  font-family: inherit;
}
.web-video-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.web-video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0d1b2a;
  overflow: hidden;
}
.web-video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.web-video-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
  transition: background var(--transition-fast);
}
.web-video-card:hover .web-video-play {
  background: rgba(0, 0, 0, 0.32);
}
.web-video-play span {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
}
.web-video-play svg { fill: var(--sanapp-blue); margin-left: 3px; }
.web-video-duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
}
.web-video-body {
  padding: 16px 18px 20px;
}
.web-video-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.web-video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Modal de reproducción HLS --- */
.web-player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}
.web-player-overlay.open { display: flex; }
.web-player-box {
  width: min(960px, 100%);
}
.web-player-box video {
  width: 100%;
  border-radius: var(--radius-md);
  background: #000;
  max-height: 80vh;
}
.web-player-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  margin-bottom: 12px;
  gap: 16px;
}
.web-player-title { font-weight: 700; font-size: 1.1rem; }
.web-player-close {
  background: none;
  border: 0;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}

/* --- Institucional --- */
.web-inst-card .web-card-body { gap: 4px; }
.web-inst-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.web-inst-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.web-inst-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.web-inst-actions .btn {
  padding: 10px 20px;
  font-size: 0.92rem;
}

/* --- Sección de Contacto (home) --- */
.contact {
  padding: var(--section-padding);
  background: var(--bg-light);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 50px auto 0;
}
.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  background: var(--bg-white);
  border-radius: var(--radius-md);
  padding: 34px 24px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.contact-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.contact-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-blue);
}
.contact-icon svg { width: 28px; height: 28px; fill: var(--sanapp-blue); }
.contact-item.wa .contact-icon { background: #E3F9EC; }
.contact-item.wa .contact-icon svg { fill: #25D366; }
.contact-item.ig .contact-icon { background: #FCE7F0; }
.contact-item.ig .contact-icon svg { fill: #E1306C; }
.contact-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
}
.contact-value {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  word-break: break-word;
}

/* --- Estado vacío --- */
.web-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.web-empty svg { opacity: 0.4; margin-bottom: 16px; }

@media (max-width: 600px) {
  .web-hero { padding: 120px 0 50px; }
  .web-section { padding: 50px 0; }
}
