/*
Theme Name: Night Flow
Theme URI: https://thenightflowreport.com
Author: The Night Flow Report
Description: Tema proprio do The Night Flow Report. Sem page builder, sem jQuery, sem framework. Fontes autohospedadas, dois arquivos woff2, zero requisicao externa.
Version: 1.0
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
License: GPLv2 or later
Text Domain: nightflow
*/

/* ---------- Fontes autohospedadas. Variaveis, um arquivo por familia. ---------- */

@font-face {
  font-family: 'Source Serif 4';
  src: url('assets/fonts/source-serif-4-latin.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Source Sans 3';
  src: url('assets/fonts/source-sans-3-latin.woff2') format('woff2');
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  --midnight: #16273A;
  --midnight-soft: #24384F;
  --sage: #6E8460;
  --sage-deep: #55684A;
  --linen: #F6F2EA;
  --linen-warm: #EFE9DD;
  --amber: #C8862F;
  --amber-deep: #A96D20;
  --ink: #2A2F36;
  --ink-soft: #5A6169;
  --rule: #DDD5C6;

  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --measure: 68ch;
  --gutter: 20px;
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--linen);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 19px;
  line-height: 1.7;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a { color: var(--sage-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--midnight); }

::selection { background: var(--amber); color: #fff; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--midnight); color: var(--linen);
  padding: 12px 20px; z-index: 100;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

/* ---------- Header ---------- */

.site-header {
  background: var(--midnight);
  padding: 18px 0;
  border-bottom: 3px solid var(--sage);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}

.site-logo { display: block; flex: 0 0 auto; }
.site-logo svg, .site-logo img { width: 232px; max-width: 58vw; }

.site-logo-text {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: var(--linen); text-decoration: none;
}

.site-nav ul { display: flex; gap: 22px; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  color: var(--linen); text-decoration: none;
  font-size: 0.86rem; font-weight: 600;
  letter-spacing: 1.2px; text-transform: uppercase;
  display: block; padding: 12px 0; min-height: 44px; line-height: 20px;
}
.site-nav a:hover { color: var(--sage); }

/* ---------- Tipografia de conteudo ---------- */

.entry { padding: 44px 0 64px; }

.entry-title {
  font-family: var(--serif);
  font-size: clamp(2rem, 5.2vw, 2.9rem);
  font-weight: 600; line-height: 1.16;
  color: var(--midnight);
  margin: 0 0 18px;
  letter-spacing: -0.6px;
  max-width: 20ch;
}

.byline {
  font-size: 0.92rem; color: var(--ink-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 18px; margin-bottom: 30px;
}
.byline strong { color: var(--midnight); font-weight: 600; }
.byline a { color: var(--ink-soft); }

.entry-content { max-width: var(--measure); }

.entry-content p { margin: 0 0 1.35em; }

.entry-content h2 {
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3.6vw, 1.85rem);
  font-weight: 600; line-height: 1.28;
  color: var(--midnight);
  margin: 2.1em 0 0.6em;
  letter-spacing: -0.3px;
}

.entry-content h3 {
  font-family: var(--sans);
  font-size: 1.16rem; font-weight: 600;
  color: var(--midnight);
  margin: 1.8em 0 0.5em;
}

.entry-content ul, .entry-content ol { margin: 0 0 1.35em; padding-left: 1.3em; }
.entry-content li { margin-bottom: 0.5em; }

.entry-content strong { font-weight: 600; color: var(--midnight); }

.entry-content blockquote {
  margin: 1.8em 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--sage);
  font-style: normal; color: var(--ink-soft);
}

/* Primeiro paragrafo depois do H1: o bloco de resposta direta */
.answer-block {
  background: var(--linen-warm);
  border-left: 4px solid var(--sage);
  padding: 22px 24px;
  margin: 0 0 2em;
  font-size: 1.02em;
}
.answer-block p:last-child { margin-bottom: 0; }

/* ---------- Tabelas ---------- */

.entry-content figure.wp-block-table { margin: 1.9em 0; overflow-x: auto; }

.entry-content table {
  width: 100%; border-collapse: collapse;
  font-size: 0.94rem; line-height: 1.55;
}
.entry-content th {
  background: var(--midnight); color: var(--linen);
  text-align: left; font-weight: 600;
  padding: 12px 14px;
  font-size: 0.82rem; letter-spacing: 0.7px; text-transform: uppercase;
}
.entry-content td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
.entry-content tbody tr:nth-child(even) { background: rgba(255,255,255,0.55); }

/* ---------- CTA. Ambar aparece SO aqui. ---------- */

.entry-content a[rel~="sponsored"] {
  display: block;
  background: var(--amber);
  color: #fff;
  text-decoration: none;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  text-align: center;
  padding: 18px 26px;
  margin: 2em auto;
  min-height: 56px;
  border-radius: 3px;
  max-width: 520px;
  transition: background 0.15s ease;
}
.entry-content a[rel~="sponsored"]:hover { background: var(--amber-deep); color: #fff; }
.entry-content a[rel~="sponsored"] strong { color: #fff; font-weight: 600; }

/* Link de afiliado dentro de tabela volta a ser link normal */
.entry-content td a[rel~="sponsored"],
.entry-content th a[rel~="sponsored"] {
  display: inline; background: none; color: var(--sage-deep);
  padding: 0; margin: 0; min-height: 0; text-decoration: underline;
  font-size: inherit; text-align: left;
}

/* ---------- Imagem destacada ---------- */

.featured {
  margin: 0 0 30px;
  border-radius: 2px;
  overflow: hidden;
}
.featured img { width: 100%; }

/* ---------- Caixa do autor ---------- */

.author-box {
  margin: 3.5em 0 0;
  padding: 26px 24px;
  background: var(--linen-warm);
  border-top: 3px solid var(--midnight);
  font-size: 0.96rem;
  line-height: 1.65;
}
.author-box h2 {
  font-family: var(--sans); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--sage-deep); margin: 0 0 10px;
}
.author-box p { margin: 0 0 0.8em; }
.author-box p:last-child { margin-bottom: 0; }

.disclosure {
  margin-top: 2.5em;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.6;
  border-top: 1px solid var(--rule);
  padding-top: 18px;
}

/* ---------- Home ---------- */

.home-hero {
  background: var(--midnight);
  color: var(--linen);
  padding: 56px 0 52px;
}
.home-hero h1 {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 5.4vw, 2.7rem);
  font-weight: 600; line-height: 1.2;
  margin: 0 0 14px; max-width: 18ch;
  letter-spacing: -0.5px;
}
.home-hero p {
  font-size: 1.06rem; line-height: 1.6;
  color: rgba(246,242,234,0.78);
  margin: 0; max-width: 46ch;
}

.post-list { list-style: none; margin: 0; padding: 44px 0 64px; }
.post-list li { border-bottom: 1px solid var(--rule); padding: 26px 0; }
.post-list li:first-child { padding-top: 0; }
.post-list h2 {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 600;
  line-height: 1.3; margin: 0 0 8px;
}
.post-list h2 a { color: var(--midnight); text-decoration: none; }
.post-list h2 a:hover { color: var(--sage-deep); text-decoration: underline; }
.post-list .excerpt { margin: 0; color: var(--ink-soft); font-size: 0.98rem; line-height: 1.6; }
.post-list .meta { font-size: 0.82rem; color: var(--ink-soft); margin: 0 0 6px; letter-spacing: 0.4px; }

/* ---------- Footer ---------- */

.site-footer {
  background: var(--midnight);
  color: rgba(246,242,234,0.72);
  padding: 46px 0 40px;
  font-size: 0.92rem;
  line-height: 1.65;
}
.site-footer a { color: var(--linen); }
.site-footer .footer-logo { margin-bottom: 22px; }
.site-footer .footer-logo svg { width: 200px; }
.site-footer nav ul { list-style: none; margin: 0 0 20px; padding: 0; display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer nav a { font-size: 0.9rem; }
.site-footer .legal { font-size: 0.84rem; color: rgba(246,242,234,0.5); margin: 0; }

/* ---------- Mobile. O teste: uma mao so, no escuro, sem oculos. ---------- */

@media (max-width: 720px) {
  body { font-size: 18px; }
  :root { --gutter: 16px; }

  .header-inner { flex-direction: column; align-items: flex-start; gap: 4px; }
  .site-nav ul { gap: 18px; }
  .site-logo svg, .site-logo img { width: 200px; max-width: 72vw; }

  .entry { padding: 30px 0 48px; }
  .entry-title { max-width: none; }

  .entry-content h2 { margin-top: 1.8em; }

  .entry-content a[rel~="sponsored"] { max-width: none; padding: 20px 18px; }

  .entry-content table { font-size: 0.9rem; }
  .entry-content th, .entry-content td { padding: 10px 11px; }

  .home-hero { padding: 40px 0 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
