/* carousel.css */
#newsCarousel {
  /* Proporción fija (6/5, la misma que 580×484) que NO depende de la foto
     de cada noticia — object-fit:cover recorta cualquier foto a esta forma.
     Pero el tamaño en sí es fluido: llena el ancho de su columna hasta un
     tope de 580px, y se achica en conjunto (ancho Y alto, sin distorsión)
     en columnas o viewports más angostos. Esto evita que un ancho fijo en
     px empuje/aplaste la columna de texto vecina en el grid (lo que pasaba
     antes en viewports de ~961-1300px). */
  width: 100%; max-width: 580px;
  aspect-ratio: 580 / 484;
  border-radius: var(--rlg);
  box-shadow: var(--shlg);
  overflow: hidden;
  position: relative;
  margin-bottom: 28px;
  background: var(--slate);
}

.cr-track {
  display: flex;
  height: 100%;
  transition: transform .35s ease;
}

.cr-item {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cr-media {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.cr-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.cr-media-icon {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--deep3) 0%, var(--deep) 60%, #12566e 100%);
}
.cr-media-icon svg { color: rgba(255,255,255,.8); }

.cr-content {
  flex-shrink: 0;
  padding: 14px 18px 16px;
  background: var(--white);
  border-top: 1px solid var(--border);
}
.cr-date  { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal2); margin-bottom: 3px; }
.cr-title { font-size: 14px; font-weight: 800; color: var(--deep); line-height: 1.3; margin-bottom: 3px; }
.cr-desc  {
  font-size: 12px; color: var(--muted); line-height: 1.5;
  /* máx. 2 líneas: el texto no le roba altura a la foto */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cr-pinned-btn { display: inline-block; margin-top: 5px; font-size: 12px; }

/* ── Skeleton (mientras carga /api/noticias) ─────── */
.cr-skeleton         { height: 100%; display: flex; flex-direction: column; }
.cr-skeleton-media   { flex: 1; min-height: 0; border-radius: 0; }
.cr-skeleton-content { padding: 14px 18px 16px; }
.cr-skeleton-line    { height: 11px; border-radius: 4px; }

/* Prev / Next arrows */
.cr-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.85); border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--deep); z-index: 2; transition: background .15s;
  /* keep arrows inside the media area, not over the text */
  top: calc(50% - 30px);
}
.cr-btn:hover  { background: #fff; }
.cr-btn-prev   { left: 10px; }
.cr-btn-next   { right: 10px; }

/* Dots — 27% from bottom keeps them in the image area regardless of carousel size */
.cr-dots {
  position: absolute; bottom: 27%; left: 50%; transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 2;
}
.cr-dot {
  width: 6px; height: 6px; border-radius: 50%; border: none; padding: 0;
  cursor: pointer; background: rgba(255,255,255,.45);
  transition: background .15s, transform .15s;
}
.cr-dot.active { background: #fff; transform: scale(1.4); }

/* ── Mobile ─────────────────────────────────────── */
@media (max-width: 960px) {
  /* about-grid pasa a 1 columna: el newsCarousel ya se achica solo (fluido,
     misma proporción 6/5) — acá solo hace falta centrarlo si la columna
     queda más ancha que el tope de 580px. */
  #newsCarousel { margin-inline: auto; }
}

@media (max-width: 640px) {
  /* Flechas visibles también en móvil: sin ellas (y con dots de 6px)
     no había ninguna señal de que existieran más noticias.
     44px: mínimo táctil (antes 34px). */
  .cr-btn {
    width: 44px; height: 44px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    font-size: 18px;
  }
  .cr-btn-prev { left: 8px; }
  .cr-btn-next { right: 8px; }

  /* Dots arriba a la derecha: siempre sobre la foto, nunca sobre el texto,
     y con tamaño/contraste para que se vean */
  .cr-dots {
    bottom: auto; top: 10px; left: auto; right: 12px; transform: none;
    gap: 7px;
  }
  .cr-dot {
    position: relative; /* ancla el ::after que agranda el área táctil */
    width: 8px; height: 8px;
    background: rgba(255,255,255,.55);
    box-shadow: 0 1px 4px rgba(0,0,0,.35);
  }
  /* No se puede llegar a 44px sin que los hit-areas de dots vecinos se
     pisen (7px de gap entre 5 dots) — este ::after invisible cuadruplica
     el área táctil real (8px → 16px) sin agrandar el punto visualmente. */
  .cr-dot::after { content: ''; position: absolute; inset: -4px; }
  .cr-dot.active { transform: scale(1.3); }
}
