/**
 * ==========================================================
 * PRESENCIALES — Dharma / Zen (Versión Flex)
 * ==========================================================
 * Reescritura completa usando Flexbox en lugar de Grid.
 * Coherente con selector_autor.css.
 * ==========================================================
 */

/* -------------------------------------------
   BASE GENERAL
------------------------------------------- */
.presenciales {
  padding: 30px;
  background: transparent;
  color: var(--text-color);
}
#inicio-presenciales {
  scroll-margin-top: 120px; /* ajusta según la altura del header */
}

/* -------------------------------------------
   TÍTULO DE SECCIÓN
------------------------------------------- */
.titulo-seccion {
  margin: 50px 0 80px 0;
  font-family: var(--fuente-inter);
  color: var(--color-principal);
  text-align: center;
  font-size: clamp(1.2rem, 2.5vw, 3.5rem);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.8px;
}
.section-subtitle {
  max-width: 800px;
  margin: 0 auto;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 2rem;
  letter-spacing: 1.6px;
  opacity: 0.7;
  color: var(--color-principal);
  /* font-style: italic; */
  text-align: center;
}
.section-subtitle-mobile {
  max-width: 400px;
  padding: 10px;
  margin: .5rem auto ;
  font-size: 0.95rem;
  line-height: 1.7;
  letter-spacing: 1.4px;
  opacity: 0.7;
  color: var(--color-principal);
  /* font-style: italic; */
  text-align: center;
}
.section-banner {
  display: block;
  width: 50%;
  height: auto;
  margin: 1rem auto ;
  margin-top: -2.5rem;
  /* border-radius: 12px; */
  object-fit: cover;
    /*border: 4px double #80000099;*/
     background: linear-gradient(145deg, #f4f4f4, #ddd);
     padding: 2px;


}
.section-banner::before {
  content: "";
  position: absolute;
  inset: 6px;
  /*border: 2px solid #8000007a;*/
 
  pointer-events: none;
}

/* -------------------------------------------
   NOTA: Estilos comunes movidos a components.css
   - .abecedario-container, .abecedario
   - .grid-autores, .autor-card, .autor-imagen, .autor-nombre
   - .btn-volver, .titulo-letra, .mensaje-vacio
------------------------------------------- */

/* -------------------------------------------
   BASE DE CARRUSEL
------------------------------------------- */
.carrusel-container {
  position: relative;
  overflow: hidden;
  max-width: 1300px;
  margin: 0 auto;
    /* 🔥 FIX: Reservar altura mínima para evitar CLS */
  min-height: 320px; /* Altura aproximada de una card + padding */
  
  /* Opcional: mostrar un fondo sutil mientras carga */
  background: linear-gradient(
    to right,
    transparent,
    rgba(128, 0, 0, 0.02) 50%,
    transparent
  );
}

/* 2️⃣ SKELETON LOADER (opcional pero recomendado) */
.carrusel-container::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-principal);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* Mostrar loader solo si el carrusel está vacío */
.carrusel-container:empty::before,
.carrusel-wrapper:empty::before {
  opacity: 1;
}


.carrusel-wrapper {
  display: flex;
  flex-wrap: nowrap;  /* Ahora el wrapper maneja el nowrap */
  gap: 2rem;         /* Y el gap */
  cursor: grab;
  user-select: none;
  will-change: transform;
  transition: transform 0.5s ease;
    /* 🔥 FIX: Altura mínima para el wrapper */
  min-height: 280px;
  align-items: flex-start; /* Evitar estiramiento vertical */
}

.carrusel-wrapper:active { cursor: grabbing; }

/* -------------------------------------------
   CARD INDIVIDUAL DE AUTOR
------------------------------------------- */
.card2-carrusel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: auto;
  min-width: 240px;
  max-width: 260px;
  background: #fff;
  /*border-radius: 12px;*/
  box-shadow: inset 0 1px 3px rgba(255,255,255,0.5), var(--shadow-soft);
  padding: 1rem;
  margin-top:10px;
  text-align: center;
  transition: all 0.3s ease;
  flex: 1 1 240px;
    /* 🔥 FIX: Evitar cambios de tamaño inesperados */
  contain: layout style paint;
  content-visibility: auto; /* Renderizado lazy nativo */
}

.card2-carrusel:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow-subtle);
  color: var(--text-color);
  border-radius: 12px;
}

.card2-carrusel a {
  text-decoration: none;
}

.card2-imagen {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 3px solid var(--color-principal);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  margin: 0 auto 1rem;
  transition: transform 0.3s ease;
  background-blend-mode: multiply;
    /* 🔥 FIX: Color de fondo mientras carga la imagen */
  /*background-color: #f5f5f5;*/
  
  /* 🔥 FIX: Prevenir layout shift */
  contain: layout style paint;
}

.card2-imagen:hover {
  transform: scale(1.05);
}

.card2-titulo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 2.5rem;
  font-family: var(--fuente-inter);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-principal);
  margin-top: 15px;
  line-height: 1.3;
    /* 🔥 FIX: Usar font-display para evitar FOIT */
  font-display: swap; /* Esto va en @font-face, pero ayuda aquí también */
  
  /* 🔥 FIX: Prevenir cambios de layout por fuentes */
  contain: layout style;
}

.card2-titulo:hover {
  color: var(--color-principal);
  filter: sepia(90%);
}

/* -------------------------------------------
   BOTONES DE NAVEGACIÓN
------------------------------------------- */
.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: radial-gradient(circle at 30% 30%, var(--color-principal-hover) 0%, var(--color-principal) 90%);
  color: #fff;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  opacity: 0.85;
  transition: all 0.3s ease;
  z-index: 20;
    /* 🔥 FIX: Evitar reflow de botones */
  contain: layout style paint;
}

.nav-button:hover {
  transform: translateY(-50%) scale(1.08);
  opacity: 1;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  background: radial-gradient(circle at 30% 30%, var(--color-principal) 0%, var(--color-principal-hover) 90%);
}
.nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.4 !important;
}

.prev-button { left: 8px; font-size: 1.5rem; padding-right: 6px; }
.next-button { right: 8px; font-size: 1.5rem; padding-left: 6px; }

@media (max-width: 768px) {
  .nav-button { display: none; }
}

/* -------------------------------------------
   BOTÓN "VER MÁS AUTORES"
------------------------------------------- */
.btn-vermas {
  display: none;
  margin: 1.5rem auto 0;
  padding: 0.7rem 1.4rem;
  background: linear-gradient(135deg, var(--color-principal), var(--color-principal-hover));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.btn-vermas:hover {
  background: linear-gradient(135deg, var(--color-principal-hover), var(--color-principal));
  transform: scale(1.03);
}

@media (max-width: 768px) {
  .btn-vermas { display: block; }
}

/* -------------------------------------------
   ANIMACIÓN SUAVE
------------------------------------------- */
.fade-in {
  opacity: 0;
  transform: translateY(14px);
  animation: fadeInUp 0.45s ease forwards;
    /* 🔥 FIX: Prevenir jumps durante la animación */
  will-change: opacity, transform;
}

@keyframes fadeInUp {
  to { opacity: 1; transform: translateY(0); }
}


/* 5️⃣ PREVENIR INVISIBLE TEXT (FOIT) */
.card2-titulo,
.titulo-seccion,
.autor-nombre {
  /* Asegurar que el texto sea visible mientras carga la fuente */
  font-display: swap;
  
  /* Size matching para reducir layout shift */
  font-size-adjust: 0.5;
}







