/* =====================================================================
   TGF — Portal de notícias
   Camada carregada DEPOIS de style.css (css.php do tema).
   Referências: g1.globo.com, botafogo.org.br/noticias, araras.org/noticias.

   Escala de espaçamento (4px): 4 8 12 16 20 24 32 40 48.
   Nada de valor solto — todo respiro sai de --s-*.
   R5: cores de var(--color-1..5) (tb_project); fallback = verde TGF.
   ===================================================================== */
:root {
  --tgf-ink:      #12151a;
  --tgf-ink-2:    #39414d;
  --tgf-muted:    #6b7280;
  --tgf-line:     #e6e8eb;
  --tgf-line-2:   #d3d7dd;
  --tgf-bg:       #ffffff;
  --tgf-bg-soft:  #f5f6f7;
  --tgf-accent:   var(--color-1, #74913a);
  --tgf-accent-d: var(--color-3, #5a7329);
  --tgf-max:      1220px;

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px;

  --rail: 320px;          /* largura da coluna lateral */
  --gutter: var(--s-10);  /* vão entre corpo e lateral */
}

body.tgf-portal { background: var(--tgf-bg); color: var(--tgf-ink); }

/* O drawer fechado fica em position:fixed com translateX(100%), ou seja,
   320px ALEM da borda direita — isso cria rolagem horizontal e cortava a
   pagina inteira no mobile. `clip` resolve sem virar contexto de rolagem
   (ao contrario de `hidden`, que quebraria o position:sticky do header). */
html:has(body.tgf-portal) { overflow-x: clip; }
body.tgf-portal { overflow-x: clip; max-width: 100%; }

/* O template Litho (lib.2lab.com.br/.../litho/css/style.css) aplica
   `section { padding: 130px 0; overflow: hidden }` a TODA tag <section>
   — era a origem dos vaos brancos gigantes entre os blocos. Zerado so
   dentro do portal; as outras paginas do tema seguem com o Litho. */
.tgf-pagina section, .tgf-corpo section, .tgf-trilho section { padding: 0; overflow: visible; }

.tgf-wrap { max-width: var(--tgf-max); margin: 0 auto; padding: 0 var(--s-5); }
.tgf-portal a { text-decoration: none; color: inherit; }
.tgf-portal img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* =====================================================================
   1. CABEÇALHO
   ===================================================================== */
.tgf-top { background: var(--tgf-ink); color: #fff; font-size: 12px; }
.tgf-top .tgf-wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); height: 32px;
}
.tgf-top .data { text-transform: capitalize; opacity: .7; }
.tgf-top nav { display: flex; gap: var(--s-4); }
.tgf-top nav a { opacity: .78; }
.tgf-top nav a:hover { opacity: 1; }

.tgf-head { background: #fff; border-bottom: 1px solid var(--tgf-line); position: sticky; top: 0; z-index: 900; }
.tgf-head .tgf-wrap { display: flex; align-items: center; gap: var(--s-6); height: 68px; }
.tgf-head .marca { flex-shrink: 0; }
.tgf-head .marca img { width: auto; height: 38px; object-fit: contain; }

.tgf-busca { margin-left: auto; position: relative; width: min(320px, 38vw); }
.tgf-busca input {
  width: 100%; height: 38px; border: 1px solid var(--tgf-line-2); border-radius: 999px;
  padding: 0 var(--s-10) 0 var(--s-4); font: inherit; font-size: 14px;
  background: var(--tgf-bg-soft); color: var(--tgf-ink);
}
.tgf-busca input:focus { outline: 2px solid var(--tgf-accent); outline-offset: -1px; background: #fff; }
.tgf-busca button {
  position: absolute; right: 4px; top: 4px; width: 30px; height: 30px; border: 0;
  border-radius: 999px; background: var(--tgf-accent); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.tgf-busca svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; }

.tgf-burger { display: none; background: none; border: 0; cursor: pointer; padding: var(--s-2); color: var(--tgf-ink); }
.tgf-burger span { display: block; width: 21px; height: 2px; background: currentColor; border-radius: 2px; }
.tgf-burger span + span { margin-top: 5px; }

.tgf-editorias { background: #fff; border-bottom: 2px solid var(--tgf-ink); }
.tgf-editorias .tgf-wrap { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; }
.tgf-editorias .tgf-wrap::-webkit-scrollbar { display: none; }
.tgf-editorias a {
  padding: var(--s-3) var(--s-3); font-size: 13.5px; font-weight: 700; white-space: nowrap;
  color: var(--tgf-ink-2); border-bottom: 3px solid transparent; margin-bottom: -2px;
}
.tgf-editorias a:hover { color: var(--tgf-ink); }
.tgf-editorias a.on { color: var(--tgf-accent-d); border-bottom-color: var(--tgf-accent); }

/* =====================================================================
   2. ÁTOMOS
   ===================================================================== */
.tgf-rotulo {
  display: block; font-size: 11px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--tgf-accent-d); margin-bottom: var(--s-2);
}
.tgf-meta {
  display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap;
  font-size: 12.5px; color: var(--tgf-muted); margin-top: var(--s-2);
}
.tgf-meta .ponto { width: 3px; height: 3px; border-radius: 50%; background: var(--tgf-line-2); flex: none; }

.tgf-foto { position: relative; overflow: hidden; background: var(--tgf-bg-soft); border-radius: 4px; }
.tgf-foto::before { content: ""; display: block; padding-top: 56.25%; }
.tgf-foto img { position: absolute; inset: 0; transition: transform .4s cubic-bezier(.2,.6,.2,1); }
a:hover > .tgf-foto img, .tgf-card:hover .tgf-foto img { transform: scale(1.035); }

.tgf-titulo-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* =====================================================================
   3. GRADE DA PÁGINA — corpo + trilho lateral contínuos
   Tudo (inclusive a manchete) vive nas duas colunas, então nenhuma
   delas "termina antes" e abre buraco branco.
   ===================================================================== */
.tgf-pagina {
  display: grid; grid-template-columns: minmax(0, 1fr) var(--rail);
  gap: var(--gutter); align-items: start; padding-top: var(--s-6);
}
.tgf-corpo { min-width: 0; }
.tgf-trilho { min-width: 0; display: flex; flex-direction: column; gap: var(--s-6); }

/* ---------- manchete ---------- */
.tgf-manchete { padding-bottom: var(--s-6); border-bottom: 1px solid var(--tgf-line); }
.tgf-manchete .tgf-foto::before { padding-top: 52%; }
.tgf-manchete h2 {
  font-size: clamp(27px, 3vw, 38px); line-height: 1.1; letter-spacing: -.021em;
  margin: var(--s-3) 0 0; font-weight: 800;
}
.tgf-manchete h2 a:hover { color: var(--tgf-accent-d); }
.tgf-manchete .resumo {
  margin: var(--s-3) 0 0; font-size: 16px; line-height: 1.5; color: var(--tgf-ink-2); max-width: 62ch;
}
.tgf-manchete .tgf-rotulo { margin-top: var(--s-3); }

/* ---------- chamadas do trilho ---------- */
.tgf-mini { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.tgf-mini h3 { margin: 0; font-size: 15px; line-height: 1.3; font-weight: 700; }
.tgf-mini h3 a:hover { color: var(--tgf-accent-d); }
.tgf-mini .tgf-rotulo { margin-bottom: var(--s-1); font-size: 10.5px; }
.tgf-mini .tgf-meta { margin-top: var(--s-1); }
.tgf-lista-mini { display: flex; flex-direction: column; gap: var(--s-4); }
.tgf-lista-mini .tgf-mini + .tgf-mini { border-top: 1px solid var(--tgf-line); padding-top: var(--s-4); }

/* ---------- título de seção ---------- */
.tgf-secao {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  margin: var(--s-8) 0 var(--s-4); padding-bottom: var(--s-2);
  border-bottom: 2px solid var(--tgf-ink);
}
.tgf-secao:first-child { margin-top: 0; }
.tgf-secao h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -.012em; display: flex; align-items: center; gap: var(--s-2); }
.tgf-secao h2::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--tgf-accent); }
.tgf-secao .todas { font-size: 12.5px; font-weight: 700; color: var(--tgf-accent-d); white-space: nowrap; }
.tgf-secao .todas:hover { text-decoration: underline; }

/* ---------- linha do tempo ---------- */
.tgf-fluxo .linha {
  display: grid; grid-template-columns: 58px minmax(0, 1fr) 104px;
  gap: var(--s-4); align-items: start; padding: var(--s-3) 0;
  border-bottom: 1px solid var(--tgf-line);
}
.tgf-fluxo .linha:first-child { padding-top: 0; }
.tgf-fluxo .hora { font-size: 12.5px; font-weight: 800; color: var(--tgf-accent-d); padding-top: 1px; }
.tgf-fluxo h3 { margin: 0; font-size: 15.5px; line-height: 1.32; font-weight: 700; }
.tgf-fluxo h3 a:hover { color: var(--tgf-accent-d); }
.tgf-fluxo .tgf-rotulo { margin-bottom: var(--s-1); font-size: 10.5px; }

/* ---------- bloco de editoria ---------- */
.tgf-editoria { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--s-6) var(--s-8); }
.tgf-editoria .destaque h3 { margin: var(--s-3) 0 0; font-size: 20px; line-height: 1.22; font-weight: 800; }
.tgf-editoria .destaque h3 a:hover { color: var(--tgf-accent-d); }
.tgf-editoria .lista { display: flex; flex-direction: column; }
.tgf-editoria .lista .item { padding: var(--s-3) 0; border-bottom: 1px solid var(--tgf-line); }
.tgf-editoria .lista .item:first-child { padding-top: 0; }
.tgf-editoria .lista .item:last-child { border-bottom: 0; padding-bottom: 0; }
.tgf-editoria .lista h3 { margin: 0; font-size: 15px; line-height: 1.33; font-weight: 700; }
.tgf-editoria .lista h3 a:hover { color: var(--tgf-accent-d); }

/* ---------- grade de cards ---------- */
.tgf-grade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-8) var(--s-6); }
.tgf-card { display: flex; flex-direction: column; min-width: 0; }
.tgf-card .tgf-foto { margin-bottom: var(--s-3); }
.tgf-card h3 { margin: 0; font-size: 16px; line-height: 1.3; font-weight: 700; }
.tgf-card h3 a:hover { color: var(--tgf-accent-d); }
.tgf-card .resumo {
  margin: var(--s-2) 0 0; font-size: 13.5px; line-height: 1.5; color: var(--tgf-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- blocos do trilho ---------- */
.tgf-bloco { border: 1px solid var(--tgf-line); border-radius: 8px; padding: var(--s-4); background: #fff; }
.tgf-bloco h3 {
  margin: 0 0 var(--s-3); font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .07em; display: flex; align-items: center; gap: var(--s-2);
}
.tgf-bloco h3::before { content: ""; width: 4px; height: 14px; background: var(--tgf-accent); border-radius: 2px; }
.tgf-maislidas { list-style: none; margin: 0; padding: 0; counter-reset: ml; }
.tgf-maislidas li {
  counter-increment: ml; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: var(--s-3);
  padding: var(--s-3) 0; border-top: 1px solid var(--tgf-line);
}
.tgf-maislidas li:first-child { border-top: 0; padding-top: 0; }
.tgf-maislidas li::before { content: counter(ml); font-size: 18px; font-weight: 800; line-height: 1.1; color: var(--tgf-accent); opacity: .5; }
.tgf-maislidas a { font-size: 14px; line-height: 1.32; font-weight: 600; }
.tgf-maislidas a:hover { color: var(--tgf-accent-d); }
.tgf-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tgf-chips a {
  font-size: 12.5px; font-weight: 700; padding: 6px var(--s-3); border-radius: 999px;
  background: var(--tgf-bg-soft); color: var(--tgf-ink-2); border: 1px solid var(--tgf-line);
}
.tgf-chips a:hover { background: var(--tgf-accent); color: #fff; border-color: var(--tgf-accent); }

.tgf-sentinela { padding: var(--s-6) 0 0; text-align: center; color: var(--tgf-muted); font-size: 13.5px; }

/* =====================================================================
   4. RODAPÉ
   ===================================================================== */
.tgf-rodape { background: var(--tgf-ink); color: #fff; margin-top: var(--s-12); padding: var(--s-10) 0 var(--s-6); }
.tgf-rodape .grade { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: var(--s-8); }
.tgf-rodape img.marca { width: auto; height: 46px; object-fit: contain; }
.tgf-rodape p { margin: var(--s-4) 0 0; font-size: 13.5px; line-height: 1.6; color: rgba(255,255,255,.6); max-width: 360px; }
.tgf-rodape h4 { margin: 0 0 var(--s-3); font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.tgf-rodape ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.tgf-rodape ul a { font-size: 13.5px; color: rgba(255,255,255,.6); }
.tgf-rodape ul a:hover { color: #fff; }
.tgf-rodape .base {
  margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid rgba(255,255,255,.12);
  display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  font-size: 12.5px; color: rgba(255,255,255,.5);
}

/* =====================================================================
   5. MENU LATERAL (mobile)
   ===================================================================== */
.tgf-drawer {
  position: fixed; inset: 0 0 0 auto; width: min(320px, 86vw); background: #fff; z-index: 1000;
  transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1);
  padding: var(--s-12) var(--s-6) var(--s-8); overflow-y: auto;
}
.tgf-drawer { visibility: hidden; }
.tgf-drawer.on { transform: translateX(0); visibility: visible; }
.tgf-drawer a { display: block; padding: var(--s-3) 0; font-weight: 700; font-size: 16.5px; border-bottom: 1px solid var(--tgf-line); }
.tgf-drawer .fechar { position: absolute; top: var(--s-4); right: var(--s-4); background: none; border: 0; font-size: 28px; line-height: 1; cursor: pointer; }
.tgf-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 999; display: none; }
.tgf-scrim.on { display: block; }

/* =====================================================================
   6. BARRA DE APLICATIVO (só no mobile)
   ===================================================================== */
.tgf-tabbar { display: none; }

/* =====================================================================
   7. RESPONSIVO
   ===================================================================== */
@media (max-width: 1100px) {
  :root { --rail: 280px; --gutter: var(--s-8); }
  .tgf-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .tgf-pagina { grid-template-columns: minmax(0, 1fr); gap: var(--s-8); }
  .tgf-editoria { grid-template-columns: minmax(0, 1fr); gap: var(--s-4); }
  .tgf-editoria .destaque h3 { font-size: 19px; }
  .tgf-rodape .grade { grid-template-columns: 1fr 1fr; }
}

/* ---------- experiência de app ---------- */
@media (max-width: 680px) {
  .tgf-top { display: none; }

  .tgf-head .tgf-wrap { height: 56px; gap: var(--s-3); }
  .tgf-head .marca img { height: 30px; }
  .tgf-busca { display: none; }
  .tgf-burger { display: block; margin-left: auto; }

  /* editorias viram chips roláveis, no padrão de app */
  .tgf-editorias { border-bottom: 1px solid var(--tgf-line); position: sticky; top: 56px; z-index: 890; }
  .tgf-editorias .tgf-wrap { gap: var(--s-2); padding: var(--s-2) var(--s-4) var(--s-3); }
  .tgf-editorias a {
    padding: 9px var(--s-3); border: 1px solid var(--tgf-line); border-radius: 10px;
    background: #fff; font-size: 13px; min-height: 38px; display: flex; align-items: center;
    border-bottom-width: 1px; margin-bottom: 0;
  }
  .tgf-editorias a.on { background: var(--tgf-accent); border-color: var(--tgf-accent); color: #fff; }

  .tgf-wrap { padding: 0 var(--s-4); }
  .tgf-pagina { padding-top: var(--s-4); gap: var(--s-6); }

  /* manchete em cartão de app */
  .tgf-manchete .tgf-foto { border-radius: 10px; }
  .tgf-manchete h2 { font-size: 24px; line-height: 1.15; }
  .tgf-manchete .resumo { font-size: 15px; }

  /* miniaturas maiores, alvo de toque confortável */
  .tgf-mini { grid-template-columns: 104px minmax(0, 1fr); gap: var(--s-3); }
  .tgf-mini h3 { font-size: 15.5px; }
  .tgf-lista-mini { gap: var(--s-4); }

  .tgf-secao { margin: var(--s-6) 0 var(--s-3); }
  .tgf-secao h2 { font-size: 17px; }

  .tgf-fluxo .linha { grid-template-columns: minmax(0, 1fr) 96px; gap: var(--s-3); padding: var(--s-4) 0; }
  .tgf-fluxo .hora {
    grid-column: 1; grid-row: 1; font-size: 11.5px; margin-bottom: 2px;
  }
  .tgf-fluxo .linha > div { grid-column: 1; grid-row: 2; }
  .tgf-fluxo .linha > a { grid-column: 2; grid-row: 1 / span 2; align-self: center; }

  .tgf-grade { grid-template-columns: minmax(0, 1fr); gap: var(--s-6); }
  .tgf-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: var(--s-3); align-items: start; }
  .tgf-card .tgf-foto { margin-bottom: 0; border-radius: 8px; }
  .tgf-card h3 { font-size: 15.5px; }
  .tgf-card .resumo { display: none; }

  .tgf-bloco { border-radius: 10px; }
  .tgf-rodape { margin-top: var(--s-8); padding-bottom: var(--s-4); }
  .tgf-rodape .grade { grid-template-columns: 1fr; gap: var(--s-6); }

  /* barra de abas fixa — padrão araras.org/noticias */
  .tgf-tabbar {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 950;
    background: rgba(255,255,255,.96); backdrop-filter: saturate(180%) blur(12px);
    border-top: 1px solid var(--tgf-line);
    padding: var(--s-1) max(var(--s-1), env(safe-area-inset-right))
             calc(var(--s-1) + env(safe-area-inset-bottom)) max(var(--s-1), env(safe-area-inset-left));
  }
  .tgf-tabbar a {
    min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: 10.5px; font-weight: 700; color: var(--tgf-muted); border-radius: 12px;
  }
  .tgf-tabbar .ic { width: 44px; height: 26px; display: grid; place-items: center; border-radius: 9px; }
  .tgf-tabbar svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; }
  .tgf-tabbar a.on { color: var(--tgf-accent-d); }
  .tgf-tabbar a.on .ic { background: color-mix(in srgb, var(--tgf-accent) 16%, #fff); }
  body.tgf-portal { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .tgf-mini { grid-template-columns: 88px minmax(0, 1fr); }
  .tgf-card { grid-template-columns: 100px minmax(0, 1fr); }
  .tgf-manchete h2 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .tgf-foto img, .tgf-drawer { transition: none; }
}
