/* =============================================
   PORTAL G1 — CSS Principal
   ============================================= */

/* ---- Variáveis ---- */
:root {
  --portal-red:       #28269C;
  --portal-dark:      #000000;
  --portal-gray:      #6c757d;
  --portal-light-bg:  #f4f4f6;
  --portal-border:    #e5e5e5;
  --font-heading:     'Merriweather', Georgia, serif;
  --font-body:        'Inter', system-ui, sans-serif;
  --navbar-bg:        #28269C;
  --footer-bg:        #eaf0ff;
}

/* ---- Reset / Base ---- */
*,
*::before,
*::after { box-sizing: border-box; }

body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: #222;
  background: #fff;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }

a { color: var(--portal-red); }
a:hover { color: #1a1874; }

/* =============================================
   HEADER
   ============================================= */
.portal-header { border-bottom: 1px solid var(--portal-border); }

/* Topbar */
.header-topbar { background: #f9f9f9; border-bottom: 1px solid var(--portal-border); }
.topbar-social a { font-size: .85rem; }
.topbar-social a:hover { color: var(--portal-red) !important; }

/* Logo */
.header-brand { background: #fff; }
.brand-logo { outline: none; }
.header-logo {
  height: 36px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  border: none;
  outline: none;
}
@media (max-width: 575.98px) {
  .header-logo { height: 28px; max-width: 120px; }
}

/* Busca */
.header-search { max-width: 360px; width: 100%; }
.header-search .form-control:focus { box-shadow: none; border-color: var(--portal-red); }

/* ---- Menu categorias ---- */
.navbar-categorias {
  background: var(--navbar-bg);
  padding: 0;
}
.navbar-categorias .nav-link {
  color: #fff !important;
  font-size: .85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: .55rem .75rem;
  transition: background .2s;
  border-bottom: 3px solid transparent;
}
.navbar-categorias .nav-link:hover,
.navbar-categorias .nav-link:focus {
  background: rgba(0,0,0,.2);
}
.navbar-categorias .navbar-toggler { color: #fff; }

/* =============================================
   DESTAQUE HERO
   ============================================= */
.destaque-hero {
  position: relative;
  width: 100%;
  max-height: 540px;
  overflow: hidden;
}
.destaque-hero-link { display: block; text-decoration: none; }
.destaque-hero-img {
  width: 100%;
  height: 540px;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.destaque-hero:hover .destaque-hero-img { transform: scale(1.02); }
.destaque-hero-img--empty { background: var(--portal-dark); height: 540px; }
.destaque-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.2) 60%, transparent 100%);
}
.destaque-hero-titulo {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,.5);
}
.destaque-hero-sub { font-size: 1.05rem; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.destaque-hero-meta { font-size: .82rem; }

/* =============================================
   SECTION TITLES
   ============================================= */
.section-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .6rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.section-title-bar {
  display: inline-block;
  width: 4px;
  height: 1.25em;
  background: var(--portal-red);
  border-radius: 2px;
  flex-shrink: 0;
}

/* =============================================
   CARDS DE NOTÍCIA
   ============================================= */
.noticia-card { border-radius: 8px; transition: box-shadow .25s, transform .25s; }
.noticia-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.12) !important; transform: translateY(-2px); }

.noticia-card-img-link { display: block; overflow: hidden; border-radius: 8px 8px 0 0; }
.noticia-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform .4s;
}
.noticia-card:hover .noticia-card-img { transform: scale(1.05); }
.noticia-card-img-placeholder {
  width: 100%;
  height: 180px;
  background: var(--portal-light-bg);
}
.noticia-card-title {
  font-family: var(--font-heading);
  font-size: .92rem;
  line-height: 1.35;
}
.noticia-card-sub { font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.noticia-card-footer { font-size: .78rem; padding-top: .5rem; border-top: 1px solid var(--portal-border); }

/* =============================================
   FEED SEQUENCIAL (HOME) — CARDS COM FOTO
   ============================================= */
.feed-card {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  border: 1px solid var(--portal-border);
  transition: box-shadow .25s, transform .25s;
  margin-bottom: 1.1rem;
}
.feed-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  transform: translateY(-2px);
}
.feed-card-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  min-height: 150px;
}

/* Imagem à esquerda */
.feed-card-img-wrap {
  width: 280px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.feed-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s;
}
.feed-card:hover .feed-card-img { transform: scale(1.05); }
.feed-card-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 150px;
  background: var(--portal-light-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ccc;
  font-size: 2.5rem;
}

/* Corpo do card */
.feed-card-body {
  flex: 1;
  min-width: 0;
  padding: 1rem 1.1rem;
  display: flex;
  flex-column: column;
  flex-direction: column;
}
.feed-card-badge {
  font-size: .72rem;
  font-weight: 600;
  border-radius: 3px;
  padding: .2em .6em;
  margin-bottom: .5rem;
  display: inline-block;
  width: fit-content;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.feed-card-titulo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #1a1a1a;
  margin-bottom: .35rem;
  transition: color .2s;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-card:hover .feed-card-titulo { color: var(--portal-red); }
.feed-card-sub {
  font-size: .87rem;
  color: var(--portal-gray);
  line-height: 1.5;
  margin-bottom: auto;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-card-meta {
  font-size: .77rem;
  color: var(--portal-gray);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-top: .65rem;
  padding-top: .55rem;
  border-top: 1px solid var(--portal-border);
  flex-wrap: wrap;
}
.feed-card-meta .dot { opacity: .4; }

@media (max-width: 575px) {
  .feed-card-img-wrap { width: 130px; }
  .feed-card-titulo { font-size: .93rem; -webkit-line-clamp: 2; }
  .feed-card-sub { display: none; }
  .feed-card-body { padding: .75rem; }
}

/* =============================================
   PÁGINA DA NOTÍCIA
   ============================================= */
.noticia-titulo {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: .4rem;
}
.noticia-subtitulo { font-size: 1.15rem; }

/* Meta */
.noticia-meta { font-size: .88rem; }
.meta-avatar-placeholder {
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--portal-light-bg);
  font-size: 1rem;
}
.meta-avatar-sm { width: 28px; height: 28px; min-width: 28px; font-size: .75rem; }

/* Conteúdo rich text */
.noticia-conteudo { font-size: 1.08rem; line-height: 1.8; color: #333; }
.noticia-conteudo h2,
.noticia-conteudo h3 { font-family: var(--font-heading); margin-top: 1.8rem; }
.noticia-conteudo img { border-radius: 6px; margin: 1rem 0; }
.noticia-conteudo blockquote {
  border-left: 4px solid var(--portal-red);
  padding-left: 1.1rem;
  color: var(--portal-gray);
  font-style: italic;
  margin: 1.5rem 0;
}
.noticia-conteudo a { color: var(--portal-red); text-decoration: underline; }

/* Galeria */
.galeria-thumb { height: 160px; object-fit: cover; transition: transform .3s, filter .3s; }
.galeria-item:hover .galeria-thumb { transform: scale(1.06); filter: brightness(.85); }

/* Comentários */
.comentario-item { background: #fff; }
.comentario-resposta { background: #fafafa; }

/* =============================================
   SIDEBAR
   ============================================= */
.portal-sidebar { position: sticky; top: 80px; }

.sidebar-title {
  font-family: var(--font-heading);
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 1rem;
}
.sidebar-badge {
  display: inline-block;
  color: #fff;
  padding: .25em .7em;
  border-radius: 4px;
  font-size: .82rem;
}

.sidebar-rank-list { counter-reset: rank; }
.sidebar-rank-item { margin-bottom: .85rem; }
.rank-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--portal-border);
  line-height: 1;
  min-width: 28px;
  font-family: var(--font-heading);
}

.sidebar-link {
  color: #222;
  text-decoration: none;
  font-size: .87rem;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-link:hover { color: var(--portal-red); }
.sidebar-meta { font-size: .75rem; }

.sidebar-thumb {
  width: 72px;
  height: 60px;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar-thumb-placeholder {
  width: 72px;
  height: 60px;
  flex-shrink: 0;
}

/* =============================================
   PERFIL DE USUÁRIO
   ============================================= */
.perfil-foto { width: 100px; height: 100px; object-fit: cover; border: 3px solid var(--portal-border); }
.perfil-foto-placeholder {
  width: 100px;
  height: 100px;
  background: var(--portal-light-bg);
  border: 3px solid var(--portal-border);
}

/* =============================================
   WIDGET PREVISÃO DO TEMPO
   ============================================= */
.weather-widget {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1rem 1.1rem;
  color: #212529;
  border: 1px solid #dee2e6;
}
.weather-city {
  font-weight: 700;
  font-size: .95rem;
  color: #212529;
}
.weather-desc {
  color: #6c757d !important;
  font-size: .8rem;
  margin-top: .1rem;
}
.weather-temp-main {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  color: #212529;
}
.weather-unit {
  font-size: 1rem;
  font-weight: 400;
  vertical-align: super;
  color: #6c757d;
}
.weather-details { color: #6c757d !important; }
.weather-details i { color: #28269C; }
.weather-forecast {
  border-top: 1px solid #dee2e6;
  padding-top: .75rem;
}
.weather-day {
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  padding: .4rem .3rem;
}
.weather-day-date { color: #6c757d !important; }
.weather-day-temp { color: #212529; }

/* =============================================
   FOOTER
   ============================================= */
.portal-footer { border-top: 3px solid var(--portal-red); }
.portal-footer .container {
  max-width: 860px;
}
.footer-main {
  background: linear-gradient(180deg, #eef3ff 0%, var(--footer-bg) 100%);
  color: #1e2a44;
}
.footer-layout {
  /* coloque em space between */
  display: flex; 
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}
.footer-columns-group {
  display: flex;
  gap: 3rem;
  flex-wrap: wrap;
}
.footer-column {
  flex: 0 0 auto;
  min-width: 120px;
}
.footer-heading {
  color: #1f2e59;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.footer-links { margin: 0; }
.footer-links li + li { margin-top: .15rem; }
.footer-links a {
  color: #33466f;
  font-size: .88rem;
  font-weight: 500;
}
.footer-links a:hover {
  color: var(--portal-red);
  text-decoration: underline;
}
.footer-brand {
  flex: 0 0 auto;
  max-width: 280px;
  text-align: left;
}
.footer-brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: .4rem;
}
.footer-logo-img {
  height: 54px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}
.footer-description {
  color: #4a5e87;
  line-height: 1.5;
}
.footer-social {
  display: flex;
  gap: .55rem;
  justify-content: flex-start;
}
.footer-social-link {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #b8c8ef;
  color: #33466f;
  background: rgba(255, 255, 255, .6);
  transition: all .2s ease;
}
.footer-social-link:hover {
  background: var(--portal-red);
  border-color: var(--portal-red);
  color: #fff;
}
.footer-bottom {
  background: #dce6ff;
  border-top: 1px solid #c6d6fb;
}
.footer-bottom .text-muted,
.footer-bottom a.text-muted { color: #4a5e87 !important; }
.footer-bottom a.text-muted:hover { color: #1f2e59 !important; }

@media (max-width: 991.98px) {
  .footer-layout {
    flex-direction: column;
    gap: 1.2rem;
    text-align: center;
  }
  .footer-columns-group {
    justify-content: center;
    width: 100%;
  }
  .footer-column {
    text-align: center;
    min-width: 110px;
  }
  .footer-brand {
    width: 100%;
    max-width: 100%;
    text-align: center;
  }
  .footer-brand-link { justify-content: center; }
  .footer-social { justify-content: center; }
}

/* =============================================
   PAGINAÇÃO
   ============================================= */
.page-link { color: var(--portal-red); border-radius: 4px !important; }
.page-item.active .page-link { background: var(--portal-red); border-color: var(--portal-red); color: #fff; }
.page-link:hover { color: #fff; background: var(--portal-red); border-color: var(--portal-red); }

/* =============================================
   ANÚNCIOS — BANNERS
   ============================================= */
.anuncio-banner-wrap { line-height: 0; }
.anuncio-banner { display: block; overflow: hidden; border-radius: 6px; }
.anuncio-banner img { transition: opacity .2s; }
.anuncio-banner:hover img { opacity: .92; }

/* Placeholder "Anuncie Aqui" */
.anuncio-placeholder {
  line-height: normal;
  border-radius: 6px;
  overflow: hidden;
}
.anuncio-placeholder-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    #f3f4f6,
    #f3f4f6 8px,
    #e5e7eb 8px,
    #e5e7eb 16px
  );
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  cursor: default;
  min-height: 90px;
}
.anuncio-placeholder--sidebar .anuncio-placeholder-inner { min-height: 250px; }
.anuncio-placeholder-label {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .12em;
  color: #9ca3af;
  text-transform: uppercase;
}
.anuncio-placeholder-cta {
  font-size: .82rem;
  font-weight: 600;
  color: #6b7280;
}

/* =============================================
   ANÚNCIOS — POPUP (modal com fundo desfocado)
   ============================================= */
.anuncio-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, .5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.anuncio-popup-overlay.anuncio-popup-show {
  display: flex;
  animation: popupFadeIn .3s ease;
}
@keyframes popupFadeIn {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}
.anuncio-popup-card {
  position: relative;
  max-width: min(90vw, 560px);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.6);
}
.anuncio-popup-img {
  display: block;
  width: 100%;
  height: auto;
}
.anuncio-popup-fechar {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 10;
  background: rgba(0,0,0,.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.anuncio-popup-fechar:hover { background: rgba(0,0,0,.8); }

/* =============================================
   UTILITÁRIOS / MISC
   ============================================= */
.categoria-header { transition: background .2s; }

/* Alert bootstrap overrides */
.alert-info { --bs-alert-color: #0c4a6e; --bs-alert-bg: #e0f2fe; }

/* =============================================
   RESPONSIVO
   ============================================= */
@media (max-width: 767.98px) {
  .logo-g1 { font-size: 1.4rem; }
  .header-search { max-width: 200px; }
  .destaque-hero-img { height: 260px; }
  .destaque-hero-img--empty { height: 260px; }
  .destaque-hero { max-height: 260px; }
  .portal-sidebar { position: static; }
  .noticia-card-img { height: 150px; }
}

@media (max-width: 575.98px) {
  .header-user .btn span { display: none; }
}
