/* Pica — estilos da página do projeto e da documentação.
   A paleta, os tipos de letra e o desenho do ecrã dos Comensais são os da
   aplicação (Catppuccin Latte e Mocha), para que a página e a aplicação se leiam
   como uma coisa só. Nada é carregado de fora. */

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fontes/roboto-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fontes/roboto-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fontes/roboto-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}

/* A linha «Total» da matriz é itálica, tal como na aplicação. */
@font-face {
  font-family: "Roboto";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fontes/roboto-latin-400-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+20AC;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fontes/roboto-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fontes/roboto-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}

@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fontes/roboto-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-024F, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}

/* Latte. */
:root {
  color-scheme: light dark;
  --fundo: #eff1f5;
  --texto: #4c4f69;
  --esbatido: #6c6f85;
  --limite: #ccd0da;
  --superficie: #e6e9ef;
  --crosta: #dce0e8;
  --azul: #1e66f5;
  --sobre-cor: #ffffff;
  --cor-0: #1e66f5; /* blue */
  --cor-1: #8839ef; /* mauve */
  --largura: 60rem;
  --leitura: 34rem;
}

/* Mocha. */
@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #1e1e2e;
    --texto: #cdd6f4;
    --esbatido: #a6adc8;
    --limite: #313244;
    --superficie: #181825;
    --crosta: #11111b;
    --azul: #89b4fa;
    --sobre-cor: #11111b;
    --cor-0: #89b4fa;
    --cor-1: #cba6f7;
  }
}

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

body {
  margin: 0;
  background-color: var(--fundo);
  color: var(--texto);
  font-family: "Roboto", system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

/* Evita a última linha com uma palavra só, frequente em frases longas em
   português. Onde não for suportado, a quebra é a normal. */
p,
li {
  text-wrap: pretty;
}

a {
  color: var(--azul);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 2px solid var(--azul);
  outline-offset: 2px;
  border-radius: 2px;
}

.envolvente {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Barra de topo. */

.topo {
  border-bottom: 1px solid var(--limite);
}

.topo .envolvente {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.marca {
  display: block;
  line-height: 0;
}

.marca img {
  display: block;
  height: 48px;
  width: auto;
}

.topo nav {
  margin-left: auto;
  display: flex;
  gap: 1.25rem;
  font-size: 0.9375rem;
}

/* Cabeçalho: a pergunta à esquerda, a resposta à direita. */

.principal {
  padding: 3rem 0 0;
}

.principal .envolvente {
  display: grid;
  gap: 2.5rem;
  align-items: start;
}

.sobretitulo {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--esbatido);
}

.principal h1 {
  margin: 0;
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.tese {
  margin: 1.125rem 0 0;
  font-size: 1.125rem;
  color: var(--esbatido);
}

.legenda-ecra {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--esbatido);
}

/* Acções. */

.accoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.75rem;
}

.botao {
  display: inline-block;
  padding: 0.6875rem 1.375rem;
  border-radius: 6px;
  background-color: var(--azul);
  color: var(--sobre-cor);
  font-weight: 500;
  font-size: 0.9375rem;
}

.botao:hover {
  text-decoration: none;
  filter: brightness(1.08);
}

.factos {
  list-style: none;
  margin: 2rem 0 0;
  padding: 1.25rem 0 0;
  border-top: 1px solid var(--limite);
  font-size: 0.9375rem;
  color: var(--esbatido);
}

.factos li {
  padding: 0.1875rem 0 0.1875rem 1.125rem;
  position: relative;
}

.factos li::before {
  content: "·";
  position: absolute;
  left: 0.25rem;
}

/* O ecrã dos Comensais, com o desenho que tem na aplicação. */

.ecra {
  border: 1px solid var(--limite);
  border-radius: 10px;
  background-color: var(--fundo);
  overflow: hidden;
}

.ecra-barra {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--limite);
  background-color: var(--crosta);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--esbatido);
}

.ecra-corpo {
  padding: 1rem;
}

.legenda-dietas {
  color: var(--esbatido);
  font-size: 0.8125rem;
  margin-bottom: 1rem;
}

.legenda-dietas p {
  margin: 0 0 0.25rem;
}

.legenda-dietas ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}

.dia h3 {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.dia-data {
  font-weight: 400;
  color: var(--esbatido);
}

.refeicao {
  background-color: var(--superficie);
  border-radius: 8px;
  padding: 0.875rem 1rem;
  margin-bottom: 0.75rem;
}

.refeicao:last-child {
  margin-bottom: 0;
}

.refeicao header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.nome-refeicao {
  font-weight: 700;
}

.distintivo {
  display: inline-block;
  border-radius: 1rem;
  padding: 0.1rem 0.7rem;
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--sobre-cor);
  background-color: var(--azul);
}

.distintivo-dieta {
  background-color: var(--esbatido);
  font-size: 0.75rem;
  padding: 0.05rem 0.55rem;
}

.cor-0 { color: var(--cor-0); }
.cor-1 { color: var(--cor-1); }
.fundo-0 { background-color: var(--cor-0); }
.fundo-1 { background-color: var(--cor-1); }

.matriz {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
}

.matriz th,
.matriz td {
  text-align: center;
  padding: 0.3rem 0.5rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--limite);
}

.matriz thead th {
  font-weight: 500;
  color: var(--esbatido);
  font-size: 0.8125rem;
}

.matriz th:first-child,
.matriz td:first-child {
  text-align: left;
  width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matriz tbody tr:last-child td {
  border-bottom: none;
}

/* Secções. */

.seccao {
  padding: 3.5rem 0 0;
}

.seccao h2 {
  margin: 0 0 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.introducao {
  margin: 0 0 1.5rem;
  color: var(--esbatido);
  max-width: var(--leitura);
}

/* Um módulo ligado é um bloco cheio; um módulo por ligar é só um contorno.
   A diferença é a mesma que a casa vê nas configurações. */

.cartao-ligado {
  border-radius: 10px;
  background-color: var(--superficie);
  padding: 1.5rem 1.625rem;
}

.cartao-ligado h3,
.cartao-opcional h3 {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.lista {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lista li {
  padding: 0.3125rem 0 0.3125rem 1rem;
  position: relative;
  font-size: 0.9375rem;
}

.lista li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--esbatido);
}

.opcionais {
  display: grid;
  gap: 1rem;
}

.cartao-opcional {
  border: 1px solid var(--limite);
  border-radius: 10px;
  padding: 1.25rem 1.375rem;
}

.cartao-opcional p {
  margin: 0;
  font-size: 0.9375rem;
}

/* Capturas dos ecrãs. */

.par {
  display: grid;
  gap: 1.75rem;
}

.par figure {
  margin: 0;
}

.par img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--limite);
  border-radius: 10px;
}

.par figcaption {
  margin-top: 0.625rem;
  font-size: 0.875rem;
  color: var(--esbatido);
}

/* Perfis. */

.perfis {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.perfis th {
  text-align: left;
  vertical-align: top;
  padding: 0.75rem 1.5rem 0.75rem 0;
  font-weight: 700;
  white-space: nowrap;
}

.perfis td {
  vertical-align: top;
  padding: 0.75rem 0;
}

.perfis tbody tr + tr th,
.perfis tbody tr + tr td {
  border-top: 1px solid var(--limite);
}

.nota {
  margin: 1.25rem 0 0;
  color: var(--esbatido);
  max-width: var(--leitura);
}

/* Dados. */

.dados {
  border-radius: 10px;
  background-color: var(--superficie);
  padding: 1.5rem 1.625rem;
  font-size: 0.9375rem;
}

.dados h2 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
}

.dados p {
  margin: 0;
  max-width: 44rem;
}

/* Documentação: índice à esquerda, texto à direita. */

.doc {
  display: grid;
  gap: 2.5rem;
  padding: 2.5rem 0 0;
}

.indice h2 {
  margin: 0 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--esbatido);
}

.indice ol {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}

.indice li {
  padding: 0.25rem 0;
}

.indice a[aria-current="page"] {
  color: var(--texto);
  font-weight: 700;
}

.conteudo {
  max-width: 40rem;
}

.conteudo h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.conteudo .resumo {
  margin: 0 0 2rem;
  font-size: 1.125rem;
  color: var(--esbatido);
}

.conteudo h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.conteudo h3 {
  margin: 1.75rem 0 0.5rem;
  font-size: 1.0625rem;
  font-weight: 700;
}

.conteudo p,
.conteudo ul,
.conteudo ol {
  margin: 0 0 1rem;
}

.conteudo ul,
.conteudo ol {
  padding-left: 1.25rem;
}

.conteudo li {
  margin-bottom: 0.375rem;
}

.conteudo figure {
  margin: 1.5rem 0;
}

.conteudo figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--limite);
  border-radius: 10px;
}

.conteudo figcaption {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--esbatido);
}

/* Uma captura de telemóvel esticada à largura do texto fica com tudo enorme. */
.conteudo .retrato img {
  max-width: 20rem;
}

.conteudo table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  margin: 0 0 1.25rem;
}

.conteudo th {
  text-align: left;
  vertical-align: top;
  padding: 0.625rem 1rem 0.625rem 0;
  font-weight: 700;
}

.conteudo td {
  vertical-align: top;
  padding: 0.625rem 1rem 0.625rem 0;
}

.conteudo tbody tr + tr th,
.conteudo tbody tr + tr td {
  border-top: 1px solid var(--limite);
}

/* Bloco de aviso: o que se perde, o que não se recupera, o que fecha. */
.reparo {
  margin: 1.5rem 0;
  border-left: 3px solid var(--esbatido);
  background-color: var(--superficie);
  border-radius: 0 8px 8px 0;
  padding: 0.875rem 1.125rem;
  font-size: 0.9375rem;
}

.reparo p {
  margin: 0;
}

.seguinte {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--limite);
  font-size: 0.9375rem;
}

/* Fecho e rodapé. */

.fecho {
  padding: 3.5rem 0 0;
}

.fecho p {
  margin: 0;
  font-size: 1.125rem;
  max-width: var(--leitura);
}

.rodape {
  margin-top: 4rem;
  border-top: 1px solid var(--limite);
  padding: 1.75rem 0 3rem;
  font-size: 0.875rem;
  color: var(--esbatido);
}

.rodape .envolvente {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.rodape img {
  display: block;
  height: 36px;
  width: auto;
}

.rodape nav {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

@media (min-width: 52rem) {
  .principal {
    padding-top: 4.5rem;
  }

  .principal .envolvente {
    grid-template-columns: minmax(0, 1fr) minmax(0, 24rem);
    gap: 3.5rem;
    /* O ecrã é mais alto do que o texto; centrado, a diferença lê-se como
       composição e não como espaço que sobrou. */
    align-items: center;
  }

  .lista {
    columns: 2;
    column-gap: 2.5rem;
  }

  .lista li {
    break-inside: avoid;
  }

  .opcionais {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .doc {
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }

  .indice {
    position: sticky;
    top: 2rem;
  }

  /* O telemóvel fica estreito ao lado do ecrã grande, como na realidade. */
  .par {
    grid-template-columns: 18rem minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
  }
}
