*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Brand Conexão Implantes */
  --ci-blue-900:    #002447;
  --ci-blue-800:    #00386C;
  --ci-blue-700:    #004F98;
  --ci-blue-100:    #EBF2FA;
  --ci-blue-50:     #F4F8FC;

  --ci-gold-700:    #9A6B1A;
  --ci-gold-600:    #B88226;
  --ci-gold-500:    #D49B35;
  --ci-gold-100:    #FBF4E8;

  --ci-text-main:   #0E1726;
  --ci-text-muted:  #475569;
  --ci-text-subtle: #8A99AD;

  --ci-bg:          #F5F7FA;
  --ci-surface:     #FFFFFF;
  --ci-border:      #E2E8F0;
  --ci-border-subtle:#EDF2F7;

  /* Typography */
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --shell-max:  920px;
  --header-h:   64px;
}

/* Scrollbar invisível */
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
}

/* Browser defaults */
::selection {
  background: var(--ci-blue-100);
  color: var(--ci-blue-900);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--ci-bg);
}

body {
  font-family: var(--font-sans);
  background: var(--ci-bg);
  color: var(--ci-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ── Top Bar Institucional ── */
.top-notice {
  background: var(--ci-blue-900);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.top-notice-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.top-notice-channel {
  color: var(--ci-gold-500);
  font-weight: 600;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ci-blue-800);
  border-bottom: 2px solid var(--ci-gold-600);
  box-shadow: 0 4px 20px rgba(0, 36, 71, 0.12);
}

.header-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 0 32px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
}

.header-logo {
  height: 26px;
  width: auto;
  display: block;
  opacity: 0.95;
  transition: opacity .15s ease;
}

.header-logo:hover {
  opacity: 1;
}

.header-pipe {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
}

.header-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.header-edition-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.header-audience {
  font-size: 0.85rem;
  font-weight: 600;
  color: #FFFFFF;
  letter-spacing: 0.01em;
}

/* ── Main Layout ── */
.main {
  flex: 1;
  max-width: var(--shell-max);
  width: 100%;
  margin: 0 auto;
  padding: 48px 32px 88px;
}

.hidden {
  display: none !important;
}

/* ── Feedback States ── */
.state-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 120px 0;
  color: var(--ci-text-muted);
  font-size: 0.9rem;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid var(--ci-border);
  border-top-color: var(--ci-blue-700);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.state-error {
  max-width: 480px;
  margin: 64px auto;
  padding: 48px 40px;
  background: var(--ci-surface);
  border: 1px solid var(--ci-border);
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.error-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FEF2F2;
  color: #DC2626;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 20px;
}

.error-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--ci-text-main);
  margin-bottom: 12px;
}

.error-body {
  font-size: 0.92rem;
  color: var(--ci-text-muted);
  line-height: 1.6;
}

.error-hint {
  font-size: 0.8rem;
  color: var(--ci-text-subtle);
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--ci-border-subtle);
}

/* ── Hero Editorial do Boletim ── */
.editorial-hero {
  background: var(--ci-surface);
  border: 1px solid var(--ci-border);
  border-radius: 12px;
  padding: 40px 44px;
  margin-bottom: 48px;
  box-shadow: 0 2px 8px rgba(0, 36, 71, 0.04);
  position: relative;
}

.hero-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.target-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 4px;
  background: var(--ci-blue-50);
  color: var(--ci-blue-800);
  border: 1px solid #D0E1F5;
}

.target-badge[data-profile="gestores"] {
  background: var(--ci-gold-100);
  color: var(--ci-gold-700);
  border-color: #EBD4AC;
}

.target-badge[data-profile="externo"] {
  background: #ECFDF5;
  color: #065F46;
  border-color: #A7F3D0;
}

.editorial-date {
  font-size: 0.82rem;
  color: var(--ci-text-muted);
  font-weight: 500;
}

.editorial-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 3.8vw, 2.6rem);
  line-height: 1.18;
  color: var(--ci-blue-900);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.editorial-lede {
  font-size: 1.05rem;
  color: var(--ci-text-muted);
  line-height: 1.6;
  max-width: 72ch;
}

/* ── Estrutura de Seções ── */
.news-sections-stream {
  display: flex;
  flex-direction: column;
  gap: 52px;
}

.section-group {}

.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--ci-border);
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-accent-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ci-gold-600);
}

.section-title-text {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ci-blue-900);
}

.section-count-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ci-text-subtle);
}

/* ── Grid de Cards Noticiosos ── */
.cards-editorial-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

.cards-editorial-grid.single-item {
  grid-template-columns: 1fr;
}

/* Card Individual */
.news-card-article {
  background: var(--ci-surface);
  border: 1px solid var(--ci-border);
  border-radius: 10px;
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all .2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  min-height: 190px;
  position: relative;
}

.news-card-article:hover {
  transform: translateY(-2px);
  border-color: #B5CCE8;
  box-shadow: 0 12px 28px rgba(0, 36, 71, 0.08);
}

.card-top {
  margin-bottom: 16px;
}

.card-topic-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ci-gold-700);
  margin-bottom: 10px;
}

.card-headline {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ci-text-main);
  line-height: 1.4;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.card-excerpt {
  font-size: 0.88rem;
  color: var(--ci-text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--ci-border-subtle);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ci-blue-700);
}

.cta-arrow-icon {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease;
}

.news-card-article:hover .cta-arrow-icon {
  transform: translateX(4px);
}

/* ── Modal Dialog Editorial ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(14, 23, 38, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 24px;
  backdrop-filter: blur(6px);
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-dialog {
  background: var(--ci-surface);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 20, 50, 0.25);
  overflow: hidden;
  border: 1px solid var(--ci-border);
  animation: slideUp .25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header-pane {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 30px 32px 22px;
  border-bottom: 1px solid var(--ci-border);
  background: var(--ci-surface);
  flex-shrink: 0;
}

.modal-section-context {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ci-gold-700);
  margin-bottom: 8px;
}

.modal-article-title {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  line-height: 1.25;
  color: var(--ci-blue-900);
}

.modal-close-trigger {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--ci-border);
  background: var(--ci-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--ci-text-muted);
  transition: all .15s ease;
}
.modal-close-trigger:hover {
  background: var(--ci-blue-900);
  color: #FFFFFF;
  border-color: var(--ci-blue-900);
}

.modal-content-stream {
  overflow-y: auto;
  padding: 28px 32px 36px;
  flex: 1;
  font-size: 0.98rem;
  color: var(--ci-text-main);
  line-height: 1.8;
}

.modal-content-stream p {
  margin-bottom: 18px;
  color: var(--ci-text-muted);
}

.modal-content-stream strong {
  color: var(--ci-text-main);
  font-weight: 700;
}

/* ── Bloco de Comprovação & Fontes no Modal ── */
.modal-sources-block {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--ci-border);
}

.modal-sources-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.sources-icon-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ci-gold-600);
}

.modal-sources-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ci-gold-700);
}

.modal-sources-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
}

.modal-source-item {
  display: flex;
}

.modal-source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--ci-bg);
  border: 1px solid var(--ci-border);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8rem;
  color: var(--ci-blue-900);
  transition: all .15s ease;
  max-width: 100%;
}

.modal-source-link:hover {
  background: var(--ci-blue-50);
  border-color: #B5CCE8;
  color: var(--ci-blue-800);
}

.source-link-label {
  font-weight: 600;
}

.source-link-url {
  font-size: 0.72rem;
  color: var(--ci-text-subtle);
  border-left: 1px solid var(--ci-border);
  padding-left: 8px;
}

.source-link-arrow {
  color: var(--ci-text-subtle);
  transition: transform .15s ease;
  flex-shrink: 0;
}

.modal-source-link:hover .source-link-arrow {
  transform: translate(2px, -2px);
  color: var(--ci-blue-700);
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--ci-border);
  padding: 20px 32px;
  background: var(--ci-surface);
}

.footer-inner-shell {
  max-width: var(--shell-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-col-brand {
  align-items: flex-start;
  gap: 3px;
}

.footer-brand-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--ci-blue-900);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.footer-meta-pill {
  font-size: 0.7rem;
  color: var(--ci-text-subtle);
  font-weight: 500;
}

.footer-col-meta {
  align-items: flex-end;
  text-align: right;
  gap: 3px;
}

.footer-channel-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ci-blue-700);
}

.footer-edition-tag {
  font-size: 0.68rem;
  color: var(--ci-text-subtle);
}

/* ── Responsividade ── */
@media (max-width: 820px) {
  .cards-editorial-grid {
    grid-template-columns: 1fr;
  }
  .main {
    padding: 36px 24px 64px;
  }
  .editorial-hero {
    padding: 30px 28px;
    margin-bottom: 36px;
  }
  .footer-inner-shell {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }
  .footer-col-brand,
  .footer-col-meta {
    align-items: center;
    text-align: center;
  }
}

@media (max-width: 600px) {
  :root {
    --header-h: 56px;
  }
  .top-notice { display: none; }
  .header-inner {
    padding: 0 18px;
  }
  .header-logo {
    height: 22px;
  }
  .header-pipe { display: none; }
  .header-audience {
    font-size: 0.72rem;
    max-width: 170px;
  }
  .main {
    padding: 24px 16px 56px;
  }
  .editorial-hero {
    padding: 24px 20px;
    margin-bottom: 32px;
  }
  .editorial-title {
    font-size: 1.65rem;
  }
  .news-sections-stream {
    gap: 38px;
  }
  .modal-dialog {
    max-height: 85vh;
  }
  .modal-header-pane {
    padding: 20px 20px 16px;
  }
  .modal-content-stream {
    padding: 20px 20px 28px;
  }
}
