/* ============================================
   Renato Picks — Design System
   ============================================ */

:root {
  /* Light theme (default) */
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-alt: #f5f5f5;
  --text: #111827;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;
  --accent-button: #2563eb;          /* NOVO: fundo do botão no light (igual ao accent) */
  --accent-button-hover: #1d4ed8;    /* NOVO: hover do botão no light */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;

  --max-width: 680px;
  --max-width-wide: 920px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-alt: #1a1a1a;
  --text: #f5f5f5;
  --text-muted: #a3a3a3;
  --text-soft: #737373;
  --border: #262626;
  --border-strong: #404040;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: #172554;
  --accent-button: #1d4ed8;          /* NOVO: fundo do botão no dark (azul escuro) */
  --accent-button-hover: #2563eb;    /* NOVO: hover do botão no dark */
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* ============================================
   Reset & Base
   ============================================ */

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

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.2s ease, color 0.2s ease;
}

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

/* ============================================
   Typography
   ============================================ */

h1, h2, h3, h4 {
  margin: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); margin-bottom: 0.5em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); margin-top: 2.5em; margin-bottom: 0.6em; }
h3 { font-size: 1.125rem; margin-top: 1.75em; margin-bottom: 0.4em; }

p { margin: 0 0 1.1em; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

strong { color: var(--text); font-weight: 600; }
em { font-style: italic; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }
li { margin-bottom: 0.4em; color: var(--text-muted); }
li::marker { color: var(--text-soft); }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

/* ============================================
   Layout
   ============================================ */

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.container--wide { max-width: var(--max-width-wide); }

.site-header {
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
  margin-bottom: 48px;
}

.site-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
}

.site-brand__name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}
.site-brand__name:hover { text-decoration: none; color: var(--accent); }

.site-brand__tag { font-size: 0.8rem; color: var(--text-soft); font-weight: 400; }

/* ============================================
   Site nav (desktop/tablet: horizontal)
   ============================================ */

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px 24px;
  margin-top: 16px;
}

.site-nav a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--text);
  text-decoration: none;
  border-bottom-color: var(--accent);
}

.site-nav a[aria-current="page"] {
  color: var(--accent);
  text-decoration: none;
  border-bottom-color: var(--accent);
}

main { padding-bottom: 64px; }

/* ============================================
   Article / Content
   ============================================ */

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.article-title { margin-bottom: 12px; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.article-body p { font-size: 1.05rem; line-height: 1.75; }
.article-body > :first-child { margin-top: 0; }

/* ============================================
   Seleção de texto — roxo escuro
   ============================================ */

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

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

/* Dark mode: roxo ligeiramente mais claro para não sumir no fundo escuro */
[data-theme="dark"] ::selection {
  background: var(--accent);
  color: #ffffff;
}

[data-theme="dark"] ::-moz-selection {
  background: var(--accent);
  color: #ffffff;
}

/* ============================================
   Components
   ============================================ */

.notice {
  padding: 16px 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin: 1.5em 0;
}
.notice p { margin: 0; font-size: 0.9rem; }
.notice--accent { background: var(--accent-soft); border-color: transparent; }

.card {
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* CTA block */
.cta {
  margin: 2.5em 0;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: var(--shadow);
}
.cta h3 { margin: 0 0 8px; font-size: 1.15rem; }
.cta p { margin: 0 0 18px; font-size: 0.95rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.button:hover { background: var(--accent-hover); color: #ffffff; text-decoration: none; }
.button:active { transform: translateY(1px); }
.button--block { display: flex; width: 100%; }
.button-arrow { font-size: 1.1em; line-height: 1; }

.small { font-size: 0.82rem; color: var(--text-soft); }

/* Post list (legacy version, kept for compatibility) */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}
.post-item:last-child { border-bottom: none; }
.post-item__title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 4px;
}
.post-item__title:hover { color: var(--accent); text-decoration: none; }
.post-item__desc { margin: 0 0 6px; font-size: 0.95rem; color: var(--text-muted); }
.post-item__date { font-size: 0.78rem; color: var(--text-soft); font-weight: 500; }

/* Footer */
.site-footer {
  margin-top: 64px;
  padding: 32px 0 40px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.site-footer p {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 0 0 8px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
  margin: 16px 0;
  padding: 0;
  border: none;
}
.site-footer nav a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}
.site-footer nav a:hover { color: var(--accent); text-decoration: none; }
.site-footer .copyright { font-size: 0.78rem; color: var(--text-soft); margin-top: 16px; }

/* ============================================
   Post cards
   ============================================ */

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.post-card {
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.post-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.post-card--empty { padding: 24px; text-align: center; }

.post-card__link {
  display: block;
  padding: 22px 24px;
  color: inherit;
  text-decoration: none;
}
.post-card__link:hover { text-decoration: none; }

.post-card__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.post-card__category {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.post-card__date { font-size: 0.78rem; color: var(--text-soft); font-weight: 500; }

.post-card__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.post-card__desc { margin: 0 0 14px; font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

.post-card__more {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  transition: color 0.15s ease;
}
.post-card:hover .post-card__more { color: var(--accent-hover); }

@media (max-width: 600px) {
  .post-card__link { padding: 18px 20px; }
  .post-card__title { font-size: 1.1rem; }
}

/* ============================================
   Custom scrollbar
   ============================================ */

html {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) var(--bg);
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background-color: var(--border-strong);
  border-radius: 999px;
  border: 3px solid var(--bg);
  background-clip: content-box;
  transition: background-color 0.15s ease;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--accent); background-clip: content-box; }
::-webkit-scrollbar-corner { background: var(--bg); }

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background-color: #525252;
  border-color: var(--bg);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }

/* ============================================
   Reading progress bar
   ============================================ */

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 5px;
  width: 0;
  background: var(--accent);
  z-index: 1000;
  transition: width 0.05s linear;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .reading-progress { transition: none; }
}

/* ============================================
   Read state
   ============================================ */

.post-card__read {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  padding: 2px 8px;
  border-radius: 999px;
}

.products-item__category {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

[data-theme="dark"] .post-card__read {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
}

.post-card--read .post-card__title { color: var(--text-muted); }
.post-card--read .post-card__link:hover .post-card__title { color: var(--text); }

.products-item__read {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  border-radius: 999px;
}

[data-theme="dark"] .products-item__read {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
}

.products-item.is-read .products-item__title {
  color: var(--text-muted);
}

/* ============================================
   Post navigation (prev / next / home)
   ============================================ */

.post-nav {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.post-nav__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.post-nav__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.post-nav__item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Reverse visual order: Older on the left, Newer on the right */
.post-nav__item--newer { order: 2; text-align: right; }
.post-nav__item--older { order: 1; text-align: left; }

.post-nav__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.post-nav__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.post-nav__arrow { color: var(--accent); }

.post-nav__home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.post-nav__home:hover { color: var(--accent); text-decoration: none; }

@media (max-width: 600px) {
  .post-nav__grid { grid-template-columns: 1fr; }
  .post-nav__item--newer { order: 1; text-align: left; }
  .post-nav__item--older { order: 2; text-align: left; }
}

/* ============================================
   Product research section
   ============================================ */

.section-link { margin: 12px 0 0; font-size: 0.88rem; }
.section-link a { font-weight: 600; }

.products-empty {
  padding: 20px;
  background: var(--surface-alt);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 1em 0;
}

.products-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.products-item {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  position: relative;   /* ← NOVO */
}

.products-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.products-item__link {
  display: block;
  padding: 22px 24px;
  color: inherit;
  text-decoration: none;
}
.products-item__link:hover { text-decoration: none; }

.products-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.products-item__verdict {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.products-item__date { font-size: 0.78rem; color: var(--text-soft); font-weight: 500; }

.products-item__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.products-item__desc { margin: 0 0 14px; font-size: 0.95rem; color: var(--text-muted); line-height: 1.6; }

.products-item__more {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.products-item:hover .products-item__more { color: var(--accent-hover); }

@media (max-width: 600px) {
  .products-item__link { padding: 18px 20px; }
  .products-item__title { font-size: 1.1rem; }
}

/* ============================================
   Botão de favorito (cards de Products/Books)
   ============================================ */

.save-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.15s ease, background 0.15s ease;
}

.save-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.save-btn.is-saved {
  color: var(--accent);
}

.save-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   Product CTA
   ============================================ */

.product-cta {
  margin: 3em 0;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-align: center;
}

.product-cta__eyebrow {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.product-cta__title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
}

.product-cta__text {
  margin: 0 auto 22px;
  max-width: 480px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.product-cta__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.product-cta__button:hover {
  background: #043296;
  color: #ffffff;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.product-cta__button:active { transform: translateY(1px); }

.product-cta__arrow {
  font-size: 1.1em;
  line-height: 1;
  transition: transform 0.15s ease;
}
.product-cta__button:hover .product-cta__arrow { transform: translateX(3px); }

.product-cta__note {
  margin: 16px 0 0;
  font-size: 0.78rem;
  color: var(--text-soft);
  line-height: 1.5;
}

[data-theme="dark"] .product-cta__button:hover {
  box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

@media (max-width: 600px) {
  .product-cta { padding: 24px 20px; }
  .product-cta__title { font-size: 1.1rem; }
  .product-cta__button { width: 100%; padding: 14px 20px; }
}

/* ============================================
   Language switcher (flags)
   ============================================ */

.lang-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.lang-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 3px;
  opacity: 0.75;
  transition: opacity 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}

.lang-switcher a:hover {
  opacity: 1;
  transform: translateY(-1px);
  text-decoration: none;
}

.lang-switcher a[aria-current="true"] {
  opacity: 1;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.lang-switcher .flag {
  display: block;
  width: 24px;
  height: 16px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

@media (max-width: 600px) {
  .lang-switcher {
    gap: 6px;
    margin-top: 10px;
  }
  .lang-switcher .flag {
    width: 20px;
    height: 14px;
  }
}

/* ============================================
   Back to top
   ============================================ */

#back-to-top {
  position: fixed;
  bottom: 58px;
  right: 24px;
  z-index: 998;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease,
    border-color 0.15s ease, box-shadow 0.15s ease;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============================================
   Related section (posts, products, books)
   ============================================ */

.related-section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related-section__title {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.related-section__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .related-section__list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .related-section__list { grid-template-columns: 1fr 1fr 1fr; }
}

.related-section__item {
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.related-section__item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.related-section__link {
  display: block;
  padding: 18px 20px;
  color: inherit;
  text-decoration: none;
}

.related-section__link:hover { text-decoration: none; }

.related-section__item-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.related-section__item-desc {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.related-section__more {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

/* ============================================
   Filter bar (tag filters on list pages)
   ============================================ */

.filter-wrap {
  position: relative;
  margin: 0 0 24px;
}

.filter-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
  padding: 2px 0;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-btn {
  display: inline-block;
  flex: 0 0 auto;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.filter-btn--active {
  color: #ffffff;
  background: #2563eb;
  border-color: var(--accent);
}

.filter-btn--active:hover {
  color: #ffffff;
  background: #05359d;
  border-color: var(--accent-hover);
}

/* Setas indicadoras de scroll (desktop e mobile) */
.filter-arrow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  display: flex;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 2;
}

.filter-arrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--text-muted);
  border-right: 2px solid var(--text-muted);
  display: block;
  margin: 0 auto;
}

.filter-arrow--left {
  left: 0;
  justify-content: flex-start;
  background: linear-gradient(to right, var(--bg) 40%, transparent 100%);
}

.filter-arrow--left::before {
  transform: rotate(-135deg);
  margin-left: 10px;
}

.filter-arrow--right {
  right: 0;
  justify-content: flex-end;
  background: linear-gradient(to left, var(--bg) 40%, transparent 100%);
}

.filter-arrow--right::before {
  transform: rotate(45deg);
  margin-right: 10px;
}

.filter-arrow.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .filter-bar {
    scroll-behavior: auto;
  }
  .filter-arrow {
    transition: none;
  }
}

/* ============================================
   Related section (posts, products, books)
   ============================================ */

.related-section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.related-section__title {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.related-section__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 600px) {
  .related-section__list { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 900px) {
  .related-section__list { grid-template-columns: 1fr 1fr 1fr; }
}

.related-section__item {
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.related-section__item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.related-section__link {
  display: block;
  padding: 18px 20px;
  color: inherit;
  text-decoration: none;
}

.related-section__link:hover { text-decoration: none; }

.related-section__item-title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.related-section__item-desc {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.related-section__more {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
}

/* ============================================
   Glossary
   ============================================ */

.glossary-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 24px 0 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.glossary-filter__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.glossary-filter__btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.glossary-filter__btn--active {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.glossary-category {
  margin: 40px 0;
}

.glossary-category__title {
  margin: 0 0 20px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.glossary-list {
  margin: 0;
  padding: 0;
}

.glossary-term {
  margin: 0 0 20px;
  padding: 0;
}

.glossary-term:last-child {
  margin-bottom: 0;
}

.glossary-term__name {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.glossary-term__definition {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

@media (max-width: 600px) {
  .glossary-filter {
    gap: 4px;
  }
  .glossary-filter__btn {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    font-size: 0.75rem;
  }
  .glossary-category__title {
    font-size: 1.05rem;
  }
  .glossary-term__name {
    font-size: 0.95rem;
  }
  .glossary-term__definition {
    font-size: 0.9rem;
  }
}

/* ============================================
   Share actions (share label + gradient icons)
   ============================================ */

.share-actions {
  margin: 40px 0 32px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  /* Fallback se o JS não rodar */
  --share-grad: linear-gradient(135deg, #833ab4 0%, #e1306c 50%, #feda75 100%);
}

.share-actions__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.share-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.share-btn:active:not(:disabled) {
  transform: translateY(0);
}

.share-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.share-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* O ícone: silhueta do SVG preenchida pelo gradiente */
.share-btn__icon {
  display: block;
  width: 24px;
  height: 24px;
  background: var(--share-grad);
  -webkit-mask-image: var(--icon-mask);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-image: var(--icon-mask);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.share-btn[hidden] { display: none !important; }

@media (max-width: 600px) {
  .share-actions {
    margin: 32px 0 24px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .share-actions__label {
    margin-right: 2px;
    margin-bottom: 0;
  }
  .share-btn {
    width: 44px;
    height: 44px;
  }
  .share-btn__icon {
    width: 24px;
    height: 24px;
  }
}

.share-btn--coin { position: relative; }

.share-btn--coin .share-btn__coin-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.share-btn--coin .share-btn__coin-badge.is-count {
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--text-muted, #6b7280);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.share-btn--coin.is-locked { cursor: not-allowed; }
.share-btn--coin.is-locked .share-btn__icon { opacity: .35; }

.share-btn--coin.is-unlocked { animation: coinPop .5s ease; }
.share-btn--coin.is-pulse { animation: coinPop .4s ease; }

.share-btn--download.is-coming-soon {
  opacity: .4;
  cursor: not-allowed;
}
.share-btn--download.is-coming-soon:hover {
  opacity: .4;
}

@keyframes coinPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.share-btn--download.is-coming-soon {
  opacity: .4;
  cursor: not-allowed;
}
.share-btn--download.is-coming-soon:hover {
  opacity: .4;
}
.quiz--modal {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

/* ============================================
   Notas de Leitura — bottom sheet
   ============================================ */

.note-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 1000;   /* era 500 */
  opacity: 0;
  transition: opacity 0.25s ease;
}

.note-overlay:not([hidden]) {
  opacity: 1;
}

.note-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1001;   /* era 501 */
  max-width: 640px;
  margin: 0 auto;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  color: var(--text);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-sizing: border-box;
}

.note-sheet.is-open {
  transform: translateY(0);
}

.note-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.note-sheet__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.note-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.note-sheet__close:hover {
  background: var(--border);
  color: var(--text);
}

.note-sheet__close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.note-sheet__textarea {
  flex: 1 1 auto;
  min-height: 160px;
  padding: 16px 20px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.55;
  resize: none;
  outline: none;
}

.note-sheet__textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

body.note-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .note-sheet {
    max-width: none;
    max-height: 80vh;
  }
}

/* ============================================
   Activity — abas, itens e botão remover
   (compartilhado pelo profile-fab.js)
   ============================================ */

.activity-tabs {
  display: flex;
  gap: 4px;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.activity-tabs::-webkit-scrollbar {
  display: none;
}

.activity-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.activity-tab:hover {
  color: var(--text);
}

.activity-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.activity-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 20px;
}

.activity-panel[hidden] {
  display: none;
}

.activity-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease;
}

.activity-item:hover {
  background: var(--border);
  text-decoration: none;
}

.activity-item__title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.activity-item__meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.activity-empty {
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin: 0;
}

/* ============================================
   Activity — item + botão remover (lixeira)
   ============================================ */

.activity-item-wrap {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.activity-item-wrap .activity-item {
  flex: 1 1 auto;
  border-bottom: none;
}

.activity-item__remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-soft);
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.activity-item__remove:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.activity-item__remove:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* ============================================
   Profile FAB + sheet
   ============================================ */

.profile-fab {
  position: fixed;
  right: 24px;
  z-index: 998;
  display: inline-flex;
  bottom: 80px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow);
}

.profile-fab:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.profile-fab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* No mobile, entra na coluna do bottom right */
@media (max-width: 600px) {
  .profile-fab {
    right: 25px;
    bottom: 105px;
    width: 44px;
    height: 44px;
  }
}

/* Sheet do perfil */
.profile-sheet__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 8px;
}

.profile-sheet__greeting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.profile-sheet__edit {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  border-radius: 6px;
}

.profile-sheet__edit:hover {
  color: var(--text);
  background: var(--border);
}

.profile-sheet__name-edit {
  display: flex;
  gap: 8px;
  padding: 0 20px 12px;
}

.profile-sheet__name-edit[hidden] {
  display: none;
}

.profile-sheet__name-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
}

.profile-sheet__name-save,
.profile-sheet__name-cancel {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-sheet__name-save {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.profile-sheet__name-save:hover {
  filter: brightness(1.1);
}

/* Aba progresso */
.profile-progress__coins {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 12px;
}

.profile-progress__coins-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
}

.profile-progress__coins-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.profile-progress__title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 12px;
}

.profile-progress__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.profile-progress__meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.profile-progress__label {
  font-weight: 600;
}

.profile-progress__value {
  color: var(--text-muted);
}

.profile-progress__bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.profile-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.profile-progress__clear {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.profile-progress__clear:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* Botão de tema dentro do Meu Perfil */
.profile-sheet__top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-sheet__theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.profile-sheet__theme svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

[data-theme="light"] .profile-sheet__theme .icon-sun,
:root:not([data-theme="dark"]) .profile-sheet__theme .icon-sun {
  display: none;
}

[data-theme="dark"] .profile-sheet__theme .icon-moon {
  display: none;
}

[data-theme="dark"] .profile-sheet__theme .icon-sun {
  display: block;
}

.profile-sheet__theme:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-alt);
}

.profile-sheet__theme:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   Table of Contents (TOC)
   ============================================ */

.toc {
  margin: 0 0 40px;
  padding: 20px 24px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.toc__title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-soft);
  margin-bottom: 12px;
}

.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc__item {
  margin: 0;
  padding: 0;
  counter-increment: toc;
}

.toc__item a {
  display: block;
  padding: 6px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.toc__item a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

.toc__item--h2 a {
  font-weight: 600;
  color: var(--text);
}

.toc__item--h3 a {
  padding-left: 20px;
  font-size: 0.85rem;
}

/* scroll-margin para os headings não ficarem escondidos atrás do header fixo */
.article-body h2,
.article-body h3 {
  scroll-margin-top: 100px;
}

@media (max-width: 600px) {
  .toc {
    padding: 16px 18px;
  }
  .toc__item a {
    font-size: 0.85rem;
  }
}

/* ============================================
   Courses index (list of courses)
   ============================================ */

.course-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.course-card {
  position: relative;
  margin: 0;
  padding: 0;
}

.course-card__link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.course-card__link:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.course-card__meta-top {
  display: flex;
  padding-right: 36px; 
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.course-card__tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.course-card__date {
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 500;
}

.course-card__read {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  border-radius: 999px;
}

[data-theme="dark"] .course-card__read {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
}

.course-card__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.course-card__desc {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.course-card__meta {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* ============================================
   Course modal (full screen, focus mode)
   ============================================ */

body.course-modal-open {
  overflow: hidden;
}

.course-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
}

.course-modal.is-open {
  display: block;
}

.course-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.course-modal__panel {
  position: absolute;
  inset: 0;
  max-width: none;
  margin: 0;
  border-radius: 0;
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 768px) {
  .course-modal__panel {
    max-width: 900px;
    margin: 0 auto;
    top: 20px;
    bottom: 20px;
    border-radius: var(--radius-lg);
  }
}

/* Header com gradiente aleatório */
.course-modal__header {
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.course-modal__header-bg {
  position: absolute;
  inset: 0;
  background: var(--accent);
  transition: background 0.3s ease;
}

.course-modal__header-bg::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.course-modal__header-inner {
  position: relative;
  z-index: 1;
  padding: 24px 28px 20px;
  color: #ffffff;
}

.course-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.course-modal__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.course-modal__title {
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
  padding-right: 40px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.course-modal__subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  opacity: .8;
  line-height: 1.35;
}
.course-modal__subtitle:empty {
  display: none;
}

.course-modal__progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.course-modal__progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.course-modal__progress-fill {
  height: 100%;
  width: 0;
  background: #ffffff;
  transition: width 0.3s ease;
}

.course-modal__progress-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}

.course-modal__content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 32px;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

/* Modules (accordion) */
.course-modules {
  list-style: none;
  padding: 0;
  margin: 0;
}

.course-module {
  margin: 0 0 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.course-module__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 18px;
  background: var(--surface-alt);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.course-module__toggle:hover {
  background: var(--accent-soft);
}

.course-module__arrow {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.course-module__lessons {
  list-style: none;
  padding: 0;
  margin: 0;
}

.course-lesson {
  margin: 0;
  border-top: 1px solid var(--border);
}

.course-lesson__btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 18px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.course-lesson__btn:hover {
  background: var(--accent-soft);
  color: var(--text);
}

.course-lesson__btn.is-done {
  color: var(--text);
}

.course-lesson__check {
  font-size: 1rem;
  color: var(--text-soft);
}

.course-lesson__btn.is-done .course-lesson__check {
  color: #16a34a;
}

[data-theme="dark"] .course-lesson__btn.is-done .course-lesson__check {
  color: #4ade80;
}

/* Lesson content */
.course-modal__back {
  display: inline-block;
  margin-bottom: 20px;
  padding: 6px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.course-modal__back:hover {
  color: var(--accent-hover);
}

.course-lesson-content__title {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.course-lesson-content__body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.course-lesson-content__body p {
  margin: 0 0 1em;
}

.course-lesson-content__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.course-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.course-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--border-strong);
}

.course-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.course-btn--done {
  color: var(--accent);
  border-color: var(--accent);
}

.course-btn--done.is-done {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.course-btn--next {
  margin-left: auto;
}

/* Congrats screen */
.course-congrats {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  min-height: 300px;
}

.course-congrats__icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.course-congrats__title {
  margin: 0 0 28px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  max-width: 400px;
  line-height: 1.4;
}

.course-btn--back-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.course-btn--back-index:hover {
  background: var(--accent);
  color: #ffffff;
}

@media (max-width: 600px) {
  .course-modal__header-inner {
    padding: 20px 20px 16px;
  }
  .course-modal__content {
    padding: 20px 20px 28px;
  }
  .course-modal__title {
    font-size: 1.1rem;
  }
  .course-btn--next {
    margin-left: 0;
  }
  .course-lesson-content__actions {
    flex-direction: column;
  }
  .course-btn {
    width: 100%;
  }
}

/* ============================================
   Course congrats + completed card
   ============================================ */

.course-congrats {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  min-height: 300px;
}

.course-congrats__icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

.course-congrats__title {
  margin: 0 0 28px;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  max-width: 400px;
  line-height: 1.4;
}

.course-btn--back-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.course-btn--back-index:hover {
  background: var(--accent);
  color: #ffffff;
}

.course-card.is-complete .course-card__link {
  border-color: var(--accent);
}

.course-card.is-complete .course-card__meta {
  color: #16a34a;
  font-weight: 700;
}

[data-theme="dark"] .course-card.is-complete .course-card__meta {
  color: #4ade80;
}

.course-card__progress {
  display: block;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin: 12px 0 8px;
  overflow: hidden;
}

.course-card__progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

.course-card.is-complete .course-card__progress-fill {
  background: #16a34a;
}

[data-theme="dark"] .course-card.is-complete .course-card__progress-fill {
  background: #4ade80;
}

/* ============================================
   Home courses section
   ============================================ */

.home-courses {
  margin: 48px 0;
}

.home-courses__title {
  margin: 0 0 20px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ============================================
   Header actions (theme-toggle + nav-toggle)
   ============================================ */

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: fixed;
  top: 20px;
  right: 20px;
  transform: none;
  z-index: 999;
}

/* ============================================
   Desktop (≥1201px): esconde o botão espelho
   ============================================ */

/* Acessibilidade: desliga as transições do menu para quem
   prefere menos movimento */
@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .nav-overlay {
    transition: none !important;
  }
}

/* ============================================
   Support page (donate + suggestions)
   ============================================ */

.support-actions {
  margin: 32px 0 48px;
  display: flex;
  justify-content: center;
}

.support-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 36px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  background: #2563eb;
  border: none;
  border-radius: var(--radius);
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.support-btn:hover {
  color: #ffffff;
  background: #092f80;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.support-btn--secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  box-shadow: none;
}

.support-btn--secondary:hover {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

@media (max-width: 600px) {
  .support-btn {
    width: 100%;
    padding: 16px 24px;
  }
}

/* ============================================
   Home carousel (latest content)
   ============================================ */

.home-carousel-section {
  margin: 56px 0 64px;
}

.home-carousel-section__header {
  position: relative;
  margin-bottom: 48px;
  padding-bottom: 20px;
}

.home-carousel-section__header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 999px;
}

.home-carousel-section__eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

.home-carousel-section__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.home-carousel {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -24px;
  padding: 24px 24px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}


.home-carousel::-webkit-scrollbar {
  height: 6px;
}

.home-carousel::-webkit-scrollbar-track {
  background: transparent;
}

.home-carousel::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 999px;
}

.home-carousel__track {
  display: flex;
  gap: 16px;
}

.home-carousel__card {
  flex: 0 0 280px;
  height: 380px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: #ffffff;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.home-carousel__card--course {
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}

.home-carousel__card::after {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.home-carousel__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  color: #ffffff;
  text-decoration: none;
}

.home-carousel__type {
  display: inline-block;
  align-self: flex-start;
  padding: 4px 12px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
}

.home-carousel__body {
  display: flex;
  flex-direction: column;
  gap: 4px; /* Reduz o espaço entre o título e a descrição */
}

.home-carousel__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
}

.home-carousel__desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.3; /* Linhas bem próximas e limpas */
  color: rgba(255, 255, 255, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-carousel__footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-carousel__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.home-carousel__meta-tag {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.home-carousel__meta-date {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.7);
}

.home-carousel__cta {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-carousel__card:hover .home-carousel__cta {
  text-decoration: underline;
}

/* Badge "Read" no carrossel */
.home-carousel__read {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
}

.home-carousel__card.is-read .home-carousel__title {
  opacity: 0.85;
}

@media (max-width: 600px) {
  .home-carousel__card {
    flex: 0 0 240px;
    height: 340px;
    padding: 18px;
  }
  .home-carousel__title {
    font-size: 1.05rem;
    color: #ffffff;
  }
  .home-carousel__desc {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
  }
}

/* ============================================
   Home education section (courses, posts, glossary)
   ============================================ */

.home-education {
  margin: 56px 0;
}

.home-education__title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.home-education__intro {
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 640px;
}

.home-education__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 600px) {
  .home-education__grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.home-education__card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.home-education__card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.home-education__icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
  line-height: 1;
}

.home-education__card-title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.home-education__card-desc {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
}

.home-education__link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.home-education__link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 600px) {
  .home-education__card {
    padding: 20px;
  }
  .home-education__title {
    font-size: 1.2rem;
  }
  .home-education__icon {
    font-size: 1.5rem;
  }
  .home-education__card-title {
    font-size: 1rem;
  }
  .home-education__card-desc {
    font-size: 0.85rem;
  }
}

/* Container principal da barra de progresso */
.reading-progress-global, 
.dim-progress-container {
  margin: 32px 0 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Texto descritivo (ex: "2 of 4 content viewed - 50%") */
.reading-progress-global__text,
.dim-progress__text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Trilha cinza da barra */
.reading-progress-global__bar,
.dim-progress__bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

/* Preenchimento colorido da barra */
.reading-progress-global__fill,
.dim-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ============================================
   Dimension Reading Progress Bar
   ============================================ */

.dim-progress {
  margin: 36px 0 24px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dim-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dim-progress__text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dim-progress__value {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
}

.dim-progress__bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.dim-progress__fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* ============================================
   Global reading progress (home only - 5 dimensions)
   ============================================ */

.global-progress {
  margin: 56px 0 32px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.global-progress__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.global-progress__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.global-progress__clear {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.global-progress__clear:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.global-progress__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px 20px;
}

.global-progress__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.global-progress__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  line-height: 1.2;
}

.global-progress__label {
  font-weight: 600;
  color: var(--text);
}

.global-progress__value {
  color: var(--text-muted);
  font-size: 0.78rem;
}

.global-progress__bar {
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.global-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-button), var(--accent-button-hover));
  border-radius: 999px;
  transition: width 0.4s ease;
}

@media (max-width: 600px) {
  .global-progress {
    padding: 20px 22px;
  }
  .global-progress__title {
    font-size: 0.98rem;
  }
  .global-progress__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* ============================================
   Breadcrumbs
   ============================================ */

.breadcrumbs {
  margin: 0 0 24px;
  font-size: 0.82rem;
  color: var(--text-soft);
}

.breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumbs__item + .breadcrumbs__item::before {
  content: "›";
  color: var(--text-soft);
  font-size: 0.9rem;
  margin-right: 2px;
}

.breadcrumbs__item a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumbs__item a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumbs__item--current {
  color: var(--text);
  font-weight: 500;
}

@media (max-width: 600px) {
  .breadcrumbs {
    font-size: 0.78rem;
  }
}

/* Badge "Read" nos relacionados */
.related-section__read {
  display: inline-block;
  margin-bottom: 6px;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  border-radius: 999px;
}

[data-theme="dark"] .related-section__read {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
}

.related-section__item.is-read .related-section__item-title {
  color: var(--text-muted);
}

/* Botão de limpar histórico de leitura */
.global-progress__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.global-progress__clear {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.global-progress__clear:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

/* ============================================
   Music page (focus tracks)
   ============================================ */

.music-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin: 24px 0;
}

@media (min-width: 700px) {
  .music-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.music-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

@media (min-width: 700px) {
  .music-card {
    flex-direction: row;
    align-items: stretch;
  }
}

.music-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.music-card__body {
  padding: 24px;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  flex: 1;
}

@media (min-width: 700px) {
  .music-card__body {
    padding: 24px 28px;
  }
}

.music-card__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.music-card__desc {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.5;
  flex: 1;
}

.music-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.music-card__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.music-card__play:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.6);
}

.music-card__play.is-playing {
  background: rgba(255, 255, 255, 0.35);
  border-color: #ffffff;
}

.music-card__play:disabled {
  opacity: 0.6;
  cursor: wait;
}

.music-card__youtube {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.music-card__youtube:hover {
  color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Persistent Player (bottom fixo)
   ============================================ */

.persistent-player {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 998;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.18);

  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  will-change: transform, opacity;
}

.persistent-player__back {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  transition: background 0.15s ease;
}

.persistent-player__back:hover,
.persistent-player__back:focus-visible {
  background: rgba(0, 0, 0, 0.2);
  text-decoration: none;
  color: #fff;
}

.persistent-player__back svg {
  width: 18px;
  height: 18px;
  display: block;
}

.persistent-player.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.persistent-player.is-leaving {
  transform: translateY(100%);
  opacity: 0;
}

.persistent-player__body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
}

.persistent-player__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.persistent-player__close {
  position: relative;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.persistent-player__ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg); /* começa no topo */
  pointer-events: none;
}

.persistent-player__ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.5;
}

.persistent-player__ring-fill {
  fill: none;
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 1.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s linear;
}

.persistent-player__close-x {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.persistent-player__close:hover .persistent-player__ring-bg {
  stroke: rgba(255, 255, 255, 0.4);
}

@media (max-width: 600px) {
  .persistent-player__body {
    padding: 8px 12px;
    gap: 8px;
  }
  .persistent-player__title {
    font-size: 0.85rem;
  }
  .persistent-player__close {
    width: 32px;
    height: 32px;
  }
}
/* ============================================
   Music — "Keep listening while you read"
   ============================================ */

.music-continue {
  margin-top: 48px;
}

.music-continue__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.music-continue__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.music-continue__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 16px;
  border-radius: 12px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 72px;
}

.music-continue__card:hover,
.music-continue__card:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  text-decoration: none;
  color: #fff;
}

.music-continue__label {
  display: block;
}

.music-continue__arrow {
  font-size: 1rem;
  opacity: 0.85;
  flex: 0 0 auto;
}

@media (max-width: 900px) {
  .music-continue__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .music-continue__grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Page spotlight (círculo blurred que segue o mouse)
   ============================================ */

.page-spotlight {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.page-spotlight__glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0;
  will-change: transform, opacity;
  transform: translate3d(-50%, -50%, 0);
  transition: opacity 0.8s ease;  /* ← aumentei de 0.4s para 0.8s */
}

@media (prefers-reduced-motion: reduce) {
  .page-spotlight {
    display: none;
  }
}

/* ============================================
   Nav — bolinha de "conteúdo novo"
   ============================================ */

.site-nav > a {
  position: relative;
}

.nav-new-dot {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  margin-left: 2px;
  width: 6px;
  height: 6px;
  background: #e1306c;
  border-radius: 50%;
  pointer-events: none;
  animation: navDotPulse 2s ease-in-out infinite;
}

@keyframes navDotPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.5; }
}

@media (max-width: 1200px) {
  .nav-new-dot {
    top: 50%;
    left: auto;
    right: 8px;
    transform: translateY(-50%);
    margin-left: 0;
    width: 7px;
    height: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav-new-dot {
    animation: none;
  }
}

/* TextTube no carrossel da home */
.home-carousel__thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  overflow: hidden;
  margin: 0.5rem 0 0.75rem;
  background: #000;
}

.home-carousel__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-carousel__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 2.2rem;
  background: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* --------------------------------------------------
   Vídeo no topo do post 
   -------------------------------------------------- */
.post-video {
  margin: 24px 0 32px;
}

.post-video__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.post-video__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.post-video__attribution {
  margin: 8px 0 0;
  font-size: 12px;
  opacity: .7;
  line-height: 1.4;
}
.post-video__attribution a {
  color: inherit;
  text-decoration: underline;
}

/* ============================================
   "Show more" (paginação dos index)
   ============================================ */

.filter-more-wrap {
  margin: 24px 0 8px;
  display: flex;
  justify-content: center;
}

.filter-more-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.filter-more-btn:hover {
  border-color: var(--accent-button);
  color: var(--accent-button);
}

.filter-more-btn:focus-visible {
  outline: 2px solid var(--accent-button);
  outline-offset: 2px;
}

/* --------------------------------------------------
   Checklists (dentro do profile-sheet)
   -------------------------------------------------- */
.cl { display: flex; flex-direction: column; gap: 12px; }

.cl-new { display: flex; gap: 8px; }
.cl-new__input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(0,0,0,.12));
  background: var(--bg, #fff);
  color: inherit;
  font: inherit;
}
.cl-new__btn {
  padding: 8px 14px;
  border-radius: 8px;
  border: 0;
  background: var(--accent, #4c1d95);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.cl-lists, .cl-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }

.cl-list {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 10px;
  background: var(--bg-soft, rgba(0,0,0,.04));
  padding: 2px;
}
.cl-list__open {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.cl-list__title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-list__meta { font-size: 12px; opacity: .7; flex-shrink: 0; }
.cl-list__rename, .cl-list__del, .cl-item__del {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  opacity: .7;
}
.cl-list__rename:hover, .cl-list__del:hover, .cl-item__del:hover { opacity: 1; background: rgba(0,0,0,.06); }

.cl-detail__top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cl-detail__back {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 4px 6px;
  font-weight: 600;
  opacity: .8;
}
.cl-detail__back:hover { opacity: 1; }
.cl-detail__title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cl-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bg-soft, rgba(0,0,0,.04));
}
.cl-item__label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.cl-item__check { flex-shrink: 0; }
.cl-item__text { overflow: hidden; text-overflow: ellipsis; }
.cl-item.is-done .cl-item__text { text-decoration: line-through; opacity: .55; }
.cl-item__del { flex-shrink: 0; }

/* --------------------------------------------------
   Timer de foco
   -------------------------------------------------- */
.timer { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 8px 0; }
.timer__title { margin: 0; font-size: 15px; opacity: .8; font-weight: 600; }

.timer__ring {
  --pct: 0;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    conic-gradient(var(--accent, #4c1d95) calc(var(--pct) * 1turn), rgba(0,0,0,.08) 0);
  position: relative;
}
.timer__ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--bg, #fff);
}
.timer__time {
  position: relative;
  z-index: 1;
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.timer__presets { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.timer__preset {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(0,0,0,.12));
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.timer__preset.is-active { background: var(--accent, #4c1d95); color: #fff; border-color: transparent; }

.timer__custom { display: flex; align-items: center; gap: 6px; }
.timer__custom-input {
  width: 72px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(0,0,0,.12));
  background: var(--bg, #fff);
  color: inherit;
  font: inherit;
  text-align: center;
}
.timer__custom-unit { font-size: 13px; opacity: .7; }
.timer__custom-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: 0;
  background: var(--bg-soft, rgba(0,0,0,.06));
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.timer__hint { margin: 0; font-size: 12px; opacity: .6; text-align: center; }

.timer__actions { display: flex; gap: 8px; }
.timer__start, .timer__pause, .timer__reset {
  padding: 10px 18px;
  border-radius: 10px;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.timer__start { background: var(--accent, #4c1d95); color: #fff; }
.timer__pause { background: var(--bg-soft, rgba(0,0,0,.08)); color: inherit; }
.timer__reset { background: transparent; color: inherit; border: 1px solid var(--border, rgba(0,0,0,.12)); }
.timer__reset:disabled { opacity: .4; cursor: not-allowed; }

/* --------------------------------------------------
   Quiz (posts e texttube)
   -------------------------------------------------- */
.quiz {
  max-width: 720px;
  margin: 40px auto 32px;
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--bg-soft, rgba(0,0,0,.04));
  border: 1px solid var(--border, rgba(0,0,0,.08));
}

.quiz__title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
}

.quiz__note {
  margin: 0 0 14px;
  font-size: 13px;
  opacity: .7;
}

.quiz__q {
  margin: 18px 0;
  padding-top: 12px;
  border-top: 1px solid var(--border, rgba(0,0,0,.08));
}
.quiz__q:first-of-type { border-top: 0; padding-top: 0; }

.quiz__stem {
  margin: 0 0 10px;
  font-weight: 600;
  line-height: 1.45;
}

.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.quiz__opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0,0,0,.08));
  background: var(--bg, #fff);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.quiz__opt:hover { background: var(--bg-soft, rgba(0,0,0,.03)); }

.quiz__radio {
  margin-top: 3px;
  flex-shrink: 0;
}

.quiz__opt-text { line-height: 1.4; }

/* Estados após correção */
.quiz__opt.is-correct {
  border-color: #10b981;
  background: rgba(16,185,129,.08);
}
.quiz__opt.is-wrong {
  border-color: #ef4444;
  background: rgba(239,68,68,.08);
}
.quiz__opt.is-chosen.is-correct { box-shadow: 0 0 0 1px #10b981 inset; }
.quiz__opt.is-chosen.is-wrong   { box-shadow: 0 0 0 1px #ef4444 inset; }

.quiz__explanation {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
  font-size: 14px;
  line-height: 1.45;
}

.quiz__result {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--bg, #fff);
  border: 1px solid var(--border, rgba(0,0,0,.08));
}

.quiz__score { margin: 0 0 4px; font-weight: 600; }
.quiz__verdict { margin: 0; font-weight: 700; }
.quiz__verdict.is-pass { color: #10b981; }
.quiz__verdict.is-fail { color: #ef4444; }

.quiz__coins {
  margin: 8px 0 0;
  font-weight: 700;
  color: var(--accent, #4c1d95);
}
.quiz__coins--muted { color: inherit; opacity: .65; font-weight: 500; }

.quiz__actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.quiz__submit {
  padding: 10px 20px;
  border-radius: 10px;
  border: 0;
  background: var(--accent, #4c1d95);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.quiz__submit:hover { filter: brightness(1.08); }
.quiz__submit:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 600px) {
  .quiz { padding: 16px 16px; margin: 28px 12px 24px; }
  .quiz__actions { justify-content: stretch; }
  .quiz__submit { width: 100%; }
}

/* Ações de interação na aula do curso (caneta + share + moeda) */
.course-lesson-content__interact {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border, rgba(0,0,0,.08));
}
.course-lesson-content__interact .share-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* --------------------------------------------------
   Claim do quiz (cursos) — +10 moedas
   -------------------------------------------------- */
.quiz__claim {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(76, 29, 149, 0.08); /* roxo suave */
  border: 1px solid rgba(76, 29, 149, 0.25);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

.quiz__claim-title {
  margin: 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent, #4c1d95);
}

.quiz__claim-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 0;
  background: var(--accent, #4c1d95);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.quiz__claim-btn:hover { filter: brightness(1.1); }
.quiz__claim-btn:active { transform: scale(0.98); }
.quiz__claim-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--bg-soft, rgba(0,0,0,.08));
  color: inherit;
}

/* Dark mode: ajusta o fundo roxo suave para não ficar estranho */
@media (prefers-color-scheme: dark) {
  .quiz__claim {
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.3);
  }
  .quiz__claim-title { color: #a78bfa; }
}

/* Dark mode via atributo/classe */
[data-theme="dark"] .quiz__claim,
body.dark .quiz__claim,
html.dark .quiz__claim {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
}
[data-theme="dark"] .quiz__claim-title,
body.dark .quiz__claim-title,
html.dark .quiz__claim-title {
  color: #a78bfa;
}
/* --------------------------------------------------
   Badges de níveis / conquistas (dentro do Meu Perfil)
   -------------------------------------------------- */

.profile-badges-slot {
  padding: 4px 20px 4px;
  border-bottom: 1px solid var(--border, rgba(0,0,0,.08));
}

.profile-badges {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-badges__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  opacity: .7;
}

/* Carrossel: rola no toque/trackpad, sem barra visível */
.profile-badges__scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.profile-badges__scroll::-webkit-scrollbar { display: none; }

/* Card base — sem fundo, sem borda, só ícone + nome */
.profile-badge {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  scroll-snap-align: start;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.profile-badge:focus-visible {
  outline: 2px solid var(--accent, #4c1d95);
  outline-offset: 2px;
}

.profile-badge__icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.profile-badge__icon svg {
  width: 100%;
  height: 100%;
}

.profile-badge__name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Cor por família */
.profile-badge.is-reader { --fam: #2563eb; }
.profile-badge.is-coin   { --fam: #b45309; }
.profile-badge.is-quiz   { --fam: #047857; }
.profile-badge.is-explorer { --fam: #7c3aed; }

/* --------------------------------------------------
   Estados
   -------------------------------------------------- */

/* Bloqueada: grayscale, cursor help */
.profile-badge.is-locked {
  cursor: help;
  filter: grayscale(1) opacity(.45);
}
.profile-badge.is-locked .profile-badge__icon {
  color: var(--text, #333);
}

/* Pronta para resgatar: ícone branco (dark) / cinza-escuro (light) */
.profile-badge.is-unlocked .profile-badge__icon {
  color: #ffffff;
}
:root:not([data-theme="dark"]) .profile-badge.is-unlocked .profile-badge__icon {
  color: #6b7280;
}
.profile-badge.is-unlocked:hover {
  transform: translateY(-2px);
}

/* Resgatada (claimed): ícone na cor da família, sem bolinha */
.profile-badge.is-claimed {
  cursor: default;
}
.profile-badge.is-claimed .profile-badge__icon {
  color: var(--fam);
}

/* Bolinha vermelha na badge pronta */
.profile-badge__dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  pointer-events: none;
  animation: rp-dot-pulse 2s ease-in-out infinite;
}

/* Bolinha vermelha no FAB */
#rp-fab-stack .profile-fab {
  position: relative;
}

.profile-fab__dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  pointer-events: none;
  z-index: 2;
  animation: rp-dot-pulse 2s ease-in-out infinite;
}

@keyframes rp-dot-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(220, 38, 38, 0);
    transform: scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-fab__dot {
    animation: none;
  }
}

/* Tooltip via data-tip (CSS only) */
.profile-badge[data-tip]:hover::after,
.profile-badge[data-tip]:focus-visible::after {
  content: attr(data-tip);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 8px;
  background: rgba(17,17,17,.95);
  color: #fff;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  z-index: 10;
  pointer-events: none;
}

/* --------------------------------------------------
   Mapa conceitual (SVG)
   -------------------------------------------------- */
.concept-map__hint {
  margin: 0 0 12px;
  font-size: 13px;
  opacity: .7;
  line-height: 1.4;
}

.concept-map__canvas {
  overflow: auto;
  max-height: 70vh;
  padding: 4px 0 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  touch-action: none;
}
.concept-map__canvas::-webkit-scrollbar {
  display: none;
}
.concept-map__canvas.is-dragging,
.concept-map__canvas:active {
  cursor: grabbing;
}

.concept-map__svg {
  display: block;
  margin: 0;
  max-width: none;
  max-height: none;
  flex: 0 0 auto;
}

.concept-map__line {
  stroke: var(--border, rgba(0,0,0,.18));
  stroke-width: 1.5;
}

.concept-map__node {
  cursor: pointer;
  outline: none;
}

.concept-map__node:focus-visible .concept-map__rect {
  stroke: var(--accent, #4c1d95);
  stroke-width: 2;
}

.concept-map__rect {
  fill: var(--bg, #fff);
  stroke: var(--border, rgba(0,0,0,.18));
  stroke-width: 1;
  transition: fill .15s ease, stroke .15s ease;
}
.concept-map__node:hover .concept-map__rect {
  stroke: var(--accent, #4c1d95);
  fill: var(--bg-soft, rgba(0,0,0,.04));
}

.concept-map__label {
  fill: var(--text, #111);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  pointer-events: none;
  user-select: none;
}

.concept-map__badge {
  fill: var(--accent, #4c1d95);
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 600px) {
  .concept-map__hint { font-size: 12px; }
  .concept-map__label { font-size: 12px; }
  .concept-map__canvas { max-height: 60vh; }
}

/* ---------- Nav toggle (hamburger) — BASE ---------- */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.nav-toggle:hover {
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ============================================
   Container dos botões flutuantes (canto inferior direito)
   Ordem visual (column): Menu → Perfil → Back-to-top
   ============================================ */

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

#rp-fab-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Quando o player de música está visível, sobe o container */
body.has-player #rp-fab-stack {
  bottom: calc(56px + 24px + env(safe-area-inset-bottom, 0));
}

@media (max-width: 600px) {
  body.has-player #rp-fab-stack {
    bottom: calc(48px + 24px + env(safe-area-inset-bottom, 0));
  }
}

/* Sobrescreve o posicionamento antigo dos 3 botões */
#rp-fab-stack .nav-toggle,
#rp-fab-stack .profile-fab,
#rp-fab-stack #back-to-top {
  position: relative;
  right: auto;
  bottom: auto;
  margin: 0;
}

/* Back-to-top: oculto com max-height (anima o slide),
   em vez de display:none (que mataria a transição) */
#rp-fab-stack #back-to-top {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  transform: translateY(8px);
  margin: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease,
              transform 0.3s ease, visibility 0.3s ease;
}

#rp-fab-stack #back-to-top.visible {
  max-height: 44px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============================================
   Menu mobile em popover (anima de baixo para cima)
   - No desktop (>1200px), o .site-nav continua no header (horizontal)
   - No mobile (≤1200px), o .site-nav é movido para #rp-fab-stack
     via fab-stack.js e vira popover acima do hamburguer
   ============================================ */
@media (max-width: 1200px) {

    .header-actions {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    transform: none;
  }

  .nav-toggle {
    display: flex;
  }

  #rp-fab-stack {
    /* o container é o offset parent do popover */
    position: fixed;
  }

  #rp-fab-stack .site-nav {
    display: flex;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    left: auto;
    top: auto;
    width: 240px;
    max-width: calc(100vw - 48px);
    height: auto;
    max-height: 70vh;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    z-index: 300;
    overflow-y: auto;
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;

    opacity: 0;
    transform: translateY(8px);
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease,
                visibility 0s linear 0.2s;
  }

  #rp-fab-stack .site-nav::-webkit-scrollbar {
    display: none;
  }

  #rp-fab-stack .site-nav.is-open {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.2s ease, transform 0.2s ease,
                visibility 0s linear 0s;
  }

  #rp-fab-stack .site-nav > a {
    width: 100%;
    max-width: none;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border);
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    background: transparent;
    border-radius: 6px;
  }

  #rp-fab-stack .site-nav > a:last-of-type {
    border-bottom: none;
  }

  #rp-fab-stack .site-nav > a:hover {
    background: var(--surface);
    color: var(--text);
  }

    /* Ordem fixa no stack: hamburguer → perfil → seta */
  #rp-fab-stack .nav-toggle   { order: 1; }
  #rp-fab-stack .profile-fab  { order: 2; }
  #rp-fab-stack #back-to-top  { order: 3; }
  #rp-fab-stack .site-nav     { order: 0; }

  /* Overlay: escurece, sem blur */
  .nav-overlay {
    position: fixed;
    inset: 0;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.35);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    z-index: 299;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  body.nav-open {
    overflow: hidden;
  }
}

/* ============================================
   Desktop (≥1201px): rede de segurança
   Se o fab-stack.js atrasar em devolver o .site-nav ao
   header, o CSS garante que ele não vire popover nem
   fique colado no canto inferior direito.
   ============================================ */

@media (min-width: 1201px) {
  #rp-fab-stack .site-nav {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    max-height: none;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    opacity: 1;
    transform: none;
    visibility: visible;
    pointer-events: auto;
    transition: none;
  }

  #rp-fab-stack .nav-toggle {
    display: none;
  }

  .theme-toggle-mobile {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-nav,
  .nav-overlay {
    transition: none !important;
  }
}

#stripe-embedded-checkout {
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rp-pdf-choice {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.rp-pdf-choice__body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-badges {
  position: relative;
}
.profile-badges__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border, rgba(0,0,0,.15));
  background: var(--bg, #fff);
  color: var(--text, #111);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.profile-badges__arrow--left { left: -6px; }
.profile-badges__arrow--right { right: -6px; }
.profile-badges__arrow[hidden] { display: none; }
@media (min-width: 1201px) {
  .profile-badges__arrow { display: none; }
}

/* ============================================
   Posts list (substitui .products-item* na listagem)
   ============================================ */

.posts-empty {
  padding: 20px;
  background: var(--surface-alt);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 1em 0;
}

.posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.posts-item {
  list-style: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  position: relative;
}

.posts-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.posts-item__link {
  display: block;
  padding: 22px 24px;
  color: inherit;
  text-decoration: none;
}
.posts-item__link:hover { text-decoration: none; }

.posts-item__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.posts-item__category {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
}

.posts-item__date {
  font-size: 0.78rem;
  color: var(--text-soft);
  font-weight: 500;
}

.posts-item__read {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #16a34a;
  background: rgba(22, 163, 74, 0.1);
  border-radius: 999px;
}

[data-theme="dark"] .posts-item__read {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.12);
}

.posts-item__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.posts-item__desc {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.posts-item__more {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.posts-item:hover .posts-item__more {
  color: var(--accent-hover);
}

.posts-item.is-read .posts-item__title {
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .posts-item__link { padding: 18px 20px; }
  .posts-item__title { font-size: 1.1rem; }
}

/* Estados de "vazio" para cursos, glossário e música */
.course-list-empty,
.glossary-error,
.music-empty {
  padding: 20px;
  background: var(--surface-alt);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 1em 0;
}