@import url("/assets/brand-tokens.css");
:root {
  --bg: var(--color-fundo);
  --surface: var(--color-surface);
  --text: var(--color-texto);
  --muted: var(--color-texto-secundario);
  --line: var(--color-borda);
  --accent: var(--color-dourado-texto);
  --accent-text: var(--color-surface);
  font: 16px/1.65 var(--font-corpo);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}
a {
  color: var(--accent);
  text-underline-offset: 0.2em;
}
button,
input,
select,
textarea {
  font: inherit;
  max-width: 100%;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button {
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
}
button:hover {
  border-color: var(--accent);
}
button.primary {
  background: var(--accent);
  color: var(--accent-text);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
input,
textarea,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 0.6rem;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
label {
  display: block;
  margin: 0.65rem 0 0.3rem;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: -0.025em;
}
h2 {
  font-size: 1.5rem;
}
h3 {
  font-size: 1.2rem;
}
h1,
h2,
h3,
h4,
[id] {
  scroll-margin-top: 90px;
}
p,
li {
  overflow-wrap: anywhere;
}
img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}
video {
  width: 100%;
}
figure {
  margin: 1.5rem 0;
}
figcaption,
.muted,
.breadcrumbs,
.eyebrow {
  color: var(--muted);
}
.lead {
  font-size: 1.15rem;
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 68px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem max(1rem, env(safe-area-inset-left));
}
.brand {
  font-weight: 750;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}
.brand span {
  color: var(--muted);
  font-weight: 400;
}
.reading-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 900px) 190px;
  max-width: 1500px;
  margin: auto;
  gap: 2rem;
  padding: 2rem 1.5rem;
}
.reading-layout > main {
  min-width: 0;
}
.desktop-nav,
.desktop-toc {
  align-self: start;
  position: sticky;
  top: 100px;
  max-height: calc(100dvh - 125px);
  overflow: auto;
}
.desktop-nav a,
.desktop-toc a,
#menu-dialog nav a {
  display: block;
  padding: 0.45rem 0.5rem;
  border-radius: 5px;
}
.desktop-nav a[aria-current] {
  background: var(--surface);
  font-weight: 700;
}
.desktop-nav details details {
  margin-left: 0.8rem;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 0.5rem 0;
}
details > p {
  margin: 0.5rem;
}
footer {
  border-top: 1px solid var(--line);
  padding: 2rem;
  color: var(--muted);
}
.mobile-toc,
#menu-open {
  display: none;
}
.table-scroll {
  max-width: 100%;
  overflow: auto;
  margin: 1.5rem 0;
  overscroll-behavior-x: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th,
td {
  border: 1px solid var(--line);
  padding: 0.7rem;
  min-width: 110px;
  vertical-align: top;
}
caption {
  padding: 0.8rem;
  text-align: left;
  font-weight: 650;
}
th {
  background: var(--surface);
}
pre {
  overflow: auto;
  padding: 1rem;
  background: var(--surface);
  border-radius: 6px;
}
blockquote,
.notice {
  border-left: 3px solid var(--accent);
  padding: 1rem;
  margin: 1.5rem 0;
  background: var(--surface);
}
.notice.warning,
.notice.error {
  border-color: #dcaa5b;
}
.article-actions {
  margin-top: 2.5rem;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}
.article-actions button {
  margin: 0.3rem;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  width: min(680px, calc(100% - 24px));
  max-height: 85vh;
  max-height: 85dvh;
  overflow: auto;
  padding: 1.25rem;
}
dialog::backdrop {
  background: #0009;
}
#search-results {
  padding-left: 1rem;
}
#search-results li {
  padding: 0.5rem 0;
}
#search-dialog form {
  text-align: right;
}
#search-dialog input {
  position: sticky;
  top: 0;
  z-index: 1;
}
.skip {
  position: absolute;
  top: -100px;
  z-index: 100;
  background: var(--surface);
  padding: 1rem;
}
.skip:focus {
  top: 0;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.inline,
.actions,
.toolbar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}
.inline input {
  flex: 1;
  min-width: 120px;
}
.admin-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  max-width: 1400px;
  margin: auto;
}
.admin-layout > nav {
  padding: 1rem;
  position: sticky;
  top: 70px;
  align-self: start;
}
.admin-layout > nav button {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0.3rem 0;
}
.admin-layout > main {
  min-width: 0;
  padding: 1.5rem;
  max-width: 1100px;
}
.admin-layout nav button[aria-current] {
  border-color: var(--accent);
  color: var(--accent);
}
.record {
  border-bottom: 1px solid var(--line);
  padding: 1rem 0;
}
.record h2 {
  margin: 0.3rem 0;
}
.login {
  max-width: 480px;
  margin: 8vh auto;
  padding: 1.5rem;
}
.status {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: pre-wrap;
}
.error {
  border-color: #df987a;
}
.editor {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 400px;
  overflow-wrap: anywhere;
}
.editor:focus-within {
  border-color: var(--accent);
}
.editor-toolbar {
  background: var(--surface);
  padding: 0.5rem;
  border-radius: 6px;
  margin: 0.5rem 0;
}
.editor-toolbar button {
  font-size: 0.9rem;
}
.editor table p {
  margin: 0.3rem;
}
.editor [data-slate-editor] {
  min-height: 280px;
  outline: none;
}
.block-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.5rem;
}
.block-actions button {
  font-size: 0.85rem;
}
.preview {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--line);
  background: white;
}
.preview.mobile {
  max-width: 390px;
}
.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.pill {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  font-size: 0.85rem;
}
.toolbar details {
  position: relative;
}
.toolbar details[open] > div {
  padding: 1rem;
  max-height: 60vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
}
.field-help {
  color: var(--muted);
  font-size: 0.9rem;
}
.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.check input {
  width: 22px;
  min-height: 22px;
}
.admin-menu {
  display: none;
}
kbd {
  font-size: 0.75rem;
  color: var(--muted);
}
.code-output {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 400px;
  overflow: auto;
}
.editor-figure {
  padding: 0.75rem;
  background: var(--surface);
}
[role="status"] {
  overflow-wrap: anywhere;
}
@media (max-width: 1200px) {
  .reading-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .desktop-toc {
    display: none;
  }
  .mobile-toc {
    display: block;
  }
}
@media (max-width: 760px) {
  .reading-layout {
    display: block;
    padding: 1.3rem 1rem;
  }
  .desktop-nav {
    display: none;
  }
  #menu-open {
    display: block;
  }
  .top {
    gap: 0.4rem;
    min-height: 60px;
    flex-wrap: wrap;
  }
  .top > a:last-child {
    display: none;
  }
  .top kbd {
    display: none;
  }
  .brand span {
    display: none;
  }
  .top button {
    padding: 0.4rem 0.6rem;
  }
  .admin-layout {
    display: block;
  }
  .admin-layout > nav {
    position: static;
    display: flex;
    overflow-x: auto;
    padding: 0.5rem;
    gap: 0.4rem;
  }
  .admin-layout > nav button {
    width: auto;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .admin-layout > main {
    padding: 1rem;
  }
  .grid-form {
    grid-template-columns: 1fr;
  }
  .editor {
    padding: 0.6rem;
  }
  .toolbar {
    gap: 0.3rem;
  }
  .toolbar > button {
    font-size: 0.85rem;
  }
  .login {
    margin: 2rem auto;
  }
  .table-scroll {
    margin: 1rem 0;
  }
  dialog {
    padding: 1rem;
    max-height: calc(100dvh - 24px);
  }
  footer {
    padding-bottom: max(2rem, env(safe-area-inset-bottom));
  }
  .top .brand {
    font-size: 0.95rem;
  }
  .editor-toolbar {
    position: static;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
.resize-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  min-height: 44px;
  cursor: col-resize;
  float: right;
  touch-action: none;
  color: var(--muted);
}

/* Adaptação do guia oficial: conteúdo sólido; vidro só na navegação/controles. */
body {
  background: linear-gradient(155deg, var(--canvas-alto), var(--canvas-meio));
  min-height: 100dvh;
}
h1,
h2,
h3 {
  color: var(--color-texto-forte);
}
h1 {
  font-size: clamp(1.75rem, 4vw, 2.125rem);
}
button {
  border-radius: var(--radius-botao);
}
input,
select,
textarea {
  border-color: var(--color-borda-controle);
  border-radius: var(--radius-controle);
  background: var(--surface);
  font-size: max(1em, 16px);
}
input:not([type="checkbox"]):not([type="radio"]),
select {
  min-height: 52px;
}
button.primary {
  color: var(--text);
  background: var(--vidro-tingido-solido);
  border-color: var(--color-borda-controle);
  font-weight: 600;
}
button.primary:hover {
  background: var(--vidro-tingido-hover-solido);
}
.top {
  background: var(--vidro-solido);
  border: 0;
  box-shadow: var(--shadow-cartao);
}
.top button,
.editor-toolbar button {
  background: var(--vidro-solido);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}
.brand-logo {
  width: 160px;
  height: auto;
  flex-shrink: 0;
}
.brand-logo-dark,
.brand-symbol {
  display: none;
}
html[data-theme="dark"] .brand-logo-light {
  display: none;
}
html[data-theme="dark"] .brand-logo-dark {
  display: block;
}
.brand span {
  font-size: 0.875rem;
}
.reading-layout {
  max-width: 1500px;
  gap: 24px;
}
.reading-layout > main,
.admin-layout > main,
.login {
  background: var(--surface);
  border-radius: var(--radius-cartao);
  box-shadow: var(--shadow-cartao);
  padding: clamp(20px, 3vw, 32px);
}
.admin-layout > main {
  margin: 24px 16px;
}
.desktop-nav,
.admin-layout > nav {
  border-radius: var(--radius-modal);
  padding: 16px;
  background: var(--vidro-solido);
  box-shadow: var(--shadow-cartao);
}
.desktop-nav a,
.desktop-toc a,
#menu-dialog nav a,
.admin-layout > nav button {
  border-radius: var(--radius-botao);
  min-height: 44px;
}
.desktop-nav a[aria-current],
.admin-layout nav button[aria-current] {
  background: var(--vidro-tingido-solido);
  color: var(--text);
  font-weight: 600;
}
.editor,
.editor-toolbar,
.status,
.table-scroll,
pre,
.toolbar details[open] > div {
  border-radius: var(--radius-controle);
}
.editor {
  background: var(--surface);
}
.login {
  width: min(480px, calc(100% - 40px));
  border-radius: var(--radius-modal);
}
dialog {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
}
@supports (
  (backdrop-filter: blur(24px)) or (-webkit-backdrop-filter: blur(24px))
) {
  .top,
  .desktop-nav,
  .admin-layout > nav {
    background: var(--vidro-navegacao-fill);
    backdrop-filter: blur(24px) saturate(1.15);
    -webkit-backdrop-filter: blur(24px) saturate(1.15);
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .top,
  .desktop-nav,
  .admin-layout > nav {
    background: var(--vidro-solido);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  body {
    background: var(--bg);
  }
}
@media (max-width: 760px) {
  :root {
    font-size: 17px;
  }
  .reading-layout {
    padding: 20px;
  }
  .admin-layout > main {
    margin: 16px;
    padding: 20px;
  }
  .admin-layout > nav {
    margin: 12px 16px;
    border-radius: var(--radius-cartao);
  }
  .admin-layout > nav button {
    min-width: max-content;
  }
  .top {
    padding-inline: max(12px, env(safe-area-inset-left));
  }
}
@media (max-width: 480px) {
  .top .brand-logo,
  html[data-theme="dark"] .top .brand-logo-dark {
    display: none;
  }
  .top .brand-symbol {
    display: block;
    width: 36px;
    height: 44px;
    object-fit: contain;
  }
  .top .brand-symbol-dark {
    display: none;
  }
  html[data-theme="dark"] .top .brand-symbol-light {
    display: none;
  }
  html[data-theme="dark"] .top .brand-symbol-dark {
    display: block;
  }
  .top .brand {
    gap: 8px;
  }
  .top .brand span {
    display: block;
  }
}
