/* Arquivo do blog de UX e UI Design. Tokens primeiro, depois estrutura, depois conteúdo. */

@font-face { font-family: "Geist"; src: url(/fontes/geist.woff2) format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url(/fontes/geist-italic.woff2) format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Anybody"; src: url(/fontes/anybody.woff2) format("woff2"); font-weight: 100 900; font-stretch: 50% 150%; font-style: normal; font-display: swap; }

:root {
  color-scheme: light dark;
  /* claro: tela cinza frio, quadros brancos */
  --tela: oklch(0.972 0.003 255);
  --quadro: oklch(0.995 0.001 255);
  --tinta: oklch(0.32 0.012 258);
  --apagado: oklch(0.5 0.014 258);
  --linha: oklch(0.9 0.005 255);
  --selecao: oklch(0.52 0.2 259);
  --contorno-img: oklch(0 0 0 / 0.1);

  --fonte-corpo: "Geist", sans-serif;
  --fonte-titulo: "Anybody", "Geist", sans-serif;
  --coluna: 46rem;
  --pagina: 72rem;
  --margem: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    /* escuro: preto de OLED, sem branco puro */
    --tela: oklch(0.12 0.003 260);
    --quadro: oklch(0.17 0.004 260);
    --tinta: oklch(0.84 0.004 260);
    --apagado: oklch(0.68 0.01 260);
    --linha: oklch(0.27 0.006 260);
    --selecao: oklch(0.74 0.14 252);
    --contorno-img: oklch(1 0 0 / 0.1);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--tela);
  color: var(--tinta);
  font-family: var(--fonte-corpo);
  font-size: 1.125rem;
  line-height: 1.7;
  letter-spacing: 0.002em;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
}
img, svg, iframe { max-width: 100%; display: block; }
a { color: var(--selecao); text-underline-offset: 0.18em; text-decoration-thickness: 0.07em; }
a:hover { text-decoration-thickness: 0.14em; }
a:focus-visible { outline: 2px solid var(--selecao); outline-offset: 3px; border-radius: 2px; }
::selection { background: color-mix(in oklch, var(--selecao) 28%, transparent); }

/* ---------- aviso de arquivo ---------- */
.aviso { background: var(--quadro); border-bottom: 1px solid var(--linha); }
.aviso p {
  margin: 0 auto; max-width: var(--pagina); padding: 0.7rem var(--margem);
  font-size: 0.9375rem; line-height: 1.5; color: var(--tinta); text-wrap: pretty;
}
.aviso a { font-weight: 600; white-space: nowrap; }

/* ---------- topo ---------- */
.topo {
  max-width: var(--pagina); margin: 0 auto; padding: 1.25rem var(--margem);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem;
}
.marca {
  font-family: var(--fonte-titulo); font-weight: 700; font-stretch: 112%; font-size: 1.25rem;
  letter-spacing: -0.02em; color: var(--tinta); text-decoration: none; line-height: 1.2;
}
.topo nav { display: flex; gap: 0.25rem; }
.topo nav a {
  color: var(--tinta); text-decoration: none; font-size: 1rem; font-weight: 500;
  padding: 0.6rem 0.8rem; border-radius: 0.5rem; min-height: 2.75rem; display: inline-flex; align-items: center;
}
.topo nav a:hover { background: var(--linha); }
.topo nav a[aria-current] { font-weight: 700; box-shadow: inset 0 -2px 0 var(--selecao); border-radius: 0.5rem 0.5rem 0 0; }

/* ---------- estrutura ---------- */
main { max-width: var(--pagina); margin: 0 auto; padding: 1rem var(--margem) 5rem; }

h1, h2, h3 { font-family: var(--fonte-titulo); text-wrap: balance; margin: 0; }
h1 { font-weight: 700; font-stretch: 112%; letter-spacing: -0.03em; line-height: 1.05; font-size: clamp(2.25rem, 5.4vw + 0.5rem, 4.25rem); }

.rotulo { font-size: 0.9375rem; font-weight: 500; color: var(--apagado); margin: 0; line-height: 1.4; letter-spacing: 0.01em; }
.rotulo a { color: inherit; }

/* ---------- home: abertura ---------- */
.abertura { padding: 3rem 0 3.5rem; max-width: 50rem; }
.abertura h1 { margin-bottom: 1.25rem; }
.abertura p { margin: 0; font-size: 1.1875rem; max-width: 52ch; color: var(--tinta); text-wrap: pretty; }

/* ---------- índice por ano ---------- */
.secao-titulo { font-size: 1.0625rem; font-weight: 600; font-family: var(--fonte-corpo); letter-spacing: 0.01em; color: var(--apagado); margin: 0 0 1rem; text-wrap: pretty; }
.ano { display: grid; grid-template-columns: 1fr; gap: 0.25rem 2rem; padding: 2rem 0; border-top: 1px solid var(--linha); }
.ano-num {
  font-weight: 800; font-stretch: 112%; letter-spacing: -0.04em; line-height: 1;
  font-size: clamp(2.5rem, 6vw, 4rem); color: var(--apagado); font-variant-numeric: tabular-nums;
}
.lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.25rem; }
@media (min-width: 52rem) {
  .ano { grid-template-columns: 14rem minmax(0, 1fr); padding: 2.5rem 0; }
  .ano-num { position: sticky; top: 1.5rem; align-self: start; }
}

/* quadro: o item do índice se comporta como um frame do Figma ao ser selecionado */
.quadro {
  --respiro: 0.75rem;
  position: relative; display: block; padding: 1rem var(--respiro); margin: 0 calc(var(--respiro) * -1);
  color: inherit; text-decoration: none; border-radius: 2px;
}
.quadro::before {
  content: ""; position: absolute; inset: 0; border: 1px solid var(--selecao); opacity: 0; transition: opacity 120ms ease-out; pointer-events: none;
}
.quadro::after {
  content: ""; position: absolute; inset: -3.5px; opacity: 0; transition: opacity 120ms ease-out; pointer-events: none;
  --h: linear-gradient(var(--selecao), var(--selecao));
  background:
    var(--h) 0 0 / 7px 7px no-repeat, var(--h) 100% 0 / 7px 7px no-repeat,
    var(--h) 0 100% / 7px 7px no-repeat, var(--h) 100% 100% / 7px 7px no-repeat;
}
.quadro:hover::before, .quadro:hover::after, .quadro:focus-visible::before, .quadro:focus-visible::after { opacity: 1; }
.quadro:focus-visible { outline: none; }
.quadro .titulo {
  display: block; font-family: var(--fonte-titulo); font-weight: 600; font-stretch: 105%;
  font-size: clamp(1.25rem, 1.2vw + 1rem, 1.5rem); line-height: 1.25; letter-spacing: -0.015em; margin: 0.2rem 0 0.35rem; text-wrap: balance;
}
.quadro .desc { display: block; color: var(--apagado); font-size: 1rem; line-height: 1.55; max-width: 56ch; text-wrap: pretty; }
@media (min-width: 52rem) { .quadro { --respiro: 1.25rem; } }

/* ---------- vídeos ---------- */
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1.5rem 1.25rem; list-style: none; margin: 0; padding: 0; }
.videos .quadro { margin: 0; padding: 0.75rem; }
.videos .miniatura {
  display: block; aspect-ratio: 16 / 9; width: 100%; height: auto; object-fit: cover; border-radius: 6px;
  outline: 1px solid var(--contorno-img); outline-offset: -1px; background: var(--quadro);
}
.videos .titulo { font-size: 1.125rem; margin-top: 0.7rem; }
.ver-todos { margin: 1.5rem 0 0; font-weight: 600; }
.bloco-videos { padding: 2.5rem 0 0; border-top: 1px solid var(--linha); margin-top: 1rem; }

/* ---------- artigo ---------- */
.artigo { max-width: var(--coluna); margin: 0 auto; }
.artigo > header { padding: 2.5rem 0 2rem; }
.artigo > header h1 { margin: 0.75rem 0 1rem; font-size: clamp(2rem, 3.6vw + 0.75rem, 2.875rem); font-stretch: 106%; line-height: 1.1; }
.artigo .meta { margin: 0; font-size: 0.9375rem; color: var(--apagado); font-variant-numeric: tabular-nums; }

/* medida recalibrada para a Geist: 54ch rende uns 66 caracteres por linha (o ch da Geist é estreito) */
.texto { --medida: 54ch; }
.texto > :where(p, ul, ol, blockquote, h2, h3, h4, h5) { max-width: var(--medida); }
.texto img { max-width: 100%; }
.texto p, .texto ul, .texto ol, .texto blockquote, .texto figure, .texto .video { margin: 0 0 1.35em; }
.texto p, .texto li { text-wrap: pretty; }
.texto h2 { font-weight: 700; font-stretch: 108%; letter-spacing: -0.025em; line-height: 1.15; font-size: clamp(1.5rem, 1.6vw + 1.1rem, 2rem); margin: 2.6em 0 0.7em; }
.texto h3 { font-weight: 600; font-stretch: 104%; letter-spacing: -0.015em; line-height: 1.25; font-size: 1.3125rem; margin: 2em 0 0.55em; }
.texto h4 { font-weight: 600; font-size: 1.125rem; margin: 1.6em 0 0.4em; }
.texto h2:first-child, .texto h3:first-child { margin-top: 0; }
.texto ul, .texto ol { padding-left: 1.4em; }
.texto li { margin: 0.35em 0; padding-left: 0.2em; }
.texto li::marker { color: var(--apagado); }
.texto strong { font-weight: 650; }
.texto blockquote { margin-left: 0; padding: 0.1em 0 0.1em 1.25em; color: var(--apagado); font-style: italic; border-left: 1px solid var(--linha); }
.texto hr { border: 0; height: 1px; background: var(--linha); margin: 2.5em 0; max-width: none; }
.texto figure { max-width: none; }
.texto img {
  height: auto; border-radius: 8px; outline: 1px solid var(--contorno-img); outline-offset: -1px; background: var(--quadro);
}
.texto figcaption, .texto .wp-caption-text { font-size: 0.9375rem; color: var(--apagado); margin-top: 0.6rem; line-height: 1.5; max-width: var(--medida); }
.texto p > img:only-child { margin: 0.4em 0; }
.texto a { word-break: break-word; }
.texto .video { max-width: none; aspect-ratio: 16 / 9; background: var(--quadro); border-radius: 8px; overflow: hidden; outline: 1px solid var(--contorno-img); outline-offset: -1px; }
.texto .video iframe { width: 100%; height: 100%; border: 0; }
.video-topo { aspect-ratio: 16 / 9; background: var(--quadro); border-radius: 8px; overflow: hidden; outline: 1px solid var(--contorno-img); outline-offset: -1px; margin: 0 0 2rem; }
.video-topo iframe { width: 100%; height: 100%; border: 0; }

.vizinhos { display: grid; gap: 1rem; margin-top: 4rem; padding-top: 2rem; border-top: 1px solid var(--linha); }
@media (min-width: 40rem) { .vizinhos { grid-template-columns: 1fr 1fr; } }
.vizinhos a { display: block; text-decoration: none; color: inherit; padding: 1rem 1.25rem; border: 1px solid var(--linha); border-radius: 6px; min-height: 2.75rem; }
.vizinhos a:hover, .vizinhos a:focus-visible { border-color: var(--selecao); }
.vizinhos small { display: block; font-size: 0.9375rem; color: var(--apagado); margin-bottom: 0.2rem; }
.vizinhos strong { font-family: var(--fonte-titulo); font-weight: 600; font-stretch: 105%; font-size: 1.0625rem; line-height: 1.3; letter-spacing: -0.01em; text-wrap: balance; }
.vizinhos .proximo { text-align: right; }

.voltar { margin: 2.5rem 0 0; }

/* ---------- rodapé ---------- */
.rodape { border-top: 1px solid var(--linha); }
.rodape p { max-width: var(--pagina); margin: 0 auto; padding: 1.75rem var(--margem); font-size: 0.9375rem; color: var(--apagado); line-height: 1.6; text-wrap: pretty; }

/* ---------- 404 ---------- */
.nada { padding: 4rem 0; max-width: 40rem; }
.nada h1 { margin-bottom: 1rem; }

@media (prefers-reduced-motion: reduce) {
  .quadro::before, .quadro::after { transition: none; }
}
@media print {
  .aviso, .topo nav, .vizinhos, .rodape { display: none; }
  body { background: #fff; color: #000; }
}
