/* Termos e Privacidade: layout de leitura no tema da landing (rosa, algodão,
   areia, Urbanist). Índice lateral com a seção atual marcada, barra de
   progresso e voltar ao topo. Os tokens de cor vêm de lp.css. */

html { scroll-padding-top: 96px; }
body.legal { background: var(--blush); color: #48626D; }
[hidden] { display: none !important; }

/* progresso de leitura */
.lg-progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 60; background: transparent; }
.lg-progress i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--pink), var(--berry)); transform-origin: 0 50%; transform: scaleX(0); }

/* topo */
.lg-nav {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 14px;
  padding: 12px max(var(--gutter), calc((100% - 1160px) / 2));
  background: rgba(255,245,248,.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(181,18,79,.08);
}
.lg-nav .nav-logo { color: #0D172B; }
.lg-docs { display: flex; gap: 4px; margin-left: auto; background: #fff; border-radius: var(--r-pill); padding: 4px; box-shadow: 0 4px 14px -8px rgba(181,18,79,.3); }
.lg-docs a { text-decoration: none; font-weight: 800; font-size: 13px; color: #60758D; padding: 7px 14px; border-radius: var(--r-pill); transition: background .2s, color .2s; }
.lg-docs a[aria-current="page"] { background: var(--pink); color: #fff; }
.lg-docs a:not([aria-current]):hover { color: var(--berry); background: var(--blush-2); }
.lang-switch { display: flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--blush-2); }
.lang-switch button { font: inherit; background: none; border: 0; color: var(--berry); font-weight: 800; font-size: 12px; padding: 6px 11px; border-radius: var(--r-pill); cursor: pointer; }
.lang-switch button[aria-pressed="true"] { background: #fff; color: var(--pink); box-shadow: 0 2px 8px -2px rgba(181,18,79,.3); }
.lg-back { text-decoration: none; font-weight: 800; font-size: 13px; color: #fff; background: var(--pink); padding: 9px 16px; border-radius: var(--r-pill); transition: transform .2s var(--pop); }
.lg-back:hover { transform: translateY(-2px); }

/* cabeçalho rosa */
.lg-hero { position: relative; overflow: hidden; padding: 56px 0 96px; background: linear-gradient(160deg, var(--pink), #FF5C93 60%, var(--berry)); color: #fff; }
.lg-hero::after { content: "♥"; position: absolute; right: 6%; top: -40px; font-size: 280px; line-height: 1; color: rgba(255,255,255,.08); transform: rotate(14deg); pointer-events: none; }
.lg-hero h1 { font-weight: 800; text-transform: uppercase; letter-spacing: -.02em; line-height: 1; font-size: clamp(36px, 6vw, 72px); max-width: 16ch; }
.lg-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.lg-meta span { font-size: 13px; font-weight: 800; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); padding: 7px 12px; border-radius: var(--r-pill); }

/* corpo: índice + texto */
.lg-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: -64px; position: relative; z-index: 1; padding-bottom: 80px; }
.lg-toc { position: sticky; top: 84px; max-height: calc(100vh - 104px); display: flex; flex-direction: column; background: #fff; border-radius: 24px; padding: 16px 10px 10px 16px; box-shadow: 0 20px 40px -24px rgba(181,18,79,.35); }
.lg-toc-head { display: flex; align-items: center; justify-content: space-between; padding-right: 6px; }
.lg-toc-head b { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--berry); }
.lg-toc-toggle { display: none; }
.lg-search { margin: 12px 6px 8px 0; position: relative; }
.lg-search input { width: 100%; font: inherit; font-size: 13px; font-weight: 600; color: #0D172B; border: 2px solid var(--blush-2); background: var(--blush); border-radius: 14px; padding: 9px 12px; outline: none; transition: border-color .2s; }
.lg-search input:focus { border-color: var(--pink); }
.lg-toc ol { list-style: none; margin: 0; padding: 0 6px 6px 0; overflow-y: auto; overscroll-behavior: contain; }
.lg-toc li a { display: flex; gap: 10px; align-items: baseline; text-decoration: none; color: #48626D; font-size: 13.5px; font-weight: 600; line-height: 1.3; padding: 8px 10px; border-radius: 12px; transition: background .2s, color .2s; }
.lg-toc li a .n { flex: none; min-width: 26px; font-size: 11px; font-weight: 800; color: var(--pink); }
.lg-toc li a:hover { background: var(--blush); color: var(--berry); }
.lg-toc li a.on { background: var(--pink); color: #fff; }
.lg-toc li a.on .n { color: #fff; }
.lg-toc li.miss { display: none; }

.lg-doc { background: #fff; border-radius: 32px; padding: clamp(24px, 4vw, 56px); box-shadow: 0 30px 60px -36px rgba(181,18,79,.35); min-width: 0; }
.lg-doc p, .lg-doc li { font-size: 16.5px; line-height: 1.7; color: #48626D; }
.lg-doc p { margin: 0 0 14px; }
.lg-doc ul, .lg-doc ol { margin: 0 0 16px; padding-left: 22px; }
.lg-doc li { margin-bottom: 8px; }
.lg-doc li::marker { color: var(--pink); }
.lg-doc strong { color: #0D172B; }
.lg-doc a { color: var(--pink); font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: rgba(250,58,127,.3); }
.lg-doc a:hover { text-decoration-color: var(--pink); }
.lg-doc hr { display: none; }
.lg-doc h2 {
  display: flex; align-items: center; gap: 12px; margin: 44px 0 16px; padding-top: 28px; border-top: 2px dashed var(--blush-2);
  font-size: clamp(21px, 2.4vw, 26px); font-weight: 800; color: var(--berry); letter-spacing: -.01em; line-height: 1.2;
}
.lg-doc h2:first-of-type { margin-top: 28px; }
.lg-doc h2 .num { flex: none; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 14px; background: var(--blush-2); color: var(--pink); display: grid; place-items: center; font-size: 16px; }
.lg-doc h2 .anchor { margin-left: auto; opacity: 0; font-size: 18px; text-decoration: none; color: var(--pink-light); transition: opacity .2s; }
.lg-doc h2:hover .anchor { opacity: 1; }
.lg-doc h3 { font-size: 18px; font-weight: 800; color: #0D172B; margin: 26px 0 10px; }
.lg-doc blockquote { margin: 0 0 20px; padding: 18px 20px 18px 56px; position: relative; background: var(--blush); border: 2px solid var(--blush-2); border-radius: 20px; }
.lg-doc blockquote::before { content: "!"; position: absolute; left: 16px; top: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--pink); color: #fff; font-weight: 800; display: grid; place-items: center; }
.lg-doc blockquote p:last-child { margin-bottom: 0; }
.lg-doc .table-wrap { overflow-x: auto; margin: 0 0 20px; border-radius: 18px; border: 2px solid var(--blush-2); }
.lg-doc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.lg-doc th, .lg-doc td { text-align: left; padding: 12px 14px; vertical-align: top; color: #48626D; border-bottom: 1px solid var(--blush-2); }
.lg-doc th { background: var(--blush); color: var(--berry); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.lg-doc tr:last-child td { border-bottom: 0; }
.lg-doc td:first-child { font-weight: 700; color: #0D172B; }
.lg-doc code { background: var(--blush); color: var(--berry); padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* voltar ao topo */
.lg-top { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; background: var(--pink); color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 10px 24px -8px rgba(250,58,127,.7); opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none; transition: opacity .3s, transform .4s var(--pop); }
.lg-top.show { opacity: 1; transform: none; pointer-events: auto; }

/* rodapé enxuto */
.lg-foot { background: var(--sand-2); color: #48626D; padding: 32px 0; }
.lg-foot .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; justify-content: space-between; }
.lg-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.lg-foot a { text-decoration: none; font-weight: 700; color: #48626D; }
.lg-foot a:hover { color: var(--berry); }
.lg-foot small { font-size: 13px; opacity: .8; }

@media (max-width: 960px) {
  .lg-layout { grid-template-columns: 1fr; margin-top: -56px; }
  .lg-toc { position: sticky; top: 64px; z-index: 20; max-height: none; padding: 10px 12px; border-radius: 20px; }
  .lg-toc-toggle { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 800; color: var(--pink); background: var(--blush); border: 0; border-radius: var(--r-pill); padding: 7px 12px; cursor: pointer; }
  .lg-toc-current { font-size: 13px; font-weight: 700; color: #0D172B; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; flex: 1; margin: 0 10px; }
  .lg-toc:not(.open) .lg-search, .lg-toc:not(.open) ol { display: none; }
  .lg-toc.open ol { max-height: 55vh; }
  .lg-toc-head b { display: none; }
}
@media (min-width: 961px) { .lg-toc-current { display: none; } }
@media (max-width: 640px) {
  .lg-nav { gap: 8px; flex-wrap: wrap; }
  .lg-nav .nav-logo span { display: none; }
  .lg-docs a { padding: 6px 10px; font-size: 12px; }
  .lg-back { display: none; }
  .lg-toc { top: 58px; }
  .lg-hero { padding: 40px 0 84px; }
  .lg-doc { border-radius: 24px; }
  .lg-doc h2 .num { min-width: 38px; height: 38px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
