/*
Theme Name: Alta Renda Minimal
Theme URI: https://altarendablog.com.br
Author: Danilo
Author URI: https://altarendablog.com.br
Description: Tema minimalista para portais de finanças premium, milhas e acesso VIP. Modo claro/escuro com alternador sol/lua, otimizado para SEO e Google Discover, com layout editorial inspirado em cartões de embarque.
Version: 1.0.0
Requires at least: 6.0
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: altarenda
*/

/* =========================================================
   DESIGN TOKENS
   Conceito: "cartão de embarque" — a estética de sinalização
   aeroportuária e cartões premium, sem cair no clichê de
   fundo creme+terracota ou preto+neon.
   ========================================================= */

:root{
  /* núcleo da paleta */
  --ink:        #1a1a1a;
  --paper:      #ffffff;
  --gold:       #b08d3d;
  --navy:       #242424;
  --teal:       #b08d3d;
  --stone:      #8f8f8f;

  /* modo claro (padrão) */
  --bg:          var(--paper);
  --bg-raised:   #ffffff;
  --bg-inset:    #f0f0f0;
  --text:        var(--ink);
  --text-muted:  #666666;
  --accent:      var(--gold);
  --accent-ink:  var(--navy);
  --stamp:       var(--teal);
  --border:      #e3e3e3;
  --border-strong: #cfcfcf;
  --shadow:      0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-mono-label: 'Space Grotesk', 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --radius: 2px;
  --container: 1180px;
  --measure: 700px;

  color-scheme: light;
}

html[data-theme="dark"]{
  --bg:          #1c1c1c;
  --bg-raised:   #242424;
  --bg-inset:    #2b2b2b;
  --text:        #ededed;
  --text-muted:  #a6a6a6;
  --accent:      #d1ac57;
  --accent-ink:  #e6e6e6;
  --stamp:       #d1ac57;
  --border:      #333333;
  --border-strong: #454545;
  --shadow:      0 1px 2px rgba(0,0,0,.3), 0 12px 28px rgba(0,0,0,.35);
  color-scheme: dark;
}

@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{ animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; }
body{
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  transition: background-color .25s ease, color .25s ease;
}
img{ max-width: 100%; height: auto; display: block; }
a{ color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible{
  outline: 2px solid var(--stamp);
  outline-offset: 2px;
}
h1,h2,h3,h4{
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
p{ margin: 0 0 1.2em; }
.container{ max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.eyebrow{
  font-family: var(--font-mono-label);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--stamp);
  font-weight: 600;
}
.visually-hidden{
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
.skip-link{
  position: absolute; left: 8px; top: -60px;
  background: var(--accent-ink); color: var(--bg);
  padding: 10px 16px; z-index: 999; transition: top .2s;
  border-radius: var(--radius);
}
.skip-link:focus{ top: 8px; }

/* =========================================================
   HEADER
   ========================================================= */
.site-header{
  position: sticky; top: 0; z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(140%) blur(6px);
}
.site-header .container{
  display: flex; align-items: center; justify-content: space-between;
  height: 68px; gap: 24px;
}
.site-branding{ display: flex; align-items: center; gap: 10px; min-width: 0; }
.site-branding img{ max-height: 34px; width: auto; }
.site-title{
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-title a{ color: var(--text); }

.primary-nav{ display: flex; align-items: center; gap: 28px; }
.primary-nav ul{ list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.primary-nav a{
  font-family: var(--font-mono-label);
  font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  font-weight: 600; color: var(--text-muted);
  padding: 6px 2px; border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.primary-nav a:hover, .primary-nav a.current{ color: var(--text); border-color: var(--accent); }

.header-actions{ display: flex; align-items: center; gap: 14px; }

.menu-toggle{
  display: none; background: none; border: 1px solid var(--border-strong);
  border-radius: var(--radius); width: 38px; height: 38px; cursor: pointer;
  color: var(--text);
}

/* theme toggle: sol / lua */
.theme-toggle{
  --w: 56px; --h: 30px;
  position: relative; width: var(--w); height: var(--h);
  border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg-inset); cursor: pointer; padding: 0;
  flex-shrink: 0;
}
.theme-toggle .knob{
  position: absolute; top: 3px; left: 3px;
  width: calc(var(--h) - 8px); height: calc(var(--h) - 8px);
  border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  transition: transform .3s cubic-bezier(.65,0,.35,1), background .3s;
  transform: translateX(0);
}
html[data-theme="dark"] .theme-toggle .knob{ transform: translateX(26px); background: var(--accent); }
.theme-toggle svg{ width: 13px; height: 13px; }
.theme-toggle .icon-sun{ color: #fff; }
.theme-toggle .icon-moon{ color: var(--ink); }
html[data-theme="dark"] .theme-toggle .icon-sun{ display:none; }
html[data-theme="light"] .theme-toggle .icon-moon, :root:not([data-theme]) .theme-toggle .icon-moon{ display:none; }

/* =========================================================
   TICKET CARD — elemento assinatura do tema
   Inspirado em cartão de embarque: canto recortado,
   divisor tracejado, rótulo estilo "portão de embarque".
   ========================================================= */
.ticket{
  position: relative;
  display: flex; flex-direction: column;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.ticket:hover{ transform: translateY(-3px); border-color: var(--border-strong); }
.ticket-media{ position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-inset); }
.ticket-media img{ width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ticket:hover .ticket-media img{ transform: scale(1.04); }
.ticket-gate{
  position: absolute; top: 10px; left: 10px;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono-label); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 2px;
}
.ticket-body{ padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ticket-title{ font-size: 20px; margin: 0; }
.ticket-title a{ color: var(--text); }
.ticket-excerpt{ color: var(--text-muted); font-size: 14.5px; margin: 0; }
.ticket-divider{
  border: none; height: 0; border-top: 1.5px dashed var(--border-strong);
  margin: 2px 0; position: relative;
}
.ticket-divider::before, .ticket-divider::after{
  content: ""; position: absolute; top: -8px; width: 16px; height: 16px;
  background: var(--bg); border-radius: 50%; border: 1px solid var(--border);
}
.ticket-divider::before{ left: -28px; }
.ticket-divider::after{ right: -28px; }
.ticket-meta{
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-mono-label); font-size: 11.5px; letter-spacing: .04em;
  color: var(--text-muted); text-transform: uppercase;
}
.ticket-meta span{ display: flex; align-items: center; gap: 5px; }

.ticket--featured{ flex-direction: row; align-items: stretch; }
.ticket--featured .ticket-media{ flex: 1 1 52%; aspect-ratio: auto; }
.ticket--featured .ticket-body{ flex: 1 1 48%; justify-content: center; padding: 32px 36px; gap: 14px; }
.ticket--featured .ticket-title{ font-size: 32px; }
@media (max-width: 780px){
  .ticket--featured{ flex-direction: column; }
  .ticket--featured .ticket-media{ aspect-ratio: 16/9; }
}

/* =========================================================
   GRID / LAYOUT
   ========================================================= */
.section{ padding: 48px 0; }
.section-head{ display:flex; align-items: baseline; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.section-head h2{ font-size: 26px; margin: 0; }
.section-head .view-all{ font-family: var(--font-mono-label); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--stamp); font-weight: 600; }

.grid{ display: grid; gap: 26px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px){ .grid{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px){ .grid{ grid-template-columns: 1fr; } }

.category-pills{ display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 30px; }
.category-pills a{
  font-family: var(--font-mono-label); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: 999px;
  color: var(--text-muted); font-weight: 600; transition: all .15s;
}
.category-pills a:hover, .category-pills a.is-active{ background: var(--accent-ink); color: var(--bg); border-color: var(--accent-ink); }

/* =========================================================
   ARTICLE (single.php)
   ========================================================= */
.article-header{ max-width: var(--measure); margin: 0 auto; padding: 46px 24px 0; }
.article-header .eyebrow{ display:block; margin-bottom: 14px; }
.article-header h1{ font-size: clamp(28px, 4vw, 42px); }
.article-lede{ font-size: 19px; color: var(--text-muted); margin-top: 10px; }
.article-meta-bar{
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center;
  font-family: var(--font-mono-label); font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--text-muted); margin: 20px 0 0; padding-bottom: 20px;
  border-bottom: 1.5px dashed var(--border-strong);
}
.article-meta-bar span{ display: flex; align-items: center; gap: 6px; }

.article-featured-media{ max-width: var(--container); margin: 28px auto; padding: 0 24px; }
.article-featured-media img{ border-radius: var(--radius); width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.article-layout{ max-width: var(--container); margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 48px; }
@media (max-width: 980px){ .article-layout{ grid-template-columns: 1fr; } }

.article-content{ max-width: var(--measure); font-size: 18px; line-height: 1.75; }
.article-content h2{ font-size: 27px; margin-top: 2.1em; }
.article-content h3{ font-size: 21px; margin-top: 1.7em; }
.article-content p{ margin-bottom: 1.3em; }
.article-content ul, .article-content ol{ padding-left: 1.3em; margin-bottom: 1.3em; }
.article-content li{ margin-bottom: .4em; }
.article-content img{ border-radius: var(--radius); margin: 1.6em 0; }
.article-content blockquote{
  margin: 1.8em 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--accent);
  font-style: italic; color: var(--text-muted); font-size: 19px;
}
.article-content table{ width: 100%; border-collapse: collapse; margin: 1.8em 0; font-size: 15.5px; }
.article-content table th{
  background: var(--accent-ink); color: var(--bg); text-align: left;
  padding: 12px 14px; font-family: var(--font-mono-label); font-size: 12.5px;
  text-transform: uppercase; letter-spacing: .04em;
}
.article-content table td{ padding: 11px 14px; border-bottom: 1px solid var(--border); }
.article-content table tr:nth-child(even) td{ background: var(--bg-inset); }
.article-content a{ color: var(--stamp); text-decoration: underline; text-underline-offset: 3px; }
.article-content hr{ border: none; border-top: 1.5px dashed var(--border-strong); margin: 2.4em 0; }

.toc{
  position: sticky; top: 90px; background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px; font-size: 14px;
}
.toc .eyebrow{ margin-bottom: 10px; }
.toc ol{ list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li{ counter-increment: toc; margin-bottom: 9px; }
.toc li::before{ content: counter(toc, decimal-leading-zero) " "; font-family: var(--font-mono-label); color: var(--accent); font-weight: 600; margin-right: 4px; }
.toc a{ color: var(--text-muted); }
.toc a:hover{ color: var(--text); }
@media (max-width: 980px){ .toc{ position: static; margin-bottom: 20px; } }

.author-box{
  max-width: var(--measure); margin: 40px auto 0; padding: 22px 24px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-inset);
  display: flex; gap: 16px; align-items: flex-start;
}
.author-box img{ width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; }
.author-box h3{ font-size: 15px; margin: 0 0 4px; font-family: var(--font-mono-label); text-transform: uppercase; letter-spacing: .04em; }
.author-box p{ margin: 0; font-size: 14.5px; color: var(--text-muted); }

.whatsapp-cta{
  max-width: var(--measure); margin: 36px auto; padding: 22px 26px;
  background: var(--accent-ink); color: var(--bg); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.whatsapp-cta a{
  background: var(--accent); color: #1a1300; font-weight: 700; padding: 11px 22px;
  border-radius: 999px; font-size: 14.5px; white-space: nowrap;
}

/* =========================================================
   LOJA / PRODUTO
   ========================================================= */
.produto-card{
  background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow);
}
.produto-card img{ height: 140px; object-fit: contain; }
.produto-card h3{ font-size: 19px; margin: 0; }
.produto-price{ font-family: var(--font-mono-label); font-size: 13px; color: var(--stamp); text-transform: uppercase; letter-spacing: .05em; }
.produto-card .btn{
  margin-top: auto; text-align: center; background: var(--accent-ink); color: var(--bg);
  padding: 11px; border-radius: var(--radius); font-weight: 700; font-size: 14.5px;
  transition: background .15s;
}
.produto-card .btn:hover{ background: var(--stamp); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer{ border-top: 1px solid var(--border); margin-top: 60px; padding: 40px 0; background: var(--bg-inset); }
.footer-grid{ display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-grid nav ul{ list-style: none; display: flex; gap: 20px; padding: 0; margin: 0; flex-wrap: wrap; }
.footer-grid a{ color: var(--text-muted); font-size: 14px; }
.footer-grid a:hover{ color: var(--text); }
.footer-note{ font-size: 13px; color: var(--text-muted); margin-top: 24px; }

/* =========================================================
   RESPONSIVE NAV
   ========================================================= */
@media (max-width: 860px){
  .menu-toggle{ display: flex; align-items: center; justify-content: center; }
  .primary-nav{
    position: fixed; inset: 68px 0 0 0; background: var(--bg);
    flex-direction: column; align-items: flex-start; padding: 26px 24px;
    transform: translateY(-8px); opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
  }
  .primary-nav.is-open{ opacity: 1; transform: translateY(0); pointer-events: auto; }
  .primary-nav ul{ flex-direction: column; gap: 4px; width: 100%; }
  .primary-nav a{ display: block; width: 100%; padding: 14px 4px; border-bottom: 1px solid var(--border); }
}

/* pagination */
.pagination{ display: flex; gap: 10px; justify-content: center; margin: 40px 0; font-family: var(--font-mono-label); font-size: 13px; }
.pagination a, .pagination span{ padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); }
.pagination .current{ background: var(--accent-ink); color: var(--bg); }

/* reading progress bar */
#reading-progress{ position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 100; width: 0%; transition: width .1s linear; }
