/* ==========================================================================
   Elecciones - diseno nuevo (vista elecciones, tema uazuayacademic)
   Libreria uazuayacademic/elecciones, adjunta desde
   templates/views/elecciones/nuevo/bloque-1.html.twig. Solo carga en los
   nodos de "Nodos con el diseno nuevo" (Apariencia > uazuayacademic).
   Todo va bajo .ele para no afectar otros componentes de la pagina.

   Maquetacion: hero claro; secciones cortas 2-3 por fila con el cronograma a
   la derecha; procesos, actas, videos e informacion a lo ancho; documentos
   en tarjetas.
   ========================================================================== */

.ele {
  --ele-navy: #1e3c72;
  --ele-navy-2: #2a5298;
  --ele-blue: #0070b4;
  --ele-ink: #1f2933;
  --ele-muted: #5b6776;
  --ele-line: #e2e7ee;
  --ele-soft: #f5f7fa;
  --ele-tint: #eaf1f9;
  --ele-radius: 12px;
  --ele-ease: cubic-bezier(.2, .6, .2, 1);
  margin: 1.5rem 0 3.5rem;
  color: var(--ele-ink);
}

.ele *,
.ele *::before,
.ele *::after {
  box-sizing: border-box;
}

.ele-icon {
  display: block;
  flex: none;
}

/* Anclas (#ele-actas, #proceso-123, #doc-456): el destino queda bajo la
   cabecera fija del sitio. --ele-header-offset lo calcula js/elecciones.js;
   130px cubre la cabecera de escritorio mientras carga el script. */
.ele [id] {
  scroll-margin-top: calc(var(--ele-header-offset, 130px) + 1rem);
}

/* Foco visible con teclado */
.ele a:focus-visible,
.ele summary:focus-visible {
  outline: 3px solid var(--ele-blue);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Hero ---------- */
.ele-hero {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border: 1px solid var(--ele-line);
  border-top: 4px solid var(--ele-navy);
  border-radius: var(--ele-radius);
  background: #fff;
  color: var(--ele-ink);
}

.ele-hero__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--ele-tint);
  color: var(--ele-navy);
}

.ele-hero__text {
  min-width: 0;
}

.ele .ele-hero__title {
  margin: .2rem 0 0;
  color: var(--ele-navy);
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 700;
  line-height: 1.2;
}

.ele-hero__body {
  max-width: 72ch;
  margin-top: .9rem;
  color: var(--ele-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.ele-hero__body > :last-child {
  margin-bottom: 0;
}

.ele-hero__body a {
  color: var(--ele-navy);
  text-decoration: underline;
}

/* ---------- Rejilla de secciones ---------- */
.ele-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  /* Separacion vertical amplia entre secciones (equivale a un salto de linea
     extra antes de cada titulo). */
  gap: 3.75rem 1.5rem;
  align-items: start;
}

.ele-section {
  min-width: 0;
}

.ele-section--wide {
  grid-column: 1 / -1;
}

/* Cronograma a la derecha: ultima columna de la primera fila; las demas
   secciones cortas llenan las columnas de la izquierda (dense). En movil
   (una columna) sigue el orden normal. */
@media (min-width: 768px) {
  .ele-main {
    grid-auto-flow: row dense;
  }

  .ele #ele-cronograma {
    grid-column: -2 / -1;
    grid-row: 1;
  }
}

.ele-section__head {
  display: flex;
  align-items: center;
  gap: .85rem;
  margin-bottom: 1rem;
}

.ele-section__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--ele-tint);
  color: var(--ele-navy);
}

.ele-section__heading {
  min-width: 0;
}

.ele .ele-section__title {
  margin: 0;
  color: var(--ele-ink);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.ele-section__subtitle {
  margin: .15rem 0 0;
  color: var(--ele-muted);
  font-size: .95rem;
}

/* ---------- Tarjeta generica (Estatutos, Reglamentos) ---------- */
.ele-card {
  border: 1px solid var(--ele-line);
  border-radius: var(--ele-radius);
  background: #fff;
}

.ele-raw {
  padding: .6rem 1.1rem;
  line-height: 1.6;
}

.ele-raw ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ele-raw li,
.ele-raw .field__item {
  padding: .6rem 0;
  border-top: 1px solid var(--ele-line);
}

.ele-raw li:first-child,
.ele-raw .field__item:first-child {
  border-top: 0;
}

.ele-raw a {
  color: var(--ele-navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ele-raw > :last-child,
.ele-raw p:last-child {
  margin-bottom: 0;
}

/* ---------- Documentos en tarjetas ---------- */
.ele .ele-docs,
.ele .ele-card.ele-docs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  list-style: none;
}

/* En una seccion corta (una columna) las tarjetas van una debajo de otra */
.ele-section:not(.ele-section--wide) .ele-docs {
  grid-template-columns: minmax(0, 1fr);
}

.ele-doc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .9rem;
  margin: 0;
  padding: 1.1rem;
  border: 1px solid var(--ele-line);
  border-radius: var(--ele-radius);
  background: #fff;
  transition: border-color .2s var(--ele-ease), box-shadow .2s var(--ele-ease);
}

.ele-doc:hover {
  border-color: var(--ele-navy);
  box-shadow: 0 10px 22px -14px rgba(30, 60, 114, .45);
}

.ele-doc__name {
  min-width: 0;
  color: var(--ele-ink);
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Boton con texto (descargar / abrir / ver documento) */
.ele .ele-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 40px;
  padding: .4rem .95rem;
  border: 1.5px solid var(--ele-navy);
  border-radius: 999px;
  background: transparent;
  color: var(--ele-navy);
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s var(--ele-ease), color .2s var(--ele-ease);
}

.ele .ele-btn:hover,
.ele .ele-btn:focus-visible {
  background: var(--ele-navy);
  color: #fff;
  text-decoration: none;
}

/* Boton de la tarjeta: relleno y a lo ancho */
.ele .ele-doc .ele-btn {
  justify-content: center;
  width: 100%;
  margin-top: auto;
  background: var(--ele-navy);
  color: #fff;
}

.ele .ele-doc .ele-btn:hover,
.ele .ele-doc .ele-btn:focus-visible {
  border-color: var(--ele-navy-2);
  background: var(--ele-navy-2);
}

/* ---------- Vista previa de PDF (details), ocupa toda la fila ---------- */
.ele .ele-doc--preview {
  grid-column: 1 / -1;
  display: block;
  padding: 0;
}

.ele-preview__summary {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .9rem 1.1rem;
  border-radius: var(--ele-radius);
  list-style: none;
  cursor: pointer;
  transition: background-color .2s var(--ele-ease);
}

.ele-preview__summary::-webkit-details-marker {
  display: none;
}

.ele-preview__summary::marker {
  content: "";
}

.ele-preview__summary:hover {
  background: var(--ele-soft);
}

.ele-preview__summary .ele-doc__name {
  flex: 1 1 auto;
}

.ele .ele-preview__summary .ele-btn {
  width: auto;
  margin-top: 0;
  background: transparent;
  color: var(--ele-navy);
}

.ele .ele-preview__summary:hover .ele-btn {
  background: var(--ele-navy);
  color: #fff;
}

.ele-preview__close {
  display: none;
}

.ele-preview[open] .ele-preview__open {
  display: none;
}

.ele-preview[open] .ele-preview__close {
  display: inline;
}

.ele-btn--toggle .ele-icon--chevron {
  transition: transform .2s var(--ele-ease);
}

.ele-preview[open] .ele-btn--toggle .ele-icon--chevron {
  transform: rotate(180deg);
}

.ele-preview__body {
  padding: 0 1.1rem 1.1rem;
}

.ele-preview__frame {
  display: block;
  width: 100%;
  height: min(75vh, 720px);
  min-height: 420px;
  border: 1px solid var(--ele-line);
  border-radius: 8px;
  background: var(--ele-soft);
}

.ele-preview__fallback {
  margin: .6rem 0 0;
  font-size: .9rem;
}

.ele-preview__fallback a {
  color: var(--ele-navy);
  text-decoration: underline;
}

/* ---------- Procesos electorales ---------- */
/* Un solo panel gris agrupa todos los procesos (las tarjetas blancas
   resaltan encima) y una linea separa un proceso del siguiente. */
.ele-processes {
  padding: 1.25rem 1.5rem 1.5rem;
  border: 1px solid var(--ele-line);
  border-radius: var(--ele-radius);
  background: var(--ele-soft);
}

.ele-process + .ele-process {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--ele-line);
}

.ele .ele-process__title {
  position: relative;
  margin: 0 0 .75rem;
  padding-left: .9rem;
  color: var(--ele-navy);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
}

.ele-process__title::before {
  content: "";
  position: absolute;
  top: .15em;
  bottom: .15em;
  left: 0;
  width: 4px;
  border-radius: 2px;
  background: var(--ele-blue);
}

.ele-process--media .ele-process__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.ele-process__docs {
  min-width: 0;
}

.ele-process__media {
  margin: 0;
}

.ele-process__media img {
  display: block;
  width: 100%;
  max-height: 280px;
  border-radius: 10px;
  object-fit: cover;
}

.ele .ele-group {
  margin: 1rem 0 .5rem;
  color: var(--ele-muted);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ele-empty {
  margin: 0;
  color: var(--ele-muted);
  font-style: italic;
}

/* ---------- Cronograma: lista estilo agenda, sin tarjeta ---------- */
.ele-crono {
  padding: 0;
}

.ele .ele-crono__lista {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ele-crono__item {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  column-gap: 1rem;
  align-items: center;
  padding: .5rem 0;
}

.ele-crono__fecha {
  color: var(--ele-ink);
  line-height: 1.05;
  text-align: center;
}

.ele-crono__mes {
  display: block;
  font-size: .95rem;
  font-weight: 700;
}

.ele-crono__dia {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

/* Rango de dias ("18–22"): mas pequeno para caber en la columna */
.ele-crono__dia--rango {
  padding: .3rem 0 .2rem;
  font-size: 1.05rem;
  white-space: nowrap;
}

.ele-crono__anio {
  display: block;
  margin-top: .15rem;
  color: var(--ele-muted);
  font-size: .72rem;
  font-weight: 600;
}

.ele-crono__libre {
  display: block;
  font-size: .85rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ele-crono__detalle {
  display: flex;
  align-items: center;
  align-self: stretch;
  min-height: 3rem;
  padding: .2rem 0 .2rem 1rem;
  border-left: 2px solid #6b7686;
}

.ele .ele-crono__titulo {
  margin: 0;
  color: var(--ele-ink);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.ele-crono__desc {
  margin-top: .9rem;
  color: var(--ele-muted);
  line-height: 1.6;
}

.ele-crono__desc > :last-child {
  margin-bottom: 0;
}

.ele .ele-crono__enlaces {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  margin: 1rem 0 0;
}

.ele .ele-crono__enlace {
  color: var(--ele-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.ele .ele-crono__enlace:hover,
.ele .ele-crono__enlace:focus-visible {
  color: var(--ele-navy);
  text-decoration-thickness: 2px;
}

/* ---------- Videos ---------- */
.ele-videos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: 1.25rem;
}

.ele-videos--single {
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
}

.ele-video {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--ele-line);
  border-radius: var(--ele-radius);
  background: #000;
}

.ele-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Portada: miniatura de YouTube + boton de play, antes de cargar el reproductor */
.ele .ele-video__portada {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
}

.ele-video__miniatura {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ele-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  display: flex;
  transform: translate(-50%, -50%);
}

.ele-video__play svg {
  width: 68px;
  height: 48px;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .35));
}

.ele-video__play-fondo {
  fill: #212121;
  fill-opacity: .8;
  transition: fill .2s ease, fill-opacity .2s ease;
}

.ele .ele-video__portada:hover .ele-video__play-fondo,
.ele .ele-video__portada:focus-visible .ele-video__play-fondo {
  fill: #f00;
  fill-opacity: 1;
}

.ele .ele-video__portada:focus-visible {
  outline: 3px solid var(--ele-navy);
  outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
  .ele-video__play-fondo {
    transition: none;
  }
}

@supports not (aspect-ratio: 1 / 1) {
  .ele-video {
    height: 0;
    padding-top: 56.25%;
  }
}

/* ---------- Informacion importante ---------- */
.ele-note {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--ele-line);
  border-left: 4px solid var(--ele-navy);
  border-radius: var(--ele-radius);
  background: var(--ele-soft);
}

.ele-note .ele-section__icon {
  background: #fff;
}

.ele-note__body {
  line-height: 1.65;
}

.ele-note__body ul,
.ele-note__body ol {
  margin-bottom: .75rem;
  padding-left: 1.25rem;
}

.ele-note__body li {
  margin-bottom: .35rem;
}

.ele-note__body > :last-child {
  margin-bottom: 0;
}

/* Comportamiento previo de esta pagina: sin mapa del pie */
#google-map {
  display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 767.98px) {
  .ele-main {
    gap: 3rem 1.5rem;
  }

  .ele-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: .9rem;
    margin-bottom: 2rem;
  }

  .ele-hero__icon {
    width: 46px;
    height: 46px;
  }

  .ele-process--media .ele-process__grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .ele-process__media {
    order: -1;
  }

  .ele-process__media img {
    max-height: 200px;
  }

  .ele-note {
    padding: 1rem;
  }
}

@media (max-width: 575.98px) {
  .ele-processes {
    padding: 1rem;
  }

  .ele-preview__summary {
    flex-wrap: wrap;
  }

  .ele-preview__summary .ele-doc__name {
    flex-basis: 100%;
  }

  .ele-preview__frame {
    min-height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ele *,
  .ele *::before,
  .ele *::after {
    transition: none !important;
  }
}
