/* Paleta de Biblioleche */
:root {
  --bl-grad1: #d5ac09;
  --bl-grad2: #ffffff;
  --bl-accent: #E3BE55;
  --bl-dark: #333333;
  --bl-light: #7a0000;
}

/* Estilos generales para evitar desbordamientos */
body, html {
  overflow-x: hidden; /* Vital para móviles: evita scroll horizontal indeseado */
  margin: 0;
  padding: 0;
}

.biblioleche-page {
  font-family: 'Raleway', sans-serif;
  background-color: #fff;
  width: 100%;
  max-width: 100vw; /* Asegura que no se salga del ancho de pantalla */
}

/* Hero con degradado Biblioleche */
.biblioleche-page .hero-section {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw); /* Truco para full-width */
  padding: 4rem 0;
  background: linear-gradient(135deg, var(--bl-grad1), var(--bl-grad2));
  color: var(--bl-light);
  text-align: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.25);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 1rem; /* Margen lateral seguro para móvil */
}

.hero-content h2 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(2rem, 8vw, 3.5rem); /* clamp dinámico */
  margin-bottom: 1rem;
  line-height: 1.1;
}

.hero-content p {
  font-size: clamp(1rem, 4vw, 1.3rem);
  margin-bottom: 2rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-btn {
  background: var(--bl-accent);
  color: var(--bl-dark);
  font-family: 'Raleway', sans-serif;
  font-weight: 700;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.hero-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* Contenedor principal limitado para PC */
.biblioleche-content {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem; /* Padding lateral esencial */
  box-sizing: border-box;
}

.biblioleche-content h3 {
  font-family: 'Raleway', sans-serif;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  color: var(--bl-grad1);
  margin-bottom: 1rem;
  font-weight: 800;
}

/* Galería Biblioleche (Grid flexible) */
.biblioleche-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* Se adapta solo */
  gap: 1rem;
  margin-top: 2rem;
}

.biblioleche-gallery figure {
  margin: 0;
}

.biblioleche-gallery img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

.biblioleche-gallery img:hover {
  transform: scale(1.02);
}

.biblioleche-gallery figcaption {
  text-align: center;
  font-style: italic;
  color: var(--bl-dark);
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

/* Destacado “highlight” */
.highlight {
  color: var(--bl-grad1);
  font-weight: bold;
}

/* Footer estilo Biblioleche */
.site-footer {
  background: var(--bl-grad1);
  color: #fff;
  padding: 2rem 0;
  text-align: center;
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.site-footer .footer-links a {
  color: #fff;
  margin: 0 0.8rem;
  font-family: 'Raleway', sans-serif;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
}


.bl-sobre, .bl-bloque {
  display: grid;
  gap: 2rem;
  margin: 3rem 0;
  align-items: center; /* Centrado vertical mejorado */
}

/* PC: Columnas definidas */
@media (min-width: 901px) {
  .bl-sobre {
    grid-template-columns: 1.5fr 1fr; /* Texto : Imagen */
  }
  
  .bl-bloque {
    grid-template-columns: 1fr 1.5fr; /* Imagen : Texto */
  }
}

/* MÓVIL: Una sola columna (Stack) */
@media (max-width: 900px) {
  .bl-sobre, .bl-bloque {
    grid-template-columns: 1fr; /* Todo en 1 columna */
    text-align: left; /* Lectura más natural en móvil */
    gap: 1.5rem;
  }

  /* Orden visual en móvil: Imagen arriba, texto abajo (opcional, aquí está normal) */
  /* Si quisieras invertir orden, usarías order: -1; */
}

/* Estilos internos de texto e imagen */
.bl-texto, .bl-bloque-texto {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #444;
}

.bl-texto h3, .bl-bloque-texto h3 {
  color: var(--bl-grad1);
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

/* === Ajuste de Imágenes: Sobre el Proyecto & Contexto === */

/* Imagen del Libro Animado (Sobre el Proyecto) */
.bl-figure img {
  width: 100%;
  
  /* Reducimos tamaño máximo en PC (antes ~320px o 400px) */
  max-width: 250px; 
  
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(255, 209, 2, 0.4); /* Sombra amarilla suave */
  object-fit: contain; /* Asegura que se vea el dibujo completo */
  margin: 0 auto;
  display: block;
  
  /* Opcional: Límite de altura para evitar estiramientos raros */
  max-height: 350px; 
}

/* Imagen del Cartón de Leche (Contexto) */
.bl-bloque-fig img {
  width: 100%;
  
  /* Reducimos tamaño máximo en PC (antes ~250px o 400px) */
  max-width: 220px; 
  
  height: auto;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  object-fit: contain;
  margin: 0 auto;
  display: block;
  
  /* Control de altura */
  max-height: 400px;
}

/* AJUSTES ESPECÍFICOS PARA MÓVIL */
@media (max-width: 900px) {
  .bl-figure img, 
  .bl-bloque-fig img {
    /* En móvil permitimos que sean un poco más grandes para que se noten */
    max-width: 280px; 
    margin-bottom: 1.5rem; /* Espacio extra debajo de la imagen antes del texto */
  }
}


.bl-figure figcaption {
  text-align: center;
  color: #777;
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* === REBRANDING VISUAL: Secciones Alternas === */
.bl-section {
  padding: 3rem 2rem;
  margin: 2rem 0;
  border-radius: 20px;
}

.alt-bg {
  background: linear-gradient(135deg, #fff9ea, #fff0c9); /* Fondo crema suave */
}

/* Imagen con brillo cálido */
.soft-glow img {
  border-radius: 16px;
  box-shadow: 0 0 25px rgba(213, 172, 9, 0.25); /* Brillo dorado sutil */
}



/* --- ESTILOS BASE (Comunes) --- */
.instructivo-grid.full-width {
  width: 100%;
  box-sizing: border-box;
}

.paso {
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.paso img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 0.8rem;
  background: #fff;
}

.paso h4 {
  color: var(--bl-grad1);
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

@media (min-width: 901px) {
  .instructivo-grid.full-width {
    display: grid !important; /* Forzamos Grid */
    grid-template-columns: repeat(3, 1fr) !important; /* 3 Columnas estrictas */
    gap: 3rem 2rem; /* Espacio vertical y horizontal */
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 2rem;
  }

  /* Efecto "Escalera" para que no se vea aburrido */
  .paso:nth-child(3n+2) { transform: translateY(30px); } /* Columna del medio baja */
  .paso:nth-child(3n+3) { transform: translateY(60px); } /* Columna derecha baja más */

  .paso:hover {
    transform: translateY(-10px) scale(1.02) !important; 
    box-shadow: 0 15px 30px rgba(213, 172, 9, 0.2);
    z-index: 5;
    border-color: var(--bl-accent);
  }

  /* Control estricto de imagen en PC */
  .paso img {
    max-height: 250px; /* Altura máxima para que no sean gigantes */
    min-height: 180px;
  }
}

@media (max-width: 900px) {
  .instructivo-grid.full-width {
    display: flex !important;
    flex-direction: column !important;
    gap: 2rem;
    width: 95% !important;
    margin: 2rem auto;
  }

  .paso img {
    max-height: 350px; /* Imágenes grandes en celular */
  }
}

/* === SECCIÓN: MOMENTOS BIBLIOLECHE (Arreglo de Imágenes) === */

.momentos-biblioleche {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, #fff8e6, #fff2cc);
  border-radius: 24px;
  margin: 5rem 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.momentos-texto {
  max-width: 750px;
  margin: 0 auto 3rem;
}

.momentos-texto h2 {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--bl-dark);
  margin-bottom: 1rem;
}

.momentos-texto p {
  font-family: 'Raleway', sans-serif;
  font-size: 1.1rem;
  color: #444;
  line-height: 1.8;
}

.momentos-imagenes {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Aquí está el arreglo de tamaño para PC */
.momentos-imagenes img {
  width: 100%;
  
  /* Límite en PC: Máximo 500px de ancho */
  max-width: 500px; 
  
  /* Altura controlada */
  height: 400px; 
  
  object-fit: cover; 
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin: 0 auto;
  display: block;
}

.momentos-imagenes img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.18);
}

/* === AJUSTE MÓVIL === */
@media (max-width: 900px) {
  .momentos-imagenes img {
    /* En móvil sí permitimos que ocupe casi todo el ancho disponible */
    max-width: 100%; 
    height: auto; 
    max-height: 500px;
  }
}
/* === LAYOUT ESPECIAL: SOBRE EL PROYECTO === */

/* Estilo base común */
.sobre-proyecto {
  background: #fffdf6;                 /* Tarjeta crema suave */
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  border-radius: 24px;
}

/* Imagen de portada un poco más pequeña y centrada */
.sobre-proyecto .bl-figure img {
  max-width: 260px;
}

/* ===== PC / ESCRITORIO ===== */
@media (min-width: 900px) {
  .sobre-proyecto {
    /* Dos columnas: texto ancho + imagen */
    grid-template-columns: 2fr 1fr;
    align-items: start;
    padding: 3rem 3rem;
  }

  .sobre-proyecto .bl-texto {
    max-width: 720px;
    text-align: left;
  }

  .sobre-proyecto .bl-texto p {
    font-size: 1.05rem;
    line-height: 1.7;
  }

  .sobre-proyecto .bl-figure {
    justify-self: center;
  }
  /* Imagen un poco más grande solo en PC */
    .sobre-proyecto .bl-figure img {
    max-width: 220px;
  }


}

/* ===== MÓVIL / TABLET PEQUEÑA ===== */
@media (max-width: 899px) {
  .sobre-proyecto {
    grid-template-columns: 1fr;   /* Todo en 1 columna */
    padding: 2.5rem 1.25rem;
    text-align: left;
    
  }

  .sobre-proyecto .bl-texto {
    max-width: 600px;
    margin: 0 auto 1.8rem;        /* Texto centrado como bloque, pero alineado a la izq. */
  }

  .sobre-proyecto .bl-figure {
    text-align: center;
  }

  .sobre-proyecto .bl-figure img {
    max-width: 220px;             
  }

  .sobre-proyecto .bl-figure figcaption {
    text-align: center;
    font-size: 0.85rem;
  }
}
@media (min-width: 901px) {
  .momentos-imagenes img{
    width: 100%;
    max-width: none;

    aspect-ratio: 4 / 3;
    height: auto;

    object-fit: contain; 
    object-position: center; 

    /* CAMBIO CLAVE: ya no “blanco” */
    background: rgba(255, 248, 230, 0.85); /* crema similar al fondo de la sección */
    padding: 14px;

    border-radius: 18px;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 10px 24px rgba(0,0,0,.10);

    /* Extra pro: efecto vidrio (si el navegador lo soporta) */
    backdrop-filter: blur(6px); 
    -webkit-backdrop-filter: blur(6px); /* Safari */
  }
}


/* Base (móvil-first): todo en una columna, limpio */
.librico{
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  padding: 2.25rem 1.25rem;
}

.librico-imagen{
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 1rem;
}

.librico-imagen img{
  width: min(360px, 90%);
  height: auto;
  object-fit: contain; /* Mantiene proporción sin deformar. */ 
  display: block;
}

.librico-texto{
  max-width: 70ch;
  margin: 0 auto;
  text-align: left;
}

.titulo-librico{
  color: var(--bl-grad1);
  margin: 0 0 .75rem;
  line-height: 1.1;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
}

/* Mini galería: cards uniformes */
.mini-galeria{
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.25rem;
}

.gal-item{
  background: #fffdf6;
  border: 1px solid rgba(0,0,0,.06);
  border-radius: 18px;
  padding: .9rem;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
  display: grid;
  gap: .6rem;
  justify-items: center;
  text-align: center;
}

.gal-item img{
  width: 100%;
  max-width: 260px;
  aspect-ratio: 4 / 3;
  object-fit: contain; /* Para ilustraciones/fotos verticales se ve más “limpio”. */
  display: block;
}

.gal-item span{
  display: block;
  font-size: .95rem;
  color: #444;
  font-weight: 600;
}

/* ===== PC: 2 columnas (imagen + texto) y galería en 3 ===== */
@media (min-width: 901px){
  .librico{
    display: grid;
    grid-template-columns: minmax(320px, 420px) 1fr; /* imagen | texto */
    gap: 2.5rem;
    align-items: center;
    padding: 3rem 3rem;
  }

  .librico-imagen{
    margin-bottom: 0;
    justify-content: start;
  }

  .librico-imagen img{
    width: 100%;
    max-width: 420px;
  }

  .librico-texto{
    margin: 0;
    max-width: 78ch;
  }

  .mini-galeria{
    grid-column: 2; /* galería debajo del texto, a la derecha */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 1.25rem;
  }

  .gal-item img{
    max-width: 220px; /* evita que se vean “gigantes” en PC */
  }
}

/* Accesibilidad: si el usuario pide menos movimiento, apagamos animaciones */
@media (prefers-reduced-motion: reduce){
  .bounce-in{
    animation: none !important; 
  }
}


@media (min-width: 901px) {

  /* --- SOBRE EL PROYECTO --- */
  .bl-section.sobre-proyecto{
    display: grid; /* Grid para layout editorial. */ /* [web:150] */
    grid-template-columns: minmax(540px, 1.7fr) minmax(260px, 0.9fr); 
    gap: 3rem;
    align-items: start;
    padding: 3.25rem 3.25rem;
  }

  .bl-section.sobre-proyecto .bl-texto{
    max-width: 78ch;
  }

  .bl-section.sobre-proyecto .bl-figure{
    justify-self: center;
    align-self: start;
    margin: 0;
  }

  .bl-section.sobre-proyecto .bl-figure img{
    width: 100%;
    max-width: 260px;
    max-height: 340px;
    object-fit: contain; /* Evita deformación por proporciones. */ 
  }

  /* --- CONTEXTO --- */
  .bl-section.contexto{
    display: grid; /* Grid para 2 columnas en PC. */ 
    grid-template-columns: minmax(260px, 0.9fr) minmax(540px, 1.7fr); 
    gap: 3rem;
    align-items: start;
    padding: 3.25rem 3.25rem;
  }

  .bl-section.contexto .bl-bloque-fig{
    justify-self: center;
    align-self: start;
    margin: 0;
  }

  .bl-section.contexto .bl-bloque-fig img{
    width: 100%;
    max-width: 280px;
    max-height: 420px;
    object-fit: contain; 
  }

  .bl-section.contexto .bl-bloque-texto{
    max-width: 78ch;
  }

  /* Opcional: unificar títulos visualmente dentro de estas secciones */
  .bl-section.sobre-proyecto h2,
  .bl-section.contexto h2{
    margin-top: 0;
  }
}


/* Contenedor: recorta lo que se sale y centra el carrusel */
.plano-carrusel .carousel-container{
  position: relative;
  overflow: hidden;              /* clave: no deja “desbordes” visibles */
  border-radius: 22px;
  max-width: 1100px;
  margin: 1.5rem auto 0;
}

/* Track horizontal real */
.plano-carrusel .carousel-track{
  display: flex;
  width: 100%;
  transition: transform .35s ease;
  will-change: transform;
}

/* Cada slide ocupa el 100% del contenedor (1 visible) */
.plano-carrusel .carousel-item{
  flex: 0 0 100%;
  box-sizing: border-box;
  padding: 1.25rem;
  text-align: center;

  background: rgba(255,255,255,0.65);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(0,0,0,.10);
}

/* Imagen controlada (evita “poster infinito”) */
.plano-carrusel .carousel-item img{
  width: 100%;
  height: auto;
  max-height: 520px;             /* ajusta la altura máxima visible */
  object-fit: contain;           /* evita recortes feos en planos */
  display: block;
  margin: 0 auto 0.75rem;
}

/* Texto */
.plano-carrusel .carousel-item h4{
  margin: .25rem 0 .25rem;
  color: var(--bl-grad1);
  font-family: 'Fredoka One', cursive;
}

.plano-carrusel .carousel-item p{
  margin: 0;
  color: #444;
  max-width: 60ch;
  margin-inline: auto;
}

/* Botones grandes y centrados */
.plano-carrusel .carousel-btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  z-index: 5;

  background: rgba(255,255,255,.85);
  box-shadow: 0 10px 22px rgba(0,0,0,.14);
}

.plano-carrusel .carousel-btn.prev{ left: 12px; }
.plano-carrusel .carousel-btn.next{ right: 12px; }

@media (max-width: 900px){
  .plano-carrusel .carousel-container{
    overflow-x: auto;                    
    scroll-snap-type: x mandatory;        
    -webkit-overflow-scrolling: touch;
  }

  /* el track sigue siendo flex */
  .plano-carrusel .carousel-track{
    scroll-snap-align: start;
  }

  .plano-carrusel .carousel-item{
    scroll-snap-align: center;            
}
}