/* ==========================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ================================---------- */
:root {
  --green: #173c38;
  --cream: #f7eedc;
  --gold: #aa8550;
  --ink: #503a2a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0%, #fffaf0 0%, #f7eedc 55%, #ede0c9 100%);
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  min-height: 100vh;
}


/* ==========================================
   2. ENCABEZADO Y CONTENEDOR PRINCIPAL
   ================================---------- */
.top {
  background: var(--green);
  color: #f8efdc;
  text-align: center;
  padding: 16px 22px;
  box-shadow: 0 6px 25px #173c3825;
}

.top small {
  display: block;
  letter-spacing: .23em;
  text-transform: uppercase;
  font: 11px system-ui, sans-serif;
  color: #dfc69b;
}

.top strong {
  display: block;
  font-size: clamp(17px, 2.4vw, 27px);
  font-weight: normal;
  margin-top: 6px;
}

.wrap {
  max-width: 1180px;
  margin: auto;
  padding: 34px 22px 50px;
}

.eyebrow {
  text-align: center;
  font: 12px system-ui, sans-serif;
  letter-spacing: .25em;
  color: #8e724e;
  text-transform: uppercase;
}

.heading {
  text-align: center;
  font-size: clamp(30px, 4.8vw, 52px);
  font-weight: normal;
  margin: 8px 0;
}

.sub {
  text-align: center;
  font: 14px/1.6 system-ui, sans-serif;
  color: #786956;
  margin: 0 0 25px;
}


/* ==========================================
   3. VISOR HISTÓRICO Y ESCENARIO
   ================================---------- */
.viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 340px);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  border: 1px solid #d7c5a5;
  border-radius: 22px;
  background: linear-gradient(145deg, #e9dbc1, #faf3e6);
  overflow: hidden;
  box-shadow: 0 18px 50px #60421e1c;
}

.stage:before {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid #ffffffa3;
  border-radius: 14px;
  pointer-events: none;
}

.slide {
  position: absolute;
  max-height: calc(100% - 42px);
  max-width: calc(100% - 42px);
  height: auto;
  width: auto;
  object-fit: contain;
  box-shadow: 0 14px 32px #33230f2e;
  opacity: 0;
  transform: translateX(30px) scale(.97);
  transition: opacity .65s ease, transform .65s cubic-bezier(.2, .8, .2, 1);
}

.slide.active {
  opacity: 1;
  transform: translateX(0) scale(1);
  z-index: 1;
}

.slide.out {
  transform: translateX(-30px) scale(.97);
}


/* ==========================================
   4. DETALLES Y CONTROLES
   ================================---------- */
.detail {
  padding: 12px 0;
}

.detail .index {
  font: 12px system-ui, sans-serif;
  letter-spacing: .22em;
  color: #987b54;
}

.detail .year {
  font-size: clamp(50px, 7vw, 88px);
  color: var(--green);
  line-height: 1.1;
  margin: 10px 0;
}

.detail h2 {
  font-size: clamp(22px, 3vw, 32px);
  font-weight: normal;
  margin: 10px 0 15px;
}

.detail p {
  font: 15px/1.7 system-ui, sans-serif;
  color: #766955;
}

.rule {
  width: 80px;
  height: 2px;
  background: var(--gold);
  margin: 22px 0;
}

.controls {
  display: flex;
  gap: 12px;
  margin: 25px 0;
}

.controls button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff9e9;
  padding: 13px 19px;
  border-radius: 100px;
  cursor: pointer;
  font: 14px system-ui, sans-serif;
  transition: .2s;
}

.controls button:hover:not(:disabled) {
  background: #2c6259;
  transform: translateY(-2px);
}

.controls button:disabled {
  opacity: .35;
  cursor: default;
}

.controls button.secondary {
  background: transparent;
  color: var(--green);
}

.progress {
  height: 4px;
  background: #d7c6a8;
  border-radius: 10px;
  overflow: hidden;
}

.progress div {
  height: 100%;
  width: 0;
  background: var(--green);
  transition: width .5s;
}


/* ==========================================
   5. LÍNEA DE TIEMPO (RAIL Y POINTS)
   ================================---------- */
.rail-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 34px;
  font: 12px system-ui, sans-serif;
  color: #7b674e;
}

.rail {
  display: flex;
  gap: 13px;
  overflow-x: auto;
  padding: 18px 3px 22px;
  scrollbar-width: thin;
  scrollbar-color: #ab8b60 transparent;
}

.point {
  position: relative;
  flex: 0 0 auto;
  min-width: 76px;
  border: 0;
  background: none;
  cursor: pointer;
  color: #78634a;
  font: 12px system-ui, sans-serif;
  padding: 0;
  text-align: center;
}

.point:before {
  content: '';
  display: block;
  height: 2px;
  background: #c5af88;
  position: absolute;
  left: -14px;
  right: 50%;
  top: 10px;
  z-index: 0;
}

.point:first-child:before {
  display: none;
}

.dot {
  position: relative;
  display: block;
  width: 21px;
  height: 21px;
  border: 3px solid #b49b72;
  background: #f8efdf;
  border-radius: 50%;
  margin: 0 auto 10px;
  transition: .25s;
}

.point.current .dot {
  background: var(--green);
  border-color: var(--green);
  box-shadow: 0 0 0 5px #173c3820;
}

.point.current {
  color: var(--green);
  font-weight: bold;
}


/* ==========================================
   6. PIE DE PÁGINA Y ACCESIBILIDAD
   ================================---------- */
.footer {
  text-align: center;
  font: 12px/1.6 system-ui, sans-serif;
  color: #8b785d;
  padding: 20px;
}

button:focus-visible {
  outline: 3px solid #c79a50;
  outline-offset: 4px;
}
.back {
  text-align: center;
  margin: 28px 0 0;
  font: 14px system-ui, sans-serif;
}

.back a {
  color: var(--green);
}

/* ==========================================
   7. MEDIA QUERIES (RESPONSIVO)
   ================================---------- */
@media (max-width: 760px) {
  .wrap {
    padding: 25px 14px;
  }
  
  .viewer {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .stage {
    min-height: 0;
    height: min(64vh, 620px);
    border-radius: 15px;
  }
  
  .slide {
    max-height: calc(100% - 24px);
    max-width: calc(10