/* Fábrica de Conteúdos · identidade do Manual de Marca v1.2 (skill taste-sonia)
   Cores só por variável. Um bloco escuro por ecrã: o cabeçalho do topo comum (escritorio.css).
   Escala de espaço: 8, 16, 24, 40, 64. Um raio para blocos, cápsula para botões. */

/* As variáveis vêm de escritorio.css, carregado antes deste ficheiro. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--grao), var(--fundo);
  color: var(--noite);
  font: 16px/1.55 var(--sans);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.3rem, 7vw, 3.6rem); letter-spacing: -.01em; }
h1 em { color: var(--vivo); }
h2 { font-size: 1.45rem; }
a { color: var(--vinho); }

.etiqueta { font: 700 .72rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ouro); margin: 0 0 16px; }

.vista { max-width: 1120px; margin: 0 auto; padding: 16px 16px 64px; outline: none; }
.topo { display: grid; gap: 16px; margin-bottom: 24px; }
.voltar { text-decoration: none; font-size: .9rem; justify-self: start; }

/* Botões: um principal por ecrã */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 24px; border: 0; border-radius: 999px;
  background: var(--vivo); color: var(--papel); font: 700 .92rem var(--sans);
  text-decoration: none; cursor: pointer;
  transition: background-color .4s var(--curva), transform .4s var(--curva);
}
.botao:hover { background: var(--vinho); transform: translateY(-1px); }
.botao-discreto { background: var(--papel); color: var(--vinho); box-shadow: inset 0 0 0 1px var(--linha); }
.botao-discreto:hover { background: var(--fundo); }
.botao:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--ouro); outline-offset: 2px;
}

/* Campos */
input[type="search"], .campo input, .campo select, .campo textarea {
  width: 100%; min-height: 44px; padding: 10px 16px;
  border: 1px solid var(--linha); border-radius: 12px;
  background: var(--papel); color: var(--noite); font: 1rem var(--sans);
}
.campo { display: grid; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--vinho); }
.campo textarea { resize: vertical; line-height: 1.55; font-weight: 400; }
.campo textarea.codigo { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; }
.campo-caixa { display: flex; align-items: center; gap: 8px; align-self: end; min-height: 44px; }
.campo-caixa input { width: 22px; min-height: 22px; accent-color: var(--vinho); }

.vazio { color: var(--suave); font-style: italic; }

/* Folha */
.folha { display: grid; gap: 16px; background: var(--papel); padding: 24px 16px; border-radius: var(--raio); box-shadow: var(--sombra); border-top: 2px solid var(--ouro); }
.campo-titulo input { font: 1.45rem var(--serif); border-color: transparent; padding-left: 0; }
.grelha { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grelha .campo input, .grelha .campo select { min-width: 0; }
.campo-data { grid-column: span 2; }
.mensagem-auto { border: 1px solid var(--linha); border-radius: var(--raio); padding: 16px; display: grid; gap: 8px; margin: 0; }
.nota-video { margin: 0; font-size: .8rem; color: var(--suave); }
.botoes-video { display: flex; flex-wrap: wrap; gap: 8px; }
.resposta-video { background: var(--fundo); border-left: 3px solid var(--ouro); border-radius: var(--raio); padding: 10px 14px; }
.resposta-video p { margin: 0; white-space: pre-wrap; }
.resposta-video-titulo { font: 700 .64rem/1.6 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--vinho); }
.imagens-grelha { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.imagem { margin: 0; display: grid; gap: 6px; }
.imagem img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; background: var(--fundo); border: 1px solid var(--linha); }
.imagem figcaption { display: flex; align-items: center; gap: 4px; }
.imagem-numero { font: 700 .78rem var(--sans); color: var(--vinho); margin-right: auto; font-variant-numeric: tabular-nums; }
.imagem-botao { min-height: 32px; min-width: 32px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--fundo); color: var(--vinho); font: 700 .74rem var(--sans); cursor: pointer; }
.imagem-botao:disabled { opacity: .35; cursor: default; }
.botao-ficheiro { position: relative; cursor: pointer; }
.botao-ficheiro input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.mensagem-auto legend { font: italic 1.15rem var(--serif); padding: 0 8px; color: var(--vinho); }
.contador { font-weight: 400; color: var(--suave); font-variant-numeric: tabular-nums; }
.contador.passou { color: var(--vivo); font-weight: 700; }
.acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.copiar-pequeno {
  justify-self: start; background: none; border: 0; padding: 0 0 8px; color: var(--vinho);
  font: 700 .78rem var(--sans); cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--ouro); text-underline-offset: 4px;
}

/* Voz e definições */
.texto-voz { background: var(--papel); border-radius: var(--raio); padding: 24px 16px; box-shadow: var(--sombra); max-width: 760px; }
.texto-voz h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin-bottom: 16px; }
.texto-voz h2 { margin: 40px 0 16px; }
.texto-voz h3 { margin: 24px 0 8px; font-size: 1.15rem; }
.texto-voz p, .texto-voz li { max-width: 68ch; }
.texto-voz blockquote { margin: 16px 0; padding-left: 16px; border-left: 2px solid var(--ouro); font-family: var(--serif); font-style: italic; }
.texto-voz hr { border: 0; border-top: 1px solid var(--linha); margin: 24px 0; }
.tabela { overflow-x: auto; }
.tabela table { border-collapse: collapse; width: 100%; font-size: .9rem; }
.tabela th, .tabela td { text-align: left; padding: 8px; border-bottom: 1px solid var(--linha); vertical-align: top; }
.tabela th { color: var(--vinho); }
.cartao-def { background: var(--papel); border-radius: var(--raio); padding: 24px 16px; box-shadow: var(--sombra); border-top: 2px solid var(--ouro); display: grid; gap: 16px; margin-bottom: 24px; }
.cartao-def p { margin: 0; }

/* Avisos */
.aviso { color: var(--vivo); min-height: 1.4em; margin: 0; }
.aviso-global {
  position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 60; margin: 0 auto; max-width: 480px;
  background: var(--escuro); color: var(--papel); padding: 16px; border-radius: var(--raio); text-align: center;
}

/* Entrar */
.ecra-entrar { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.entrar { width: min(100%, 380px); display: grid; gap: 24px; }
.entrar form { display: grid; gap: 16px; }

@media (min-width: 720px) {
  .vista { padding: 24px 28px 64px; }
  .folha, .texto-voz, .cartao-def { padding: 40px; }
  .grelha { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .campo-data { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
