/*
Theme Name: Flux Blog
Theme URI: https://github.com/ga-almeida/flux-studio
Author: Flux Studio
Description: Tema dos blogs dos canais do Flux Studio: página inicial com o vídeo mais novo, abas por assunto, post com o vídeo na capa, índice ao lado e perguntas frequentes. As cores, as abas e os links do canal são configurados pelo Flux Studio (Perfil do canal → Blog → Configurar o site).
Version: 1.0.0
Requires at least: 6.3
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: flux-blog
*/

/* Cores padrão (as do Wild Kingdom Uncovered: pôr do sol sobre preto); o Studio troca pelas do canal. */
:root {
  --ink: #141210;
  --ink-2: #2a2622;
  --sunset: #f28c1b;
  --amber: #ffb627;
  --ember: #e0521d;
  --sand: #fbf7f1;
  --sand-2: #f3ebdf;
  --card: #ffffff;
  --text: #2b2724;
  --muted: #7a7068;
  --line: #ebe3d7;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(40, 25, 10, 0.08);
  --head: 'Poppins', system-ui, sans-serif;
  --body: 'Nunito Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--sand); color: var(--text); font-family: var(--body); font-size: 17px; line-height: 1.7; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
.wrap { width: min(1200px, calc(100% - 40px)); margin: 0 auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.skip-link:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 100; background: #fff; padding: 10px 14px; border-radius: 10px; }

/* Topo */
.topbar { background: var(--ink); color: #f5e9d8; font-size: 13.5px; text-align: center; padding: 8px 16px; }
.topbar b, .topbar strong { color: var(--amber); }
.topbar .pulse { display: inline-block; vertical-align: middle; margin: -2px 10px 0 0; }
.ic { width: 16px; height: 16px; flex-shrink: 0; }
.search .ic { width: 18px; height: 18px; color: var(--ink); }
.btn .ic { width: 14px; height: 14px; }
/* A bolinha laranja que pulsa (selo "New this week" e faixa do topo). */
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--sunset); box-shadow: 0 0 10px var(--sunset); flex-shrink: 0; }
.pulse::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--sunset); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { from { transform: scale(0.6); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse::after { animation: none; } html { scroll-behavior: auto; } }
.header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.admin-bar .header { top: 32px; }
.header .wrap { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.brand strong { font-family: var(--head); font-weight: 800; font-size: 17px; line-height: 1.05; letter-spacing: 0.2px; color: var(--ink); text-transform: uppercase; }
.brand strong small { display: block; font-size: 10.5px; letter-spacing: 3px; color: var(--sunset); font-weight: 700; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tabs a { font-family: var(--head); font-weight: 600; font-size: 14.5px; padding: 8px 13px; border-radius: 999px; color: var(--ink-2); white-space: nowrap; }
.tabs a:hover { background: var(--sand-2); }
.tabs a.on { background: var(--ink); color: #fff; }
.search { display: grid; place-items: center; width: 42px; height: 42px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; background: #fff; cursor: pointer; padding: 0; }
.search[aria-expanded='true'] { border-color: var(--sunset); }
.search-pop { border-top: 1px solid var(--line); background: #fff; }
.search-pop .wrap { display: flex; gap: 10px; padding: 14px 0; min-height: 0; }
.search-pop input, .search-form input { flex: 1; font: inherit; font-size: 16px; padding: 10px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--sand); color: var(--text); }
.search-pop input:focus, .search-form input:focus { outline: 2px solid var(--sunset); outline-offset: 1px; }
.search-form { display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--head); font-weight: 700; font-size: 14.5px; border-radius: 999px; padding: 11px 20px; border: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-sun { background: linear-gradient(135deg, var(--amber), var(--sunset) 55%, var(--ember)) border-box; border: 0; padding: 13px 22px; color: #1b0f05; box-shadow: 0 8px 20px rgba(242, 140, 27, 0.35); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; border: 0; padding: 12px 22px; }

/* Destaque (o post mais novo) */
.hero { position: relative; overflow: hidden; background: radial-gradient(1200px 500px at 85% 30%, rgba(242, 140, 27, 0.35), transparent 60%), radial-gradient(800px 400px at 10% 110%, rgba(224, 82, 29, 0.25), transparent 60%), var(--ink); color: #fff; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center; padding: 72px 0 84px; }
.pill { display: inline-block; font-family: var(--head); font-weight: 700; font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ember); background: #fff1e3; padding: 5px 12px; border-radius: 999px; line-height: 1.5; }
.hero .pill { background: rgba(255, 182, 39, 0.16); color: var(--amber); }
.hero h1 { font-family: var(--head); font-weight: 800; font-size: clamp(34px, 4.4vw, 54px); line-height: 1.08; margin: 18px 0 16px; letter-spacing: -0.5px; }
.hero p { color: #e8dccb; font-size: 18px; margin: 0 0 28px; max-width: 560px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-media { position: relative; }
.hero-media .frame { position: relative; display: block; border-radius: 24px; overflow: hidden; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08); }
.hero-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.live { position: absolute; top: 16px; left: 16px; display: inline-flex; align-items: center; gap: 10px; padding: 7px 14px 7px 13px; border-radius: 999px; background: rgba(20, 18, 16, 0.6); backdrop-filter: blur(10px) saturate(1.4); border: 1px solid rgba(255, 255, 255, 0.16); color: #fff; font-family: var(--head); font-weight: 700; font-size: 12.5px; letter-spacing: 0.3px; }
.hero-meta { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding-left: 4px; color: #d9cbb8; font-family: var(--head); font-weight: 600; font-size: 14px; }
.hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.hero-meta .ic { width: 18px; height: 18px; color: var(--amber); }
.hero-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, 0.3); }
.play { position: absolute; inset: 0; display: grid; place-items: center; background: none; border: 0; padding: 0; cursor: pointer; }
.play span { width: 78px; height: 78px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35); transition: transform 0.2s; }
.play:hover span { transform: scale(1.06); }
.play span::after { content: ''; border-left: 22px solid var(--ember); border-top: 14px solid transparent; border-bottom: 14px solid transparent; margin-left: 6px; }

/* Seções */
.section { padding: 72px 0 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.eyebrow { font-family: var(--head); font-weight: 700; font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase; color: var(--sunset); }
.section-head h2 { font-family: var(--head); font-weight: 800; font-size: clamp(26px, 3vw, 34px); color: var(--ink); margin: 6px 0 0; line-height: 1.15; }
.more { font-family: var(--head); font-weight: 700; font-size: 14px; color: var(--ember); }

/* Assuntos */
.topics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.topic { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 5; color: #fff; box-shadow: var(--shadow); background: linear-gradient(160deg, var(--ink-2), var(--ink)); }
.topic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.topic:hover img { transform: scale(1.05); }
.topic::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(20, 18, 16, 0.92)); }
.topic div { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; }
.topic b { display: block; font-family: var(--head); font-weight: 800; font-size: 19px; line-height: 1.15; }
.topic small { color: var(--amber); font-weight: 700; font-size: 13px; }

/* Cards de post */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform 0.2s; }
.card:hover { transform: translateY(-4px); }
.card img, .card .blank, .hero-media .blank { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.card .blank, .hero-media .blank { background: radial-gradient(300px 160px at 80% 0%, rgba(242, 140, 27, 0.4), transparent 70%), var(--ink); }
.card .body { padding: 18px 20px 22px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; flex: 1; }
.card h3 { font-family: var(--head); font-weight: 700; font-size: 19px; line-height: 1.3; margin: 0; color: var(--ink); }
.card p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.meta { margin-top: auto; color: var(--muted); font-size: 13px; display: flex; gap: 8px; align-items: center; }
.meta .dot { width: 4px; height: 4px; background: #c9bfb2; border-radius: 50%; }
.pagination { display: flex; justify-content: center; gap: 8px; margin: 40px 0 0; flex-wrap: wrap; }
.pagination .page-numbers { font-family: var(--head); font-weight: 700; font-size: 14.5px; min-width: 42px; height: 42px; padding: 0 14px; display: grid; place-items: center; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.pagination .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* Faixa do canal */
.band { margin: 80px 0 0; background: radial-gradient(700px 300px at 80% 0%, rgba(242, 140, 27, 0.4), transparent 70%), var(--ink); color: #fff; }
.band .wrap { display: flex; align-items: center; gap: 28px; padding: 46px 0; flex-wrap: wrap; }
.band img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; }
.band div { flex: 1; min-width: 240px; }
.band h3 { font-family: var(--head); font-weight: 800; font-size: 28px; margin: 0 0 6px; }
.band p { margin: 0; color: #e8dccb; }

/* Rodapé */
.footer { background: #0d0c0b; color: #bdb2a5; font-size: 14.5px; }
.footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 56px 0 30px; }
.footer .brand strong { color: #fff; }
.footer h4 { font-family: var(--head); color: #fff; font-size: 15px; margin: 0 0 12px; }
.footer a { display: block; padding: 3px 0; }
.footer a:hover { color: var(--amber); }
.footer .legal { border-top: 1px solid #262320; text-align: center; padding: 18px 0; font-size: 13px; color: #8a8076; }

/* Página do post */
.crumbs { font-size: 13.5px; color: var(--muted); padding-top: 34px; text-align: center; }
.crumbs a { color: var(--ember); font-weight: 700; }
.post-head { max-width: 860px; margin: 0 auto; text-align: center; padding: 18px 0 30px; }
.post-head h1 { font-family: var(--head); font-weight: 800; font-size: clamp(32px, 4.2vw, 50px); line-height: 1.12; color: var(--ink); margin: 16px 0; letter-spacing: -0.4px; }
.post-head .lede { color: var(--muted); font-size: 19px; margin: 0 auto 22px; max-width: 720px; }
.byline { display: inline-flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); text-align: left; line-height: 1.5; }
.byline img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.byline b { color: var(--ink); font-family: var(--head); }
.cover { position: relative; max-width: 1100px; margin: 0 auto; border-radius: 26px; overflow: hidden; box-shadow: var(--shadow); background: var(--ink); }
.cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cover iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; max-width: 1100px; margin: 50px auto 0; }
.layout.solo { grid-template-columns: minmax(0, 820px); justify-content: center; }
.article { background: var(--card); border-radius: 24px; padding: 44px 52px; box-shadow: var(--shadow); min-width: 0; }
.article > :first-child { margin-top: 0; }
.article h2 { font-family: var(--head); font-weight: 800; font-size: 28px; line-height: 1.25; color: var(--ink); margin: 46px 0 14px; scroll-margin-top: 100px; }
.article h3 { font-family: var(--head); font-weight: 700; font-size: 19px; color: var(--ink); margin: 26px 0 8px; }
.article p { margin: 0 0 18px; }
.article figure { margin: 26px 0; }
.article .wp-block-image img { border-radius: 16px; margin: 0 auto; }
.article figcaption { font-size: 13.5px; color: var(--muted); text-align: center; margin-top: 8px; }
.article .wp-block-embed iframe { width: 100%; border-radius: 16px; }
.article table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; font-size: 15.5px; }
.article td, .article th { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.article tr:nth-child(odd) td { background: #fdf9f3; }
.article tr:last-child td { border-bottom: 0; }
.article td:first-child { width: 42%; color: var(--ink); }
.article ul, .article ol { padding-left: 20px; }
.article a { color: var(--ember); font-weight: 600; }
.article blockquote { margin: 26px 0; padding: 4px 0 4px 20px; border-left: 4px solid var(--sunset); color: var(--ink-2); font-style: italic; }
/* Perguntas frequentes (blocos "Detalhes" do WordPress): abrem e fecham. */
.article details { border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin: 10px 0; background: #fffdf9; }
.article summary { cursor: pointer; font-family: var(--head); font-weight: 700; color: var(--ink); }
.article details[open] summary { color: var(--ember); }
.article details > :not(summary) { margin: 10px 0 0; }
.aside { display: flex; flex-direction: column; gap: 20px; }
.aside .box { background: var(--card); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); }
.aside .sticky { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 20px; }
.aside h4 { font-family: var(--head); font-weight: 800; font-size: 15px; margin: 0 0 12px; color: var(--ink); text-transform: uppercase; letter-spacing: 1.2px; }
.toc a { display: block; font-size: 14.5px; padding: 7px 0 7px 12px; border-left: 3px solid var(--line); color: var(--ink-2); line-height: 1.4; }
.toc a:hover, .toc a.on { border-left-color: var(--sunset); color: var(--ink); font-weight: 700; }
.sub { text-align: center; background: radial-gradient(400px 200px at 50% 0%, rgba(242, 140, 27, 0.35), transparent 70%), var(--ink) !important; color: #fff; }
.sub img { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 10px; object-fit: cover; }
.aside .sub h4 { color: #fff; }
.sub p { color: #e8dccb; font-size: 14.5px; margin: 6px 0 16px; line-height: 1.5; }
.related { max-width: 1100px; margin: 70px auto 0; }

/* Página de aba, busca e páginas soltas */
.tab-hero { background: radial-gradient(900px 360px at 85% 0%, rgba(242, 140, 27, 0.32), transparent 65%), var(--ink); color: #fff; text-align: center; }
.tab-hero .wrap { padding: 8px 0 44px; }
.tab-hero .crumbs { color: #b9ab9a; }
.tab-hero .crumbs a { color: var(--amber); }
.tab-hero h1 { font-family: var(--head); font-weight: 800; font-size: clamp(34px, 4.6vw, 56px); margin: 14px 0 10px; letter-spacing: -0.5px; line-height: 1.1; }
.tab-hero p { color: #e8dccb; font-size: 18px; max-width: 640px; margin: 0 auto 26px; }
.tab-hero .search-form input { background: rgba(255, 255, 255, 0.95); }
.chips { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.chip { font-family: var(--head); font-weight: 700; font-size: 14px; padding: 9px 18px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.28); background: transparent; color: #fff; cursor: pointer; }
.chip:hover { border-color: var(--amber); }
.chip.on { background: linear-gradient(135deg, var(--amber), var(--sunset)) border-box; border-color: transparent; color: #1b0f05; }
.page-body { max-width: 820px; margin: 46px auto 0; }

@media (max-width: 980px) {
  .hero .wrap, .layout { grid-template-columns: 1fr; }
  .topics { grid-template-columns: repeat(2, 1fr); }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
  .aside .sticky { position: static; }
}
@media (max-width: 782px) { .admin-bar .header { top: 46px; } }
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: calc(100% - 32px); }
  .header .wrap { gap: 12px; min-height: 64px; flex-wrap: wrap; padding: 8px 0; }
  .search { margin-left: auto; }
  .tabs { order: 3; width: 100%; flex: none; }
  .header .btn { display: none; }
  .hero .wrap { padding: 44px 0 56px; gap: 32px; }
  .topics { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .topic { aspect-ratio: 1 / 1; }
  .topic b { font-size: 17px; }
  .grid { grid-template-columns: 1fr; }
  .article { padding: 26px 20px; }
  .cover { border-radius: 18px; }
  .footer .wrap { grid-template-columns: 1fr; }
}
