/* Componente: normalización dentro del scope */
.news-ticker, .news-ticker * { box-sizing: border-box; }

/* Contenedor ticker (valores grandes mantenidos) */
.news-ticker {
  height: 89px;
  overflow: hidden;
  position: relative;
  background: #0f1724;
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  box-sizing: border-box;
}

/* Track y wrap */
.news-track-wrap {
  display: flex;
  align-items: center;
  width: 100%;
}

.news-track {
  display: flex;
  align-items: center;
  white-space: normal; /* permitir wrapping dentro del texto */
  will-change: transform;
  gap: 44px; /* mantener tu valor grande */
}

/* Item: mantengo tus anchos grandes pero corrijo inconsistencias */
.news-item {
  display: flex;
  gap: 32px;
  align-items: center;
  min-width: 480px;   /* valor original preservado */
  max-width: 660px;
  background: rgba(255,255,255,0.03);
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  position: relative; /* necesario para pseudoelemento */
  box-sizing: border-box;
}

/* Imagen pequeña (unificada: evita duplicados) */
.news-thumb {
  width: 89px;
  height: 89px;
  object-fit: cover;
  border-radius: 4px;
  flex: 0 0 93px;
  background: #223;
}

/* Accesibilidad: foco */
.news-item:focus { outline: 2px solid #60a5fa; }

/* Título: coherencia en clamp y legibilidad */
.news-title {
 font-size: 14px !important;
    font-weight: 100 !important;
    line-height: 1.25 !important;
  color: #e6eef8;
  display: -webkit-box;
  -webkit-line-clamp: 5;    /* preservo 4 líneas si ese era el objetivo */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: calc(1.2em * 5);
}

/* Separador: usar variable --sep-left para ajustar desde JS/CSS */
.news-item + .news-item::before {
  content: "";
  position: absolute;
  left: var(--sep-left, -1px); /* mantengo -1px como fallback (tu valor) */
  top: 12px;
  bottom: 12px;
  width: 5px;               /* grosor preservado */
  background: #d32f2f;      /* rojo */
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(211,47,47,0.25);
  pointer-events: none;
}

/* Modal (sin cambios funcionales) */
.news-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1200;
}
.news-modal[aria-hidden="false"] { display: flex; }

.news-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.news-modal-panel {
  position: relative;
  background: #fff;
  color: #0b1220;
  max-width: 900px;
  width: min(95%, 900px);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(2,6,23,0.6);
  z-index: 2;
  display: grid;
  align-items: start;
}

.news-modal-image {
  width: 100%;
  height: auto;
  max-height: 64vh;
  object-fit: contain;
  border-radius: 6px;
  grid-column: 1 / -1;
}

.news-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.news-modal-summary {
  margin-top: 8px;
  font-size: 15px;
  line-height: 1.5;
}

.news-modal-close {
  position: absolute;
  right: 1px;
  top: 8px;
  background: transparent;
  border: none;
  font-size: 96px;
  cursor: pointer;
  color: #2dc70e;
}
@media (max-width: 600px) {
  /* asegurar comportamiento consistente */
  html, body { -webkit-text-size-adjust: 100%; }

  .news-ticker {
    height: 100px !important;
    min-height: 100px !important;
    padding: 12px 16px !important;
    overflow: hidden !important;
  }

  /* Track: aumentar el gap entre items para más separación horizontal */
  .news-track {
    gap: 48px !important; /* mayor separación visual entre noticias */
    padding-left: 4px; /* pequeño offset para que no pegue al borde */
  }

  /* Cada item no debe estirarse ocupando todo el viewport.
     Le damos un ancho calculado y evitamos grow descontrolado */
  .news-item {
    display: flex;
    align-items: center;
    gap: 12px !important;
    padding: 10px !important;
    box-sizing: border-box;
    flex: 0 0 auto;                /* evitar que el item crezca para llenar track */
    width: calc(100vw - 44px);     /* ocupe casi todo el ancho disponible por defecto */
    max-width: calc(100vw - 44px);
    min-width: 260px !important;   /* permite que el item sea estrecho en scroll, pero no 0 */
    border-radius: 6px;
    position: relative;
  }

  /* Thumb un poco más pequeño para ceder anchura al texto */
  .news-thumb {
    width: 80px !important;
    height: 80px !important;
    flex: 0 0 80px !important;
    border-radius: 6px !important;
  }

  /* Bloque de texto: ocupar el resto y poder encoger (min-width:0 es clave) */
  .news-text {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: block;
  }

  /* Título: 15px, hasta 5 líneas y buena legibilidad */
  .news-title {
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 1.25 !important;
    color: #e6eef8 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 5!important; /* permitir hasta 3 líneas */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-height: calc(1.25em * 5) !important;
    word-break: break-word !important;
  }

  /* Separador entre items: mantengo visible pero más delgado */
  .news-item + .news-item::before {
    left: var(--sep-left-mobile, -1px) !important;
    top: 12px !important;
    bottom: 12px !important;
    width: 3px !important;
    background: #d32f2f !important;
  }

  /* Si querés aún más separación entre noticias, aumentá este padding en el track:
     .news-track { gap: 36px !important; } */
}

/* Modal: animación fade/backdrop + panel */
.news-modal {
  position: fixed;
  inset: 0;
  display: flex;           /* dejar flex; controlamos visibilidad con aria-hidden y clases */
  align-items: center;
  justify-content: center;
  z-index: 1200;
  pointer-events: none;    /* evita interacción cuando está oculto */
}

/* Backdrop inicial transparente */
.news-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 280ms cubic-bezier(.2,.9,.3,1);
  will-change: background;
}

/* Panel inicial: invisible y levemente desplazado/escala */
.news-modal-panel {
  position: relative;
  background: #fff;
  color: #0b1220;
  max-width: 900px;
  width: min(95%, 900px);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 12px 30px rgba(2,6,23,0.6);
  z-index: 2;
  transform: translateY(10px) scale(0.995);
  opacity: 0;
  transition: opacity 280ms cubic-bezier(.2,.9,.3,1), transform 280ms cubic-bezier(.2,.9,.3,1);
  will-change: opacity, transform;
  pointer-events: auto;
}

/* Estado visible: backdrop oscuro y panel visible */
.news-modal.show .news-modal-backdrop {
  background: rgba(0,0,0,0.6);
}

.news-modal.show .news-modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
  transition-duration: 420ms;
}

/* Asegurarse de que cuando aria-hidden=true la modal no interaccione */
.news-modal[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
}

/* Cuando aria-hidden=false, usamos visibility pero la clase .show controla la animación.
   Esto permite que al cerrar primero removamos la clase .show y luego, al terminar la transición,
   pongamos aria-hidden=true para quitar del flujo de lectura. */
.news-modal[aria-hidden="false"] {
  visibility: visible;
  pointer-events: auto;
}


.news-modal-source {
  margin-top: 15px;
  text-align: right;
}

.news-modal-source a {
  color: #0066cc;
  text-decoration: none;
}

.news-modal-source a:hover {
  text-decoration: underline;
}

