/* ==========================================================================
   PRAGMA — Diseño Base (Estética Serena, Humana y Compatible con Imágenes)
   ========================================================================== */

:root {
  --bg-primary: #F7F5F0;
  --bg-secondary: #EFECE6;
  --bg-surface: rgba(255, 255, 255, 0.72);

  --text-main: #232A26;
  --text-muted: #5C6460;
  --text-soft: #8A928E;

  --accent-sage: #4A6B5D;
  --accent-sage-light: #DCE5E0;

  --placeholder-bg: #DFDDD7;
  --placeholder-border: #CECBC3;
  --placeholder-text: #767A77;

  --border-subtle: rgba(35, 42, 38, 0.09);
  --border-strong: rgba(35, 42, 38, 0.18);

  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --sidebar-width: 280px;
  /* Transición más ágil para no marear si el usuario scrollea rápido */
  --transition-reveal: 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  --transition-fast: 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-main);
  overflow-x: clip;
}

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  width: 100%;
  background-color: var(--bg-primary);
}

/* ==========================================================================
   RECUADROS GRISES PARA IMÁGENES (Listos para reemplazar por <img>)
   ========================================================================== */

.img-placeholder {
  width: 100%;
  background-color: var(--placeholder-bg);
  border: 1px solid var(--placeholder-border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--placeholder-text);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  overflow: hidden;
  position: relative;
}

/* Cuando pongas una etiqueta <img> adentro, se adapta automáticamente */
.img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ratio-portrait {
  aspect-ratio: 4 / 5;
}

.ratio-landscape {
  aspect-ratio: 4 / 3;
}

.ratio-wide {
  aspect-ratio: 16 / 9;
}

/* ==========================================================================
   LAYOUT PRINCIPAL (Panel fijo en PC / Botón arriba izq en Móvil)
   ========================================================================== */

.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem 1.85rem;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
  color: var(--text-main);
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--accent-sage), #2C4239);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Navegación Lateral (Jerarquía Páginas vs Sub-secciones con sangría) */
.sidebar-nav {
  margin: auto 0;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.68rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: all var(--transition-fast);
}

/* Nivel principal: "Inicio" y "Lecturas Recomendadas" a la par */
.nav-parent {
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.96rem;
}

/* Sub-lista con sangría y línea guía lateral (Solo en PC) */
.nav-sublist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  margin-left: 1.35rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-strong);
}

.nav-sublink {
  padding: 0.48rem 0.75rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.nav-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: transparent;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.nav-sublink .nav-indicator {
  width: 5px;
  height: 5px;
}

.nav-link:hover {
  color: var(--text-main);
  background-color: rgba(35, 42, 38, 0.04);
}

.nav-link.active {
  color: var(--text-main);
  font-weight: 600;
  background-color: rgba(74, 107, 93, 0.1);
}

.nav-link.active .nav-indicator {
  background-color: var(--accent-sage);
  transform: scale(1.25);
}

/* Pie del Panel */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border-subtle);
}

.status-pill {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-sage);
}

.sidebar-cta {
  display: inline-block;
  text-align: center;
  padding: 0.72rem 1rem;
  border-radius: 8px;
  background-color: var(--text-main);
  color: var(--bg-primary);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  transition: background-color var(--transition-fast);
}

.sidebar-cta:hover {
  background-color: var(--accent-sage);
}

/* Botón Móvil Arriba a la Izquierda */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 1.1rem;
  left: 1.1rem;
  z-index: 120;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(247, 245, 240, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  box-shadow: 0 4px 16px rgba(35, 42, 38, 0.06);
}

.hamburger-line {
  width: 20px;
  height: 1.75px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.mobile-menu-btn.is-open .hamburger-line:nth-child(1) {
  transform: translateY(6.75px) rotate(45deg);
}
.mobile-menu-btn.is-open .hamburger-line:nth-child(2) {
  opacity: 0;
}
.mobile-menu-btn.is-open .hamburger-line:nth-child(3) {
  transform: translateY(-6.75px) rotate(-45deg);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(25, 30, 27, 0.32);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   SECCIONES Y CONTENIDO
   ========================================================================== */

.main-stream {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  margin-left: var(--sidebar-width);
}

.stream-section {
  min-height: 88vh;
  display: flex;
  align-items: center;
  padding: 5.5rem 4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-container {
  width: 100%;
  min-width: 0;
  max-width: 1040px;
  margin: 0 auto;
}

.eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-sage);
  font-weight: 600;
  margin-bottom: 1rem;
}

.display-title {
  font-family: var(--font-serif);
  font-size: clamp(2.4rem, 4.2vw, 3.8rem);
  font-weight: 500;
  line-height: 1.12;
  color: var(--text-main);
  margin-bottom: 1.35rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 3.3vw, 2.85rem);
  font-weight: 500;
  line-height: 1.18;
  color: var(--text-main);
  margin-bottom: 0.9rem;
}

.section-subtitle,
.lead-text {
  font-size: 1.04rem;
  color: var(--text-muted);
  max-width: 580px;
  font-weight: 300;
  line-height: 1.7;
}

/* --- 01. Hero con Imagen --- */
.hero-split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-actions {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.65rem;
  border-radius: 999px;
  background-color: var(--accent-sage);
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  background-color: #3B574B;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.55rem;
  border-radius: 999px;
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.btn-ghost:hover {
  background-color: rgba(35, 42, 38, 0.05);
}

/* --- 02. Espacio + Tarjetas con Imagen --- */
.section-header {
  margin-bottom: 2.75rem;
}

.space-showcase {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.editorial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.editorial-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.card-img {
  border-radius: 10px;
}

.editorial-card h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
}

.editorial-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* --- 03. Modalidades con Imagen Lateral --- */
.split-showcase {
  display: flex;
  flex-direction: column;
}

.modality-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.25rem;
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  align-items: center;
}

.modality-row:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.modality-tag {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-sage);
  display: block;
  margin-bottom: 0.3rem;
}

.modality-body h3 {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.modality-body p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* --- 04. Equipo Profesional (Carrusel Horizontal + Modal Detallado) --- */
.carousel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.carousel-controls {
  display: flex;
  gap: 0.65rem;
}

.carousel-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 1.05rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.carousel-btn:hover {
  background-color: var(--accent-sage);
  border-color: var(--accent-sage);
  color: #fff;
}

.team-carousel-wrapper {
  position: relative;
  width: 100%;
}

.team-carousel {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.4rem 0.2rem 1.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--placeholder-border) transparent;
  cursor: grab;
}

.team-carousel.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  scroll-behavior: auto;
  user-select: none;
}

.team-carousel::-webkit-scrollbar {
  height: 6px;
}

.team-carousel::-webkit-scrollbar-track {
  background: transparent;
}

.team-carousel::-webkit-scrollbar-thumb {
  background-color: var(--placeholder-border);
  border-radius: 999px;
}

.profile-card {
  flex: 0 0 300px;
  scroll-snap-align: start;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.profile-card:hover {
  transform: translateY(-4px);
  border-color: rgba(74, 107, 93, 0.4);
  box-shadow: 0 12px 26px rgba(35, 42, 38, 0.06);
}

.profile-photo {
  border-radius: 10px;
}

.profile-role {
  font-size: 0.75rem;
  color: var(--accent-sage);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 0.25rem;
}

.profile-info h3 {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.profile-info p {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.profile-card-hint {
  margin-top: auto;
  padding-top: 0.4rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-sage);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Modal / Card Ampliado al clickear un profesional */
.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(25, 30, 27, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.profile-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.profile-modal-card {
  width: 100%;
  max-width: 760px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: 22px;
  padding: 2.25rem;
  position: relative;
  box-shadow: 0 24px 60px rgba(25, 30, 27, 0.22);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-modal-backdrop.is-open .profile-modal-card {
  transform: translateY(0) scale(1);
}

.profile-modal-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-main);
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.profile-modal-close:hover {
  background: var(--text-main);
  color: var(--bg-primary);
}

.profile-modal-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.25rem;
  align-items: start;
}

.profile-modal-body h3 {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.profile-modal-desc {
  font-size: 0.98rem;
  color: var(--text-main);
  margin-bottom: 0.9rem;
  line-height: 1.7;
}

.profile-modal-extra {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.profile-modal-actions {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

/* --- 05. Contacto --- */
.contact-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 3rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-map {
  margin-top: 1.5rem;
  width: 100%;
  height: 240px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  background-color: var(--placeholder-bg);
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  filter: saturate(0.82) contrast(0.97);
}

.minimal-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.input-group input,
.input-group textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background-color: var(--bg-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--text-main);
}

.input-group input:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--accent-sage);
}

.stream-footer {
  margin-top: 3.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* ==========================================================================
   ANIMACIONES DE SCROLL (Anticipadas y suaves para no marear)
   ========================================================================== */

.reveal-item {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--transition-reveal),
    transform var(--transition-reveal);
  will-change: opacity, transform;
}

.reveal-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Atenuación sutil solo cuando ya quedó bastante arriba fuera de vista */
.reveal-item.is-past {
  opacity: 0.35;
  transform: translateY(-6px);
}

/* Delays muy cortos para que al bajar rápido responda al instante */
.delay-1 { transition-delay: 0.04s; }
.delay-2 { transition-delay: 0.08s; }
.delay-3 { transition-delay: 0.12s; }

/* ==========================================================================
   RESPONSIVE (Móviles y Tablets)
   ========================================================================== */

@media (max-width: 960px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
    width: 275px;
  }

  .sidebar.is-open {
    transform: translateX(0);
    box-shadow: 16px 0 40px rgba(25, 30, 27, 0.15);
  }

  /* En celulares: ocultar sub-secciones con sangría y dejar solo Inicio y Lecturas Recomendadas */
  .nav-sublist {
    display: none;
  }

  .main-stream {
    margin-left: 0;
  }

  .stream-section {
    padding: 5rem 1.4rem 4rem;
    min-height: auto;
  }

  .hero-split,
  .editorial-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .profile-card {
    flex: 0 0 265px;
  }

  .profile-modal-grid {
    grid-template-columns: 1fr;
    gap: 1.35rem;
  }

  .profile-modal-card {
    padding: 1.6rem 1.35rem;
  }

  .modality-row {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .contact-box {
    padding: 1.85rem 1.35rem;
  }
}
