/* Tema do Encaixe — a camada visual da home e do catálogo.
 *
 * Só aparência: nenhuma regra aqui muda o que um botão faz, para onde um link
 * vai ou quais campos existem. Quem manda no comportamento é o index.html.
 *
 * Carrega DEPOIS do Tailwind. Como o Tailwind injeta seus estilos em tempo de
 * execução, as regras abaixo levam o prefixo `body` para vencer pela
 * especificidade, e não pela ordem — a ordem não é garantida.
 *
 * A direção, em uma frase: papel e tinta de prancha de projeto, com o laranja
 * reservado para a ação. Quem entra aqui é marceneiro e projetista, gente de
 * oficina e de obra; o visual vem da mesa deles, não de uma agência.
 */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url('/site/fontes/archivo-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
                 U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,
                 U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --papel: #f5f5f2;
  --tinta: #1c2430;
  --grafite: #5b6470;
  --linha: #d9dbd6;
  --laranja: #ea580c;
  --laranja-escuro: #c2410c;
  --verde: #2f7d5b;

  /* Uma escala só, em vez de um tamanho para cada lugar. */
  --texto-pequeno: 0.8125rem;
  --texto: 0.9375rem;
  --texto-grande: 1.125rem;
}

/* `body[class]` e não só `body`: o <body> carrega `bg-[#f8fafc]` e
 * `text-slate-800` do Tailwind, que têm mais especificidade que o seletor
 * simples e deixavam o fundo azulado. */
body,
body[class] {
  background-color: var(--papel);
  color: var(--tinta);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-stretch: 100%;
  font-size: var(--texto);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* A personalidade está nos títulos: a mesma família, mais estreita e pesada,
 * como letra de prancha. O corpo fica na largura normal. */
body h1,
body h2,
body h3,
body .titulo-prancha {
  font-family: 'Archivo', system-ui, sans-serif;
  font-stretch: 78%;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--tinta);
}

/* ------------------------------------------------------------------ forma */
/* Um raio só, pequeno. Hoje tudo é arredondado igual, do botão ao cartão. */
body .rounded-xl,
body .rounded-2xl,
body .rounded-3xl,
body .rounded-lg {
  border-radius: 4px;
}

/* Sem sombra espalhada em tudo. Sombra só onde algo flutua sobre a página
 * (menus e janelas), que é onde ela informa alguma coisa. */
body [class*="shadow"] {
  box-shadow: none;
}
body .shadow-xl,
body .shadow-2xl,
body .shadow-lg.absolute,
body details > div.absolute,
body .group > div.absolute {
  box-shadow: 0 10px 28px rgba(28, 36, 48, 0.14);
}

/* O cartão não levanta ao passar o mouse: a borda escurece. O que mudou fica
 * claro sem a página inteira dançar. */
body .card-hover {
  transition: border-color 0.15s ease;
}
body .card-hover:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--tinta);
}

/* ----------------------------------------------------------------- cor */
/* Gradientes laranja viram laranja liso; é a cor da marca, sem enfeite. */
body [class*="bg-gradient"][class*="orange"],
body [class*="bg-gradient"][class*="amber"] {
  background-image: none;
  background-color: var(--laranja);
}
body [class*="bg-gradient"][class*="orange"]:hover,
body [class*="bg-gradient"][class*="amber"]:hover {
  background-color: var(--laranja-escuro);
}
/* Fundos em degradê de seção viram o papel. */
body [class*="bg-gradient-to-b"][class*="from-white"] {
  background-image: none;
  background-color: transparent;
}

/* Rótulo em caixa alta com letras espaçadas era enfeite em toda parte. Frase
 * normal diz a mesma coisa e se lê melhor. */
body .uppercase {
  text-transform: none;
}
body .tracking-wider,
body .tracking-widest,
body .tracking-wide {
  letter-spacing: normal;
}

/* O ponto que pulsava ao lado dos títulos de seção não indicava nada. */
body .anim-pulse,
body .animate-pulse {
  animation: none;
}

/* ---------------------------------------------------------------- barra */
.barra-topo {
  background: var(--tinta);
  color: #e9ebe7;
  font-size: var(--texto-pequeno);
  font-weight: 500;
  text-align: center;
  padding: 0.45rem 1rem;
}

.marca {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
}
.marca svg {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: block;
}
.marca .nome {
  font-stretch: 78%;
  font-weight: 800;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--tinta);
}
.marca .lema {
  font-size: 0.72rem;
  color: var(--grafite);
  line-height: 1.2;
  margin-top: 0.2rem;
}

/* ---------------------------------------------------------------- abertura */
.abertura {
  border-bottom: 1px solid var(--linha);
  padding: clamp(2.5rem, 6vw, 5rem) 0;
}
.abertura-grade {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}
@media (min-width: 900px) {
  .abertura-grade {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 4rem;
  }
}
.abertura h1 {
  font-size: clamp(2.4rem, 5.4vw, 4rem);
  line-height: 1.02;
  max-width: 14ch;
  margin: 0;
}
.abertura .lide {
  margin: 1.25rem 0 0;
  font-size: var(--texto-grande);
  color: var(--grafite);
  max-width: 46ch;
}
.busca {
  display: flex;
  margin-top: 2rem;
  max-width: 34rem;
  background: #fff;
  border: 1px solid var(--tinta);
  border-radius: 4px;
}
.busca:focus-within {
  outline: 2px solid var(--laranja);
  outline-offset: 2px;
}
.busca input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.85rem 1rem;
  font: inherit;
  color: var(--tinta);
  outline: none;
}
.busca button {
  border: 0;
  background: var(--laranja);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 0 1.4rem;
  cursor: pointer;
  border-radius: 0 3px 3px 0;
}
.busca button:hover {
  background: var(--laranja-escuro);
}
.acoes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin-top: 1.25rem;
}
.botao-tinta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--tinta);
  color: #fff;
  font-weight: 700;
  padding: 0.7rem 1.15rem;
  border-radius: 4px;
  text-decoration: none;
}
.botao-tinta:hover {
  background: #000;
}
.link-simples {
  color: var(--tinta);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.link-simples:hover {
  color: var(--laranja-escuro);
}
.nota-acervo {
  margin: 1.5rem 0 0;
  font-size: var(--texto-pequeno);
  color: var(--grafite);
}
.nota-acervo strong {
  color: var(--tinta);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* O desenho da abertura é a seção de um móvel: uma lateral e três
 * prateleiras encaixadas nela — o mesmo "E" da marca, em escala de prancha. */
.prancha {
  width: 100%;
  max-width: 30rem;
  justify-self: center;
  color: var(--tinta);
}
.prancha svg {
  display: block;
  width: 100%;
  height: auto;
}
.prancha text {
  font-family: 'Archivo', system-ui, sans-serif;
  fill: var(--tinta);
}
.prancha .corpo {
  fill: #fff;
  stroke: var(--tinta);
  stroke-width: 1.6;
}
.prancha .cota {
  fill: none;
  stroke: var(--grafite);
  stroke-width: 1;
}
.prancha .rasgo {
  fill: none;
  stroke: var(--laranja);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

/* Um único movimento na página inteira: o desenho se traça uma vez, ao
 * carregar. Quem pede menos movimento recebe o desenho pronto. */
@media (prefers-reduced-motion: no-preference) {
  .prancha .corpo,
  .prancha .cota,
  .prancha .rasgo {
    stroke-dashoffset: 1;
    animation: tracar 1.5s ease-out forwards;
  }
  .prancha .corpo { stroke-dasharray: 1; animation-delay: 0.1s; }
  .prancha .cota  { stroke-dasharray: 1; animation-delay: 0.7s; }
  .prancha .rasgo { stroke-dasharray: 5 4; stroke-dashoffset: 400; animation-delay: 0.5s; }
  .prancha text   { opacity: 0; animation: surgir 0.5s ease-out 1.3s forwards; }
}
@keyframes tracar { to { stroke-dashoffset: 0; } }
@keyframes surgir { to { opacity: 1; } }


/* Vitrine da abertura: cartões sobrepostos que trocam de modelo a cada 10 s. */
.vitrine {
  position: relative;
  width: 100%;
  max-width: 44rem;
  aspect-ratio: 1.3 / 1;
  justify-self: center;
}
.v-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--tinta);
  box-shadow: 0 6px 18px rgba(22, 29, 43, 0.12);
  color: var(--tinta);
  text-decoration: none;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 0.35s ease, transform 0.35s ease, box-shadow 0.2s ease;
}
.v-card.v-dentro { opacity: 1; transform: none; }
.v-card:hover { box-shadow: 0 10px 26px rgba(22, 29, 43, 0.22); z-index: 9; }
.v-img {
  flex: 1;
  min-height: 0;
  background: #f5f5f2 center / contain no-repeat;
  margin: 6px 6px 0;
}
.v-nome {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 6px 9px 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v1 { left: 29%; top: 27%; width: 25%; height: 24%; z-index: 1; }
.v2 { left: 53%; top: 22%; width: 26%; height: 26%; z-index: 2; }
.v3 { left: 15.5%; top: 40%; width: 23.6%; height: 24.5%; z-index: 2; }
.v4 { left: 35%; top: 50.6%; width: 26%; height: 26%; z-index: 4; }
.v5 { left: 60%; top: 48.8%; width: 26%; height: 21%; z-index: 2; }
.v6 { left: 20%; top: 67%; width: 24%; height: 24.5%; z-index: 5; }
.v7 { left: 46%; top: 70.6%; width: 26%; height: 21%; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .v-card { transition: none; }
}

/* Vídeo de apresentação no lugar da vitrine, 16:9, com o mesmo traço dos cartões. */
.video-abertura {
  position: relative;
  width: 100%;
  max-width: 44rem;
  aspect-ratio: 16 / 9;
  justify-self: center;
  background: #161d2b;
  border: 1px solid var(--tinta);
  box-shadow: 0 10px 26px rgba(22, 29, 43, 0.22);
}
.video-abertura iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* -------------------------------------------------------------- categorias */
.indice {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  column-gap: 3rem;
}
@media (min-width: 640px)  { .indice { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .indice { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.indice a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--linha);
  color: var(--tinta);
  text-decoration: none;
  font-weight: 600;
}
.indice a:hover {
  border-bottom-color: var(--tinta);
  color: var(--laranja-escuro);
}
.indice .conta {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.indice .vazia {
  font-weight: 400;
  color: var(--grafite);
  font-size: var(--texto-pequeno);
}

/* ------------------------------------------------------------------ foco */
body a:focus-visible,
body button:focus-visible,
body input:focus-visible,
body select:focus-visible,
body summary:focus-visible {
  outline: 2px solid var(--laranja);
  outline-offset: 2px;
}

/* ------------------------------------------------------- selo de acesso */
/* Quem pode baixar o modelo. O formato diz o tipo: vazado é da comunidade,
 * cheio é à venda, verde é livre. Sem isso eram três blocos laranja iguais. */
.selo-acesso {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  border-radius: 3px;
  border: 1px solid var(--tinta);
  background: #fff;
  color: var(--tinta);
}
.selo-acesso[data-acesso="Avulso"] {
  background: var(--tinta);
  color: #fff;
}
.selo-acesso[data-acesso="Livre"] {
  border-color: var(--verde);
  color: var(--verde);
}
/* Comunidade: borda e letra laranja, a cor da marca. */
.selo-acesso[data-acesso="Comunidade"] {
  border-color: var(--laranja);
  color: var(--laranja-escuro);
}

/* O menu de categorias tinha um pontinho de cor diferente para cada item, sem
 * significado nenhum. O nome já identifica a categoria. */
body nav .group a > span[class*="w-2"][class*="h-2"] {
  display: none;
}

/* O canto direito do cabeçalho (Publicar, Entrar, Criar conta) não pode
 * quebrar linha: com a fonte nova o menu do meio disputava o espaço e os
 * botões se empilhavam. */
body header a[href="/publicar"],
body header #area-conta a {
  white-space: nowrap;
}
body header #area-conta,
body header a[href="/publicar"] {
  flex: none;
}

/* ------------------------------------------------- cabeçalho na cor da antiga barra
 * A barra de propaganda do topo saiu; o cabeçalho ficou com a cor dela (tinta). Só o primeiro nível do menu muda de cor:
 * os menus que abrem (categorias, conta) continuam brancos, com texto escuro. */
.barra-topo { display: none !important; }
header.sticky {
  background: var(--tinta) !important;
  border-color: var(--tinta) !important;
  backdrop-filter: none !important;
}
header.sticky .marca .nome { color: #ffffff; }
header.sticky .marca .lema { color: #c9ced6; }
header.sticky nav > a,
header.sticky nav > .group > button {
  color: #e9ebe7 !important;
}
header.sticky nav > a:hover,
header.sticky nav > .group > button:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
}
header.sticky nav > a[aria-current="page"],
header.sticky nav > a.ativo {
  color: #ffffff !important;
  box-shadow: inset 0 -2px 0 #ea580c;
}
header.sticky nav svg { color: #c9ced6; }
header.sticky #area-conta > a:not(.text-orange-600) { color: #ffffff !important; }
header.sticky #area-conta > a:hover { background: rgba(255, 255, 255, 0.12) !important; }
header.sticky details > summary {
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  background: transparent !important;
}
header.sticky details > summary:hover { background: rgba(255, 255, 255, 0.12) !important; }

/* Gratuitos e a conta, ajustados ao cabeçalho escuro */
header.sticky nav > a#nav-gratuitos {
  background: rgba(16, 185, 129, 0.18) !important;
  border-color: rgba(52, 211, 153, 0.55) !important;
  color: #6ee7b7 !important;
}
header.sticky nav > a#nav-gratuitos:hover {
  background: rgba(16, 185, 129, 0.32) !important;
  color: #a7f3d0 !important;
}
header.sticky #area-conta > button {
  border-color: rgba(255, 255, 255, 0.35) !important;
  background: transparent !important;
}
header.sticky #area-conta > button:hover { background: rgba(255, 255, 255, 0.12) !important; }
header.sticky #area-conta > button > span.text-slate-800 { color: #ffffff !important; }
