/* ==========================================================================
   CECA Historia Timeline — Widget Styles
   Fondo oscuro con slider horizontal de tarjetas históricas.
   Usa variables CSS del tema ceca-theme (assets/css/variables.css).
   ========================================================================== */

/* ── Animaciones ───────────────────────────── */
@keyframes cecaHistoriaFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cecaHistoriaSlideIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ── Contenedor principal ──────────────────── */
.ceca-historia-timeline,
.ceca-historia-timeline *,
.ceca-historia-timeline *::before,
.ceca-historia-timeline *::after {
  box-sizing: border-box;
}

.ceca-historia-timeline {
  position: relative;
  width: 100%;
  overflow: hidden;
  background-color: var(--ceca-primary, #002a4f);
  font-family: var(--ceca-font-family, "Encode Sans Expanded", sans-serif);
  animation: cecaHistoriaFadeIn 0.5s ease both;
}

/* ── Wrapper interior ────────────────────── */
.ceca-historia-timeline__wrapper {
  position: relative;
  padding: 32px 16px 80px 16px;
  max-width: 1920px;
  margin: 0 auto;
}

/* ── Imagen de fondo decorativa ──────────── */
.ceca-historia-timeline__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ceca-historia-timeline__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

── Gradiente lateral izquierdo ─────────────
/* .ceca-historia-timeline__gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 420px;
  height: 100%;
  background: linear-gradient(
    to right,
    var(--ceca-primary, #002a4f) 0%,
    rgba(3, 78, 103, 0) 100%
  );
  z-index: 2;
  pointer-events: none;
} */

/* ── Zona del slider ───────────────────────── */
.ceca-historia-timeline__track-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  overflow: hidden;
}

.ceca-historia-timeline__track {
  display: flex;
  align-items: flex-end;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

/* ── Tarjeta individual ────────────────────── */
.ceca-historia-timeline__card {
  flex-shrink: 0;
  width: 469px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding-bottom: 10px;
  animation: cecaHistoriaSlideIn 0.6s ease both;
}

/* ── Contenido superior de la tarjeta ──────── */
.ceca-historia-timeline__card-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 32px 0 32px;
}

.ceca-historia-timeline__card-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 32px;
}

/* ── Imagen del hito ───────────────────────── */
.ceca-historia-timeline__image-wrap {
  width: 405px;
  height: 270px;
  overflow: hidden;
  background-color: var(--ceca-border-color, #ddd);
  box-shadow: 0px 4px 30px -1px rgba(0, 0, 0, 0.1);
}

.ceca-historia-timeline__image {
  display: block;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.ceca-historia-timeline__image-wrap:hover .ceca-historia-timeline__image {
  transform: scale(1.05);
}

/* ── Bloque de texto ───────────────────────── */
.ceca-historia-timeline__text {
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: flex-end;
  width: 405px;
}

/* ── Título enriquecido ────────────────────── */
.ceca-historia-timeline__title {
  font-size: clamp(18px, 1.25vw, 24px);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ceca-white, #ffffff);
  margin: 0;
}

.ceca-historia-timeline__title em,
.ceca-historia-timeline__title i {
  font-weight: 400;
  font-style: italic;
}

/* ── Divider ───────────────────────────────── */
.ceca-historia-timeline__divider {
  width: 100%;
  height: 1px;
  background-color: rgba(255, 255, 255, 0.3);
}

/* ── Descripción ───────────────────────────── */
.ceca-historia-timeline__desc {
  font-size: clamp(15px, 1.04vw, 20px);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ceca-white, #ffffff);
  margin: 0;
}

.ceca-historia-timeline__desc strong,
.ceca-historia-timeline__desc b {
  font-weight: 700;
}

.ceca-historia-timeline__desc ul,
.ceca-historia-timeline__desc ol {
  padding-left: 20px;
  margin: 8px 0;
}

.ceca-historia-timeline__desc li {
  margin-bottom: 4px;
}

/* ── Año grande semitransparente ────────────── */
.ceca-historia-timeline__year {
  font-size: clamp(48px, 4.69vw, 90px);
  font-weight: 800;
  font-style: italic;
  line-height: 1;
  letter-spacing: -1.8px;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
  margin: 0;
}

/* ── Fila inferior: línea + fecha ──────────── */
.ceca-historia-timeline__bottom {
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 20px 0;
}

/* ── Línea horizontal del timeline ─────────── */
.ceca-historia-timeline__marker {
  position: relative;
  width: 100%;
  height: 0;
  display: flex;
  align-items: center;
}

.ceca-historia-timeline__marker-line {
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.4);
  position: relative;
}

.ceca-historia-timeline__marker-line::before {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  transform: translateY(-50%);
}

.ceca-historia-timeline__marker-line::before {
  left: 0;
  border-width: 5px;
  border-radius: 100px;
  border-color: rgb(113, 149, 164);
}

.ceca-historia-timeline__card--last
  .ceca-historia-timeline__marker-line::after {
  right: 0;
  border-width: 6px 0 6px 8px;
  border-color: transparent transparent transparent rgb(113, 149, 164);
}

.ceca-historia-timeline__card--last
  .ceca-historia-timeline__marker-line::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  border-style: solid;
  transform: translateY(-50%);
}

/* ── Fecha detallada ───────────────────────── */
.ceca-historia-timeline__date {
  padding: 40px 8px;
  font-size: clamp(18px, 1.15vw, 22px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--ceca-white, #ffffff);
  margin: 0;
}

/* ── Botones de navegación ─────────────────── */
.ceca-historia-timeline__nav {
  position: absolute;
  bottom: 80px;
  right: 40px;
  z-index: 3;
  display: flex;
  gap: 11px;
  align-items: center;
}

.ceca-historia-timeline__nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 100px;
  border: 1px solid var(--ceca-border-color, #ddd);
  background-color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  transition:
    background-color var(--ceca-transition, 0.25s ease),
    opacity var(--ceca-transition, 0.25s ease);
  padding: 20px;
}

.ceca-historia-timeline__nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.7);
}

.ceca-historia-timeline__nav-btn:focus-visible {
  outline: var(--ceca-focus-outline, 2px solid #002a4f);
  outline-offset: var(--ceca-focus-offset, 2px);
}

.ceca-historia-timeline__nav-btn[disabled] {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.ceca-historia-timeline__nav-btn--prev {
  transform: rotate(180deg);
}

.ceca-historia-timeline__nav-icon {
  width: 20px;
  height: 20px;
  path {
    stroke: #333;
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* ── Tablet (≤ 1024px) ─────────────────────── */
@media (max-width: 1024px) {
  .ceca-historia-timeline__wrapper {
    padding: 0px 16px 80px 16px;
  }
  .ceca-historia-timeline__gradient {
    width: 200px;
  }

  .ceca-historia-timeline__card {
    width: 380px;
  }

  .ceca-historia-timeline__image-wrap {
    width: 320px;
  }

  .ceca-historia-timeline__text {
    width: 320px;
  }

  .ceca-historia-timeline__nav {
    bottom: 60px;
    right: 24px;
  }

  .ceca-historia-timeline__nav-btn {
    padding: 0;
    width: 48px;
    height: 48px;
  }
}

/* ── Móvil (≤ 768px) ──────────────────────── */
@media (max-width: 768px) {
  .ceca-historia-timeline__gradient {
    display: none;
  }

  .ceca-historia-timeline__track {
    padding-left: 24px;
  }

  .ceca-historia-timeline__card {
    width: 300px;
  }

  .ceca-historia-timeline__card-inner {
    padding: 32px 16px 0;
  }

  .ceca-historia-timeline__image-wrap {
    width: 268px;
    max-height: 280px;
  }

  .ceca-historia-timeline__text {
    width: 268px;
  }

  .ceca-historia-timeline__date {
    padding: 24px 8px;
  }

  .ceca-historia-timeline__nav {
    bottom: 40px;
    right: 16px;
  }

  .ceca-historia-timeline__nav-btn {
    width: 44px;
    height: 44px;
  }

  .ceca-historia-timeline__nav-icon {
    width: 16px;
    height: 16px;
  }
}
