/* ══════════════════════════════════════════════════════════
 * News Carousel CECA
 *
 * Layout 2 columnas: info izquierda + carrusel derecha.
 * Líneas decorativas horizontales + divisor vertical.
 * BEM: .ceca-news-carousel
 * ══════════════════════════════════════════════════════════ */

/* ── Sección principal ── */
.ceca-news-carousel {
  position: relative;
  width: 100%;
}

/* ══════════════════════════════════════════
 * Líneas decorativas
 * ══════════════════════════════════════════ */

.ceca-news-carousel__line {
  display: block;
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background-color: var(--ceca-border-color, #ddd);
  z-index: 1;
}

.ceca-news-carousel__line--top {
  top: 0;
}

.ceca-news-carousel__line--bottom {
  bottom: 0;
}

.ceca-news-carousel__divider {
  display: block;
  flex: 0 0 1px;
  align-self: stretch;
  background-color: var(--ceca-border-color, #ddd);
}

/* ══════════════════════════════════════════
 * Contenedor 2 columnas
 * ══════════════════════════════════════════ */

.ceca-news-carousel__container {
  display: flex;
  align-items: stretch;
  padding: 64px 0;
}

/* ══════════════════════════════════════════
 * Columna izquierda: info
 * ══════════════════════════════════════════ */

.ceca-news-carousel__info {
  flex: 0 0 30%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 48px 0 0;
  box-sizing: border-box;
}

/* ── Título de sección (bicolor) ── */
.ceca-news-carousel__heading {
  margin: 0 0 24px;
  font-size: 48px;
  font-family: var(--ceca-font-family, "Encode Sans Expanded", sans-serif);
  line-height: 1.1;
}

.ceca-news-carousel__heading-bold {
  display: inline;
  font-weight: 700;
  color: var(--ceca-dark, #002a4f);
  font-style: normal;
}

.ceca-news-carousel__heading-italic {
  display: inline;
  font-weight: 400;
  font-style: italic;
  color: var(--ceca-secondary, #aa004f);
}

/* ── Descripción ── */
.ceca-news-carousel__description {
  margin: 0 0 40px;
  font-size: 20px;
  line-height: 1.6;
  color: var(--ceca-text-secondary, #676767);
  max-width: 100%;
}

/* ══════════════════════════════════════════
 * Navegación (flechas en la columna izquierda)
 * ══════════════════════════════════════════ */

.ceca-news-carousel__nav {
  display: flex;
  gap: 16px;
  margin-top: auto;
  padding-top: 32px;
  justify-content: flex-end;
}

.ceca-news-carousel__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 0;
  border: 1px solid var(--ceca-border-color, #ddd);
  border-radius: 50%;
  background: transparent;
  color: var(--ceca-dark, #002a4f);
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease;
}

.ceca-news-carousel__btn:hover,
.ceca-news-carousel__btn:focus-visible {
  background-color: var(--ceca-dark, #002a4f);
  color: var(--ceca-white, #ffffff);
  border-color: var(--ceca-dark, #002a4f);
}

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

.ceca-news-carousel__btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
}

.ceca-news-carousel__btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ══════════════════════════════════════════
 * Columna derecha: carrusel
 * ══════════════════════════════════════════ */

.ceca-news-carousel__viewport {
  flex: 1;
  overflow: hidden;
  min-width: 0;
  margin-left: 48px;
}

.ceca-news-carousel__track {
  display: flex;
  gap: 24px;
  transition: transform 0.45s ease;
  will-change: transform;
}

/* ══════════════════════════════════════════
 * Tarjeta de noticia
 * ══════════════════════════════════════════ */

.ceca-news-carousel__item {
  flex: 0 0 auto;
  min-width: 0;
  box-sizing: border-box;
}

.ceca-news-carousel__link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.ceca-news-carousel__link:hover,
.ceca-news-carousel__link:focus {
  text-decoration: none;
  color: inherit;
}

/* ── Imagen wrapper ── */
.ceca-news-carousel__image-wrapper {
  position: relative;
  width: 100%;
  height: 369px;
  overflow: hidden;
}

.ceca-news-carousel__image {
  display: block;
  width: 100%;
  height: 100% !important;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.ceca-news-carousel__link:hover .ceca-news-carousel__image,
.ceca-news-carousel__link:focus .ceca-news-carousel__image {
  transform: scale(1.05);
}

/* ── Hover Overlay ── */
.ceca-news-carousel__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 1;
}

.ceca-news-carousel__link:hover .ceca-news-carousel__overlay,
.ceca-news-carousel__link:focus .ceca-news-carousel__overlay {
  opacity: 1;
}

/* ── Icono enlace en círculo ── */
.ceca-news-carousel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--ceca-white, #ffffff);
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--ceca-white, #ffffff);
  transform: scale(0.8);
  transition: transform 0.25s ease;
}

.ceca-news-carousel__link:hover .ceca-news-carousel__icon,
.ceca-news-carousel__link:focus .ceca-news-carousel__icon {
  transform: scale(1);
}

.ceca-news-carousel__icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  transform: rotate(45deg);
  transition: 0.8s;
}

.ceca-news-carousel a:hover .ceca-news-carousel__icon svg {
  transform: rotate(0);
}
/* ── Título de noticia ── */
.ceca-news-carousel__item-title {
  margin: 16px 0 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--ceca-text-dark, #313131);
}

/* ══════════════════════════════════════════
 * Responsive
 * ══════════════════════════════════════════ */

/* ── Tablet landscape / Desktop pequeño ── */
@media (max-width: 1200px) {
  .ceca-news-carousel__info {
    padding-right: 32px;
  }

  .ceca-news-carousel__heading {
    font-size: 40px;
  }

  .ceca-news-carousel__description {
    font-size: 18px;
  }

  .ceca-news-carousel__viewport {
    margin-left: 32px;
  }

  .ceca-news-carousel__container {
    padding: 48px 0;
  }

  .ceca-news-carousel__btn {
    width: 56px;
    height: 56px;
  }
}

/* ── Tablet portrait ── */
@media (max-width: 1024px) {
  .ceca-news-carousel__info {
    padding-right: 24px;
  }

  .ceca-news-carousel__heading {
    font-size: 34px;
  }

  .ceca-news-carousel__description {
    font-size: 16px;
    margin-bottom: 24px;
  }

  .ceca-news-carousel__viewport {
    margin-left: 24px;
  }

  .ceca-news-carousel__btn {
    width: 48px;
    height: 48px;
  }

  .ceca-news-carousel__nav {
    gap: 12px;
  }
}

/* ── Móvil / Tablet pequeña ── */
@media (max-width: 768px) {
  .ceca-news-carousel__container {
    flex-direction: column;
    padding: 32px 0;
  }

  .ceca-news-carousel__info {
    flex: none;
    max-width: 100%;
    padding: 0 0 24px;
  }

  .ceca-news-carousel__heading {
    font-size: 32px;
    margin-bottom: 16px;
  }

  .ceca-news-carousel__description {
    font-size: 15px;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .ceca-news-carousel__nav {
    margin-top: 0;
    padding-top: 0;
    justify-content: flex-start;
  }

  .ceca-news-carousel__divider {
    display: none;
  }

  .ceca-news-carousel__viewport {
    margin-left: 0;
  }

  .ceca-news-carousel__image-wrapper {
    height: 260px;
  }

  .ceca-news-carousel__btn {
    width: 48px;
    height: 48px;
  }

  .ceca-news-carousel__btn svg {
    width: 20px;
    height: 20px;
  }

  .ceca-news-carousel__item-title {
    font-size: 17px;
    margin-top: 12px;
  }
}

/* ── Móvil pequeño ── */
@media (max-width: 480px) {
  .ceca-news-carousel__container {
    padding: 24px 0;
  }

  .ceca-news-carousel__heading {
    font-size: 28px;
  }

  .ceca-news-carousel__description {
    font-size: 14px;
  }

  .ceca-news-carousel__image-wrapper {
    height: 220px;
  }

  .ceca-news-carousel__btn {
    width: 42px;
    height: 42px;
  }

  .ceca-news-carousel__item-title {
    font-size: 15px;
  }
}

/* ══════════════════════════════════════════
 * prefers-reduced-motion
 * ══════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .ceca-news-carousel__track {
    transition: none;
  }

  .ceca-news-carousel__image {
    transition: none;
  }

  .ceca-news-carousel__overlay {
    transition: none;
  }

  .ceca-news-carousel__icon {
    transition: none;
  }

  .ceca-news-carousel__btn {
    transition: none;
  }
}
