/* ============================================================
   historia.css — Estilos de la página Historia
   Mercado del Progreso
   ============================================================ */

/* ── Slider ── */
.slider-section {
  padding: var(--spacing-section) 0;
}
.history-slider-wrapper {
  position: relative;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 0 4rem;
}
.history-slider {
  overflow: hidden;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  background: white;
}
.history-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.history-slide {
  min-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: white;
}
.history-slide.no-image {
  grid-template-columns: 1fr;
  text-align: center;
}
.history-slide.no-image .slide-text {
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
}
.slide-text {
  padding: 4rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.slide-year {
  font-family: var(--font-serif);
  font-size: clamp(3rem, 5vw, 4.5rem);
  color: var(--clr-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
  line-height: 1;
}
.slide-title {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  margin-bottom: 1.5rem;
  color: var(--clr-text-main);
  font-family: var(--font-serif);
}
.slide-desc {
  color: var(--clr-text-muted);
  font-size: 1.125rem;
  line-height: 1.8;
}

/* aspect-ratio fijo para que las imágenes panorámicas no deformen el layout */
.slide-visual {
  aspect-ratio: 4 / 3;
  position: relative;
  background: var(--clr-bg-light);
  overflow: hidden;
}
.slide-visual img {
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), filter 0.8s ease;
}
.history-slide:hover .slide-visual img {
  transform: scale(1.06);
}
.year-badge-pill {
  position: absolute;
  top: 24px;
  right: 24px;
  padding: 6px 18px;
  background-color: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50px;
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  z-index: 10;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.4s ease;
}
.slide-visual:hover .year-badge-pill,
.carousel-3d-item:hover .year-badge-pill {
  background-color: var(--clr-primary);
  border-color: var(--clr-primary-dark);
  box-shadow: 0 0 20px rgba(164, 107, 90, 0.6);
  transform: scale(1.05) translateY(-2px);
}
.slide-img-full {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}
.slide-img-split {
  display: flex;
  height: 100%;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}
.slide-img-split img {
  width: 50%;
  height: 100%;
  object-fit: cover;
}

/* ── Botones slider ── */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: white;
  border: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  font-size: 1.4rem;
  color: var(--clr-primary);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.slider-btn:hover {
  background: var(--clr-primary);
  color: white;
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 0 25px rgba(164, 107, 90, 0.7);
}
.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 10px; }

/* ── Dots ── */
.slider-dots {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 2rem;
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #cbd5e1;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dot:hover {
  background: var(--clr-accent);
  box-shadow: 0 0 10px var(--clr-accent);
  transform: scale(1.2);
}
.dot.active {
  background: var(--clr-primary);
  transform: scale(1.5);
  box-shadow: 0 0 15px rgba(164, 107, 90, 0.6);
}

/* ── Responsive slider ── */
@media (max-width: 900px) {
  .history-slide { grid-template-columns: 1fr; }
  .history-slider-wrapper { padding: 0 3rem; }
  .slide-text { padding: 2.5rem; }
  .slide-visual { aspect-ratio: 16/9; }
}
@media (max-width: 600px) {
  .history-slider-wrapper { padding: 0 0.5rem; }
  .slide-text { padding: 1.5rem; }
  .slider-btn { width: 38px; height: 38px; font-size: 1.1rem; }
  .slider-btn.prev { left: 4px; }
  .slider-btn.next { right: 4px; }
}

/* ── 3D Infinity Carousel Gallery ── */
.gallery-3d-section {
  padding: 6rem 0;
  background-color: var(--clr-primary-dark);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  perspective: 1200px;
  color: white;
}
.gallery-3d-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 4rem;
  text-align: center;
  padding: 0 1rem;
}
.carousel-3d-container {
  position: relative;
  width: 300px;
  height: 200px;
  transform-style: preserve-3d;
  animation: rotate3d 20s linear infinite;
}
.carousel-3d-item {
  position: absolute;
  width: 100%;
  height: 100%;
  left: 0;
  top: 0;
  transform-origin: center;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: box-shadow 0.4s ease, filter 0.4s ease, transform 0.4s ease;
  cursor: pointer;
}
.carousel-3d-item:hover {
  box-shadow: 0 0 40px rgba(212, 163, 115, 0.6);
  filter: brightness(1.1);
}
.carousel-3d-item:nth-child(1) { transform: rotateY(0deg)   translateZ(350px); }
.carousel-3d-item:nth-child(2) { transform: rotateY(60deg)  translateZ(350px); }
.carousel-3d-item:nth-child(3) { transform: rotateY(120deg) translateZ(350px); }
.carousel-3d-item:nth-child(4) { transform: rotateY(180deg) translateZ(350px); }
.carousel-3d-item:nth-child(5) { transform: rotateY(240deg) translateZ(350px); }
.carousel-3d-item:nth-child(6) { transform: rotateY(300deg) translateZ(350px); }
.carousel-3d-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
@keyframes rotate3d {
  from { transform: rotateY(0deg); }
  to   { transform: rotateY(360deg); }
}
.carousel-3d-container:hover {
  animation-play-state: paused;
}

/* ── Galería mobile (reemplaza al 3D en pantallas pequeñas) ── */
.gallery-mobile-grid {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  padding: 0 1rem;
  width: 100%;
  max-width: 500px;
}
.gallery-mobile-grid .gal-item {
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3/2;
  position: relative;
}
.gallery-mobile-grid .gal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
@media (max-width: 767px) {
  .carousel-3d-container { display: none; }
  .gallery-mobile-grid   { display: grid; }
}

/* ── Hero página historia ── */
.page-hero {
  position: relative;
  padding: 120px 0;
  overflow: hidden;
  color: white;
}
@keyframes kenburns {
  0%   { transform: scale(1); }
  100% { transform: scale(1.1); }
}
.hero-bg-zoom {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.7)),
              url('../assets/images/Historia/1940-Rivadavia-y-Centenera.jpg') center center / cover no-repeat;
  animation: kenburns 30s ease-out infinite alternate;
  z-index: 0;
}
.custom-shape-divider-bottom {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
}
.custom-shape-divider-bottom svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 45px;
}
.custom-shape-divider-bottom .shape-fill { fill: #f1f5f9; }

/* ── Secretos de la Arquitectura ── */
.secrets-section {
  padding: 6rem 0;
  background: white;
}
.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 4rem;
  padding: 0 2rem;
}
.section-eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--clr-primary);
  margin-bottom: 1rem;
}
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--clr-text-main);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.section-subtitle {
  color: var(--clr-text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}
.secrets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.secret-card {
  position: relative;
  padding: 2.5rem 2rem 2.5rem 2.5rem;
  border-left: 5px solid var(--clr-primary);
  background: #fafafa;
  border-radius: 0 14px 14px 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}
.secret-card.visible {
  opacity: 1;
  transform: translateY(0);
}
.secret-card:hover { box-shadow: 0 8px 30px rgba(164, 107, 90, 0.15); }
.secret-card:nth-child(2) { transition-delay: 0.15s; }
.secret-card:nth-child(3) { transition-delay: 0.30s; }
.secret-icon-bg {
  position: absolute;
  right: 0;
  bottom: -10px;
  font-size: 7rem;
  opacity: 0.06;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.secret-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--clr-primary);
  margin-bottom: 0.6rem;
}
.secret-headline {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  color: var(--clr-text-main);
  margin-bottom: 1rem;
  line-height: 1.25;
}
.secret-text {
  color: var(--clr-text-muted);
  line-height: 1.8;
  font-size: 0.96rem;
}
@media (max-width: 900px) {
  .secrets-grid { grid-template-columns: 1fr; }
}

/* ── Números que Hablan ── */
.stats-section {
  padding: 6rem 2rem;
  background: var(--clr-primary-dark);
  color: white;
  text-align: center;
}
.stats-section .section-title   { color: white; }
.stats-section .section-subtitle { color: rgba(255,255,255,0.65); }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3rem;
  max-width: 1100px;
  margin: 3rem auto 0;
}
.stat-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stat-item.visible { opacity: 1; transform: translateY(0); }
.stat-item:nth-child(2) { transition-delay: 0.12s; }
.stat-item:nth-child(3) { transition-delay: 0.24s; }
.stat-item:nth-child(4) { transition-delay: 0.36s; }
.stat-number {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 5vw, 5.5rem);
  font-weight: 700;
  color: var(--clr-accent);
  line-height: 1;
  margin-bottom: 0.75rem;
}
.stat-suffix {
  font-size: 0.45em;
  font-weight: 400;
  vertical-align: middle;
}
.stat-label {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  line-height: 1.5;
}
.stat-divider {
  width: 36px;
  height: 2px;
  background: var(--clr-primary);
  margin: 1rem auto;
  border-radius: 2px;
  opacity: 0.5;
}
@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ── Folclore y Mitos ── */
.folklore-section {
  padding: 6rem 0;
  background: #fdf8f3;
}
.folklore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}
.folklore-card {
  border-radius: 14px;
  overflow: hidden;
  background: white;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.folklore-card.visible { opacity: 1; transform: translateY(0); }
.folklore-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 14px 40px rgba(164, 107, 90, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.folklore-card:nth-child(2) { transition-delay: 0.15s; }
.folklore-card:nth-child(3) { transition-delay: 0.30s; }
.folklore-card-top {
  padding: 2.25rem 2rem 1.75rem;
  background: var(--clr-primary);
  color: white;
}
.folklore-emoji {
  font-size: 2.6rem;
  display: block;
  margin-bottom: 0.9rem;
  line-height: 1;
}
.folklore-card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
}
.folklore-card-body { padding: 1.75rem 2rem; }
.folklore-card-text {
  color: var(--clr-text-muted);
  line-height: 1.8;
  font-size: 0.96rem;
}
.folklore-tag {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--clr-primary);
  border: 1.5px solid var(--clr-primary);
  border-radius: 50px;
  padding: 4px 14px;
}
@media (max-width: 900px) {
  .folklore-grid { grid-template-columns: 1fr; }
}

/* ── Botón Back to Top ── */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 48px;
  height: 48px;
  background: var(--clr-primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(164, 107, 90, 0.45);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease;
  z-index: 999;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
}
.back-to-top:hover {
  background: var(--clr-primary-dark);
  box-shadow: 0 6px 22px rgba(164, 107, 90, 0.6);
}
