/* Revisa+ : página de venda de resumos
   Cores por curso: Medicina = verde-esmeralda e verde-água; Direito = bordô.
   Dourado só nos detalhes (o "+", linhas finas). */

@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fontes/cormorant-garamond-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("../fontes/cormorant-garamond-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Albert Sans";
  src: url("../fontes/albert-sans-latin-400-normal.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Albert Sans";
  src: url("../fontes/albert-sans-latin-500-normal.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Albert Sans";
  src: url("../fontes/albert-sans-latin-600-normal.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  --dourado: #B08D3C;
  --dourado-claro: #E3D3AA;
  --branco: #FFFFFF;
  --serifa: "Cormorant Garamond", Georgia, serif;
  --texto: "Albert Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --largura: 68rem;
}

/* Medicina */
body[data-curso="medicina"] {
  --fundo: #F2F7F5;
  --tinta: #1C2B27;
  --tinta-suave: #4F625C;
  --cor: #1F6B52;
  --cor-escura: #164F3D;
  --cor-clara: #D3E8E1;
}
/* Direito */
body[data-curso="direito"] {
  --fundo: #FAF4F3;
  --tinta: #2E1D20;
  --tinta-suave: #6A5457;
  --cor: #7A1F2B;
  --cor-escura: #5C1620;
  --cor-clara: #EFD9DB;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font-family: var(--texto);
  font-variant-numeric: lining-nums;
  font-size: 1.0625rem;
  line-height: 1.6;
  transition: background-color .35s ease, color .35s ease;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--cor); }

:focus-visible {
  outline: 2px solid var(--cor);
  outline-offset: 3px;
}

/* ---------- Topo ---------- */

.topo {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  text-align: center;
}

.marca {
  display: inline-flex;
  align-items: flex-start;
  margin: 0;
  font-family: var(--serifa);
  font-weight: 500;
  font-size: clamp(3.5rem, 15vw, 6.5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--tinta);
}

.marca-mais {
  width: .62em;
  height: .62em;
  margin-left: .04em;
  margin-top: -.02em;
  stroke: var(--dourado);
  stroke-width: 3.2;
  stroke-linecap: round;
  fill: none;
}

.chamada {
  max-width: 30rem;
  margin: 1.25rem auto 2.25rem;
  color: var(--tinta-suave);
}

/* Seletor Medicina | Direito */
.seletor {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  padding: .3rem;
  border: 1px solid var(--dourado-claro);
  border-radius: 999px;
  background: var(--branco);
}

.seletor::before {
  content: "";
  position: absolute;
  top: .3rem; bottom: .3rem; left: .3rem;
  width: calc(50% - .3rem);
  border-radius: 999px;
  background: var(--cor);
  transition: transform .35s ease, background-color .35s ease;
}
body[data-curso="direito"] .seletor::before { transform: translateX(100%); }

.seletor-opcao {
  position: relative;
  z-index: 1;
  min-width: 8.5rem;
  padding: .7rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tinta-suave);
  font: 500 1rem/1.2 var(--texto);
  cursor: pointer;
  transition: color .35s ease;
}
.seletor-opcao[aria-selected="true"] { color: var(--branco); }

/* ---------- Conteúdo ---------- */

main {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.curso-intro {
  max-width: 34rem;
  margin: 0 auto 1rem;
  text-align: center;
  color: var(--tinta-suave);
}

.resumo {
  display: grid;
  gap: 1.5rem;
  padding: 2.75rem 0;
  border-bottom: 1px solid var(--dourado-claro);
}
.resumo:last-child { border-bottom: 0; }

.resumo h2,
.em-breve h2,
.como h2 {
  margin: 0;
  font-family: var(--serifa);
  font-weight: 600;
  font-size: clamp(2rem, 7vw, 2.6rem);
  line-height: 1.1;
  color: var(--cor-escura);
}

.resumo-paginas {
  margin: .35rem 0 1rem;
  color: var(--tinta-suave);
  font-size: .95rem;
}

.resumo-temas {
  margin: 0;
  padding: 0;
  list-style: none;
}
.resumo-temas li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: .35rem;
}
.resumo-temas li::before {
  content: "";
  position: absolute;
  left: 0; top: .72em;
  width: .5rem; height: 1px;
  background: var(--dourado);
}

/* Páginas de amostra */
.amostra {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 42%;
  gap: .75rem;
  margin: 0 -1.5rem;
  padding: .25rem 1.5rem 1rem;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.amostra li { scroll-snap-align: start; }

.amostra-pagina {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 3px;
  background: var(--branco);
  cursor: zoom-in;
  box-shadow: 0 1px 2px rgba(28, 43, 39, .08), 0 6px 14px -8px rgba(28, 43, 39, .25);
}
.amostra-pagina img { border-radius: 3px; }

/* Preço e botão */
.resumo-compra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.preco {
  margin: 0;
  font-family: var(--serifa);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.botao {
  display: inline-block;
  padding: .9rem 1.5rem;
  border-radius: 999px;
  background: var(--cor);
  color: var(--branco);
  font-weight: 500;
  text-decoration: none;
  transition: background-color .2s ease;
}
.botao:hover { background: var(--cor-escura); }

/* Direito: em breve */
.em-breve {
  max-width: 32rem;
  margin: 0 auto;
  padding: 2.5rem 0 3.5rem;
  text-align: center;
}
.em-breve p { color: var(--tinta-suave); margin: 1rem 0 1.75rem; }

/* Como funciona */
.como {
  max-width: 40rem;
  margin: 1.5rem auto 0;
  padding: 3rem 0 1rem;
  border-top: 1px solid var(--dourado-claro);
}

.passos {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: passo;
}
.passos li {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.25rem;
  counter-increment: passo;
}
.passos li::before {
  content: counter(passo);
  position: absolute;
  left: 0; top: -.15rem;
  width: 2rem; height: 2rem;
  border: 1px solid var(--dourado);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--serifa);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--cor-escura);
}

.aviso {
  margin: 1.5rem 0 0;
  color: var(--tinta-suave);
  font-size: .95rem;
}

.rodape {
  max-width: var(--largura);
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  color: var(--tinta-suave);
  font-size: .95rem;
}

/* ---------- Visor (página ampliada) ---------- */

.visor {
  width: 100%;
  max-width: 44rem;
  height: 100%;
  max-height: 100%;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--branco);
}
.visor[open] {
  display: flex;
  flex-direction: column;
}
.visor::backdrop { background: rgba(20, 26, 24, .9); }

.visor-barra,
.visor-navegar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .75rem 1rem;
}
.visor-contagem { margin: 0; font-size: .95rem; }

.visor-imagem {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: contain;
  touch-action: pan-y pinch-zoom;
}

.visor button {
  padding: .6rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  background: transparent;
  color: var(--branco);
  font: 500 .95rem/1 var(--texto);
  cursor: pointer;
}
.visor button:disabled { opacity: .35; cursor: default; }
.visor button:focus-visible { outline-color: var(--branco); }

/* ---------- Telas maiores ---------- */

@media (min-width: 820px) {
  .topo { padding-top: 5rem; }

  .resumo {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    grid-template-areas:
      "texto amostra"
      "compra amostra";
    align-items: start;
    column-gap: 3.5rem;
    padding: 3.5rem 0;
  }
  .resumo-texto { grid-area: texto; }
  .amostra {
    grid-area: amostra;
    grid-auto-flow: row;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-columns: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
  }
  .resumo-compra {
    grid-area: compra;
    align-self: end;
    justify-content: flex-start;
    gap: 1.5rem;
  }
}

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

/* Nome do curso no topo (só Medicina por enquanto; o seletor Medicina | Direito volta quando Direito estiver pronto) */
.curso-nome {
  display: inline-block;
  margin: 0;
  padding: .55rem 1.6rem;
  border: 1px solid var(--dourado-claro);
  border-radius: 999px;
  background: var(--branco);
  color: var(--cor-escura);
  font-weight: 500;
}
