/* ============================================================
   SITE DO ENRICO
   Uma folha de papel centralizada sobre uma mesa.
   Tipografia OpenDyslexic. Papel quente, tinta escura.
   ============================================================ */

/* ---------- Fonte ---------- */

@font-face {
  font-family: 'OpenDyslexic';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5.2.5/files/opendyslexic-latin-400-normal.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5.2.5/files/opendyslexic-latin-400-normal.woff') format('woff');
}
@font-face {
  font-family: 'OpenDyslexic';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5.2.5/files/opendyslexic-latin-400-italic.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5.2.5/files/opendyslexic-latin-400-italic.woff') format('woff');
}
@font-face {
  font-family: 'OpenDyslexic';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5.2.5/files/opendyslexic-latin-700-normal.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5.2.5/files/opendyslexic-latin-700-normal.woff') format('woff');
}
@font-face {
  font-family: 'OpenDyslexic';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5.2.5/files/opendyslexic-latin-700-italic.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5.2.5/files/opendyslexic-latin-700-italic.woff') format('woff');
}

/* ---------- Cores e medidas ---------- */

:root {
  --canvas:  #efeade;   /* a mesa, atrás da folha */
  --paper:   #fdfcf8;   /* a folha */
  --ink:     #2e2c28;
  --muted:   #6f6a62;
  --faint:   #948e84;
  --accent:  #3f5570;
  --hair:    #e6e1d5;
  --hair-2:  #d2cbba;
  --wash:    #f6f3ea;
  --sel:     #e9e2ce;   /* seleção: um tom do próprio papel */

  --fonte: 'OpenDyslexic', 'Comic Sans MS', Verdana, system-ui, sans-serif;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

  --folha: 44rem;
  --respiro: 2.25rem;

  /* Tamanho compartilhado pelo nome no topo e pelos h1 das páginas:
     mudar aqui muda os dois juntos, no desktop e no celular. */
  --titulo: clamp(.74rem, 3.6vw, 1.15rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #121110;
    --paper:  #1d1c19;
    --ink:    #ddd8cd;
    --muted:  #9c958a;
    --faint:  #7f786e;
    --accent: #9db4d0;
    --hair:   #34322d;
    --hair-2: #48453e;
    --wash:   #24231f;
    --sel:    #33302a;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: var(--respiro) 1rem;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--fonte);
  font-size: 1rem;
  line-height: 1.75;
  font-weight: 400;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

::selection      { background: var(--sel); color: var(--ink); }
::-moz-selection { background: var(--sel); color: var(--ink); }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

/* ---------- A folha ---------- */

.folha {
  width: 100%;
  max-width: var(--folha);
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 4px;
  padding: 1.5rem 2rem 2rem;
}

/* Página inicial: a folha fica no meio da tela e só mostra a palavra. */
body.home { justify-content: center; }
body.home .folha { padding-bottom: 1.9rem; }

.folha { transition: transform .38s cubic-bezier(.4, 0, .2, 1); }

/* ---------- Cabeçalho ---------- */

.topo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: .85rem;
  border-bottom: 1px solid var(--hair);
}

/* O nome nunca quebra em duas linhas: encolhe junto com a tela. */
.wordmark {
  font-size: var(--titulo);
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wordmark:hover { color: var(--accent); }

.lang-switch { display: flex; align-items: baseline; gap: .3rem; font-size: .68rem; }
.lang-switch button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
}
.lang-switch button:hover { color: var(--ink); text-decoration: underline; }
.lang-switch button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 700;
  cursor: default;
  text-decoration: none;
}
.lang-switch .sep { color: var(--hair-2); }

/* Envolve o menu para poder desenhar as setas de rolagem no celular. */
.navwrap {
  position: relative;
  border-bottom: 1px solid var(--hair);
}

nav.mainnav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  padding: .7rem 0;
  font-size: .92rem;
}
nav.mainnav a { color: var(--muted); text-decoration: none; white-space: nowrap; }
nav.mainnav a:hover { color: var(--ink); text-decoration: underline; }
nav.mainnav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--hair-2);
}
nav.mainnav a + a::before {
  content: "|";
  color: var(--hair-2);
  padding: 0 .55em;
  text-decoration: none;
  display: inline-block;
}

/* Sub-navegação (vida acadêmica) */
.subnav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  margin: 0 0 1.8rem;
  font-size: .9rem;
}
.subnav a { color: var(--muted); text-decoration: none; }
.subnav a:hover { color: var(--ink); text-decoration: underline; }
.subnav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--hair-2);
}
.subnav a + a::before {
  content: "|";
  color: var(--hair-2);
  padding: 0 .55em;
  display: inline-block;
}

main { padding-top: 1.8rem; width: 100%; }
body.home main { padding-top: 1.6rem; }

/* ---------- Títulos e texto ---------- */

/* Mesmo tamanho do nome no topo — ver --titulo. */
h1 {
  font-size: var(--titulo);
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 .5rem;
}
h2 { font-size: 1rem; line-height: 1.35; font-weight: 700; margin: 2.2rem 0 .7rem; }
h3 { font-size: .95rem; font-weight: 700; margin: 1.4rem 0 .3rem; }

p { margin: 0 0 1.05rem; }
p:last-child { margin-bottom: 0; }

.kicker {
  display: block;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .5rem;
}

.standfirst { color: var(--muted); margin: 0 0 2rem; font-size: .97rem; }

.section { margin: 2.6rem 0; }
.section:first-child { margin-top: 0; }

hr { border: 0; border-top: 1px solid var(--hair); margin: 2rem 0; }

/* ---------- Palavra da vez ---------- */

.hero { animation: surge .45s ease both; }
@keyframes surge { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* A palavra e a setinha dividem uma linha só: nunca quebra, o
   caberNumaLinha() no site.js encolhe a fonte até caber. */
.hero__word {
  font-size: clamp(1.9rem, 6.5vw, 2.6rem);
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 .3rem;
  white-space: nowrap;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: .1em;
}
/* Sem min-width:0 de propósito: o item precisa transbordar para que
   scrollWidth denuncie o excesso e o JS saiba quanto encolher. */
.hero__word > a {
  color: inherit;
  text-decoration: none;
  flex: 0 0 auto;
}
.hero__word > a:hover { color: var(--accent); }

.hero__shuffle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 1.5em;
  height: 1.5em;
  margin-left: .35em;
  padding: 0;
  border: 0;
  background: none;
  color: var(--faint);
  cursor: pointer;
  border-radius: 50%;
}
.hero__shuffle:hover { color: var(--ink); background: var(--wash); }

.hero__lang { font-size: .84rem; color: var(--faint); margin: 0 0 1.1rem; }
.hero__lang .sep { opacity: .55; padding: 0 .4em; }

.hero__def { font-size: 1.05rem; margin: 0 0 .8rem; }
.hero__note { color: var(--muted); font-size: .95rem; margin: 0; }

/* Saída animada da home ao escolher uma seção do menu */
body.saindo .hero {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity .2s ease, transform .2s ease;
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .folha, body.saindo .hero { transition: none; }
  .hero { animation: none; }
}

/* ---------- Botões ---------- */

.btn {
  display: inline-block;
  font: inherit;
  font-size: .85rem;
  line-height: 1.4;
  padding: .38em .8em;
  border: 1px solid var(--hair-2);
  border-radius: 3px;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--wash); border-color: var(--muted); color: var(--ink); }
.btn--quiet { border-color: transparent; color: var(--muted); padding-left: 0; padding-right: .4em; }
.btn--quiet:hover { background: none; color: var(--ink); text-decoration: underline; }

/* ---------- Filtros e busca ---------- */

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .9rem;
  align-items: center;
  margin: 0 0 1.3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hair);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .75rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .8rem;
}
/* A lista de idiomas é longa: fonte menor para caber melhor. */
.filters--idiomas { font-size: .74rem; gap: 0 .65rem; }

/* Versão dropdown dos filtros — só aparece no celular. */
.filtro-select {
  display: none;
  width: 100%;
  font: inherit;
  font-size: .85rem;
  padding: .35em .6em;
  border: 1px solid var(--hair-2);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.filters button {
  font: inherit;
  border: 0;
  background: none;
  padding: 0;
  color: var(--muted);
  cursor: pointer;
}
.filters button:hover { color: var(--ink); text-decoration: underline; }
.filters button[aria-pressed="true"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--hair-2);
  text-underline-offset: 3px;
}

.search {
  flex: 1 1 11rem;
  min-width: 8rem;
  font: inherit;
  font-size: .86rem;
  padding: .3em .6em;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
}
.search::placeholder { color: var(--faint); }
.search:focus { outline: 2px solid var(--hair-2); outline-offset: 1px; }

.contagem { font-size: .8rem; color: var(--faint); margin: 0 0 1.2rem; }

/* Botão "mostrar mais": centralizado e solto do último item da lista. */
.mostrar-mais {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--hair);
}
.mostrar-mais[hidden] { display: none; }

/* ---------- Itens da vida acadêmica ---------- */

.item { padding: 1.3rem 0; border-bottom: 1px solid var(--hair); }
.item:first-child { padding-top: 0; }
.item:last-child { border-bottom: 0; padding-bottom: 0; }

.item__tipo {
  display: block;
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .2rem;
}
.item__titulo { font-size: .98rem; line-height: 1.4; font-weight: 700; margin: 0 0 .3rem; }
.item__titulo a { color: var(--ink); text-decoration: none; }
.item__titulo a:hover { color: var(--accent); text-decoration: underline; }
.item__meta { margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.6; }
.item__desc { margin: .4rem 0 0; font-size: .9rem; color: var(--muted); }
.item__acoes { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .75rem; }

/* ---------- Etcetera ---------- */

.card { padding: 1.6rem 0; border-bottom: 1px solid var(--hair); }
.card:first-child { padding-top: 0; }
.card:last-child { border-bottom: 0; padding-bottom: 0; }

.card__tipo {
  display: block;
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .35rem;
}
.card__titulo { font-size: .98rem; line-height: 1.4; font-weight: 700; margin: 0 0 .45rem; }
.card__titulo a { color: var(--ink); text-decoration: none; }
.card__titulo a:hover { color: var(--accent); text-decoration: underline; }
.card__corpo { margin: 0 0 .4rem; font-size: .95rem; }
.card__pe { font-size: .8rem; color: var(--faint); margin: .55rem 0 0; }

.card img, .card iframe, .card video {
  display: block;
  width: 100%;
  border: 1px solid var(--hair);
  border-radius: 3px;
  margin: 0 0 .6rem;
  background: var(--wash);
}
.card iframe { aspect-ratio: 16 / 9; height: auto; }

blockquote.quote {
  margin: 0 0 .5rem;
  padding-left: .9rem;
  border-left: 2px solid var(--hair-2);
  font-size: 1.02rem;
  font-style: italic;
}

/* ---------- Intraduzíveis ---------- */

.entry { padding: 1.4rem 0; border-bottom: 1px solid var(--hair); }
.entry:first-child { padding-top: 0; }
.entry:last-child { border-bottom: 0; padding-bottom: 0; }

.entry__word { font-size: 1.05rem; line-height: 1.25; font-weight: 700; margin: 0 0 .1rem; overflow-wrap: break-word; }
.entry__lang { display: block; font-size: .8rem; color: var(--faint); margin-bottom: .5rem; }
.entry__lang .sep { opacity: .55; padding: 0 .4em; }
.entry__def { margin: 0; font-size: .97rem; }
.entry__note { margin: .4rem 0 0; color: var(--muted); font-size: .9rem; }
.entry__word a { color: inherit; text-decoration: none; }
.entry__word a:hover { color: var(--accent); text-decoration: underline; }
.entry__mais { margin: .5rem 0 0; font-size: .84rem; }
.entry__mais a { color: var(--muted); }
.entry__mais a:hover { color: var(--ink); }

/* Link de uma palavra para outra, dentro do texto */
.link-palavra {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--hair-2);
  text-underline-offset: 3px;
}
.link-palavra:hover { color: var(--accent); text-decoration-style: solid; }

/* ---------- Página de uma palavra ---------- */

.palavra__titulo {
  font-size: clamp(1.6rem, 7vw, 2.2rem);
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 .2rem;
  overflow-wrap: break-word;
}
.palavra__lang { font-size: .84rem; color: var(--faint); margin: 0 0 1.4rem; }
.palavra__lang .sep { opacity: .55; padding: 0 .4em; }
.palavra__def { font-size: 1.05rem; }
.palavra__def p { margin: 0 0 .9rem; }
.palavra__nota { color: var(--muted); margin-top: 1.2rem; }
.palavra__nota p { margin: 0 0 .9rem; }

.relacionadas {
  margin: 1.8rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hair);
  font-size: .92rem;
}
.relacionadas__rot {
  display: block;
  font-size: .72rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: .25rem;
}

.palavra__anexos {
  margin-top: 2.4rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--hair);
}
.palavra__anexos h2 {
  font-size: .74rem;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin: 0 0 1rem;
}

/* Tradução do título, ao lado do original (publicações) */
.item__traducao {
  margin: 0 0 .3rem;
  font-size: .92rem;
  font-style: italic;
  color: var(--muted);
}

/* ---------- Sobre ---------- */

.retrato {
  float: right;
  width: 10rem;
  max-width: 40%;
  margin: .3rem 0 1rem 1.4rem;
  border: 1px solid var(--hair);
  border-radius: 3px;
}

.prose { font-size: .98rem; }
.prose h2 {
  font-size: .78rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 2.2rem 0 .6rem;
}

/* ---------- Projetos ---------- */

.project { padding: 1.3rem 0; border-bottom: 1px solid var(--hair); }
.project:first-child { padding-top: 0; }
.project:last-child { border-bottom: 0; padding-bottom: 0; }
.project__titulo { font-size: 1.05rem; line-height: 1.4; font-weight: 700; margin: 0 0 .3rem; }
.project__titulo a { color: var(--ink); text-decoration: none; }
.project__titulo a:hover { color: var(--accent); text-decoration: underline; }
.project__desc { margin: 0 0 .75rem; font-size: .92rem; color: var(--muted); }

.tool {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: 2.2rem;
  align-items: start;
  margin-top: 1.6rem;
}

.tool__campos { display: flex; flex-direction: column; gap: 1.1rem; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .8rem; color: var(--muted); }
.field textarea,
.field select {
  font: inherit;
  font-size: .92rem;
  padding: .5em .65em;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  resize: vertical;
}
.field textarea:focus, .field select:focus { outline: 2px solid var(--hair-2); outline-offset: 1px; }
.field__ajuda { font-size: .78rem; color: var(--faint); margin: 0; }

.field-row { display: flex; gap: 1.1rem; }
.field-row .field { flex: 1 1 0; }

.color-field { display: flex; align-items: center; gap: .55rem; }
.color-field input[type="color"] {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--hair);
  border-radius: 3px;
  background: none;
  cursor: pointer;
}
.color-field span { font-size: .8rem; color: var(--muted); }

.tool__preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.6rem;
  border: 1px solid var(--hair);
  border-radius: 6px;
  background: var(--wash);
  position: sticky;
  top: 1.6rem;
}
.tool__preview canvas { max-width: 100%; height: auto; border-radius: 3px; }
.tool__preview .empty { padding: 3rem 1rem; text-align: center; }
.tool__acoes { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }

.tool__nota { font-size: .8rem; color: var(--faint); margin-top: 1.4rem; }

@media (max-width: 40rem) {
  .tool { grid-template-columns: 1fr; }
  .tool__preview { position: static; }
}

/* ---------- Rodapé ---------- */

/* Seletor de idiomas à esquerda, frase à direita.
   O rodapé vira um container de consulta: os dois textos medem a
   largura disponível AQUI DENTRO (unidade cqi) e encolhem juntos em
   vez de brigar por espaço. Ficam sempre na mesma linha. */
footer.foot {
  container-type: inline-size;
  margin-top: 2.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--hair);
  font-size: .8rem;
  color: var(--faint);
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 1.1rem;
}
footer.foot a { color: var(--muted); }
footer.foot a:hover { color: var(--ink); }

footer.foot .lang-switch,
.foot__frase {
  white-space: nowrap;
  min-width: 0;
}

.foot__frase {
  margin-left: auto;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;   /* rede de segurança: corta antes de sobrepor */
  font-size: clamp(9px, 3.4vw, 1em);        /* navegadores sem container query */
  font-size: clamp(9px, 4cqi, 1em);
}

footer.foot .lang-switch {
  flex: 0 0 auto;
  font-size: clamp(9px, 2.9vw, .68rem);     /* navegadores sem container query */
  font-size: clamp(9px, 3.4cqi, .68rem);
}

.empty { color: var(--faint); font-size: .9rem; padding: 1.2rem 0; }

/* ---------- Aviso (toast) ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translate(-50%, .5rem);
  background: var(--ink);
  color: var(--paper);
  font-size: .85rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 10;
  max-width: calc(100vw - 2rem);
  text-align: center;
}
.toast--visivel { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .toast { transition: opacity .01s linear; }
}

/* ---------- Responsivo ---------- */

@media (max-width: 34rem) {
  /* A tipografia inteira encolhe junto com a tela: como quase tudo no
     site é medido em rem, mexer aqui reescala títulos, textos, filtros
     e espaçamentos de uma vez só. */
  html { font-size: clamp(11.5px, 3.2vw, 15px); }

  :root { --respiro: .8rem; }

  /* Sem bloco sobre bloco: a folha vira a própria página. O papel toma
     a tela toda e some a borda, o canto arredondado e o fundo atrás. */
  body {
    background: var(--paper);
    padding: var(--respiro) .9rem;
  }
  .folha {
    max-width: none;
    background: none;
    border: 0;
    border-radius: 0;
    padding: 0 0 2rem;
  }
  body.home .folha { padding-bottom: 0; }

  .retrato { float: none; width: 8.5rem; max-width: 55%; margin: 0 0 1rem; }

  /* Pisos de legibilidade: o texto corrido pode encolher, mas os
     rótulos miúdos não podem virar poeira numa tela de 320 px. */
  /* o tamanho do PT/EN no rodapé é fluido (ver footer.foot .lang-switch) */
  .kicker, .item__tipo, .card__tipo { font-size: max(9.5px, .72rem); }
  .contagem, .card__pe, .entry__lang, .hero__lang,
  .item__desc, footer.foot { font-size: max(10.5px, .82rem); }
  .filters { font-size: max(11px, .8rem); }
  .filters--idiomas { font-size: max(10.5px, .74rem); }
  .item__meta, .card__corpo, .entry__def, .entry__note { font-size: max(11.5px, .9rem); }

  /* Campos com menos de 16px fazem o iOS dar zoom ao receber foco. */
  .search, .filtro-select, input, select, textarea { font-size: max(16px, .95rem); }

  /* Nav não quebra mais linha (evita "|" solto): rola na horizontal,
     com as bordas esmaecidas e setinhas indicando que há mais itens. */
  nav.mainnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-right: 1.6rem;
    padding-left: .2rem;
    font-size: .84rem;
    /* o esmaecido nas pontas é mais largo, para as setas terem
       espaço limpo onde pousar */
    mask-image: linear-gradient(to right, transparent, black 2rem, black calc(100% - 2rem), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 2rem, black calc(100% - 2rem), transparent);
  }
  nav.mainnav::-webkit-scrollbar { display: none; }
  nav.mainnav a { flex: 0 0 auto; }

  /* As setas ficam sobre o degradê e só aparecem quando ainda há
     menu para rolar naquele lado. São indicativas: não clicáveis. */
  .navwrap::before,
  .navwrap::after {
    position: absolute;
    top: 0;
    bottom: 1px;
    display: flex;
    align-items: center;
    width: 1.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity .18s ease;
    color: var(--ink);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
  }
  .navwrap::before { content: "‹"; left: 0;  justify-content: flex-start; }
  .navwrap::after  { content: "›"; right: 0; justify-content: flex-end; }
  .navwrap.rola-esq::before,
  .navwrap.rola-dir::after { opacity: 1; }

  /* Filtros longos viram um dropdown */
  .filters--dropdown { display: none; }
  .filtro-select { display: block; }
  .search { flex: 1 1 100%; }

  .subnav { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .subnav a { white-space: nowrap; }

  /* Os títulos já encolhem junto com o html; aqui só apertamos o
     espaçamento, que numa tela estreita pesa mais que o tamanho. */
  h2 { margin: 1.8rem 0 .6rem; }
  main { padding-top: 1.4rem; }
  .standfirst { margin-bottom: 1.5rem; }
  .hero__word { font-size: clamp(1.7rem, 9vw, 2.3rem); }
}

@media print {
  body { background: #fff; padding: 0; display: block; }
  .folha { border: 0; max-width: none; padding: 0; }
  .navwrap, .subnav, .tools, .hero__shuffle, footer.foot,
  .item__acoes, .mostrar-mais { display: none; }
}
