/* ============================================================
   Moxico_Leste - Portal de Notícias
   Cores da Bandeira de Angola: vermelho, preto, amarelo
   ============================================================ */

/* --- Cores da Bandeira de Angola --- */
:root {
  --ml-primary: #CE1126;        /* Vermelho da bandeira */
  --ml-primary-dark: #a50e1e;
  --ml-primary-light: #e83a4a;
  --ml-secondary: #000000;     /* Preto da bandeira (top bar, footer) */
  --ml-flag-yellow: #FCD116;   /* Amarelo da bandeira (destaques) */
  --ml-body: #1e293b;
  --ml-muted: #64748b;
  --ml-border: #e2e8f0;
  --ml-bg: #f8fafc;
  --ml-card: #fff;
  --ml-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --ml-shadow-hover: 0 24px 48px -12px rgba(0, 0, 0, 0.12), 0 8px 24px -8px rgba(0, 0, 0, 0.06);
  --ml-radius: 0.625rem;
  --ml-radius-lg: 1rem;
  --ease-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo: cubic-bezier(0.22, 1, 0.36, 1);
}

/* --- Modo escuro --- */
html.dark {
  --ml-body: #e4e4e7;
  --ml-muted: #a1a1aa;
  --ml-border: #3f3f46;
  --ml-bg: #18181b;
  --ml-card: #27272a;
  --ml-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
  --ml-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.4);
}

/* --- Bootstrap: cores e tema --- */
:root {
  --bs-primary: var(--ml-primary);
  --bs-primary-rgb: 206, 17, 38;
  --bs-body-color: var(--ml-body);
  --bs-body-bg: var(--ml-bg);
  --bs-border-color: var(--ml-border);
  --bs-border-radius: var(--ml-radius);
  --bs-border-radius-lg: var(--ml-radius-lg);
  --bs-box-shadow: var(--ml-shadow);
}
.btn-primary {
  background-color: var(--ml-primary);
  border-color: var(--ml-primary);
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--ml-radius);
  transition: background 0.25s var(--ease-out), border-color 0.25s, transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
  background-color: var(--ml-primary-dark);
  border-color: var(--ml-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(206, 17, 38, 0.4);
}
.btn-sm { border-radius: var(--ml-radius); }
.bg-primary { background-color: var(--ml-primary) !important; }
.text-primary { color: var(--ml-primary) !important; }
.border-primary { border-color: var(--ml-primary) !important; }
.rounded-3 { border-radius: var(--ml-radius-lg) !important; }
.shadow-sm { box-shadow: var(--ml-shadow) !important; }
.shadow { box-shadow: var(--ml-shadow-hover) !important; }

/* --- Base: evitar cortes e overflow em todos os dispositivos --- */
html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ml-body);
  background-color: var(--ml-bg);
  background-image: radial-gradient(ellipse 140% 90% at 50% -15%, rgba(206, 17, 38, 0.05), transparent 55%), radial-gradient(ellipse 70% 40% at 100% 40%, rgba(252, 209, 22, 0.04), transparent 50%);
  line-height: 1.7;
  font-size: 1rem;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-width: 0;
}
img, video, iframe, embed, object {
  max-width: 100%;
  height: auto;
}
img { vertical-align: middle; }
table { width: 100%; max-width: 100%; }

/* --- Nenhum texto cortado: quebra de linha em todo o conteúdo de texto --- */
p, h1, h2, h3, h4, h5, h6, a, span, li, td, th, label,
.card-title, .card-text, .card-header, .card-meta,
.nav-link, .dropdown-item, .breadcrumb-item, .list-group-item,
.badge, .section-title, .hero-caption .h2, .hero-caption .small,
.post-meta-line, .share-buttons .btn, .empty-state,
.newsletter-section h2, .newsletter-section p, .newsletter-section .form-control,
.site-footer h6, .site-footer p, .site-footer a, .site-footer span,
.cookie-consent-text, .cookie-consent-text strong, .cookie-consent-text p,
.pwa-install-banner-text, .pwa-install-banner-text strong, .pwa-install-banner-text span,
.top-bar .top-date, .top-bar a, .logo, .offcanvas-title,
.page-content-wrap .page-content, .post-content, .ranking-list .list-group-item,
.form-label, small, .text-muted, .ad-banner {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}
.btn { white-space: normal; }
.pagination .page-link { white-space: normal; }
/* Garantir que blocos de texto não cortem: overflow visível no conteúdo de texto */
.card-body, .hero-caption, .cookie-consent-inner, .pwa-install-banner-inner,
.newsletter-section .row, .site-footer .row, .page-content-wrap {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

html.dark body { background-image: radial-gradient(ellipse 100% 60% at 50% -10%, rgba(206, 17, 38, 0.08), transparent 50%); }

/* --- Utilitários: links e transições --- */
.link-underline {
  position: relative;
}
.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--ml-primary);
  transition: width 0.25s var(--ease-out);
}
.link-underline:hover::after { width: 100%; }
.transition-smooth { transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out); }
.card-img-zoom { overflow: hidden; }
.card-img-zoom .card-img-top { transition: transform 0.5s var(--ease-out); }
.card-img-zoom:hover .card-img-top { transform: scale(1.06); }
.card-img-zoom:hover .card-img-fallback { transform: scale(1.03); }
.card-img-fallback { transition: transform 0.5s var(--ease-out); }

/* Acessibilidade: link para saltar ao conteúdo */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 0.5rem 1rem;
  background: var(--ml-primary);
  color: #fff !important;
  z-index: 9999;
  transition: top 0.2s;
  border-radius: 0 0 0.25rem 0;
}
.skip-link:focus { top: 0; }

/* --- Top bar --- */
.top-bar {
  background: linear-gradient(180deg, #0d0d0d 0%, var(--ml-secondary) 100%);
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  font-weight: 500;
}
.top-bar .container { max-width: 1140px; }
.top-bar a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s var(--ease-out), opacity 0.25s, transform 0.2s;
}
.top-bar a:hover { color: var(--ml-flag-yellow); opacity: 1; }
.top-bar .btn-success {
  color: #fff;
  font-weight: 600;
  border-radius: var(--ml-radius);
  padding: 0.35rem 0.9rem;
  font-size: 0.8125rem;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.top-bar .btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4); }
html.dark .top-bar { background: linear-gradient(180deg, #050505 0%, #0d0d0d 100%); }

/* --- Logo --- */
.logo {
  text-decoration: none;
  font-weight: 800;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
  transition: opacity 0.25s var(--ease-out), transform 0.2s var(--ease-out);
}
.logo:hover { opacity: 0.92; transform: translateY(-1px); }
.logo-main {
  color: var(--ml-body);
}
.logo-separator {
  color: var(--ml-flag-yellow);
  font-weight: 900;
  margin: 0 0.1rem;
}
.logo-highlight {
  color: var(--ml-primary);
  text-transform: uppercase;
  letter-spacing: -0.06em;
}
.footer-logo .logo-main {
  color: #fff;
}
.footer-logo .logo-highlight {
  color: var(--ml-flag-yellow);
}

/* --- Header / Navbar --- */
.site-header {
  background: rgba(255, 255, 255, 0.98) !important;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ml-border);
  position: sticky;
  top: 0;
  z-index: 1030;
  transition: box-shadow 0.35s var(--ease-out), background 0.35s var(--ease-out);
}
.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06), 0 1px 0 rgba(0, 0, 0, 0.04);
}
html.dark .site-header { background: rgba(39, 39, 42, 0.98) !important; }
.main-nav .nav-link {
  color: var(--ml-body);
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  transition: background 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.main-nav .nav-link:hover {
  background: rgba(206, 17, 38, 0.1);
  color: var(--ml-primary);
}
.main-nav .nav-link.active,
.main-nav .nav-link:focus {
  color: var(--ml-primary);
}
.main-nav .dropdown-menu {
  border: 1px solid var(--ml-border);
  box-shadow: var(--ml-shadow-hover);
  border-radius: var(--ml-radius);
  padding: 0.5rem;
}
.main-nav .dropdown-item:hover {
  background: rgba(206, 17, 38, 0.08);
  color: var(--ml-primary);
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(206, 17, 38, 0.25);
}

/* Offcanvas mobile */
.offcanvas {
  background: var(--ml-card);
}
.offcanvas .nav-link {
  color: var(--ml-body);
  border-bottom: 1px solid var(--ml-border);
}
.offcanvas .nav-link:hover { background: rgba(0, 0, 0, 0.05); }

/* --- Hero (destaque) --- */
.hero-section .container { overflow: hidden; max-width: 1140px; }
.hero-section .container > p { letter-spacing: 0.1em; font-size: 0.8rem; }
.hero-card {
  text-decoration: none;
  color: inherit;
  display: block;
  border-radius: var(--ml-radius-lg);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.5s var(--ease-out-expo), transform 0.5s var(--ease-out-expo);
  overflow: hidden;
  border: 1px solid var(--ml-border);
}
.hero-card:hover {
  box-shadow: 0 32px 64px -16px rgba(0, 0, 0, 0.18), 0 16px 32px -8px rgba(0, 0, 0, 0.08);
  transform: translateY(-8px);
}
.hero-carousel .carousel-control-prev,
.hero-carousel .carousel-control-next {
  width: 9%;
}
.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  background-size: 55% 55%;
}
.hero-carousel .carousel-indicators [data-bs-target] {
  width: 22px;
  height: 4px;
  border-radius: 2px;
}
.min-h-400 { min-height: 320px; }
@media (min-width: 992px) { .min-h-400 { min-height: 420px; } }
.hero-img {
  object-fit: cover;
  width: 100%;
  height: 100%;
  min-height: 300px;
  transition: transform 0.7s var(--ease-out);
}
.hero-card:hover .hero-img { transform: scale(1.04); }
.hero-placeholder { min-height: 300px; background: linear-gradient(135deg, var(--ml-border) 0%, var(--ml-bg) 100%); }
.hero-img-wrap { position: relative; }
.hero-img-wrap .hero-placeholder.d-none { display: none !important; }
.hero-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 80%;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 30%, rgba(0, 0, 0, 0.85) 100%);
  pointer-events: none;
}
.hero-caption { z-index: 2; padding: 1.5rem 1.5rem 1.75rem !important; }
.hero-caption .badge { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; padding: 0.4em 0.75em; }
.hero-caption .h2 { text-shadow: 0 2px 20px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3); font-size: 1.5rem; line-height: 1.3; }
@media (min-width: 768px) { .hero-caption .h2 { font-size: 1.75rem; } }
.hero-caption .small { opacity: 0.95; }

/* --- Cards de notícias --- */
.card {
  background: var(--ml-card);
  border: 1px solid var(--ml-border);
  border-radius: var(--ml-radius-lg);
  overflow: hidden;
  transition: transform 0.4s var(--ease-out-expo), box-shadow 0.4s var(--ease-out), border-color 0.3s, border-top-width 0.3s;
  position: relative;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ml-primary), var(--ml-flag-yellow));
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  z-index: 1;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: var(--ml-shadow-hover);
  border-color: rgba(206, 17, 38, 0.12);
}
.card:hover::before { opacity: 1; }
.card-header {
  border-radius: 1rem 1rem 0 0;
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
}
.card-header:first-child { border-radius: 1rem 1rem 0 0; }
.card-img-top {
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s var(--ease-out);
}
.card-img-wrap { position: relative; overflow: hidden; }
.card-img-wrap .card-img-top, .card-img-wrap .card-img-fallback { width: 100%; object-fit: cover; }
.card-img-fallback { width: 100%; height: 200px; flex: none; display: block !important; }
.card-img-post.d-none { display: none !important; }
.card-body { padding: 1.25rem 1.5rem; }
.card-title {
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1.4;
  transition: color 0.2s;
  letter-spacing: -0.01em;
}
.card:hover .card-title { color: var(--ml-primary); }
.card-text { line-height: 1.55; }
.list-group-item {
  background: var(--ml-card);
  border-color: var(--ml-border);
  color: var(--ml-body);
  padding: 0.75rem 1.25rem;
  transition: background 0.2s var(--ease-out);
}
.list-group-item:hover { background: var(--ml-bg); }

/* --- Conteúdo do artigo --- */
.post-content {
  font-size: 1.1rem;
  line-height: 1.75;
  text-align: justify;
}
.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 0.375rem;
  box-shadow: var(--ml-shadow);
}
.post-content p { margin-bottom: 1.25rem; text-align: justify; }
/* Quando o texto vem separado apenas com quebras de linha (<br>), dar espaço entre "parágrafos" */
.post-content br {
  display: block;
  margin-bottom: 0.75rem;
  content: "";
}
.post-content h2, .post-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

/* --- Newsletter --- */
.newsletter-section {
  background: linear-gradient(165deg, #0a0a0a 0%, var(--ml-secondary) 45%, #151518 100%);
  color: #fff;
  padding: 4rem 0 !important;
  position: relative;
  overflow: hidden;
}
.newsletter-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(252, 209, 22, 0.3), transparent);
  opacity: 0.8;
}
.newsletter-section .text-muted { color: rgba(255, 255, 255, 0.88) !important; }
.newsletter-section h2 { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.newsletter-section .form-control {
  border-radius: var(--ml-radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  min-height: 52px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.newsletter-section .form-control.newsletter-email { max-width: 280px; }
.newsletter-section .form-control::placeholder { color: rgba(255, 255, 255, 0.5); }
.newsletter-section .form-control:focus {
  border-color: var(--ml-flag-yellow);
  box-shadow: 0 0 0 3px rgba(252, 209, 22, 0.2);
}
.newsletter-section .btn-primary {
  padding: 0.75rem 1.75rem;
  border-radius: var(--ml-radius);
  font-weight: 600;
  transition: transform 0.3s var(--ease-out-expo), box-shadow 0.3s var(--ease-out);
}
.newsletter-section .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(206, 17, 38, 0.5);
}

/* --- Footer --- */
.site-footer {
  background: linear-gradient(180deg, #050505 0%, #0a0a0a 30%, var(--ml-secondary) 100%);
  color: rgba(255, 255, 255, 0.92);
  padding: 3.5rem 0 !important;
  position: relative;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ml-primary) 0%, var(--ml-flag-yellow) 50%, var(--ml-primary) 100%);
  opacity: 0.9;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.25s var(--ease-out), opacity 0.25s, transform 0.2s;
}
.site-footer a:hover {
  color: var(--ml-flag-yellow);
  text-decoration: underline;
  opacity: 1;
}
.site-footer .text-muted { color: rgba(255, 255, 255, 0.6) !important; }
.site-footer hr { border-color: rgba(255, 255, 255, 0.12); margin: 2rem 0; }
.social-links a {
  font-size: 1.35rem;
  opacity: 0.9;
  width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--ml-radius);
  transition: opacity 0.25s, transform 0.25s var(--ease-out-expo), background 0.25s, color 0.25s;
}
.site-footer .social-links { gap: 0.75rem; }
.social-links a:hover {
  opacity: 1;
  transform: translateY(-4px);
  color: var(--ml-flag-yellow) !important;
  background: rgba(255, 255, 255, 0.08);
}
.site-footer ul.list-unstyled li { margin-bottom: 0.5rem; }
/* Separação clara entre Institucional e Contacto no rodapé */
.site-footer .footer-col-institucional {
  padding-right: 2rem;
  border-right: 1px solid rgba(255, 255, 255, 0.15);
  margin-right: 0.5rem;
}
.site-footer .footer-col-contacto {
  padding-left: 2rem;
}
@media (max-width: 991.98px) {
  .site-footer .footer-col-institucional {
    border-right: none;
    padding-right: 0;
    margin-right: 0;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }
  .site-footer .footer-col-contacto {
    padding-left: 0;
  }
}

/* --- Publicidade --- */
.ad-banner img { max-height: 90px; object-fit: contain; }
.ad-banner.ad-top {
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.ad-banner.ad-top .container {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}
.ad-banner.ad-top a {
  width: 100%;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(206, 17, 38, 0.18);
  border-radius: 0.125rem;
  background: #fff;
}
.ad-banner.ad-top img {
  width: 100%;
  height: 90px;
  max-height: none;
  object-fit: contain; /* não corta texto do banner */
  object-position: center center;
}
.ad-sidebar img { max-height: 250px; object-fit: contain; border-radius: 0.375rem; }
.ad-in-article img { max-height: 140px; object-fit: contain; }
.ad-carousel .carousel-inner {
  background: var(--ml-card);
}
.ad-carousel img {
  height: 220px;
  object-fit: cover;
}
.ad-carousel .carousel-control-prev,
.ad-carousel .carousel-control-next {
  width: 16%;
}
.ad-carousel .carousel-control-prev-icon,
.ad-carousel .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  background-size: 60% 60%;
}
.ad-carousel .carousel-indicators [data-bs-target] {
  width: 18px;
  height: 4px;
  border-radius: 2px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  background: transparent;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}
.breadcrumb-item a {
  color: var(--ml-primary);
  transition: color 0.2s, opacity 0.2s;
}
.breadcrumb-item a:hover { color: var(--ml-primary-dark); opacity: 0.9; }
.breadcrumb-item.active { color: var(--ml-muted); font-weight: 500; }
.breadcrumb-item + .breadcrumb-item::before { opacity: 0.6; }

/* --- Paginação --- */
.pagination .page-link {
  color: var(--ml-primary);
  border-color: var(--ml-border);
  border-radius: var(--ml-radius) !important;
  padding: 0.5rem 0.85rem;
  font-weight: 600;
  transition: background 0.25s, color 0.25s, transform 0.2s;
}
.pagination .page-link:hover {
  background: rgba(206, 17, 38, 0.1);
  border-color: var(--ml-primary);
  color: var(--ml-primary-dark);
  transform: translateY(-1px);
}
.pagination .page-item.active .page-link {
  background: linear-gradient(180deg, var(--ml-primary) 0%, var(--ml-primary-dark) 100%);
  border-color: var(--ml-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(206, 17, 38, 0.35);
}

/* --- Formulários --- */
.form-control, .form-select {
  border-radius: var(--ml-radius);
  border: 1px solid var(--ml-border);
  background: var(--ml-card);
  color: var(--ml-body);
  transition: border-color 0.25s, box-shadow 0.25s var(--ease-out);
}
.form-control:focus, .form-select:focus {
  border-color: var(--ml-primary);
  box-shadow: 0 0 0 3px rgba(206, 17, 38, 0.12);
  outline: 0;
}
.form-control::placeholder { color: var(--ml-muted); }
.form-control:hover:not(:focus) { border-color: rgba(206, 17, 38, 0.25); }

/* --- Badges --- */
.badge.bg-secondary {
  background-color: var(--ml-muted) !important;
}

/* --- Modo escuro: ícone do tema --- */
.theme-toggle {
  color: var(--ml-body);
  text-decoration: none !important;
}
.theme-toggle:hover { color: var(--ml-primary); }
html.dark .theme-toggle .bi-moon-stars::before {
  content: "\f2a7"; /* Bootstrap Icons: sun */
}

/* --- Títulos de secção --- */
.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ml-body);
  margin-bottom: 1.75rem;
  padding-bottom: 0.85rem;
  border-bottom: 4px solid var(--ml-flag-yellow);
  display: inline-block;
  position: relative;
  line-height: 1.3;
}
.section-title::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 48px;
  height: 4px;
  background: var(--ml-primary);
  border-radius: 0 2px 0 0;
}
.section-title i { color: var(--ml-primary); margin-right: 0.45rem; font-size: 1.05em; }
.section-title .badge { font-size: 0.7rem; vertical-align: middle; }

/* --- Faixa bandeira --- */
.flag-stripe {
  height: 6px;
  background: linear-gradient(90deg, var(--ml-primary) 0%, var(--ml-primary) 33.33%, var(--ml-secondary) 33.33%, var(--ml-secondary) 66.66%, var(--ml-flag-yellow) 66.66%, var(--ml-flag-yellow) 100%);
  box-shadow: 0 -1px 4px rgba(0, 0, 0, 0.2);
}

/* --- Meta das cards (data, autor, views) --- */
.card-meta {
  font-size: 0.8rem;
  color: var(--ml-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.card-meta i { opacity: 0.85; }

/* --- Estado vazio --- */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--ml-muted);
  background: linear-gradient(180deg, var(--ml-card) 0%, rgba(248, 250, 252, 0.6) 100%);
  border-radius: var(--ml-radius-lg);
  border: 2px dashed var(--ml-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 0.3s, box-shadow 0.3s;
}
.empty-state:hover {
  border-color: rgba(206, 17, 38, 0.2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}
html.dark .empty-state { background: linear-gradient(180deg, var(--ml-card) 0%, rgba(39, 39, 42, 0.5) 100%); }
.empty-state i { font-size: 3rem; margin-bottom: 1.25rem; opacity: 0.5; color: var(--ml-primary); }
.empty-state-grid { border-radius: var(--ml-radius-lg); }
.empty-state.min-h-300 { min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; }

/* --- Página do artigo: partilha e autor --- */
.share-buttons .btn { transition: transform 0.2s, box-shadow 0.2s; }
.share-buttons .btn:hover { transform: translateY(-2px); }
.post-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.9rem;
  color: var(--ml-muted);
}
.post-meta-line span { display: inline-flex; align-items: center; gap: 0.35rem; }
.related-posts .card { border: 1px solid var(--ml-border); }

/* --- Sidebar: lista numerada --- */
.ranking-list .badge.rounded-circle {
  width: 1.85rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: linear-gradient(180deg, var(--ml-primary) 0%, var(--ml-primary-dark) 100%) !important;
  color: #fff !important;
  box-shadow: 0 2px 6px rgba(206, 17, 38, 0.3);
  transition: transform 0.25s var(--ease-out);
}
.ranking-list .list-group-item:hover .badge.rounded-circle { transform: scale(1.08); }

/* --- Newsletter (Bootstrap form + custom) --- */
.newsletter-section h2 { font-weight: 800; letter-spacing: -0.02em; }
.newsletter-section .form-control {
  min-height: 48px;
  border-radius: var(--ml-radius);
  border: none;
}
.newsletter-section .btn-primary { border-radius: var(--ml-radius); }

/* --- Footer: títulos --- */
.site-footer h6 {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.95);
}

/* --- Utilitários --- */
.main-content { min-height: 58vh; padding-bottom: 1rem; }
.container { max-width: 1140px; }
.page-content-wrap { padding-top: 0.5rem; }
/* Blocos de conteúdo com mais respiro */
.page-content-wrap .row.g-4 { --bs-gutter-y: 1.75rem; }
.page-content-wrap .row.g-lg-5 { --bs-gutter-y: 2rem; }
@media (min-width: 992px) {
  .page-content-wrap .row.g-lg-5 { --bs-gutter-x: 2rem; }
}
.ratio-16x9 { --bs-aspect-ratio: 56.25%; }
.gallery-item { transition: opacity 0.2s; }
.gallery-item:hover { opacity: 0.9; }
.img-article { border-radius: var(--ml-radius-lg); overflow: hidden; max-width: 100%; }
.page-content-wrap .page-content img { max-width: 100%; height: auto; }
.page-content-wrap .page-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.page-content-wrap .page-content pre, .page-content-wrap .page-content code { max-width: 100%; overflow-x: auto; word-break: break-word; }
.page-content-wrap .page-content { overflow-wrap: break-word; word-wrap: break-word; }
#offcanvasNav.offcanvas { max-width: min(400px, 100vw); }
.badge {
  font-weight: 600;
  padding: 0.4em 0.75em;
  letter-spacing: 0.02em;
  border-radius: 0.35rem;
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover .badge.bg-primary { box-shadow: 0 2px 8px rgba(206, 17, 38, 0.35); }
.ad-sidebar.border { border-color: var(--ml-border) !important; border-radius: var(--ml-radius) !important; }
.hero-sidebar-item a { transition: color 0.2s var(--ease-out); }
.hero-sidebar-item a:hover { color: var(--ml-primary) !important; }
.hero-section .bg-body-secondary { background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%) !important; }
html.dark .hero-section .bg-body-secondary { background: var(--ml-bg) !important; }

/* --- Responsivo: todos os dispositivos sem cortar --- */
@media (max-width: 1199.98px) {
  .container { max-width: 100%; padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 991.98px) {
  .site-header .container { max-width: 100%; padding-left: 1rem; padding-right: 1rem; }
  .site-header .d-flex { flex-wrap: wrap; gap: 0.5rem; }
  .logo { font-size: 1.35rem; max-width: 60%; min-width: 0; }
  .card-img-top { height: 180px; }
  .card-img-fallback { height: 180px; }
  .section-title { font-size: 1.05rem; max-width: 100%; }
  .hero-caption { padding: 1.25rem 1rem 1.5rem !important; }
  .hero-caption .h2 { word-wrap: break-word; overflow-wrap: break-word; }
  .main-content .container { padding-left: 1rem; padding-right: 1rem; }
  .site-footer .container { padding-left: 1rem; padding-right: 1rem; }
  .site-footer .row { margin-left: -0.5rem; margin-right: -0.5rem; }
  .site-footer [class^="col-"] { padding-left: 0.75rem; padding-right: 0.75rem; }
  .newsletter-section .container { padding-left: 1rem; padding-right: 1rem; }
  .newsletter-section .form-control { max-width: 100%; }
  .page-content-wrap .container { padding-left: 1rem; padding-right: 1rem; }
}
@media (max-width: 767.98px) {
  .container { padding-left: 0.875rem; padding-right: 0.875rem; }
  .top-bar .container { padding-left: 0.875rem; padding-right: 0.875rem; }
  .top-bar .d-flex { flex-wrap: wrap; gap: 0.5rem; justify-content: center; text-align: center; }
  .top-bar .top-date { width: 100%; text-align: center; }
  .hero-section .container { padding-left: 0.875rem; padding-right: 0.875rem; overflow: hidden; }
  .hero-img, .hero-placeholder { min-height: 220px; }
  .card-title { font-size: 1rem; word-wrap: break-word; overflow-wrap: break-word; }
  .card-text { overflow-wrap: break-word; }
  .section-title { font-size: 0.95rem; }
  .breadcrumb { flex-wrap: wrap; font-size: 0.85rem; }
  .pagination { flex-wrap: wrap; justify-content: center; }
  .pagination .page-link { padding: 0.4rem 0.65rem; font-size: 0.9rem; }
  .site-footer .d-flex.justify-content-between { flex-direction: column; gap: 0.75rem; text-align: center; }
  .site-footer .d-flex.justify-content-between span { word-break: break-word; }
}
@media (max-width: 575.98px) {
  .container { padding-left: 0.75rem; padding-right: 0.75rem; max-width: 100%; }
  .hero-caption .h2 { font-size: 1.15rem; line-height: 1.35; }
  .top-date { font-size: 0.7rem; }
  .flag-stripe { height: 4px; }
  .logo { font-size: 1.25rem; max-width: 55%; }
  .logo-img { height: 36px; max-width: 140px; }
  .card-body { padding: 0.875rem 1rem; }
  .card-img-top { height: 160px; }
  .card-img-fallback { height: 160px; }
  .section-title { font-size: 0.9rem; }
  .empty-state { padding: 2.5rem 1rem; }
  .empty-state i { font-size: 2.5rem; }
  .newsletter-section { padding: 2.5rem 0.75rem !important; }
  .newsletter-section h2 { font-size: 1.15rem; }
  .newsletter-section .d-flex { flex-direction: column; width: 100%; }
  .newsletter-section .form-control.newsletter-email { width: 100%; max-width: none; }
  .newsletter-section .btn { width: 100%; }
  .site-footer { padding: 2rem 0 2.5rem !important; }
  .site-footer .footer-col-institucional { padding-right: 0; margin-right: 0; margin-bottom: 1.25rem; padding-bottom: 1.25rem; }
  .site-footer .footer-col-contacto { padding-left: 0; }
  .site-footer .col-6 { width: 100%; max-width: 100%; }
  .site-footer .col-lg-4:first-child { margin-bottom: 1.5rem; }
  .cookie-consent-text { min-width: 0; }
  .cookie-consent-inner { padding: 0 0.75rem; }
  .pwa-install-banner-inner { padding: 0 0.75rem 0 1rem; }
  .ad-banner.ad-top .container { padding-left: 0.75rem; padding-right: 0.75rem; }
  .ad-banner img { max-width: 100%; }
  .hero-carousel .carousel-control-prev,
  .hero-carousel .carousel-control-next {
    width: 12%;
  }
  .ad-carousel img {
    height: 170px;
  }
}
@media (max-width: 374px) {
  .container { padding-left: 0.65rem; padding-right: 0.65rem; }
  .logo { font-size: 1.1rem; }
  .hero-caption .h2 { font-size: 1.05rem; }
  .card-body { padding: 0.75rem 0.875rem; }
  .btn { padding: 0.45rem 0.9rem; font-size: 0.9rem; }
}

/* --- Aviso instalar PWA (aparece na tela, desaparece ao instalar/fechar) --- */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  padding: 0.75rem 1rem;
  background: var(--ml-card);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  border-top: 3px solid var(--ml-primary);
}
.pwa-install-banner.visible {
  transform: translateY(0);
}
.pwa-install-banner-inner {
  max-width: 1140px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.pwa-install-banner-icon { font-size: 1.75rem; color: var(--ml-primary); flex-shrink: 0; }
.pwa-install-banner-text { flex: 1; min-width: 180px; }
.pwa-install-banner-text strong { display: block; margin-bottom: 0.15rem; }
.pwa-install-banner-text span { font-size: 0.9rem; color: var(--ml-muted); }
.pwa-install-banner-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }
.pwa-install-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--ml-muted);
  cursor: pointer;
  line-height: 1;
  border-radius: var(--ml-radius);
}
.pwa-install-close:hover { color: var(--ml-body); background: var(--ml-bg); }
@media (max-width: 575.98px) {
  .pwa-install-banner-inner { flex-direction: column; align-items: flex-start; padding-right: 2rem; }
  .pwa-install-banner-actions { width: 100%; }
  .pwa-install-banner-actions .btn { flex: 1; }
}

/* ========== Aviso de cookies (consentimento) ========== */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  padding: 1rem 0;
  background: var(--ml-card);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  border-top: 3px solid var(--ml-primary);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-consent-banner.visible {
  transform: translateY(0);
}
.cookie-consent-inner {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.cookie-consent-text {
  flex: 1;
  min-width: 260px;
  color: var(--ml-body);
}
.cookie-consent-text strong { display: flex; align-items: center; font-size: 1rem; }
.cookie-consent-text p { color: var(--ml-muted); font-size: 0.9rem; line-height: 1.5; }
.cookie-consent-text a { color: var(--ml-primary); font-weight: 600; text-decoration: underline; }
.cookie-consent-text a:hover { color: var(--ml-primary-dark); }
.cookie-consent-actions {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}
.cookie-consent-actions .btn { border-radius: var(--ml-radius); font-weight: 600; transition: transform 0.2s, box-shadow 0.2s; }
.cookie-consent-actions .btn:hover { transform: translateY(-1px); }
@media (max-width: 575.98px) {
  .cookie-consent-inner { flex-direction: column; align-items: flex-start; }
  .cookie-consent-actions { width: 100%; }
  .cookie-consent-actions .btn { flex: 1; }
}

