/* ==========================================================================
   Componente: Carrossel "Principais Notícias" — banner editorial full-width
   O título/subtítulo da seção ficam dentro do .container (centralizados);
   o carrossel em si é um irmão do .container e ocupa 100% da largura da
   seção (edge-to-edge), sem ser limitado pelo container.
   ========================================================================== */

.news-carousel {
  position: relative;
  width: 100%;
}

.news-carousel__track {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.news-carousel__track::-webkit-scrollbar {
  display: none;
}

.news-carousel__track:focus-visible {
  outline: 3px solid var(--color-gold-500);
  outline-offset: -3px;
}

/* ---- Slide: banner fotográfico em largura total ---- */
.news-carousel__slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  height: 560px;
  overflow: hidden;
  background: var(--color-navy-900);
}

@media (min-width: 640px) {
  .news-carousel__slide {
    height: clamp(520px, 42vw, 650px);
  }
}

@media (max-width: 639px) {
  .news-carousel__slide {
    height: 500px;
  }
}

/* Faixa de identificação editorial (Estadual = oliva, Federal = vermelho) */
.news-carousel__slide::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--color-primary);
  z-index: 2;
}

.news-carousel__slide--federal::before {
  background: var(--color-secondary);
}

.news-carousel__media {
  position: absolute;
  inset: 0;
}

.news-carousel__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Overlay em degradê: mais escuro embaixo, suave em cima — legibilidade do texto */
.news-carousel__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(6, 13, 22, 0.9) 0%,
    rgba(6, 13, 22, 0.62) 30%,
    rgba(6, 13, 22, 0.18) 58%,
    rgba(6, 13, 22, 0.02) 78%
  );
}

/* ---- Conteúdo textual sobre a imagem, alinhado à esquerda embaixo ---- */
.news-carousel__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: var(--space-4) var(--space-3) var(--space-4);
  color: var(--color-white);
}

@media (min-width: 900px) {
  .news-carousel__content {
    padding-left: max(var(--space-3), calc((100% - var(--container-max)) / 2 + var(--space-3)));
    padding-right: var(--space-3);
    padding-bottom: var(--space-5);
    max-width: 760px;
    min-width: min(600px, 90%);
  }
}

.news-carousel__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin-bottom: var(--space-2);
}

.news-carousel__category {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.news-carousel__content h3 {
  color: var(--color-white);
  font-size: var(--fs-xl);
  line-height: var(--lh-tight);
  margin-bottom: var(--space-2);
  text-wrap: balance;
}

.news-carousel__summary {
  color: rgba(255, 255, 255, 0.85);
  max-width: 58ch;
  margin-bottom: var(--space-3);
}

.news-carousel__footer {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.75);
}

.news-carousel__footer .btn-text {
  color: var(--color-white);
}

.news-carousel__footer .btn-text:hover {
  color: var(--color-gold-500);
}

/* ---- Setas de navegação (sobre o banner) ---- */
.news-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: rgba(9, 18, 30, 0.4);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
}

.news-carousel__arrow:hover {
  background: rgba(9, 18, 30, 0.65);
  border-color: rgba(255, 255, 255, 0.85);
}

.news-carousel__arrow svg {
  width: 22px;
  height: 22px;
}

.news-carousel__arrow--prev {
  left: var(--space-3);
}

.news-carousel__arrow--next {
  right: var(--space-3);
}

@media (max-width: 639px) {
  .news-carousel__arrow {
    width: 38px;
    height: 38px;
  }

  .news-carousel__arrow--prev {
    left: var(--space-2);
  }

  .news-carousel__arrow--next {
    right: var(--space-2);
  }
}

/* ---- Indicadores inferiores, centralizados sobre o banner ---- */
.news-carousel__dots {
  position: absolute;
  left: 50%;
  bottom: var(--space-3);
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 6px 10px;
  background: rgba(9, 18, 30, 0.4);
  border-radius: var(--radius-pill);
  backdrop-filter: blur(4px);
}

.news-carousel__dot {
  position: relative;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  background: transparent;
  padding: 0;
}

.news-carousel__dot[aria-current='true'] {
  background: var(--color-white);
  border-color: var(--color-white);
}

/* Área de toque confortável sem aumentar o tamanho visual do indicador */
.news-carousel__dot::after {
  content: '';
  position: absolute;
  inset: -10px;
}

@media (prefers-reduced-motion: reduce) {
  .news-carousel__track {
    scroll-behavior: auto;
  }
}

/* ==========================================================================\n   Refinamento: banners de notícias mais baixos e texto sem sobreposição\n   ========================================================================== */
.news-carousel {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--color-navy-900);
}

.news-carousel__slide {
  height: clamp(360px, 32vw, 440px);
  min-height: 360px;
}

.news-carousel__scrim {
  background:
    linear-gradient(90deg, rgba(5, 12, 21, .92) 0%, rgba(5, 12, 21, .76) 38%, rgba(5, 12, 21, .28) 70%, rgba(5, 12, 21, .08) 100%),
    linear-gradient(0deg, rgba(5, 12, 21, .72) 0%, rgba(5, 12, 21, .12) 55%, rgba(5, 12, 21, .04) 100%);
}

.news-carousel__content {
  position: absolute;
  inset: 0;
  z-index: 2;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  width: 100%;
  max-width: none;
  min-width: 0;
  padding:
    40px
    max(72px, calc((100vw - var(--container-max)) / 2 + 24px))
    64px;
  color: var(--color-white);
}

.news-carousel__meta,
.news-carousel__content h3,
.news-carousel__summary,
.news-carousel__footer {
  width: min(680px, 100%);
  max-width: 680px;
}

.news-carousel__meta {
  margin-bottom: 12px;
}

.news-carousel__content h3 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 2.5vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.news-carousel__summary {
  margin: 0 0 18px;
  font-size: clamp(.98rem, 1.1vw, 1.08rem);
  line-height: 1.55;
  color: rgba(255,255,255,.9);
}

.news-carousel__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.news-carousel__dots {
  bottom: 18px;
}

@media (max-width: 899px) {
  .news-carousel__slide {
    height: 420px;
    min-height: 420px;
  }

  .news-carousel__content {
    padding: 32px 64px 60px;
  }

  .news-carousel__content h3 {
    font-size: clamp(1.55rem, 5vw, 2.15rem);
  }
}

@media (max-width: 639px) {
  .news-carousel__slide {
    height: 430px;
    min-height: 430px;
  }

  .news-carousel__content {
    padding: 28px 48px 58px;
  }

  .news-carousel__meta {
    gap: 6px 8px;
  }

  .news-carousel__meta .badge--example {
    display: none;
  }

  .news-carousel__summary {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .news-carousel__arrow {
    top: 46%;
  }
}
