/* =====================================================
   OLHAPAUTA — SINGLE.CSS (COMPLETO)
   Tema claro (texto legível no fundo branco)
   + Autor (E-E-A-T / Discover): link + box do autor
===================================================== */

/* ===============================
   BASE DO SINGLE (cores só aqui)
=============================== */
.single{
  --s-bg:#ffffff;
  --s-text:#0f172a;
  --s-muted:#64748b;
  --s-muted-2:#94a3b8;
  --s-line:rgba(15,23,42,0.12);
  --s-line-2:rgba(15,23,42,0.08);
  --s-surface:#ffffff;
  --s-surface-2:#f8fafc;
  --s-surface-3:#f1f5f9;
}

/* garante leitura mesmo se o body/global ainda estiver com texto branco */
body.single{
  color: var(--s-text);
  overflow-x: clip;
}

/* PATCH principal: container com respiro no mobile */
body.single .container{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px;
}

@media (min-width:768px){
  body.single .container{
    padding:0 22px;
  }
}

/* fundo do single e respiro */
body.single .site-main{
  background: transparent;
  color: var(--s-text);
  padding-top: 28px;
}

/* links fora do texto do artigo */
body.single a{
  color: var(--s-text);
}
body.single a:hover{
  color: var(--accent, #e53935);
}

/* ===============================
   GRID DO SINGLE
=============================== */
.single-grid{
  display:grid;
  grid-template-columns:minmax(0, 1fr) 340px;
  gap:48px;
  align-items:start;
}

/* impede vazamento em grid/flex */
.single-content,
.single-sidebar{
  min-width:0;
}

/* ===============================
   COLUNA DE LEITURA
=============================== */
.single-content{
  max-width:760px;
  width:100%;
}

/* texto */
.entry-text{
  max-width:68ch;
  font-size:17px;
  line-height:1.75;
  color: var(--s-text);

  overflow-wrap:anywhere;
  word-break:break-word;
}

@media (max-width:1200px){
  .single-content,
  .entry-text{
    max-width:100%;
  }
}

/* ===============================
   BREADCRUMBS
=============================== */
.breadcrumbs{
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;

  margin: 14px 0 18px;
  padding: 8px 12px;

  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;

  color: rgba(15,23,42,0.58);
  background: rgba(15,23,42,0.03);
  border: 1px solid rgba(15,23,42,0.10);
  border-radius: 999px;
}

.breadcrumbs a{
  color: rgba(15,23,42,0.70);
  text-decoration:none;
  font-weight: 800;
}

.breadcrumbs a:hover{
  color: var(--accent, #e53935);
}

.breadcrumbs .sep{
  opacity:.35;
}

.breadcrumbs .current{
  color: rgba(15,23,42,0.85);
  font-weight: 900;
}

@media (max-width:520px){
  .breadcrumbs{
    display:flex;
    width:100%;
    border-radius: 14px;
    padding: 10px 12px;
    gap: 6px 10px;
  }
}

/* ===============================
   HEADER DO ARTIGO
=============================== */
.post-category{
  display:inline-block;
  background:var(--accent, #e53935);
  color:#fff;
  font-size:12px;
  font-weight:900;
  text-transform:uppercase;
  padding:6px 10px;
  border-radius:999px;
  margin-bottom:10px;
}

.entry-title{
  font-size:34px;
  line-height:1.15;
  font-weight:900;
  margin:10px 0 12px;
  color: var(--s-text);
}

.entry-meta{
  font-size:13px;
  color: var(--s-muted);
  margin-bottom:18px;
}

.entry-subtitle{
  font-size:18px;
  line-height:1.5;
  color: rgba(15,23,42,0.80);
  margin:16px 0 26px;
  max-width:60ch;
}

/* Autor linkado (no meta) */
.entry-meta .author-link{
  color: var(--s-text);
  text-decoration:none;
  border-bottom:1px solid rgba(15,23,42,0.18);
  padding-bottom:1px;
}
.entry-meta .author-link:hover{
  color: var(--accent, #e53935);
  border-bottom-color: rgba(229,57,53,0.35);
}

/* Botão modo leitura */
.reading-toggle{
  margin-top:14px;
  background: var(--s-surface-2);
  border:1px solid var(--s-line);
  color: var(--s-text);
  padding:10px 12px;
  border-radius:12px;
  font-weight:800;
  cursor:pointer;
  transition:.2s;
}

.reading-toggle:hover{
  border-color: rgba(229,57,53,0.35);
  background: rgba(229,57,53,0.06);
  color: var(--s-text);
}

/* ===============================
   IMAGEM DE CAPA
=============================== */
.entry-image{
  aspect-ratio:16 / 9;
  margin:26px 0 36px;
  border-radius:14px;
  overflow:hidden;
  background: var(--s-surface-3);
}

.entry-image img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* reforço geral: mídia nunca passa do container */
body.single img,
body.single iframe,
body.single video{
  max-width:100%;
  height:auto;
  display:block;
}

/* ===============================
   TEXTO
=============================== */
.entry-text p{
  margin-bottom:1.5em;
  color: rgba(15,23,42,0.92);
}

.entry-text h2{
  font-size:26px;
  margin:48px 0 18px;
  font-weight:900;
  color: var(--s-text);
}

.entry-text h3{
  font-size:20px;
  margin:36px 0 14px;
  font-weight:800;
  color: var(--s-text);
}

/* Links dentro do texto */
.entry-text a{
  color:var(--accent, #e53935);
  text-decoration:underline;
  text-underline-offset:3px;
}

.entry-text a:hover{
  color: rgba(15,23,42,0.92);
}

/* ===============================
   ANÚNCIOS NO TEXTO
=============================== */
.ad-break{
  margin:48px 0;
}

.ad-divider{
  text-align:center;
  font-size:11px;
  letter-spacing:1px;
  color: var(--s-muted);
  margin:0 0 10px;
}

.in-content-ad-container{
  display:block;
  width:100%;
  max-width:100%;
  margin:48px 0;
  overflow:hidden;
}

/* aqui estava o bug: estava escondendo o anúncio */
.in-content-ad-box{
  display:block !important;
  width:100%;
  max-width:100%;
  min-height:1px;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  overflow:hidden;
}

.in-content-ad-box ins.adsbygoogle{
  display:block !important;
  width:100% !important;
  height:auto !important;
}

.in-content-ad-box iframe,
.in-content-ad-box ins.adsbygoogle iframe{
  max-width:100% !important;
  width:100% !important;
}

/* ===============================
   BOX DO AUTOR (E-E-A-T / Discover)
=============================== */
.author-box{
  margin: 54px 0 0;
  padding: 18px;
  background: var(--s-surface-2);
  border: 1px solid var(--s-line);
  border-radius: 14px;
}

.author-box__inner{
  display:flex;
  gap:14px;
  align-items:flex-start;
  min-width:0;
}

.author-box__avatar{
  flex:0 0 auto;
}

.author-box__avatar img{
  width:64px;
  height:64px;
  border-radius:999px;
  border:1px solid var(--s-line);
  background:#fff;
}

.author-box__text{
  min-width:0;
}

.author-box__name{
  font-weight: 900;
  color: var(--s-text);
  margin: 2px 0 6px;
  line-height: 1.2;
}

.author-box__name a{
  color: var(--s-text);
  text-decoration:none;
  border-bottom:1px solid rgba(15,23,42,0.18);
  padding-bottom:1px;
}

.author-box__name a:hover{
  color: var(--accent, #e53935);
  border-bottom-color: rgba(229,57,53,0.35);
}

.author-box__bio{
  margin: 0 0 10px;
  color: rgba(15,23,42,0.78);
  font-size: 14px;
  line-height: 1.6;
}

.author-box__cta{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.author-box__more{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background:#fff;
  border:1px solid var(--s-line);
  font-weight:900;
  font-size:12px;
  color: var(--s-text);
  text-decoration:none;
}

.author-box__more:hover{
  border-color: rgba(229,57,53,0.35);
  background: rgba(229,57,53,0.06);
  color: var(--s-text);
}

@media (max-width:520px){
  .author-box{
    padding: 14px;
  }
  .author-box__inner{
    gap:12px;
  }
}

/* ===============================
   SHARE
=============================== */
.share-box{
  margin:40px 0 0;
  padding:16px;
  background: var(--s-surface-2);
  border:1px solid var(--s-line);
  border-radius:12px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.share-box a{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  background: #fff;
  border:1px solid var(--s-line);
  font-weight:800;
  color: var(--s-text);
  text-decoration:none;
}

.share-box a:hover{
  border-color: rgba(229,57,53,0.35);
  background: rgba(229,57,53,0.06);
  color: var(--s-text);
}

/* ===============================
   LEIA TAMBÉM
=============================== */
.related-posts{
  margin-top:64px;
}

.related-posts h3{
  margin:0 0 16px;
  font-size:18px;
  font-weight:900;
  color: var(--s-text);
}

.related-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:18px;
}

.related-grid a{
  display:block;
  padding:12px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--s-line);
  text-decoration:none;
}

.related-grid a:hover{
  border-color: rgba(229,57,53,0.30);
  background: rgba(229,57,53,0.04);
}

.related-grid a img{
  width:100%;
  height:auto;
  border-radius:10px;
  margin-bottom:10px;
}

.related-grid a h4{
  font-size:14px;
  line-height:1.35;
  font-weight:800;
  margin:0;
  color: var(--s-text);
}

/* SPRINT 4: alias para .related-item (mesmas props de .related-grid a) */
.related-grid .related-item{
  display:block;
  padding:12px;
  border-radius:12px;
  background:#fff;
  border:1px solid var(--s-line);
  text-decoration:none;
}
.related-grid .related-item:hover{
  border-color: rgba(229,57,53,0.30);
  background: rgba(229,57,53,0.04);
}
.related-grid .related-item img{
  width:100%;
  height:auto;
  border-radius:10px;
  margin-bottom:8px;
}
/* Badge de categoria nos related posts */
.related-item__cat{
  display:inline-block;
  font-size:10px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.08em;
  color: var(--accent, #e53935);
  margin-bottom:6px;
}
.related-grid .related-item h4{
  font-size:14px;
  line-height:1.35;
  font-weight:800;
  margin:0;
  color: var(--s-text);
}

/* ===============================
   MULTIPLEX (abaixo do Leia também)
=============================== */
.ad-slot--multiplex{
  margin:28px 0 0;
}

/* ===============================
   SIDEBAR
=============================== */
.single-sidebar{
  position:static;
  top:auto;
}

.single-sidebar .widget-box{
  background:#fff;
  border:1px solid var(--s-line);
  border-radius:12px;
  padding:18px;
}

.single-sidebar .widget-box + .widget-box{
  margin-top:28px;
}

.widget-label{
  display:block;
  font-size:10px;
  letter-spacing:1px;
  text-transform:uppercase;
  color: var(--s-muted);
  margin-bottom:10px;
}

.widget-title{
  margin:0 0 12px;
  font-size:14px;
  letter-spacing:.02em;
  text-transform:uppercase;
  font-weight:900;
  color: var(--s-text);
}

.single-sidebar .widget-box a{
  display:block;
  padding:10px 10px;
  border-radius:10px;
  color: var(--s-text);
  background: var(--s-surface-2);
  border:1px solid transparent;
  margin-bottom:8px;
  text-decoration:none;
}

.single-sidebar .widget-box a:hover{
  border-color: var(--s-line);
  background: var(--s-surface-3);
  color: var(--s-text);
}

/* ===============================
   RESPONSIVO
=============================== */
@media (max-width:900px){
  .single-grid{
    grid-template-columns:1fr;
    gap:28px;
  }

  .entry-title{
    font-size:26px;
  }

  .entry-subtitle{
    font-size:16px;
    margin:14px 0 22px;
  }

  .related-grid{
    grid-template-columns:1fr;
  }

  .single-sidebar{
    position:static;
    top:auto;
  }
}

/* ===============================
   MODO LEITURA
=============================== */
body.reading-mode .single-grid{
  grid-template-columns:1fr;
}

body.reading-mode .single-sidebar{
  display:none;
}

body.reading-mode .single-content{
  margin:0 auto;
  max-width:820px;
}

body.reading-mode .entry-text{
  max-width:72ch;
  font-size:18px;
  line-height:1.8;
}

/* sidebar rola junto */
.single-sidebar,
.single-sidebar *{
  position: static !important;
  top: auto !important;
  bottom: auto !important;
}

/* ===============================
   BARRA DE PROGRESSO DE LEITURA
=============================== */
.reading-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: #e53935;
  z-index: 9999;
  transition: width .08s linear;
  pointer-events: none;
}

/* Quando cat-strip estiver presente, a barra fica logo abaixo */
body.single .reading-progress-bar { top: 0; }

/* ===============================
   STICKY SHARE BAR (MOBILE)
=============================== */
.sticky-share {
  display: none;
}

@media (max-width: 900px) {
  .sticky-share {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: #0b0e14;
    border-top: 1px solid rgba(255,255,255,.1);
    padding: 10px 16px;
    gap: 10px;
    align-items: center;
    justify-content: center;
    safe-area-inset-bottom: env(safe-area-inset-bottom);
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }

  .sticky-share__btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 42px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity .18s;
  }

  .sticky-share__btn:active { opacity: .75; }

  .sticky-share__btn--whatsapp {
    background: #25d366;
    color: #fff;
  }

  .sticky-share__btn--copy {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.88);
    border: 1px solid rgba(255,255,255,.12);
  }

  .sticky-share__btn--copy.copied {
    background: rgba(34,197,94,.15);
    color: #4ade80;
    border-color: rgba(34,197,94,.3);
  }

  /* Empurra o conteúdo da página para não ficar atrás da barra */
  body.single { padding-bottom: 68px; }
}

.single-sidebar-inner{
  position: static !important;
  top: auto !important;
}

/* ===============================
   PATCH ADS: não vazar da página
=============================== */
body.single .banner-area,
body.single .banner-box-large,
body.single .ad-slot,
body.single .in-content-ad-container,
body.single .in-content-ad-box{
  width:100%;
  max-width:100%;
  overflow:hidden;
}

body.single .banner-box-large{
  display:block !important;
  text-align:center;
}

body.single ins.adsbygoogle{
  display:block !important;
  width:100% !important;
  max-width:100% !important;
}

body.single ins.adsbygoogle iframe{
  width:100% !important;
  max-width:100% !important;
}

body.single .banner-area *{
  max-width:100%;
}

/* garante estilo mesmo usando in-content-ad-container */
.in-content-ad-container{
  display:block;
  width:100%;
  max-width:100%;
  margin:48px 0;
  overflow:hidden;
}

.in-content-ad-container ins.adsbygoogle{
  display:block !important;
  width:100% !important;
  height:auto !important;
}

.in-content-ad-container iframe,
.in-content-ad-container ins.adsbygoogle iframe{
  max-width:100% !important;
  width:100% !important;
}

/* ===============================
   MÓDULO SPRINT 18: SCROLL INFINITO (AUTO-LOAD)
=============================== */
@media (min-width:901px){
  body.single:not(.reading-mode) .single-content{
    grid-column: 1;
  }
  body.single:not(.reading-mode) .single-sidebar{
    grid-column: 2;
    grid-row: 1;
  }
}

.op-infinite-loading {
  text-align: center;
  padding: 30px 0;
  font-weight: 600;
  font-size: 16px;
  color: var(--s-text-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.op-infinite-loading::before {
  content: "";
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: op-spin 0.8s linear infinite;
}

@keyframes op-spin {
  to { transform: rotate(360deg); }
}
