/*
Theme Name: Ricardo Souza
Theme URI: https://ricardosouza.dev
Author: Ricardo Souza
Author URI: https://ricardosouza.dev
Description: Tema portfólio moderno para desenvolvedor de software. Dark mode, 4 esquemas de cores, seção de projetos e blog gerenciáveis pelo painel do WordPress.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ricardo-souza
Tags: portfolio, blog, dark-mode, custom-colors, responsive, developer
*/

/* ==========================================================================
   1. DESIGN TOKENS  (CSS Custom Properties)
   ========================================================================== */

:root {
  /* Accent palettes — trocados via data-accent no <html> */
  --accent: #3b82f6;
  --accent-600: #2563eb;
  --accent-700: #1d4ed8;
  --accent-soft: rgba(59, 130, 246, 0.12);

  /* Tipografia */
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, monospace;

  /* Espaçamento */
  --container: 1140px;
  --gap: clamp(1rem, 3vw, 2rem);
  --radius: 16px;
  --radius-sm: 10px;

  /* Transições */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 0.18s var(--ease);
  --t: 0.35s var(--ease);
}

/* ---- Light theme (default) ---- */
:root,
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --bg-elev-2: #f1f5f9;
  --text: #0f172a;
  --text-muted: #475569;
  --text-faint: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
}

/* ---- Dark theme ---- */
[data-theme="dark"] {
  --bg: #0b1120;
  --bg-elev: #131c2e;
  --bg-elev-2: #1c2740;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --border: #243049;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.5);
  --code-bg: #060a14;
  --code-text: #e2e8f0;
}

/* ---- Accent palettes ---- */
[data-accent="blue"]   { --accent: #3b82f6; --accent-600: #2563eb; --accent-700: #1d4ed8; --accent-soft: rgba(59,130,246,.14); }
[data-accent="violet"] { --accent: #8b5cf6; --accent-600: #7c3aed; --accent-700: #6d28d9; --accent-soft: rgba(139,92,246,.14); }
[data-accent="emerald"]{ --accent: #10b981; --accent-600: #059669; --accent-700: #047857; --accent-soft: rgba(16,185,129,.14); }
[data-accent="amber"]  { --accent: #f59e0b; --accent-600: #d97706; --accent-700: #b45309; --accent-soft: rgba(245,158,11,.16); }

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */

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

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

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t), color var(--t);
  overflow-x: hidden;
}

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

a { color: var(--accent-600); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-700); }

h1, h2, h3, h4 { line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }

ul, ol { padding-left: 1.25rem; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

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

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ==========================================================================
   3. LAYOUT HELPERS
   ========================================================================== */

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 1.5rem; }

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }

.section-head { text-align: center; max-width: 640px; margin: 0 auto clamp(2rem, 5vw, 3.5rem); }
.section-head .eyebrow { color: var(--accent-600); font-family: var(--font-mono); font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); margin-top: .5rem; }
.section-head p { color: var(--text-muted); margin-top: .75rem; font-size: 1.05rem; }

.grid { display: grid; gap: var(--gap); }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   4. BUTTONS & BADGES
   ========================================================================== */

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .8rem 1.5rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px var(--accent-soft); }
.btn-primary:hover { background: var(--accent-600); color: #fff; transform: translateY(-2px); box-shadow: 0 12px 28px var(--accent-soft); }

.btn-ghost { border: 1.5px solid var(--border); color: var(--text); background: var(--bg-elev); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-600); transform: translateY(-2px); }

.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .7rem; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--accent-soft); color: var(--accent-700);
  font-family: var(--font-mono);
}
[data-theme="dark"] .badge { color: var(--accent); }

.tag {
  font-family: var(--font-mono); font-size: .72rem; padding: .25rem .55rem;
  border-radius: 6px; background: var(--bg-elev-2); color: var(--text-muted); border: 1px solid var(--border);
}

/* ==========================================================================
   5. HEADER / NAV
   ========================================================================== */

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t), background var(--t);
}
.site-header.scrolled { border-bottom-color: var(--border); }

.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 70px; }

.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; color: var(--text); }
.brand .brand-mark {
  width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-700)); color: #fff;
  font-family: var(--font-mono); font-weight: 700; box-shadow: 0 6px 16px var(--accent-soft);
}
.brand:hover { color: var(--text); }

.nav-menu { display: flex; align-items: center; gap: .25rem; list-style: none; padding: 0; margin: 0; }
.nav-menu a {
  color: var(--text-muted); font-weight: 500; font-size: .95rem; padding: .5rem .85rem; border-radius: 8px;
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-menu a:hover, .nav-menu .current-menu-item > a { color: var(--text); background: var(--bg-elev-2); }

.nav-actions { display: flex; align-items: center; gap: .5rem; }

/* Theme controls */
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text);
  transition: transform var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-600); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .icon-sun { display: none; }
[data-theme="dark"] .icon-btn .icon-sun { display: block; }
[data-theme="dark"] .icon-btn .icon-moon { display: none; }

/* Color switcher popover */
.color-switch { position: relative; }
.color-pop {
  position: absolute; right: 0; top: calc(100% + 10px);
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); padding: .85rem; display: none; gap: .6rem; grid-template-columns: repeat(4, 1fr);
  width: max-content; z-index: 50;
}
.color-pop.open { display: grid; animation: pop .2s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
.swatch {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid transparent;
  transition: transform var(--t-fast); position: relative;
}
.swatch:hover { transform: scale(1.15); }
.swatch[aria-pressed="true"] { border-color: var(--text); }
.swatch--blue   { background: #3b82f6; }
.swatch--violet { background: #8b5cf6; }
.swatch--emerald{ background: #10b981; }
.swatch--amber  { background: #f59e0b; }

/* Mobile nav */
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .nav-menu {
    position: fixed; inset: 70px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-elev); border-bottom: 1px solid var(--border); padding: 1rem 1.5rem;
    transform: translateY(-120%); transition: transform var(--t); box-shadow: var(--shadow-lg);
  }
  .nav-menu.open { transform: none; }
  .nav-menu a { padding: .85rem 1rem; border-radius: 8px; }
  .nav-toggle { display: grid; }
}

/* ==========================================================================
   6. HERO
   ========================================================================== */

.hero { position: relative; padding-block: clamp(4rem, 10vw, 8rem); overflow: hidden; }
.hero::before {
  content: ""; position: absolute; top: -30%; right: -10%; width: 60vw; height: 60vw; max-width: 700px; max-height: 700px;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%); filter: blur(20px); z-index: 0;
  pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; text-align: center; } }

.hero h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: 1.2rem 0; }
.hero h1 .grad {
  background: linear-gradient(120deg, var(--accent), var(--accent-700));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--text-muted); max-width: 52ch; }
@media (max-width: 820px) { .hero .lead { margin-inline: auto; } }
.hero-cta { display: flex; gap: .85rem; margin-top: 2rem; flex-wrap: wrap; }
@media (max-width: 820px) { .hero-cta { justify-content: center; } }

.hero-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden; font-family: var(--font-mono); font-size: .85rem;
}
.hero-card .term-bar { display: flex; align-items: center; gap: .5rem; padding: .8rem 1rem; background: var(--bg-elev-2); border-bottom: 1px solid var(--border); }
.hero-card .dot { width: 12px; height: 12px; border-radius: 50%; }
.hero-card .dot.r { background: #ef4444; } .hero-card .dot.y { background: #f59e0b; } .hero-card .dot.g { background: #10b981; }
.hero-card .term-title { margin-left: auto; color: var(--text-faint); font-size: .75rem; }
.hero-card pre { padding: 1.2rem; overflow-x: auto; color: var(--text); line-height: 1.8; }
.hero-card .c-key { color: var(--accent-600); } .hero-card .c-str { color: #10b981; } .hero-card .c-com { color: var(--text-faint); }

/* Stats strip */
.stats { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-top: 3rem; }
@media (max-width: 820px) { .stats { justify-content: center; } }
.stat .num { font-size: 2rem; font-weight: 800; color: var(--accent-600); }
.stat .label { font-size: .85rem; color: var(--text-muted); }

/* ==========================================================================
   7. ABOUT / SKILLS
   ========================================================================== */

.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 820px) { .about-grid { grid-template-columns: 1fr; } }
.about-text h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 1rem; }
.about-text p { color: var(--text-muted); margin-bottom: 1rem; }

.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.skill-card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 1.1rem; transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.skill-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.skill-card .skill-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-700); display: grid; place-items: center; margin-bottom: .75rem; font-family: var(--font-mono); font-weight: 700; }
[data-theme="dark"] .skill-card .skill-icon { color: var(--accent); }
.skill-card h4 { font-size: .98rem; }
.skill-card p { font-size: .82rem; color: var(--text-muted); margin-top: .2rem; }

/* ==========================================================================
   8. CARDS (Projects & Blog)
   ========================================================================== */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: var(--gap); }

.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform var(--t), border-color var(--t), box-shadow var(--t);
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow-lg); }

.card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-elev-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-media .placeholder {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), transparent); color: var(--accent-700);
  font-family: var(--font-mono); font-size: 2.5rem; font-weight: 700;
}
[data-theme="dark"] .card-media .placeholder { color: var(--accent); }

.card-body { padding: 1.3rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.card-meta { display: flex; align-items: center; gap: .6rem; font-size: .78rem; color: var(--text-faint); font-family: var(--font-mono); }
.card-body h3 { font-size: 1.2rem; }
.card-body h3 a { color: var(--text); }
.card-body h3 a:hover { color: var(--accent-600); }
.card-excerpt { color: var(--text-muted); font-size: .92rem; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.card-link { margin-top: .4rem; font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; color: var(--accent-600); }
.card-link svg { transition: transform var(--t-fast); }
.card:hover .card-link svg { transform: translateX(4px); }

.section-cta { text-align: center; margin-top: 3rem; }

/* ==========================================================================
   9. CONTACT
   ========================================================================== */

.contact { position: relative; }
.contact-box {
  background: linear-gradient(135deg, var(--accent), var(--accent-700)); color: #fff;
  border-radius: var(--radius); padding: clamp(2.5rem, 6vw, 4.5rem); text-align: center;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.contact-box h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.contact-box p { opacity: .92; margin: 1rem auto 2rem; max-width: 48ch; }
.contact-box .btn-primary { background: #fff; color: var(--accent-700); }
.contact-box .btn-primary:hover { background: #fff; transform: translateY(-2px); }
.contact-box .btn-ghost { border-color: rgba(255,255,255,.5); color: #fff; background: transparent; }
.contact-box .btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
/* Contato em duas colunas (texto + formulário) */
.contact-box { text-align: left; }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: center; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-info h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.contact-info p { opacity: .92; margin: 1rem 0 1.5rem; max-width: 42ch; }
.contact-channels { list-style: none; padding: 0; margin: 0; display: grid; gap: .85rem; }
.contact-channels li { display: flex; align-items: center; gap: .65rem; }
.contact-channels svg { width: 20px; height: 20px; opacity: .9; flex: none; }
.contact-channels a { color: #fff; text-decoration: none; font-weight: 500; }
.contact-channels a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Cartão do formulário */
.contact-form-wrap { background: var(--bg-elev); border-radius: var(--radius); padding: clamp(1.5rem, 4vw, 2.2rem); box-shadow: var(--shadow-lg); }
.contact-form { display: grid; gap: 1rem; }
.contact-form .field { display: grid; gap: .35rem; }
.contact-form .field > span { font-size: .85rem; font-weight: 600; color: var(--text); }
.contact-form input, .contact-form textarea {
	width: 100%; padding: .75rem .9rem; border-radius: var(--radius-sm);
	border: 1.5px solid var(--border); background: var(--bg); color: var(--text);
	font-family: inherit; font-size: 1rem; transition: border-color var(--t-fast);
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); }
.contact-form textarea { resize: vertical; min-height: 110px; }
.contact-form .btn-block { width: 100%; justify-content: center; margin-top: .3rem; }
.contact-form .btn-primary { background: var(--accent); color: #fff; }
.contact-form .btn-primary:hover { background: var(--accent-600); color: #fff; }
.rs-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-notice { padding: .8rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; font-weight: 500; border: 1px solid; }
.form-notice--success { background: #dcfce7; color: #166534; border-color: #86efac; }
.form-notice--error { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

.btn-block { width: 100%; justify-content: center; }

.social { display: flex; gap: .8rem; justify-content: center; margin-top: 2rem; }
.social a { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.15); color: #fff; transition: transform var(--t-fast), background var(--t-fast); }
.social a:hover { background: rgba(255,255,255,.28); transform: translateY(-3px); color: #fff; }
.social svg { width: 20px; height: 20px; }

/* ==========================================================================
   10. SINGLE / CONTENT
   ========================================================================== */

.page-hero { padding-block: clamp(3rem, 7vw, 5rem) clamp(1.5rem, 3vw, 2.5rem); }
.page-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); max-width: 22ch; }
.breadcrumb { font-family: var(--font-mono); font-size: .82rem; color: var(--text-faint); margin-bottom: 1rem; }
.breadcrumb a { color: var(--text-muted); }

.entry-meta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; color: var(--text-muted); font-size: .9rem; margin-top: 1.2rem; }
.entry-meta .author-chip { display: inline-flex; align-items: center; gap: .5rem; }
.entry-meta .author-chip img { width: 32px; height: 32px; border-radius: 50%; }

.entry-content { max-width: 760px; margin-inline: auto; font-size: 1.08rem; }
.entry-content > * + * { margin-top: 1.3rem; }
.entry-content h2 { font-size: 1.7rem; margin-top: 2.5rem; }
.entry-content h3 { font-size: 1.35rem; margin-top: 2rem; }
.entry-content p { color: var(--text); }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.entry-content blockquote {
  border-left: 4px solid var(--accent); padding: .5rem 0 .5rem 1.5rem; color: var(--text-muted); font-style: italic; font-size: 1.15rem;
}
.entry-content ul, .entry-content ol { color: var(--text); }
.entry-content code { font-family: var(--font-mono); background: var(--bg-elev-2); padding: .15em .4em; border-radius: 5px; font-size: .9em; }
.entry-content pre { background: var(--code-bg); color: var(--code-text); padding: 1.3rem; border-radius: var(--radius-sm); overflow-x: auto; font-family: var(--font-mono); font-size: .9rem; }
.entry-content pre code { background: none; padding: 0; }
.featured-media { max-width: 980px; margin: 0 auto 2.5rem; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); }

.project-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 1rem; max-width: 760px; margin: 0 auto 2.5rem; }
.project-meta-grid .meta-item { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.2rem; }
.project-meta-grid .meta-item .k { font-size: .75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .05em; font-family: var(--font-mono); }
.project-meta-grid .meta-item .v { font-weight: 600; margin-top: .3rem; }

/* Sumário (Table of Contents) */
.toc { max-width: 760px; margin: 0 0 2.5rem; background: var(--bg-elev); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 1rem 1.3rem; }
.toc__toggle { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-family: var(--font-mono); }
.toc__toggle svg { transition: transform var(--t-fast); flex: none; }
.toc.is-collapsed .toc__toggle svg { transform: rotate(-90deg); }
.toc__list { list-style: none; padding: 0; margin: .9rem 0 0; display: grid; gap: .15rem; overflow: hidden; transition: max-height var(--t), margin var(--t), opacity var(--t); max-height: 1000px; }
.toc.is-collapsed .toc__list { max-height: 0; margin-top: 0; opacity: 0; }
.toc__item a { display: block; padding: .35rem .6rem; border-radius: 6px; color: var(--text-muted); font-size: .92rem; text-decoration: none; border-left: 2px solid transparent; transition: color var(--t-fast), background var(--t-fast); }
.toc__item a:hover { color: var(--text); background: var(--bg-elev-2); }
.toc__item a.is-active { color: var(--accent-600); background: var(--accent-soft); font-weight: 600; }
.toc__item--h3 a { padding-left: 1.5rem; font-size: .88rem; }

/* Botão voltar ao topo */
.back-to-top {
	position: fixed; bottom: 24px; right: 24px; z-index: 90;
	width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
	background: var(--accent); color: #fff; box-shadow: 0 8px 24px var(--accent-soft);
	opacity: 0; visibility: hidden; transform: translateY(16px) scale(.9);
	transition: opacity var(--t), transform var(--t), visibility var(--t), background var(--t-fast);
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--accent-700); transform: translateY(-3px); }

/* Barra de progresso de leitura */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; background: transparent; pointer-events: none; }
.reading-progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-700)); transition: width .1s linear; }

/* Categorias e subtítulo no topo do post */
.entry-cats { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.entry-cats .badge { text-decoration: none; }
.entry-dek { font-size: 1.2rem; color: var(--text-muted); margin-top: 1rem; max-width: 60ch; line-height: 1.5; }
.entry-meta .author-chip strong { color: var(--text); font-size: .92rem; }

/* Layout do single com trilho de compartilhamento */
.single-layout { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2rem; max-width: 880px; align-items: start; }
@media (max-width: 820px) { .single-layout { grid-template-columns: 1fr; gap: 0; } }
.single-main { min-width: 0; }
.single-main .entry-content { max-width: 760px; margin-inline: 0; }

/* Trilho de compartilhamento (sticky) */
.share-rail { position: sticky; top: 100px; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
@media (max-width: 820px) { .share-rail { display: none; } }
.share-rail__label { font-size: .65rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); writing-mode: vertical-rl; margin-bottom: .3rem; }
.share-btn {
	width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
	border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-muted);
	transition: transform var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.share-btn:hover { color: var(--accent-600); border-color: var(--accent); transform: translateY(-2px); }
.share-btn svg { width: 18px; height: 18px; }
.share-copy { cursor: pointer; }
.share-copy.copied { color: #10b981; border-color: #10b981; }

/* Compartilhamento inline: aparece só no mobile (o trilho lateral cobre o desktop) */
.share-inline { display: none; align-items: center; gap: .6rem; flex-wrap: wrap; max-width: 760px; margin: 2.5rem 0 0; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.share-inline > span { font-weight: 600; color: var(--text-muted); margin-right: .3rem; }
@media (max-width: 820px) { .share-inline { display: flex; } }

/* Tags do post */
.entry-tags { display: flex; flex-wrap: wrap; gap: .5rem; max-width: 760px; margin-top: 2rem; }
.entry-tags .tag { text-decoration: none; transition: color var(--t-fast), border-color var(--t-fast); }
.entry-tags .tag:hover { color: var(--accent-600); border-color: var(--accent); }

/* Box do autor */
.author-box {
	display: flex; gap: 1.3rem; align-items: flex-start; max-width: 760px; margin: 2.5rem 0 0;
	padding: 1.6rem; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
}
@media (max-width: 540px) { .author-box { flex-direction: column; text-align: center; align-items: center; } }
.author-box img { width: 72px; height: 72px; border-radius: 50%; flex: none; }
.author-box__eyebrow { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-family: var(--font-mono); }
.author-box__info h3 { font-size: 1.25rem; margin: .2rem 0 .5rem; }
.author-box__info p { color: var(--text-muted); margin-bottom: .8rem; }
.author-box__link { font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .35rem; }

.post-nav { display: flex; justify-content: space-between; gap: 1rem; max-width: 760px; margin: 3rem auto 0; flex-wrap: wrap; }
.post-nav a { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.3rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elev); transition: border-color var(--t-fast), transform var(--t-fast); flex: 1; min-width: 200px; }
.post-nav a:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-nav .dir { font-size: .75rem; color: var(--text-faint); font-family: var(--font-mono); }
.post-nav .ttl { font-weight: 600; color: var(--text); }
.post-nav .next { text-align: right; }

/* Archive header */
.archive-filter { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-bottom: 2.5rem; }
.archive-filter a { padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-muted); font-size: .9rem; font-weight: 500; }
.archive-filter a:hover, .archive-filter a.active { border-color: var(--accent); color: var(--accent-600); background: var(--accent-soft); }

/* Pagination */
.pagination { display: flex; gap: .4rem; justify-content: center; margin-top: 3rem; flex-wrap: wrap; }
.pagination .page-numbers { padding: .55rem .9rem; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-muted); font-weight: 600; min-width: 42px; text-align: center; }
.pagination .page-numbers:hover, .pagination .current { border-color: var(--accent); background: var(--accent); color: #fff; }

/* ==========================================================================
   11. FOOTER
   ========================================================================== */

.site-footer { background: var(--bg-elev); border-top: 1px solid var(--border); padding-block: 3rem 2rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-size: .95rem; margin-bottom: .9rem; }
.footer-grid p { color: var(--text-muted); font-size: .92rem; max-width: 34ch; }
.footer-grid ul { list-style: none; padding: 0; display: grid; gap: .55rem; }
.footer-grid ul a { color: var(--text-muted); font-size: .92rem; }
.footer-grid ul a:hover { color: var(--accent-600); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 1.5rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--text-faint); font-size: .85rem; }

/* ==========================================================================
   12. UTILITIES / WP CORE
   ========================================================================== */

.screen-reader-text { 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: -999px; top: 0; z-index: 200; background: var(--accent); color: #fff; padding: .7rem 1.2rem; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; color: #fff; }
.aligncenter { margin-inline: auto; }
.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.wp-caption-text { font-size: .85rem; color: var(--text-faint); text-align: center; margin-top: .5rem; }
.sticky, .gallery-caption, .bypostauthor { display: block; }
