/* Layout comum da interface pública. Identidade herdada do site antigo
   (camecc-ref/site): Roboto Slab + Roboto Condensed, vermelho CAMECC, fundo creme.
   Mobile primeiro; as telas largas ganham o menu em linha. */

:root {
  --tinta: #101010;
  --fundo: #faf5f5;
  --vermelho: #c71818;
  --cinza: #6f6666;
  --cinza-escuro: #484848;
  --linha: #e3d9d9;
  --fonte: "Roboto Slab", Georgia, serif;
  --fonte-aux: "Roboto Condensed", "Arial Narrow", sans-serif;
  --largura: 68rem;
  --margem: clamp(1rem, 4vw, 2.5rem);
  --topo: 4.25rem;
}

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

/* Escala geral: 18px no celular, 20px em tela larga (o site antigo usava 18/24). */
html { font-size: 112.5%; scroll-behavior: smooth; scroll-padding-top: var(--topo); }
@media (min-width: 60rem) { html { font-size: 125%; } }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--fundo);
  color: var(--tinta);
  font: 300 1.0625rem/1.6 var(--fonte);
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; width: 100%; }

h1, h2, h3 { font-weight: 500; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
strong { font-weight: 600; }
img { max-width: 100%; height: auto; }

/* Link com o sublinhado vermelho que cresce, como no site antigo. */
a { color: var(--vermelho); font-weight: 500; text-decoration: none;
    background: linear-gradient(var(--vermelho), var(--vermelho)) no-repeat 0 100% / 0 2px;
    transition: background-size .15s linear; }
a:hover, a:focus-visible { background-size: 100% 2px; }
a:focus-visible, label:focus-visible, input:focus-visible + label { outline: 2px solid var(--vermelho); outline-offset: 3px; }

/* Só para leitor de tela. */
.so-leitor, .pular:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }
.pular:focus { position: absolute; left: 1rem; top: 1rem; z-index: 20; background: var(--fundo); padding: .5rem; }

/* Conteúdo de largura legível. */
.faixa { width: min(var(--largura), 100% - 2 * var(--margem)); margin-inline: auto; }

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 10;
  height: var(--topo);
  display: flex; align-items: center; justify-content: space-between;
  /* Mesmo alinhamento do conteúdo (.faixa), com a margem mínima nas telas estreitas. */
  padding-inline: max(var(--margem), (100% - var(--largura)) / 2);
  background: var(--fundo);
  border-bottom: 1px solid var(--linha);
}
.logo { background: none; display: flex; }
.logo-svg { height: 2.25rem; width: auto; fill: var(--tinta); }
.logo-cc { fill: var(--vermelho); }

.menu-abre { position: absolute; opacity: 0; width: 1px; height: 1px; }
.menu-botao { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; cursor: pointer; z-index: 12; }
.menu-botao span, .menu-botao span::before, .menu-botao span::after {
  content: ""; display: block; width: 1.75rem; height: .3rem; background: var(--vermelho);
  transition: transform .2s ease; }
.menu-botao span { position: relative; }
.menu-botao span::before { position: absolute; transform: translateY(-.6rem); }
.menu-botao span::after { position: absolute; transform: translateY(.6rem); }
.menu-abre:checked + .menu-botao span { transform: rotate(45deg); }
.menu-abre:checked + .menu-botao span::before,
.menu-abre:checked + .menu-botao span::after { transform: rotate(90deg); }

.menu { font-family: var(--fonte-aux); }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu a { color: var(--tinta); font-weight: 400; background-image: linear-gradient(var(--vermelho), var(--vermelho)); }

/* Celular: painel que desliza da direita, com as subpáginas abertas. */
.menu {
  position: fixed; inset: var(--topo) 0 0 0;
  overflow-y: auto;
  padding: 1.5rem var(--margem) 3rem;
  background: var(--fundo);
  transform: translateX(100%); visibility: hidden;
  transition: transform .25s ease, visibility .25s;
}
.menu-abre:checked ~ .menu { transform: none; visibility: visible; }
.menu > ul { display: grid; gap: 1.25rem; }
.menu > ul > li > a { font-size: 1.4rem; }
.menu li ul { display: flex; flex-wrap: wrap; gap: .25rem 1rem; margin-top: .25rem; }
.menu li ul a { font-weight: 400; color: var(--cinza-escuro); }

@media (min-width: 60rem) {
  .menu-botao { display: none; }
  .menu {
    position: static; transform: none; visibility: visible;
    padding: 0; overflow: visible; background: none;
  }
  .menu > ul { display: flex; gap: 1.75rem; }
  /* O item ocupa a altura toda do topo: o submenu começa colado nele e o hover não quebra. */
  .menu > ul > li { position: relative; height: var(--topo); display: flex; align-items: center; }
  .menu > ul > li > a { font-size: .85rem; }
  /* Seta vermelha antes de cada seção, como no site antigo: aponta para a direita e gira para
     baixo quando o submenu abre. */
  .menu > ul > li::before {
    content: ""; position: absolute; left: 0; top: 50%;
    width: .3em; height: .3em;
    border-top: 1px solid var(--vermelho); border-right: 1px solid var(--vermelho);
    transform: translate(-220%, -40%) rotate(45deg); transition: transform .3s ease;
  }
  .menu > ul > li:has(ul):is(:hover, :focus-within)::before { transform: translate(-220%, -40%) rotate(135deg); }
  .menu li ul {
    /* Sobe um pouco, por cima da borda do topo, sem encostar no nome da seção. */
    display: none; position: absolute; top: calc(100% - .85rem); left: -.75rem; min-width: 12rem;
    flex-direction: column; gap: 0; margin: 0; padding: .4rem 0;
    background: var(--fundo); border: 1px solid var(--linha); box-shadow: 0 6px 18px #0000001a;
  }
  /* Sublinhado do tamanho do texto, com a mesma folga dos dois lados. */
  .menu li ul a { display: inline-block; padding: .3rem .75rem; font-size: .8rem;
    background-position: .75rem 85%; background-size: 0 1px; }
  .menu li ul a:hover, .menu li ul a:focus-visible { background-size: calc(100% - 1.5rem) 1px; }
  .menu li:hover > ul, .menu li:focus-within > ul { display: flex; }
}
/* ---------- conteúdo comum ---------- */
.cabecalho-pagina { padding-block: clamp(2rem, 6vw, 4rem) 1rem; }
.trilha { font-family: var(--fonte-aux); font-size: .95rem; color: var(--cinza); margin-bottom: 1rem; }
.trilha a { color: var(--cinza); font-weight: 400; }
.resumo { font-size: 1.2rem; color: var(--cinza-escuro); max-width: 40rem; }

.texto { max-width: 44rem; padding-bottom: 3rem; }
.texto h2 { margin-top: 1.75em; }
.texto li::marker { color: var(--vermelho); font-weight: 700; }
.texto blockquote { margin: 1.5em 0; padding-left: 1rem; border-left: 4px solid var(--vermelho); color: var(--cinza-escuro); }
.texto hr { border: 0; border-top: 1px solid var(--linha); margin: 2.5em 0; }

/* Cartões das subpáginas de uma seção. */
.cartoes { list-style: none; padding: 0; margin: 0 0 4rem;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.cartoes a { display: block; height: 100%; padding: 1.25rem; background: #fff;
  border: 1px solid var(--linha); border-top: 4px solid var(--vermelho); color: var(--tinta); }
.cartoes a:hover { background-size: 0 0; border-color: var(--vermelho); }
.cartoes strong { display: block; font-size: 1.15rem; margin-bottom: .35rem; color: var(--vermelho); }
.cartoes span { font-weight: 300; color: var(--cinza-escuro); }

/* ---------- rodapé ---------- */
.rodape {
  margin-top: 3rem;
  /* Mesmo alinhamento do topo e do conteúdo. */
  padding: 2.5rem max(var(--margem), (100% - var(--largura)) / 2);
  background: var(--tinta); color: var(--fundo);
  display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  font-size: .95rem;
}
.rodape h2 { font: 700 .85rem var(--fonte-aux); text-transform: uppercase; letter-spacing: .08em; color: #bfb4b4; }
.rodape ul { list-style: none; margin: 0; padding: 0; }
.rodape p { margin: 0; }
.rodape a { color: var(--fundo); }
.rodape .logo-svg { fill: var(--fundo); height: 2rem; margin-bottom: .75rem; }
.rodape-marca p { color: #bfb4b4; max-width: 18rem; }

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