/* Site do Dr. Rafael Sabino: páginas de texto.
   Mesma identidade do site atual (fundo quase preto, dourado, Playfair Display
   nos títulos), com Figtree no texto e fundo quente (plano-visual-blog.md, 11/11/2026), pensada para LER texto longo no celular.
   Sem biblioteca. Contraste conferido em test_build.py (nível AA). */

:root {
  --fundo: hsl(30 15% 5%);
  --superficie: hsl(30 14% 8%);
  --elevado: hsl(30 12% 12%);
  --borda: hsl(32 13% 18%);
  --texto: hsl(38 37% 89%);
  --texto-2: hsl(35 13% 67%);
  --ouro: hsl(38 45% 60%);
  --ouro-claro: hsl(38 50% 72%);
  --ouro-escuro: hsl(38 40% 42%);
  --sobre-ouro: hsl(30 15% 5%);
  --pendencia: hsl(48 100% 77%);
  --sobre-pendencia: hsl(48 100% 6%);
  --alerta: hsl(8 100% 78%);
  --f-titulo: "Playfair Display", Georgia, "Times New Roman", serif;
  --f-texto: Figtree, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --coluna: 34em;          /* cerca de 68 caracteres por linha */
  --largo: 68rem;
  --raio: .75rem;
}

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

html {
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--f-texto);
  font-size: 1.0625rem;
  line-height: 1.7;
  overflow-wrap: break-word;
}

@media (min-width: 40em) { body { font-size: 1.125rem; } }

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

h1, h2, h3 { font-family: var(--f-titulo); font-weight: 600; line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 1.3rem + 3vw, 2.9rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.45rem, 1.2rem + 1.2vw, 1.8rem); margin-top: 2.4em; margin-bottom: .6em; color: var(--texto); }
.corpo h2::before { content: ""; display: block; width: 2.2rem; height: 2px; background: var(--ouro); margin-bottom: .85rem; }
h3 { font-family: var(--f-texto); font-size: 1.15em; font-weight: 600; line-height: 1.35; margin-top: 1.9em; margin-bottom: .4em; }

p, ul, ol, dl { margin: 0 0 1.15em; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: .45em; }
li::marker { color: var(--ouro); }
strong { font-weight: 600; color: hsl(38 45% 96%); }
hr { border: 0; border-top: 1px solid var(--borda); margin: 2.5em 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em;
  background: var(--elevado); padding: .1em .35em; border-radius: .3em; }

a { color: var(--ouro-claro); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: #fff; text-decoration-thickness: 2px; }
.corpo a { color: var(--texto); text-decoration-color: var(--ouro); }
.corpo a:hover { color: var(--ouro-claro); }

/* foco sempre visível */
:focus-visible { outline: 3px solid var(--ouro-claro); outline-offset: 3px; border-radius: .2em; }
main:focus { outline: none; }

/* pular para o conteúdo */
.pular { position: absolute; left: .75rem; top: -6rem; z-index: 50; background: var(--ouro); color: var(--sobre-ouro);
  padding: .7rem 1rem; border-radius: .5rem; font-weight: 600; text-decoration: none; }
.pular:focus { top: .75rem; }

/* faixa da prévia */
.faixa-previa { background: var(--pendencia); color: var(--sobre-pendencia); padding: .55rem 1rem; font-size: .95rem; text-align: center; }
.faixa-previa a { color: var(--sobre-pendencia); font-weight: 600; margin-left: .5rem; }
.faixa-previa strong, .nota-previa strong { color: inherit; }

/* cabeçalho */
.topo { border-bottom: 1px solid var(--borda); background: var(--fundo); }
.topo-dentro { max-width: var(--largo); margin: 0 auto; padding: .9rem 1.15rem .6rem; display: flex; flex-wrap: wrap;
  align-items: center; justify-content: space-between; gap: .4rem 2rem; }
.marca { display: block; text-decoration: none; color: var(--texto); padding: .2rem 0; }
.marca-nome { display: block; font-family: var(--f-titulo); font-size: 1.35rem; font-weight: 600; color: var(--ouro-claro); line-height: 1.2; }
.marca-sub { display: block; font-size: .78rem; letter-spacing: .03em; color: var(--texto-2); line-height: 1.4; }
.menu ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.menu li { margin: 0; }
.menu a { display: inline-block; padding: .65rem 0; min-height: 44px; color: var(--texto); text-decoration: none; font-size: .98rem; font-weight: 500; }
.menu a:hover { color: var(--ouro-claro); text-decoration: underline; }
.menu a[aria-current] { color: var(--ouro-claro); box-shadow: inset 0 -2px 0 var(--ouro); }

/* trilha */
.trilha { max-width: var(--largo); margin: 0 auto; padding: .9rem 1.15rem 0; font-size: .9rem; color: var(--texto-2); }
.trilha ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .35rem; }
.trilha li { margin: 0; }
.trilha li + li::before { content: "›"; margin-right: .35rem; color: var(--texto-2); }
.trilha a { color: var(--texto-2); display: inline-block; padding: .35rem 0; text-decoration-color: var(--borda); }
.trilha ol { flex-wrap: nowrap; overflow: hidden; white-space: nowrap; }
.trilha li { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.trilha li:first-child, .trilha li + li::before { flex: none; }
.trilha li[aria-current] { display: none; }
@media (min-width: 48em) { .trilha li[aria-current] { display: block; padding: .35rem 0; } }

/* coluna de leitura */
main { display: block; padding: 0 1.15rem 3rem; }
.texto { max-width: var(--coluna); margin: 0 auto; }
.cabeca { padding-top: 1.6rem; margin-bottom: 1.8rem; }
.revisao { margin: .5rem 0 0; font-size: .9rem; color: var(--texto-2); }

/* foto grande do médico no topo dos textos do blog: some no fundo na borda de baixo, nada escrito por cima */
.capa-retrato { margin: -.6rem -1.15rem 1.2rem; height: min(16rem, 40vh); overflow: hidden; position: relative;
  background: var(--fundo); }
.capa-retrato img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 62%, transparent 100%); mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 62%, transparent 100%); }
.capa-retrato::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(to bottom, transparent, var(--fundo)); pointer-events: none; }
@media (min-width: 40em) {
  .capa-retrato { margin: 0 0 1.4rem; height: 26rem; border-radius: 1rem; }
}
.cabeca h1 { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.1rem); line-height: 1.12; }
.quem-responde { margin: .9rem 0 0; font-size: .98rem; line-height: 1.5; color: var(--texto-2); }
.quem-responde strong { color: var(--texto); font-weight: 600; }
.retrato { width: 9.5rem; max-width: 45%; margin: 0 0 1.2rem; }
.retrato img { border-radius: var(--raio); aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }

/* resposta direta: letra maior, filete dourado, sem caixa */
.resposta { border-left: 2px solid var(--ouro); padding: .15rem 0 .2rem 1.1rem; margin: 0 0 2rem; }
.resposta-rotulo { font-family: var(--f-titulo); font-style: italic; font-size: 1.05rem; font-weight: 500;
  color: var(--ouro-claro); margin: 0 0 .35rem; }
.resposta p { margin: 0; font-size: 1.14em; line-height: 1.6; color: var(--texto); }

/* índice: painel que abre */
.indice { border-top: 1px solid var(--borda); border-bottom: 1px solid var(--borda); margin: 0 0 2.2rem; }
.indice summary { cursor: pointer; list-style: none; padding: .95rem 2rem .95rem 0; min-height: 48px; position: relative;
  font-weight: 600; color: var(--texto); }
.indice summary::-webkit-details-marker { display: none; }
.indice summary::after { content: ""; position: absolute; right: .35rem; top: 50%; width: .55rem; height: .55rem;
  border-right: 2px solid var(--ouro); border-bottom: 2px solid var(--ouro); transform: translateY(-70%) rotate(45deg); transition: transform .2s; }
.indice details[open] summary::after { transform: translateY(-20%) rotate(-135deg); }
.indice ul { list-style: none; padding: 0 0 .8rem; margin: 0; }
.indice li { margin: 0; }
.indice a { display: block; padding: .45rem 0; color: var(--texto-2); text-decoration: none; }
.indice a:hover { color: var(--ouro-claro); }

/* corpo */
.corpo > :first-child { margin-top: 0; }
.corpo h2 + h3 { margin-top: 1em; }

/* aviso em destaque (linha com "> ") */
.aviso { background: var(--superficie); border-radius: var(--raio);
  padding: 1rem 1.2rem; margin: 1.6em 0; font-size: .94em; color: var(--texto-2); }
.aviso strong { color: var(--texto); }
.aviso > :last-child { margin-bottom: 0; }

/* fala do médico (linhas com ">> "): sem caixa, letra grande, aspas douradas */
.fala { margin: 2.4em 0; padding: 1.6rem 0 0 0; position: relative; }
.fala::before { content: "\201C"; position: absolute; top: -.6rem; left: -.1rem; font-family: var(--f-titulo);
  font-size: 4.6rem; line-height: 1; color: var(--ouro); }
.fala blockquote { margin: 0; padding-left: 1.1rem; border-left: 1px solid var(--ouro-escuro); }
.fala blockquote p { font-family: var(--f-titulo); font-style: italic; font-weight: 500; font-size: 1.38rem; line-height: 1.42;
  color: var(--texto); margin: 0 0 .5em; text-wrap: pretty; }
.fala blockquote p:last-child { margin-bottom: 0; }
.fala figcaption { margin-top: .8rem; padding-left: 1.1rem; font-size: .88rem; color: var(--texto-2); }

/* figura (desenho explicativo) */
.figura { margin: 2em 0; }
.figura img { width: 100%; height: auto; border-radius: var(--raio); border: 1px solid var(--borda);
  background: var(--superficie); }
.figura figcaption { margin-top: .6rem; font-size: .85rem; color: var(--texto-2); }

/* tabela com rolagem lateral no celular */
.tabela-rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.6em 0; border: 1px solid var(--borda);
  border-radius: var(--raio);
  background:
    linear-gradient(to right, var(--fundo) 30%, transparent) left center / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--fundo) 30%, transparent) right center / 2.5rem 100% no-repeat local,
    linear-gradient(to right, hsl(40 45% 60% / .28), transparent) left center / 1rem 100% no-repeat scroll,
    linear-gradient(to left, hsl(40 45% 60% / .28), transparent) right center / 1rem 100% no-repeat scroll; }
table { border-collapse: collapse; width: 100%; font-size: .95em; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: .75rem .95rem; border-bottom: 1px solid var(--borda); min-width: 8.5rem; }
thead th { font-weight: 600; color: var(--ouro-claro); border-bottom: 1px solid var(--ouro-escuro); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
.ali-dir { text-align: right; }
.ali-centro { text-align: center; }

/* vídeo: nada do YouTube é carregado antes do clique */
.videos { margin-top: 3rem; }
.video { margin: 0 0 1.2rem; }
.video-caixa { aspect-ratio: 16 / 9; border: 1px solid var(--borda); border-radius: var(--raio); overflow: hidden;
  background: radial-gradient(ellipse at center, var(--elevado), var(--superficie)); }
.video-botao { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; width: 100%; height: 100%;
  padding: 1rem; text-align: center; color: var(--texto); text-decoration: none; }
.video-botao { position: relative; }
.video-capa { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.video-botao:has(.video-capa) { justify-content: flex-end; align-items: flex-start; padding: .9rem; }
.video-botao:has(.video-capa) .video-icone { position: relative; width: 3.2rem; height: 3.2rem; box-shadow: 0 2px 10px rgb(0 0 0 / .45); }
.video-botao:has(.video-capa) .video-acao, .video-botao:has(.video-capa) .video-nome {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.video-botao:hover { color: #fff; background: hsl(40 45% 60% / .07); }
.video-botao:focus-visible { outline-offset: -5px; }
.video-icone { width: 4rem; height: 4rem; border-radius: 50%; background: var(--ouro); position: relative; flex: none; }
.video-icone::after { content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%);
  border-style: solid; border-width: .75rem 0 .75rem 1.2rem; border-color: transparent transparent transparent var(--sobre-ouro); }
.video-acao { font-weight: 600; color: var(--ouro-claro); }
.video-nome { font-family: var(--f-titulo); font-size: 1.15em; line-height: 1.3; max-width: 26em; }
.video-quadro { width: 100%; height: 100%; border: 0; display: block; }
.video-fora { font-size: .9rem; margin: .4rem 0 0; }
.video-nota { font-size: .88rem; color: var(--texto-2); }

/* quem escreveu e revisou */
.autoria { margin-top: 3rem; padding: 1.2rem 1.25rem; background: var(--superficie); border: 1px solid var(--borda);
  border-radius: var(--raio); font-size: .95em; }
.autoria h2 { font-size: 1.2rem; margin: 0 0 .6rem; }
.autoria p:last-child { margin-bottom: 0; }
.autoria-nota { color: var(--texto-2); }
.identificacao { font-weight: 600; color: var(--texto); letter-spacing: .01em; }

/* chamada para a consulta */
.chamada { margin-top: 2rem; padding: 1.4rem 1.25rem 1.3rem; border: 1px solid var(--ouro-escuro); border-radius: var(--raio); }
.chamada h2 { margin: 0 0 .5rem; }
.chamada-nota { font-size: .9rem; color: var(--texto-2); margin: 1rem 0 0; }
.chamada-link { margin: .8rem 0 0; }
.botoes { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin: 1.1rem 0 0; }
.botao { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.35rem;
  background: var(--ouro); color: var(--sobre-ouro); border: 2px solid var(--ouro); border-radius: .6rem;
  font: inherit; font-weight: 600; line-height: 1.25; text-align: center; text-decoration: none; cursor: pointer; }
.botao:hover { background: var(--ouro-claro); border-color: var(--ouro-claro); color: var(--sobre-ouro); }
.botao:focus-visible { outline-color: #fff; }
.botao-2 { background: transparent; color: var(--ouro-claro); border-color: var(--ouro); }
.botao-2:hover { background: hsl(40 45% 60% / .14); color: #fff; }
.nota-previa { flex-basis: 100%; font-size: .82rem; background: var(--pendencia); color: var(--sobre-pendencia);
  padding: .2rem .5rem; border-radius: .3rem; width: fit-content; }
.link-botao { background: none; border: 0; padding: .4rem 0; font: inherit; color: var(--ouro-claro); text-decoration: underline; cursor: pointer; }

/* listas de páginas (home, blog, seção) */
.lista-paginas { margin-top: 2.6rem; }
.lista-paginas h2, .videos h2 { margin-top: 0; }
.lista-paginas ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.lista-paginas li { margin: 0; padding: 1.1rem 1.15rem 1.15rem; background: var(--superficie); border: 1px solid var(--borda);
  border-radius: var(--raio); position: relative; transition: border-color .15s; }
.lista-paginas li:hover { border-color: var(--ouro-escuro); }
.lista-paginas li > a { font-family: var(--f-titulo); font-size: 1.3em; font-weight: 600; line-height: 1.25; color: var(--texto);
  text-decoration: none; display: block; }
.lista-paginas li > a::after { content: ""; position: absolute; inset: 0; border-radius: var(--raio); }
.lista-paginas li > a:focus-visible { outline: none; }
.lista-paginas li > a:focus-visible::after { outline: 3px solid var(--ouro-claro); outline-offset: 2px; }
.lista-paginas li p { margin: .45rem 0 0; color: var(--texto-2); font-size: .95em; line-height: 1.55; }
.lista-paginas .miniatura { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: top;
  border-radius: calc(var(--raio) - .2rem); margin: 0 0 1rem; background: var(--fundo); }

/* capa da home */
.capa { max-width: var(--largo); margin: 0 auto; padding: 2rem 0 1rem; display: grid; gap: 1.8rem; align-items: center; }
.capa-texto { max-width: var(--coluna); }
.capa-resumo { font-size: 1.12em; margin: 1.1rem 0 0; }
.capa-id { font-size: .88rem; color: var(--texto-2); margin: 1.1rem 0 0; letter-spacing: .01em; }
.capa-foto img { border-radius: 1rem; width: 100%; max-width: 24rem; max-height: 70vh; object-fit: cover; object-position: top; margin: 0 auto; }
@media (min-width: 56em) {
  .capa { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 3rem; padding-top: 3rem; }
  .capa-foto img { max-width: 100%; }
}

/* rodapé */
.rodape { border-top: 1px solid var(--borda); background: var(--superficie); font-size: .95rem; padding: 2.2rem 1.15rem 1.6rem; }
.rodape-dentro { max-width: var(--largo); margin: 0 auto; display: grid; gap: 1.8rem; }
@media (min-width: 48em) { .rodape-dentro { grid-template-columns: 1.4fr 1.1fr 1fr 1fr; } }
.rodape h2 { font-family: var(--f-titulo); font-size: 1.05rem; font-weight: 500; font-style: italic;
  color: var(--ouro-claro); margin: 0 0 .5rem; }
.rodape-nome { font-family: var(--f-titulo); font-size: 1.3rem; color: var(--ouro-claro); margin: 0 0 .5rem; }
.rodape address { font-style: normal; margin: 0 0 .6rem; }
.rodape ul { list-style: none; padding: 0; margin: 0; }
.rodape li { margin: 0; }
.rodape li a { display: inline-block; padding: .35rem 0; }
.rodape p { margin: 0 0 .5rem; }
.rodape-nota { max-width: var(--largo); margin: 1.8rem auto 0; padding-top: 1.1rem; border-top: 1px solid var(--borda); color: var(--texto-2); font-size: .88rem; }

/* aviso de cookies */
.cookies { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--elevado); border-top: 2px solid var(--ouro);
  padding: 1rem 1.15rem; display: flex; flex-wrap: wrap; gap: .8rem 1.5rem; align-items: center; justify-content: center; font-size: .95rem; }
.cookies[hidden] { display: none; }
.cookies p { margin: 0; max-width: 44em; }
.cookies-botoes { display: flex; gap: .75rem; }

/* pendências e avisos da prévia */
.pendencia { background: var(--pendencia); color: var(--sobre-pendencia); padding: .05em .3em; border-radius: .25em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.pendencia a, .pendencia strong { color: inherit; }
.pendencia-rotulo { font-weight: 700; }
.link-quebrado { text-decoration: underline wavy var(--alerta); color: var(--alerta); }
.pendencias-lista { max-width: var(--coluna); margin: 3rem auto 0; padding: 1.2rem 1.25rem; border: 2px dashed var(--pendencia); border-radius: var(--raio); font-size: .95em; }
.pendencias-lista h2 { margin-top: 0; color: var(--pendencia); }
.pendencias-lista h3 { margin-top: 1.4em; }
.pend-explica, .conta { color: var(--texto-2); font-size: .9em; }
.pend-busca dt { font-weight: 600; color: var(--texto-2); font-size: .85em; text-transform: uppercase; letter-spacing: .06em; margin-top: .6em; }
.pend-busca dd { margin: 0; }
.painel { max-width: var(--largo); }

/* computador: a página usa a largura da tela. Foto ao lado do título, coluna de leitura mais larga
   com letra maior (mantém cerca de 70 caracteres por linha) e a lista do blog em duas colunas. */
@media (min-width: 64em) {
  .figura img { width: auto; max-width: 100%; max-height: 34rem; margin: 0 auto; display: block; }
  .figura figcaption { text-align: center; }
  :root { --coluna: 41em; }
  body { font-size: 1.1875rem; }
  .texto { max-width: calc(var(--largo) - 2.3rem); }
  .texto > :not(.cabeca) { max-width: var(--coluna); margin-left: auto; margin-right: auto; }
  .cabeca { display: grid; grid-template-columns: 24rem minmax(0, 1fr); grid-template-rows: 1fr auto auto auto 1fr;
    column-gap: 3.5rem; padding-top: 2.2rem; margin-bottom: 3.2rem; }
  .cabeca > * { grid-column: 2; }
  .cabeca > .capa-retrato { grid-column: 1; grid-row: 1 / -1; margin: 0; height: 30rem; border-radius: 1rem; }
  .cabeca > h1 { grid-row: 2; font-size: clamp(2.8rem, 1.2rem + 2.6vw, 3.6rem); }
  .cabeca > .quem-responde { grid-row: 3; font-size: 1.05rem; }
  .cabeca > .revisao { grid-row: 4; }
  .lista-paginas ul { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .botao, a { transition: background-color .15s ease, color .15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* contraste reforçado, quando o aparelho pede */
@media (prefers-contrast: more) {
  :root { --texto: #fff; --texto-2: hsl(220 8% 86%); --borda: hsl(220 8% 55%); }
}
@media (forced-colors: active) {
  .botao { border: 2px solid ButtonText; }
  .video-icone { forced-color-adjust: none; }
}

/* impressão e PDF de revisão: fundo branco, sem botões */
@media print {
  :root { --fundo: #fff; --superficie: #fff; --elevado: #fff; --texto: #000; --texto-2: #333; --ouro-claro: #000; --ouro: #000; --borda: #999; }
  html { color-scheme: light; }
  body { font-size: 11.5pt; }
  strong { color: #000; }
  .pular, .menu, .trilha, .chamada, .cookies, .video-caixa, .faixa-previa a, .rodape nav, .indice { display: none !important; }
  .tabela-rolagem { overflow: visible; background: none; }
  a { color: #000; }
  .corpo a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .85em; word-break: break-all; }
  h2, h3 { break-after: avoid; }
  .resposta, .aviso, .autoria, tr { break-inside: avoid; }
}
