/* -------------------------------------------
   MAIN LAYOUT
------------------------------------------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  /* Changed from 100vw to allow centering */
  margin: 0 auto;
  padding: clamp(30px, 2vh, 80px) 1rem 3rem;
  box-sizing: border-box;
  background-color: #fff;
}

/* -------------------------------------------
   FOOTER MINIMAL
------------------------------------------- */
.footer.minimal {
  text-align: center;
  background: var(--bg);
  color: #666;
  padding: 1rem 0;
  font-size: 0.9rem;
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  transition: background 0.6s ease;
  margin: 0 auto;
}

/* -------------------------------------------
   TÍTULOS DE SECCIÓN
------------------------------------------- */
h2 {
  color: var(--color-principal);
  font-size: 1.4rem;
  margin: 2.5rem 0 1.5rem;
  font-family: var(--fuente-inter);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

/* -------------------------------------------
   BOTÓN HAMBURGUESA FLOTANTE (universal)
------------------------------------------- */
.hamburger {
  position: fixed;
  top: 25px;
  right: 30px;
  width: 40px;
  height: 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 2000;
  padding: 0;
  transition: transform 0.3s ease;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--color-principal);
  transition: all 0.4s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(13px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-13px) rotate(-45deg);
}

.hamburger:hover {
  transform: scale(1.05);
}

/* -------------------------------------------
   MENÚ OVERLAY A PANTALLA COMPLETA
------------------------------------------- */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1500;
}

.menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.menu-overlay ul {
  list-style: none;
  padding: 0;
  margin: 0;
  text-align: center;
}

.menu-overlay li {
  margin: 1rem 0;
}

.menu-overlay a {
  font-family: var(--fuente-rubik);
  font-size: 1.8rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.menu-overlay a:hover {
  color: var(--color-principal);
}

/* -------------------------------------------
   AUTOR INFO
------------------------------------------- */

.autor-info {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeInUp 0.6s ease;
  width: auto;
  display: flex;
  justify-content: center;
  padding: 1rem;
  position: relative;
  margin-top: 20px;
}

.autor-info-card {
  padding: 2.5rem 2rem;
  width: auto;
 width: 600px;
  /* 🔥 NUEVO: Limita el ancho máximo en pantallas pequeñas */
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #f8f4e9 100%);
  /*border-radius: 24px;*/
  position: relative;
  margin: 0 auto;
  /* 🔥 NUEVO: Centrado automático */
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(139, 69, 19, 0.2);
  overflow: hidden;
}

/* Elemento decorativo tipo mandala/sello */
.autor-info-card::before {
  content: "☸";
  position: absolute;
  top: -30px;
  right: 10px;
  font-size: 8rem;
  opacity: 0.05;
  color: var(--color-principal);
  transform: rotate(15deg);
}

.autor-info img {
  width: 130px;
  /* 🔥 CORREGIDO: Unificado el tamaño */
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--color-principal);
  box-shadow: var(--shadow-soft);
  background-color: #fff;
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.autor-info img:hover {
  transform: scale(1.05);
  box-shadow:
    0 12px 35px rgba(0, 0, 0, 0.2),
    0 0 0 8px rgba(212, 175, 55, 0.3);
}

.autor-info h1 {
  color: var(--color-principal);
  font-size: 2rem;
  margin-top: 1rem;
  font-family: var(--fuente-lora);
  letter-spacing: 0.5px;
  font-weight: 500;
  line-height: 1.4;
  position: relative;
  display: inline-block;
}

.autor-info h1::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 25%;
  width: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--color-principal), transparent);
}

/* Línea decorativa adicional bajo el título */
.autor-info h1::before {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 20%;
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg,
      transparent,
      rgba(139, 69, 19, 0.4),
      transparent);
}

/* 🔥 NUEVO: Media Queries para mejor responsive */
@media (max-width: 768px) {
  .autor-info-card {
    /* width: 80%;  */
    padding: 2rem 1.5rem;
  }

  .autor-info h1 {
    font-size: 1.7rem;
  }
}

@media (max-width: 480px) {
  .autor-info-card {
    /* width: 100%; */
    /* Eliminado para permitir el centrado con margin: auto */
    padding: 1.5rem 1rem;
  }

  .autor-info h1 {
    font-size: 1.5rem;
  }

  .autor-info img {
    width: 110px;
    height: 110px;
  }
}

/* -------------------------------------------
   CONTENEDOR GENERAL (Cursos / Charlas)
------------------------------------------- */
.autor-materiales {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 2.5rem;
  margin-top: 1rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Cada bloque mantiene su estilo vertical */
.bloque-materiales {
  flex: 1 1 180px;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
}

/* -------------------------------------------
   CONTENEDOR DE CARDS (flex)
------------------------------------------- */
.bloque-materiales .grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 0;
  box-sizing: border-box;
}

/* -------------------------------------------
   CARD
------------------------------------------- */
.card {
  flex: 1 1 280px;
  /* ancho base, adaptable */
  max-width: 320px;
  background: #fff;
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transicion-suave);
  border: 1px dotted var(--color-principal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--glow-subtle);
}

.card h3 {
  color: var(--color-principal);
  font-family: var(--fuente-lora);
  font-size: 1.1rem;
  margin: 0.8rem 0;
}

.card p {
  color: var(--text-color);
  font-weight: bold;
  opacity: 0.8;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* -------------------------------------------
   BOTÓN VER RESUMEN
------------------------------------------- */
.btn-ver {
  align-self: center;
  background: var(--color-principal);
  color: #fff;
  padding: 0.55rem 1.3rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transicion-rapida);
  box-shadow: var(--shadow-soft);
}

.btn-ver:hover {
  background: var(--color-principal-hover);
  box-shadow: var(--glow-subtle);
  transform: scale(1.04);
}

/* -------------------------------------------
   BOTONES MINI
------------------------------------------- */
.bloque-materiales .botones-sesion {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .5rem;
}

/* Botones mini unificados */
.btn-mini {
  /* --btn-bg: #f2f5ff;
  --btn-bd: #cfd8ff;
  --btn-tx: #2f3b8f;
  --btn-bg-hover: #e7ecff;
  --btn-bd-hover: #b9c6ff; */

  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .75rem;
  border-radius: 10px;
  border: 1px solid var(--btn-bd);
  background: var(--btn-bg);
  color: var(--btn-tx);
  text-decoration: none;
  font-size: .92rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, transform .06s ease;
}

.btn-mini:hover {
  background: var(--btn-bg-hover);
  border-color: var(--btn-bd-hover);
}

.btn-mini:active {
  transform: translateY(1px);
}

/* Variante secundaria (para “Ver resumen”) */
.btn-mini:is(button).secundario {
  --btn-bg: #f8f8f8;
  --btn-bd: #e6e6e6;
  --btn-tx: #333;
  --btn-bg-hover: #f1f1f1;
  --btn-bd-hover: #dadada;
}

/* Accesibilidad foco */
.btn-mini:focus-visible {
  outline: 2px solid #7aa2ff;
  outline-offset: 2px;
}

/* ===========================
   MODAL RESUMEN (global)
=========================== */
.resumen-modal {
  position: fixed;
  width: 100vw;
  height: 100vh;
  inset: 0;
  /* Mantén aquí el gradiente como fondo base */
  background:
    radial-gradient(circle at 50% 20%,
      rgba(200, 80, 80, 0.25) 0%,
      transparent 60%),
    linear-gradient(135deg,
      rgba(43, 26, 26, 0.98) 0%,
      rgba(92, 0, 0, 0.95) 30%,
      rgba(128, 0, 0, 0.9) 70%,
      rgba(43, 26, 26, 0.98) 100%);
  backdrop-filter: blur(20px) contrast(1.1);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2000;
  /* Important: crear contexto para ::before */
  overflow: hidden;
}

/* Imagen overlay semi-transparente sobre el gradiente */
.resumen-modal::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('../img/overlay.webp'); /* ajustar ruta si hace falta */
  background-size: cover;
  background-position: center;
  opacity: 0.35; /* ajustar transparencia (0 = invisible, 1 = opaca) */
  pointer-events: none;
  z-index: 0;
  /* opcional: mezcla distinta
     mix-blend-mode: overlay;
  */
}

/* Asegurar que el contenido del modal quede por encima de la imagen */
.resumen-modal .resumen-modal-content {
  position: relative;
  z-index: 1;
}

.resumen-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.resumen-modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  max-width: 700px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
  position: relative;
  margin: 10px;
  display: flex;              /* añadido: layout en columna */
  flex-direction: column;     /* para que el header/cierre queden fuera del flujo scrollable si se desea */
}


/* Botón cerrar (X) */
.close-modal {
  position: absolute; /* se mantiene relativo al contenedor .resumen-modal-content */
  top: 10px;
  right: 10px;
  background: var(--color-principal);
  color: #fff;
  border-radius: 50%;
  width: 40px;               /* aumentar un poco para mejor centrado */
  height: 40px;
  padding: 0;                /* quitar padding para centrar exactamente el SVG/texto */
  display: inline-flex;      /* importante: centra contenido (SVG/text) en la circunferencia */
  align-items: center;       /* centra verticalmente */
  justify-content: center;   /* centra horizontalmente */
  border: none;
  font-size: 1rem;           /* tamaño de icono/texto */
  cursor: pointer;
  line-height: 1;
  transform: rotate(0deg) scale(1);
  transition: transform 0.4s ease, opacity 0.2s ease;
  z-index: 1001;
}

/* estado hover */
.close-modal:hover {
  transform: rotate(90deg) scale(1.2);
  opacity: 0.9;
  color: var(--warning);
}

.close-modal svg {
  width: 18px;
  height: 18px;
  display: block;
}

#resumenModalBody {
  line-height: 1.6;
  max-height: calc(80vh - 4.5rem); /* deja espacio para padding y el botón cerrar */
  overflow-y: auto;                /* activa scroll vertical en el cuerpo */
  padding-right: 1rem;             /* evitar que el scroll tape el texto */
  box-sizing: border-box;
  letter-spacing: 1.5px; /* ajustar si 2px es demasiado */
  text-align: justify;
  text-align-last: left;  
}

/* texto dentro del body */
#resumenModalBody p {
  color: var(--text-color);
  font-size: 1rem;
  text-align: justify;
  font-family: var(--fuente-inter);
  
  margin: 0 0 1rem 0;
}

/* -------------------------------------------
   MENSAJE VACÍO
------------------------------------------- */
.mensaje-vacio {
  text-align: center;
  color: #777;
  font-style: italic;
  margin: 3rem 0;
}

/* -------------------------------------------
   ANIMACIONES SUAVES
------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

/* -------------------------------------------
   RESPONSIVE
------------------------------------------- */
@media (max-width: 992px) {
  .autor-materiales {
    flex-direction: column;
    align-items: center;
  }

  .bloque-materiales {
    max-width: 700px;
  }

  .autor-info img {
    width: 110px;
    height: 110px;
  }

  .autor-info h1 {
    font-size: 1.7rem;
  }
}

@media (max-width: 768px) {
  main {
    /* padding-top: 100px; */
  }

  .autor-info img {
    width: 100px;
    height: 100px;
  }

  .autor-info h1 {
    font-size: 1.5rem;
  }

  .hamburger {
    top: 20px;
    right: 20px;
    width: 36px;
    height: 28px;
  }

  .hamburger span {
    height: 3px;
  }

  .menu-overlay a {
    font-size: 1.5rem;
  }

  .card {
    flex: 1 1 90%;
    max-width: 420px;
  }
}

@media (max-width: 480px) {
  .bloque-materiales .grid {
    grid-template-columns: 1fr;
  }

  .bloque-materiales .card {
    padding: .9rem .9rem 1.1rem;
  }

  .autor-info h1 {
    font-size: 1.3rem;
  }

  .card {
    flex: 1 1 100%;
    max-width: 380px;
  }
}