/*
Theme Name: Feed Escrevi (v30)
Author: Você
Version: 3.9
Description: Baseado no FeedJS 1.0 (o que funcionava) + botão único Ler com abertura inline do conteúdo no mesmo card.
*/

:root{--max:800px}
*{box-sizing:border-box;width: 100%;
    height: auto;}
body{margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;background:#f3f4f6;color:#111}
a{color:inherit}
.site-header{background:#111;color:#fff;padding:14px 16px}
.site-header .wrap {
    max-width: 800px;
    margin: 0 auto;
    padding: 5px;
}
.brand{font-weight:800;text-decoration:none}
.wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 5px;
}

#sentinel{height:48px}

.card {
    
    margin: 0 6px;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
    /* display: flex; */
    flex-direction: column;
}
.fig{margin:0}
.fig img{width:100%;height:100%;object-fit:contain;background:#000}

.card-head{padding:10px 12px}
.card-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 500;
}

.actions{display:flex;gap:8px;padding:8px;background:#fff;border-top:1px solid #eee}
.btn{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:8px;border-radius:999px;font:700 13px system-ui;border:1px solid #1877f2;background:#1877f2;color:#fff;cursor:pointer;text-decoration:none}
.btn:hover{filter:brightness(.97)}
.btn[aria-expanded="true"]{background:#111;border-color:#111}

.content{display:none;padding:12px;background:#fff;border-top:1px solid #eee}
.content.open{display:block}
.content img{max-width:100%;height:auto}
.content iframe,.content video{max-width:100%}
.content p{line-height:1.45}

#toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:#111;color:#fff;padding:8px 12px;border-radius:10px;font:600 12px system-ui;opacity:0;pointer-events:none;transition:opacity .2s;z-index:9999}

@media (max-width:600px){#feed{grid-template-columns:repeat(1,1fr)}
  .card-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    font-weight: 500;
}
}

/* AdSense inline */
.content ins.adsbygoogle{display:block;min-height:90px;margin:10px 0}

.card-link{
  color:#111;
  text-decoration:none;
}
.card-link:hover{
  text-decoration:underline;
}

.card-title-link{color:inherit;text-decoration:none}
.card-title-link:hover{text-decoration:underline}


/* AdSense sem espaços em branco: sem altura até renderizar */
ins.adsbygoogle{display:block;height:0;overflow:hidden;margin:0;padding:0}
ins.adsbygoogle[data-adsbygoogle-status="done"]{height:auto;overflow:visible;margin:10px 0;min-height:90px}


/* ===== Site Header (jornalístico / social) ===== */
.site-header{
  position:sticky;
  top:0;
  z-index:999;
  background:#ffffff;
  border-bottom:1px solid #e6e6e6;
  box-shadow:0 2px 6px rgba(0,0,0,.05);
}
.header-inner{
  max-width:1200px;
  margin:0 auto;
  padding:12px 16px;
  display:flex;
  flex-direction:column;
  gap:4px;
}
.brand a{
  font-size:22px;
  font-weight:800;
  text-decoration:none;
  color:#111;
}
.tagline{
  font-size:13px;
  color:#666;
}

/* ===== AdSense topo ===== */
.feed-top-ad{
  max-width:1200px;
  margin:10px auto 0 auto;
  padding:0 16px;
}
.feed-top-ad ins.adsbygoogle[data-adsbygoogle-status="done"]{
  height:auto;
  margin:10px 0;
}

/* Mobile header */
@media(max-width:600px){
  .brand a{font-size:20px}
}


/* ===== Layout Wrapper ===== */
.wrap {
    max-width: 600px;
    margin: 0 auto;
    padding: 5px;
}


/* ===== Logo ===== */
.brand-logo img{
  height:42px;
  width:auto;
  display:block;
}


@media(min-width:900px){
  
}





/* ===== Imagens dentro das matérias ===== */
.post-content img,
.entry-content img{
  width: 100%;
  height: auto;
}




/* Desktop: várias colunas, alturas independentes */
@media (min-width: 900px){
  #feed{ column-count: 1; }
}
@media (min-width: 700px) and (max-width: 899px){
  #feed{ column-count: 1; }
}
@media (min-width: 520px) and (max-width: 699px){
  #feed{ column-count: 1; }
}

/* Mobile: 1 coluna (seu pedido anterior) */
@media (max-width: 519px){
  #feed{ column-count: 1; }
}



/* ===== Card largura mínima ===== */
.card{
  min-width:300px;
}


/* ===== Leitor flutuante estilo anúncio ===== */
.reader-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  z-index:99999;
  display:none;
}
.reader-overlay.open{display:block}

.reader-box{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  width:min(680px,95%);
  background:#fff;
  border-radius:16px;
  box-shadow:0 20px 40px rgba(0,0,0,.35);
  overflow:hidden;
}

.reader-header{
  padding:12px 16px;
  font-weight:700;
  border-bottom:1px solid #eee;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

.reader-body{
  max-height:70vh;
  overflow:auto;
  padding:16px;
}
.reader-close{
  background:#f1f1f1;
  border:none;
  border-radius:999px;
  padding:6px 14px;
  font-weight:600;
  cursor:pointer;
}


/* ===== Feed estilo Pinterest (masonry) com cards min-width 300 ===== */
#feed{
  column-width: 320px; /* ~ min-width 300 + gap */
  column-gap: 16px;
}
#feed > *{
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 6px 0 6px 0;
  width: 100%;
}
#feed .card{
  display: inline-block;
  width: 100%;
  min-width: 300px;
}

/* Mobile: 1 coluna */
@media (max-width: 600px){
  #feed{ column-width: auto; column-count: 1; }
  #feed .card{ min-width: 0; }
}


/* ===== Leitor flutuante (overlay estilo anúncio/rede social) ===== */
#reader-modal{position:fixed;inset:0;z-index:99999;display:none}
#reader-modal.open{display:block}
#reader-modal .rm-backdrop{
  position:absolute;inset:0;
  background:rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
}

#reader-modal .rm-topbar{
  display:flex;align-items:center;justify-content:space-between;
  padding:12px 14px;border-bottom:1px solid #eee;background:#fff;
}
#reader-modal .rm-title{
  font-weight:800;font-size:14px;color:#111;
  line-height:1.2;max-width:calc(100% - 90px);
  overflow:hidden;white-space:nowrap;text-overflow:ellipsis;
}
#reader-modal .rm-close{
  border:0;background:#f3f4f6;color:#111; width: 40px;
  border-radius:999px;padding:8px 14px;font-weight:800;cursor:pointer;
}
#reader-modal .rm-body{flex:1;padding:14px;overflow:auto;-webkit-overflow-scrolling:touch;font-size:16px;line-height:1.6;color:#111}
#reader-modal .rm-body img{width:100%;height:auto}
html.rm-lock, body.rm-lock{overflow:hidden}


/* ===== Modal Reader: regra única para TODOS os tamanhos ===== */
#reader-modal .rm-sheet {
    position: absolute;
    left: 50%;
    top: 20px;
    bottom: 20px;
    transform: translateX(-50%);
    width: min(900px, 92vw);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
