/* ── GLOBAL ── */
:root {
  --cor-primaria: #dc3545;
  --cor-dark: #111318;
  --raio: .75rem;
}

body {
  background: #f4f5f7;
  color: #1a1a2e;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

a { text-decoration: none; color: inherit; }
a:hover { color: var(--cor-primaria); }

/* ── NAVBAR ── */
.navbar-brand { letter-spacing: -.5px; }
.navbar .container-xl { min-width: 0; flex-wrap: nowrap; }
.navbar .navbar-collapse {
  order: 1;
  flex: 1 1 0%;
  min-width: 0;
  justify-content: flex-end;
}
.category-nav-shell {
  display: flex;
  flex: 1 1 0%;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  margin-left: auto;
}
.navbar-search {
  order: 2;
  flex: 0 0 38px;
  width: 38px;
  margin: 0 .75rem;
  transition: flex-basis .18s cubic-bezier(.2, .75, .3, 1),
              width .18s cubic-bezier(.2, .75, .3, 1);
}
.navbar-search .input-group { width: 100%; }
.navbar-search-group {
  width: 38px;
  min-height: 34px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  transition: width .18s cubic-bezier(.2, .75, .3, 1),
              border-color .16s ease, background-color .16s ease;
}
.navbar-search.is-open {
  flex-basis: min(440px, 36vw);
  width: min(440px, 36vw);
}
.navbar-search.is-open .navbar-search-group {
  width: 100%;
  border-color: rgba(255,255,255,.2);
  background: rgba(255,255,255,.06);
}
.navbar-search-group:focus-within {
  border-color: rgba(255,255,255,.5);
  background: rgba(255,255,255,.1);
}
.navbar-search .form-control {
  flex: 0 0 0;
  width: 0;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  opacity: 0;
  box-shadow: none;
  visibility: hidden;
  transition: flex-basis .18s cubic-bezier(.2, .75, .3, 1),
              opacity .12s ease, padding .18s cubic-bezier(.2, .75, .3, 1);
}
.navbar-search.is-open .form-control {
  flex: 1 1 auto;
  width: auto;
  padding: 0 0 0 .85rem;
  opacity: 1;
  visibility: visible;
}
.navbar-search .form-control::placeholder { color: rgba(255,255,255,.5); }
.navbar-search .form-control::-webkit-search-cancel-button { display: none; }
.navbar-search-submit {
  flex: 0 0 36px;
  width: 36px;
  height: 32px;
  padding: .25rem;
  border: 0;
  color: rgba(255,255,255,.65);
}
.navbar-search-submit:hover,
.navbar-search-submit:focus-visible { color: #fff; }
.navbar-search.is-open .navbar-search-submit { flex-basis: 34px; width: 34px; }
.category-scroll-button {
  flex: 0 0 auto;
  border: 0;
  padding: .45rem .35rem;
  background: transparent;
  color: rgba(255,255,255,.75);
}
.category-scroll-button:hover:not(:disabled),
.category-scroll-button:focus-visible { color: #fff; }
.category-scroll-button:disabled { opacity: .3; }
.category-scroll-button[hidden] { display: none; }
.navbar-nav.category-nav {
  flex-direction: row;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.navbar-nav.category-nav::-webkit-scrollbar {
  display: none;
}
.category-nav .nav-link {
  padding: .5rem .45rem;
  white-space: nowrap;
  font-size: .88rem;
}
.category-nav .nav-link.active {
  color: #fff;
  box-shadow: inset 0 -2px var(--cor-primaria);
}
.language-switch {
  display: flex;
  order: 3;
  flex: 0 0 auto;
  align-items: center;
  gap: .65rem;
  margin-left: .75rem;
  padding-left: .75rem;
  border-left: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.45);
  font-size: .8rem;
}
.language-switch a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: rgba(255,255,255,.65);
  white-space: nowrap;
}
.language-switch a:hover,
.language-switch a.active {
  color: #fff;
}
.language-flag {
  display: block;
  width: 24px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.25);
}

@media (max-width: 991.98px) {
  .navbar .container-xl { flex-wrap: wrap; }
  .navbar-brand { order: 0; margin-right: auto; }
  .navbar .navbar-toggler { order: 1; }
  .navbar-search { order: 2; margin: 0 .6rem 0 0; }
  .navbar-search.is-open {
    position: absolute;
    top: .5rem;
    right: 5rem;
    z-index: 5;
    width: min(440px, calc(100vw - 10rem));
    flex-basis: min(440px, calc(100vw - 10rem));
    margin: 0;
  }
  .navbar .container-xl { position: relative; }
  .navbar .navbar-collapse { order: 4; flex: 0 0 100%; }
  .category-nav-shell { flex: 1 1 auto; width: 100%; margin-left: 0; }
  .language-switch {
    order: 3;
    margin: 0 .75rem 0 0;
    padding: 0 .75rem 0 0;
  }
}

/* ── CARROSSEL PRINCIPAL ── */
.carousel-img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  display: block;
  filter: brightness(.75);
}

.carousel-no-img {
  height: 520px;
  background: #1e2030;
}

.carousel-caption-custom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 2.5rem 2rem 2rem;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,0) 100%);
  color: #fff;
}

.carousel-title {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.25;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}

.carousel-resumo {
  font-size: .95rem;
  opacity: .9;
  max-width: 700px;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

/* ── CARDS DE NOTÍCIAS ── */
.card-link { display: block; }
.card-link:hover .card-noticia { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12) !important; }
.card-link:hover .card-title { color: var(--cor-primaria); }

.card-noticia {
  border-radius: var(--raio) !important;
  transition: transform .2s ease, box-shadow .2s ease;
  background: #fff;
  overflow: hidden;
}

.card-img-wrap {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: #e9ecef;
}

.card-img-wrap img.card-img-top {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
  border-radius: 0 !important;
}

.card-link:hover .card-img-wrap img { transform: scale(1.04); }

.card-img-wrap.no-img,
.no-img {
  background: #e9ecef;
  display: flex !important;
  align-items: center;
  justify-content: center;
  height: 200px;
}

.badge-categoria {
  position: absolute;
  top: .6rem; left: .6rem;
  background: var(--cor-primaria);
  color: #fff;
  font-size: .7rem;
  font-weight: 600;
  padding: .25em .6em;
  border-radius: .4rem;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.card-title { font-size: .93rem; }

/* ── ARTIGO ── */
.artigo-img {
  max-height: 460px;
  object-fit: cover;
  width: 100%;
}

.artigo-texto p {
  font-size: 1.08rem;
  line-height: 1.8;
  color: #2a2a3e;
}

/* ── SIDEBAR RELACIONADAS ── */
.card-sm .card-noticia { border-radius: var(--raio) !important; }
.no-img-sm {
  height: 100%;
  min-height: 70px;
  background: #e9ecef;
  display: block;
}

/* ── PAGINAÇÃO ── */
.pagination .page-link {
  border-radius: .4rem !important;
  margin: 0 .15rem;
  color: var(--cor-primaria);
}
.pagination .page-item.active .page-link {
  background: var(--cor-primaria);
  border-color: var(--cor-primaria);
  color: #fff;
}

/* ── RESPONSIVO ── */
@media (max-width: 768px) {
  .carousel-img, .carousel-no-img { height: 280px; }
  .carousel-title { font-size: 1.1rem; }
  .card-img-wrap { height: 160px; }
}
