/* ═══════════════════════════════════════════════════════════
   RIIGUED – Historia del Congreso  |  timeline.css  v2.0.0
   Paleta: navy #0D2B5E · cyan #29ABE2
   Burbuja expandible dentro del card
══════════════════════════════════════════════════════════ */

:root {
  --rch-navy:      #0D2B5E;
  --rch-navy-mid:  #163870;
  --rch-navy-dark: #091e44;
  --rch-cyan:      #29ABE2;
  --rch-cyan-lt:   #e8f6fd;
  --rch-white:     #ffffff;
  --rch-text:      #2d3748;
  --rch-muted:     #64748b;
  --rch-radius:    16px;
  --rch-shadow:    0 8px 40px rgba(13,43,94,.15);
  --rch-shadow-lg: 0 20px 60px rgba(13,43,94,.25);
}

/* ── Eliminar gaps del contenedor del tema ── */
.rii-page-content:has(.rch-section) {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
.rii-page-body:has(.rch-section) {
  overflow: visible !important;
  max-width: none !important;
  width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ── Sección wrapper ── */
.rch-section {
  background: linear-gradient(160deg, var(--rch-navy-dark) 0%, var(--rch-navy) 60%, #1a4a8a 100%);
  padding: 60px 0 100px;
  overflow: hidden;
  position: relative;
  width: 100vw !important;
  margin-left: calc(-50vw + 50%) !important;
  margin-right: calc(-50vw + 50%) !important;
  margin-top: 0;
}
.rch-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 10% 20%, rgba(41,171,226,.08) 0%, transparent 70%),
    radial-gradient(ellipse 400px 600px at 90% 80%, rgba(41,171,226,.06) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Header oculto (título ya en la página) ── */
.rch-section__header { display: none; }

/* ── Timeline ── */
.rch-timeline {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
}
.rch-timeline::before {
  content: '';
  position: absolute;
  left: 50%; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, rgba(41,171,226,.4) 5%, rgba(41,171,226,.4) 95%, transparent 100%);
  transform: translateX(-50%);
}

/* ── Ítem ── */
.rch-hito {
  display: grid;
  grid-template-columns: 1fr 56px 1fr;
  align-items: start;
  padding: 20px 0;
  opacity: 1;
  transform: translateY(0);
  transition: opacity .6s ease, transform .6s ease;
}

.rch-hito:nth-child(odd)  .rch-hito__card  { grid-column: 1; text-align: right; }
.rch-hito:nth-child(odd)  .rch-hito__dot   { grid-column: 2; }
.rch-hito:nth-child(odd)  .rch-hito__empty { grid-column: 3; }
.rch-hito:nth-child(even) .rch-hito__empty { grid-column: 1; }
.rch-hito:nth-child(even) .rch-hito__dot   { grid-column: 2; }
.rch-hito:nth-child(even) .rch-hito__card  { grid-column: 3; text-align: left; }
.rch-hito__empty { min-height: 1px; }

/* ── Punto central ── */
.rch-hito__dot {
  width: 56px; height: 56px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--rch-navy);
  border: 3px solid var(--rch-cyan);
  box-shadow: 0 0 0 6px rgba(41,171,226,.15), var(--rch-shadow);
  position: relative; z-index: 2;
  flex-shrink: 0; margin: 0 auto;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
  margin-top: 20px;
}
.rch-hito__dot-year {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 800;
  color: var(--rch-cyan); text-align: center; line-height: 1;
}
.rch-hito:hover .rch-hito__dot {
  transform: scale(1.15);
  box-shadow: 0 0 0 10px rgba(41,171,226,.2), var(--rch-shadow-lg);
}

/* ── Card ── */
.rch-hito__card {
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--rch-radius);
  padding: 20px 24px;
  cursor: pointer;
  position: relative;
  transition: background .25s, border-color .25s, box-shadow .25s, transform .3s cubic-bezier(.34,1.56,.64,1);
  max-width: 400px;
  overflow: hidden;
}
.rch-hito:nth-child(odd)  .rch-hito__card { margin-right: 8px; margin-left: auto; }
.rch-hito:nth-child(even) .rch-hito__card { margin-left: 8px; margin-right: auto; }

.rch-hito__card::before {
  content: '';
  position: absolute;
  top: 0; left: 16px; right: 16px; height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--rch-accent, var(--rch-cyan));
  opacity: .7;
  transition: opacity .25s, left .25s, right .25s;
}
.rch-hito:hover .rch-hito__card {
  background: rgba(255,255,255,.1);
  border-color: rgba(41,171,226,.5);
  box-shadow: var(--rch-shadow-lg);
}
.rch-hito:hover .rch-hito__card::before { left: 0; right: 0; opacity: 1; }
.rch-hito:nth-child(odd):hover  .rch-hito__card { transform: translateX(-5px); }
.rch-hito:nth-child(even):hover .rch-hito__card { transform: translateX(5px); }

.rch-hito__card-year {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  color: var(--rch-accent, var(--rch-cyan));
  text-transform: uppercase; margin-bottom: 6px; display: block;
}
.rch-hito__card-title {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 700;
  color: var(--rch-white); margin: 0 0 6px; line-height: 1.3;
}
.rch-hito__card-lugar {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: rgba(255,255,255,.6); margin: 0;
}

/* ── Burbuja — expandible dentro del card ── */
.rch-hito__bubble {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height .35s ease, opacity .25s ease, padding .3s ease, margin .3s ease;
  padding: 0;
  margin-top: 0;
}
.rch-hito__card:hover .rch-hito__bubble {
  max-height: 400px;
  opacity: 1;
  pointer-events: auto;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid rgba(41,171,226,.2);
}

.rch-hito__bubble-tema {
  font-family: 'Playfair Display', serif;
  font-size: 13px; font-style: italic;
  color: var(--rch-cyan); display: block; margin-bottom: 8px;
}
.rch-hito__bubble-resumen {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px; color: rgba(255,255,255,.8);
  line-height: 1.55; margin: 0 0 8px;
}
.rch-hito__bubble-participantes {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; color: rgba(255,255,255,.5); margin: 0 0 12px;
}
.rch-hito__bubble-cta {
  display: inline-block;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px; font-weight: 700;
  color: var(--rch-cyan);
  background: rgba(41,171,226,.12);
  border: 1px solid rgba(41,171,226,.3);
  border-radius: 50px; padding: 7px 18px;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.rch-hito__bubble-cta:hover {
  background: var(--rch-cyan);
  color: var(--rch-navy);
}

/* ── Modal ── */
.rch-modal {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.rch-modal[hidden] { display: none; }
.rch-modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(9,30,68,.82);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.rch-modal__panel {
  position: relative; background: var(--rch-white);
  border-radius: 20px; max-width: 640px; width: 100%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--rch-shadow-lg);
  animation: rchModalIn .35s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes rchModalIn {
  from { opacity: 0; transform: scale(.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.rch-modal__close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(13,43,94,.08); border: none;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--rch-navy); transition: background .2s; z-index: 2;
}
.rch-modal__close:hover { background: rgba(13,43,94,.15); }
.rch-modal__img-wrap { border-radius: 20px 20px 0 0; overflow: hidden; max-height: 240px; }
.rch-modal__img-wrap img { width: 100%; object-fit: cover; display: block; }
.rch-modal__img-placeholder {
  height: 180px;
  background: linear-gradient(135deg, var(--rch-navy) 0%, #1a4a8a 100%);
  display: flex; align-items: center; justify-content: center; font-size: 60px;
}
.rch-modal__body { padding: 28px 32px 32px; }
.rch-modal__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rch-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 50px;
  background: var(--rch-cyan-lt); color: var(--rch-navy);
}
.rch-badge--year {
  background: var(--rch-navy); color: var(--rch-white);
  font-size: 14px; font-weight: 700;
}
.rch-modal__title {
  font-family: 'Playfair Display', serif !important;
  font-size: 24px !important; font-weight: 700 !important;
  color: var(--rch-navy) !important; margin: 0 0 8px !important; line-height: 1.25 !important;
}
.rch-modal__tema {
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-style: italic;
  color: var(--rch-muted); margin: 0 0 20px;
  padding-left: 12px; border-left: 3px solid var(--rch-cyan);
}
.rch-modal__desc {
  font-family: 'DM Sans', sans-serif; font-size: 15px;
  color: var(--rch-text); line-height: 1.7; margin-bottom: 24px;
  white-space: pre-line;
}
.rch-modal__link {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 700;
  color: var(--rch-white) !important;
  background: var(--rch-navy); padding: 12px 24px; border-radius: 50px;
  text-decoration: none !important; transition: background .2s, transform .2s;
}
.rch-modal__link:hover { background: var(--rch-cyan); transform: translateY(-2px); }
.rch-modal__link[hidden] { display: none; }

/* ── Vacío ── */
.rch-empty {
  text-align: center; color: rgba(255,255,255,.6);
  font-family: 'DM Sans', sans-serif; padding: 40px;
}

/* ── Responsive ── */
@media (max-width: 700px) {
  .rch-timeline::before { left: 28px; transform: none; }
  .rch-hito { grid-template-columns: 56px 1fr; padding: 14px 0; }
  .rch-hito:nth-child(odd)  .rch-hito__card,
  .rch-hito:nth-child(even) .rch-hito__card {
    grid-column: 2; text-align: left;
    margin: 0 0 0 8px; max-width: none; transform: none !important;
  }
  .rch-hito:nth-child(odd)  .rch-hito__dot,
  .rch-hito:nth-child(even) .rch-hito__dot { grid-column: 1; margin: 16px auto 0; }
  .rch-hito__empty { display: none; }
  .rch-modal__body { padding: 20px; }
}
