:root {
  /* ── NUEVA PALETA FILAH 37 ── */
  --azul: #284d98;
  --azul-dark: #1c3a73;
  --azul-light: #eaf0fc;
  --verde: #dfd97c;
  --verde-light: #f3f0ce;
  --rojo: #d23930;
  --rojo-dark: #a82a23;
  --cafe: #5c3e35;
  --cafe-light: #f5efed;

  /* Alias para compatibilidad con clases existentes */
  --primario-guinda: var(--azul); /* el "color principal" ahora es azul */
  --dorado: var(--rojo); /* lo que antes era dorado, ahora es rojo */
  --blanco: #ffffff;
  --texto-oscuro: var(--cafe);
  --texto-suave: #6b5c57;
  --fondo-gris: var(--verde-light);
}

body {
  margin: 0;
  color: var(--texto-oscuro);
}

.seccion-principal-centrada {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5px 20px;
}

/* ════════════ ANIMACIONES DE ENTRADA ════════════ */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes lineGrow {
  from {
    width: 0;
  }
  to {
    width: 100px;
  }
}

/* Aplica si el navegador admite animación */
@media (prefers-reduced-motion: no-preference) {
  .encabezado-premium {
    animation: fadeUp 0.7s ease-out both;
  }
  .bloque-historia-editorial {
    animation: fadeUp 0.8s ease-out 0.2s both;
  }
  .encabezado-grid {
    animation: fadeUp 0.7s ease-out both;
  }
  .adorno-dorado,
  .linea-decorativa-corta {
    animation: lineGrow 0.8s ease-out 0.3s both;
  }

  /* Tarjetas con entrada escalonada */
  .tarjeta-edicion-cuadrada {
    animation: fadeUp 0.6s ease-out both;
  }
  .tarjeta-edicion-cuadrada:nth-child(1) {
    animation-delay: 0.05s;
  }
  .tarjeta-edicion-cuadrada:nth-child(2) {
    animation-delay: 0.1s;
  }
  .tarjeta-edicion-cuadrada:nth-child(3) {
    animation-delay: 0.15s;
  }
  .tarjeta-edicion-cuadrada:nth-child(4) {
    animation-delay: 0.2s;
  }
  .tarjeta-edicion-cuadrada:nth-child(5) {
    animation-delay: 0.25s;
  }
  .tarjeta-edicion-cuadrada:nth-child(6) {
    animation-delay: 0.3s;
  }
  .tarjeta-edicion-cuadrada:nth-child(7) {
    animation-delay: 0.35s;
  }
  .tarjeta-edicion-cuadrada:nth-child(8) {
    animation-delay: 0.4s;
  }
  .tarjeta-edicion-cuadrada:nth-child(9) {
    animation-delay: 0.45s;
  }
  .tarjeta-edicion-cuadrada:nth-child(n + 10) {
    animation-delay: 0.5s;
  }
}

/* --- DISEÑO DE TEXTO Y BLOQUE HISTORIA --- */
.encabezado-premium {
  text-align: center;
  margin-bottom: 50px;
}
.pre-titulo {
  color: var(--rojo); /* rojo en lugar de dorado */
  text-transform: uppercase;
  letter-spacing: 3px;
  font-weight: 700;
  font-size: 0.85rem;
}
.titulo-galardon {
  color: var(--azul); /* azul */
  font-size: 3.5rem;
  margin: 10px 0;
  font-weight: 800;
  line-height: 1.1;
}
.adorno-dorado {
  height: 4px;
  width: 100px;
  background: var(--verde); /* verde */
  margin: 20px auto;
  border-radius: 2px;
}

.bloque-historia-editorial {
  background: var(--blanco);
  padding: 2px;
  border-radius: 15px;
}

/* Letra Capital Drop Cap */
.bloque-historia-editorial p:first-of-type::first-letter {
  font-size: 4.5rem;
  font-weight: 800;
  color: var(--azul); /* azul */
  float: left;
  margin: 8px 15px 0 0;
  line-height: 0.8;
}

.contenido-texto p {
  text-align: justify;
  line-height: 1.9;
  color: var(--texto-suave);
  font-size: 1.15rem;
  margin-bottom: 25px;
}
.parrafo-destacado {
  font-size: 1.25rem !important;
  color: var(--cafe) !important;
  font-weight: 500;
}
.resaltado-guinda {
  color: var(--azul); /* azul (era guinda) */
  font-weight: 700;
}
.resaltado-oro {
  color: var(--rojo); /* rojo (era dorado) */
  font-weight: 700;
}

/* --- DISEÑO ENCABEZADO GRID --- */
.encabezado-grid {
  text-align: center;
  margin-bottom: 50px;
}
.titulo-seccion-grid {
  color: var(--azul);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 5px;
}
.linea-decorativa-corta {
  width: 60px;
  height: 3px;
  background: var(--verde); /* verde */
  margin: 0 auto 15px;
}
.subtitulo-grid {
  color: var(--cafe);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.4;
}

/* --- GRID Y TARJETAS --- */
.grid-ediciones-cuadradas {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px;
}
.tarjeta-edicion-cuadrada {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition:
    transform 0.4s,
    box-shadow 0.4s;
  border: 1px solid var(--verde-light);
}
.tarjeta-edicion-cuadrada:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(40, 77, 152, 0.18); /* sombra azul */
}
.contenedor-img-cuadrada {
  position: relative;
  padding-top: 100%;
  background: var(--verde-light); /* placeholder verde clarito */
}
.img-cartel {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.capa-hover-elegante {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(40, 77, 152, 0.9); /* azul translúcido */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: 0.3s;
  color: #fff;
  gap: 15px;
}
.tarjeta-edicion-cuadrada:hover .capa-hover-elegante {
  opacity: 1;
}
.pie-tarjeta-año {
  padding: 18px;
  text-align: center;
  background: var(--azul); /* azul */
  color: #fff;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- MODAL Y GALERÍA --- */
.modal-fondo {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(92, 62, 53, 0.92); /* café oscuro translúcido */
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease both; /* fondo desvanece */
}

.modal-contenedor {
  background: #fff;
  width: 95%;
  max-width: 1150px;
  height: 85vh;
  border-radius: 20px;
  position: relative;
  display: flex;
  overflow: hidden;
  animation: scaleIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; /* modal entra con zoom */
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Botón de Cierre "X" */
.boton-cerrar {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 45px;
  line-height: 1;
  border: none;
  background: none;
  color: var(--azul);
  cursor: pointer;
  z-index: 11000;
  transition:
    color 0.2s,
    transform 0.2s;
}
.boton-cerrar:hover {
  color: var(--rojo); /* hover en rojo */
  transform: scale(1.1) rotate(90deg); /* giro al hover */
}

.modal-layout-interno {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Columna Documentos (izquierda) */
.modal-col-izq {
  width: 35%;
  background: var(--verde-light); /* verde clarito */
  padding: 40px;
  border-right: 1px solid var(--verde);
  overflow-y: auto;
  animation: slideInLeft 0.5s ease-out 0.15s both; /* desliza desde izquierda */
}
.modal-titulo-edicion {
  color: var(--azul);
  font-size: 2rem;
  margin-top: 0;
  border-bottom: 2px solid var(--verde); /* verde */
  padding-bottom: 10px;
  margin-bottom: 30px;
}

.enlace-doc {
  display: flex;
  align-items: center;
  padding: 18px;
  background: #fff;
  border-radius: 12px;
  text-decoration: none;
  color: var(--cafe);
  margin-bottom: 15px;
  border: 1px solid var(--verde);
  transition: 0.25s;
  animation: fadeUp 0.4s ease-out both;
}
.enlace-doc:nth-of-type(1) {
  animation-delay: 0.3s;
}
.enlace-doc:nth-of-type(2) {
  animation-delay: 0.4s;
}
.enlace-doc:nth-of-type(3) {
  animation-delay: 0.5s;
}
.enlace-doc:nth-of-type(4) {
  animation-delay: 0.6s;
}

.enlace-doc:hover {
  border-color: var(--azul);
  background: var(--azul);
  color: #fff;
  transform: translateX(8px);
  box-shadow: 0 5px 15px rgba(40, 77, 152, 0.2);
}
.enlace-doc:hover i {
  color: #fff;
}
.enlace-doc i {
  font-size: 2rem;
  color: var(--azul);
  margin-right: 18px;
  transition: 0.2s;
}

/* Columna Galería (derecha) */
.modal-col-der {
  width: 65%;
  padding: 40px;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
  animation: slideInRight 0.5s ease-out 0.15s both; /* desliza desde derecha */
}
.visor-grande {
  flex: 1;
  background: var(--cafe); /* café (era negro) */
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 20px;
}
.visor-grande img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.2s;
}

.galeria-minis {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 10px 5px;
  justify-content: flex-start;
  scrollbar-width: thin;
}
.mini-foto {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.5;
  border: 3px solid transparent;
  transition: 0.3s;
  flex-shrink: 0;
}
.mini-foto.activa,
.mini-foto:hover {
  opacity: 1;
  border-color: var(--rojo); /* rojo (acento) */
}

/* Responsive */
@media (max-width: 950px) {
  .modal-layout-interno {
    flex-direction: column;
    overflow-y: auto;
  }
  .modal-col-izq,
  .modal-col-der {
    width: 100%;
    height: auto;
  }
  .visor-grande {
    height: 300px;
  }
  .titulo-galardon {
    font-size: 2.5rem;
  }
}
