/* ============================================================
   BRASILBUZZ — style.css
   Target: PageSpeed 90+ | CLS < 0.1 | LCP < 1.5s
   ============================================================ */

/* === RESET MÍNIMO === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.75;
  color: #1a1a1a;
  background: #f8f7f4;
  -webkit-font-smoothing: antialiased;
}

/* === TOKENS === */
:root {
  --red:       #c0392b;
  --red-dark:  #922b21;
  --black:     #1a1a1a;
  --gray-dark: #2c2c2c;
  --gray:      #5a5a5a;
  --gray-lt:   #8a8a8a;
  --border:    #d8d4cc;
  --bg:        #f8f7f4;
  --bg-white:  #ffffff;
  --max-w:     720px;
  --pad:       clamp(1rem, 4vw, 2rem);
}

/* === LINKS === */
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   ANÚNCIOS — CLS PREVENTION
   Reserva espaço ANTES do banner carregar para evitar layout shift
   ============================================================ */
.ad-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background: #f0ece4;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
/* Leaderboard topo: 728x90 desktop / 320x50 mobile */
.ad-top {
  min-height: 90px;
  padding: 0;
}
/* In-content: 300x250 */
.ad-inline {
  min-height: 280px;
  margin: 2rem auto;
  max-width: 320px;
  border-radius: 2px;
}
/* Float right — halfpage 300x600 */
.ad-float-right {
  float: right;
  min-height: 260px;
  min-width: 300px;
  width: 300px;
  margin: 0 0 1.5rem 2rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: #f0ece4;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* Halfpage 300x600 */
.ad-halfpage {
  min-height: 320px;
  max-width: 320px;
}
/* Rodapé leaderboard */
.ad-footer {
  min-height: 90px;
  border-top: 2px solid var(--border);
  border-bottom: none;
  margin-top: 2rem;
}
/* Label "Publicidade" */
.ad-container::before {
  content: 'Publicidade';
  display: block;
  position: absolute;
  font-family: 'Inter', sans-serif;
  font-size: 0.65rem;
  color: var(--gray-lt);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}
.ad-container { position: relative; }

/* Mobile ad: troca leaderboard por banner mobile */
@media (max-width: 767px) {
  .ad-top    { min-height: 60px; }
  .ad-footer { min-height: 60px; }
  .ad-float-right {
    float: none;
    width: 100%;
    min-width: unset;
    margin: 1.5rem 0;
  }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--bg-white);
  border-bottom: 2px solid var(--black);
  padding: 0.75rem var(--pad);
  position: sticky;
  top: 0;
  z-index: 100;
  will-change: transform; /* GPU layer */
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.site-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--black);
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none;
}
.logo-buzz   { color: var(--black); }
.logo-accent { color: var(--red); }
.logo-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--bg-white);
  background: var(--red);
  padding: 2px 5px;
  margin-left: 6px;
  vertical-align: super;
  border-radius: 2px;
}
.header-date {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--gray-lt);
}

/* ============================================================
   ARTIGO — LAYOUT
   ============================================================ */
.article-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem var(--pad) 3rem;
}

/* Categoria */
.article-category {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  align-items: center;
}
.category-tag, .urgency-tag {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}
.category-tag {
  background: var(--black);
  color: var(--bg-white);
}
.urgency-tag {
  background: var(--red);
  color: var(--bg-white);
  animation: pulse-tag 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .urgency-tag { animation: none; }
}
@keyframes pulse-tag {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.75; }
}

/* Headline */
.article-headline {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.75rem);
  font-weight: 900;
  line-height: 1.15;
  color: var(--black);
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
  border-left: 5px solid var(--red);
  padding-left: 1rem;
}
.article-headline em {
  font-style: italic;
  color: var(--red);
}

/* Deck */
.article-deck {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: var(--gray-dark);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  font-style: italic;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
}

/* Meta */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}
.author-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.author-avatar {
  width: 40px; height: 40px;
  background: var(--black);
  color: var(--bg-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
}
.author-name {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--black);
  display: block;
}
.author-cred {
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  color: var(--gray-lt);
  display: block;
}
.article-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.stat-item {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: var(--gray-lt);
}

/* ============================================================
   CORPO DO ARTIGO
   ============================================================ */
.article-body p {
  margin-bottom: 1.25rem;
  color: var(--gray-dark);
}
.article-lead {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--black) !important;
  line-height: 1.7;
  padding: 1.25rem 1.25rem 1.25rem 1.5rem;
  border-left: 4px solid var(--black);
  background: var(--bg-white);
  margin-bottom: 1.5rem !important;
}

/* Caixa de destaque */
.highlight-box {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #fff8f7;
  border: 1px solid #f5c6c0;
  border-left: 4px solid var(--red);
  padding: 1.25rem;
  border-radius: 2px;
  margin: 1.5rem 0;
}
.highlight-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.highlight-content { font-size: 1rem; color: var(--gray-dark); line-height: 1.6; }

/* Headings das seções */
.section-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.35rem, 3.5vw, 1.9rem);
  font-weight: 700;
  color: var(--black);
  margin: 2.5rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--black);
  clear: both;
}

/* ============================================================
   CARDS DE SINAL
   ============================================================ */
.signal-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--black);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: 0 0 2px 2px;
  /* Scroll-reveal: initial state */
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.signal-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.signal-card--last { margin-bottom: 2rem; }

.signal-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 900;
  color: #e0dbd2;
  line-height: 1;
  flex-shrink: 0;
  width: 2.75rem;
  text-align: center;
  padding-top: 0.1rem;
}
.signal-content h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 0.75rem;
  line-height: 1.35;
}
.signal-content p { font-size: 0.975rem; margin-bottom: 0.75rem; }
.signal-content p:last-child { margin-bottom: 0; }

.signal-warning {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: #7d3200;
  background: #fff3e8;
  border: 1px solid #f5c49a;
  border-left: 3px solid #e67e22;
  padding: 0.6rem 0.875rem;
  border-radius: 2px;
  margin-top: 0.75rem;
  line-height: 1.5;
}
.signal-warning.emergency {
  color: var(--red-dark);
  background: #fff5f4;
  border-color: #f5b0aa;
  border-left-color: var(--red);
}

/* ============================================================
   QUOTE DE IMPACTO
   ============================================================ */
.impact-quote {
  clear: both;
  border: none;
  border-left: 5px solid var(--red);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  background: var(--bg-white);
}
.impact-quote p {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
  font-style: italic;
  color: var(--black);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.impact-quote cite {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray);
  font-style: normal;
  display: block;
}

/* ============================================================
   PROTOCOLO GRID
   ============================================================ */
.protocol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  list-style: none;
}
.protocol-step {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--black);
  padding: 1.25rem;
  border-radius: 0 0 2px 2px;
}
.step-number {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 900;
  color: var(--red);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.step-content strong {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--black);
  display: block;
  margin-bottom: 0.4rem;
}
.step-content p {
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  color: var(--gray);
  line-height: 1.55;
  margin: 0;
}

/* ============================================================
   CTA BOX
   ============================================================ */
.cta-box {
  background: var(--black);
  color: var(--bg-white);
  padding: 2rem;
  border-radius: 2px;
  margin: 2rem 0;
  text-align: center;
}
.cta-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--bg-white);
}
.cta-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: #ccc;
  margin-bottom: 1.25rem;
  line-height: 1.6;
}
.share-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.share-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.65rem 1.5rem;
  border-radius: 2px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease;
  text-decoration: none;
  display: inline-block;
}
.share-btn:hover { transform: translateY(-2px); opacity: 0.9; text-decoration: none; }
.share-btn--whatsapp { background: #25d366; color: #fff; }
.share-btn--facebook { background: #1877f2; color: #fff; }

/* ============================================================
   DISCLAIMER
   ============================================================ */
.medical-disclaimer {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  color: var(--gray);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 1rem 1.25rem;
  margin-top: 2rem;
  line-height: 1.55;
}
.medical-disclaimer h4 {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gray-dark);
  margin-bottom: 0.4rem;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--black);
  color: #999;
  padding: 2rem var(--pad);
  margin-top: 0;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.footer-logo {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 900;
}
.footer-copy {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
}
.footer-nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-nav a {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  color: #888;
}
.footer-nav a:hover { color: #ccc; text-decoration: none; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.72rem;
  color: var(--gray-lt);
}
.breadcrumb li + li::before {
  content: '›';
  color: var(--border);
  margin-right: 0.4rem;
}
.breadcrumb a {
  color: var(--gray-lt);
  text-decoration: none;
}
.breadcrumb a:hover { color: var(--red); }

/* ============================================================
   SIDEBAR LAYOUT — Desktop only, CSS puro, zero JS
   ============================================================ */

/* Grid: [artigo] [sidebar] — só ativo acima de 1080px */
.page-layout {
  display: block; /* mobile: bloco simples */
  max-width: 1100px;
  margin: 0 auto;
}

@media (min-width: 1080px) {
  .page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    padding: 0 1.5rem;
    /* sem align-items: start — o padrão stretch é necessário para o sticky funcionar */
  }

  /* No desktop, o article-wrapper não precisa de max-width próprio */
  .page-layout .article-wrapper {
    max-width: none;
    padding-left: 0;
    padding-right: 0;
  }

  /* Float-right inline some no desktop — sidebar o substitui */
  .ad-float-mobile {
    display: none;
  }
}

/* Sidebar sticky */
.article-sidebar {
  display: none; /* esconde em mobile */
}

@media (min-width: 1080px) {
  .article-sidebar {
    display: block;
  }

  .sidebar-sticky {
    position: sticky;
    /* 70px = altura do header fixo + 16px de folga */
    top: 86px;
    width: 300px;
  }
}

.sidebar-label {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-lt);
  text-align: center;
  margin-bottom: 6px;
}

/* Ad slot da sidebar: reserva 600px de altura (CLS prevention) */
.ad-sidebar {
  width: 300px;
  min-height: 600px;  /* 300x600 halfpage */
  border: none;
  background: #f0ece4;
  flex-direction: column;
  padding-top: 0;
}

/* Se o AdManager servir um 300x250, o slot se ajusta */
.ad-sidebar .pubad {
  display: block;
  width: 300px;
}


.article-body::after { content: ''; display: table; clear: both; }

/* ============================================================
   ACESSIBILIDADE
   ============================================================ */
:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
