:root {
  --navy: #0A2761;
  --navy-2: #13357c;
  --red: #DF181D;
  --red-2: #b81217;
  --bg: #F3F5F9;
  --surface: #FFFFFF;
  --line: #E1E5EE;
  --text: #0F172A;
  --muted: #5B6478;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(10, 39, 97, .06), 0 4px 16px rgba(10, 39, 97, .06);
  --font-title: 'Exo 2', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--red) 55%, transparent); outline-offset: 2px; border-radius: 8px; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Topo ---------- */
.topo { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topo .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.topo .logo img { height: 34px; width: auto; }
.topo .espaco { flex: 1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-claro { background: var(--surface); color: var(--navy); border: 1px solid var(--line); }
.btn-claro:hover { background: #eef1f7; }
.btn-icone { width: 42px; padding: 0; }

/* ---------- Hero ---------- */
.hero { background: var(--navy); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; right: -60px; top: -40px; width: 280px; height: 280px; border: 36px solid var(--red); border-radius: 50%; opacity: .9; clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%); }
.hero .wrap { position: relative; z-index: 1; padding-top: 28px; padding-bottom: 72px; }
.hero small { font: 600 12px/1 var(--font); letter-spacing: .14em; text-transform: uppercase; color: #ff9a9d; }
.hero h1 { font: 700 30px/1.1 var(--font-title); margin: 10px 0 8px; letter-spacing: -.01em; max-width: 16ch; }
.hero p { margin: 0; color: #c9d3ea; max-width: 52ch; }

.busca { position: relative; margin-top: -26px; z-index: 5; }
.busca input { width: 100%; height: 52px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); padding: 0 48px 0 50px; font: 16px var(--font); color: var(--text); box-shadow: 0 8px 28px rgba(10, 39, 97, .14); }
.busca input::-webkit-search-cancel-button { display: none; }
.busca input::placeholder { color: #8a93a6; }
.busca input:focus { outline: none; border-color: var(--navy); }
.busca .lupa { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.busca .limpar { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: none; align-items: center; justify-content: center; color: var(--muted); }
.busca .limpar svg { width: 18px; height: 18px; }
.busca.com-texto .limpar { display: flex; }

/* ---------- Filtros ---------- */
.filtros { position: sticky; top: 60px; z-index: 20; background: var(--bg); padding: 14px 0 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px; margin: 0 -16px; scroll-padding: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.chip span { font-weight: 500; font-size: 12px; color: #97a0b3; }
.chip[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip[aria-pressed="true"] span { color: #aebbe0; }

/* ---------- Lista ---------- */
.secao { padding: 10px 0 18px; }
.secao-topo { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 12px; }
.secao h2 { font: 700 19px/1.2 var(--font-title); margin: 0; color: var(--navy); display: flex; align-items: center; gap: 10px; }
.secao h2::before { content: ''; width: 4px; height: 18px; border-radius: 2px; background: var(--red); }
.secao-topo p { margin: 0; font-size: 13px; color: var(--muted); }
.resultado { font-size: 14px; color: var(--muted); margin: 6px 0 12px; }

.grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; position: relative; transition: transform .15s, box-shadow .15s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(10,39,97,.06), 0 12px 28px rgba(10,39,97,.12); }
.card .capa { aspect-ratio: 4 / 3; background: #e7eaf1; overflow: hidden; }
.card .capa img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.card .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card .marca { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--red); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card h3 { margin: 0; font: 650 15px/1.25 var(--font); color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-right: 40px; }
.card .novo { background: #e8f7ee; color: #137a3e; font-weight: 600; padding: 1px 7px; border-radius: 999px; font-size: 11px; }
.card .link-card::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.card .compartilhar { position: absolute; z-index: 2; right: 8px; bottom: 8px; width: 38px; height: 38px; border-radius: 50%; background: #eef1f7; color: var(--navy); display: flex; align-items: center; justify-content: center; }
.card .compartilhar:hover { background: var(--navy); color: #fff; }
.card .compartilhar svg { width: 19px; height: 19px; }
.vazio { text-align: center; padding: 48px 16px; color: var(--muted); }
.vazio strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }

/* ---------- Rodapé ---------- */
.rodape { background: var(--navy); color: #c9d3ea; margin-top: 32px; padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); font-size: 13px; }
.rodape img { height: 34px; width: auto; margin-bottom: 10px; }

/* ---------- Folha de compartilhar ---------- */
.folha-fundo { position: fixed; inset: 0; background: rgba(8, 18, 45, .45); z-index: 90; opacity: 0; transition: opacity .2s; }
.folha { position: fixed; z-index: 91; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .25s cubic-bezier(.2,.8,.2,1); max-width: 520px; margin: 0 auto; }
.folha.aberta { transform: none; }
.folha-fundo.aberta { opacity: 1; }
.folha .alca { width: 40px; height: 4px; background: #d5dae5; border-radius: 2px; margin: 0 auto 12px; }
.folha h4 { margin: 0 0 2px; font: 700 17px/1.3 var(--font-title); color: var(--navy); }
.folha p { margin: 0 0 14px; font-size: 13px; color: var(--muted); word-break: break-all; }
.folha .opcoes { display: grid; gap: 8px; }
.folha .opcoes .btn { height: 50px; font-size: 15px; width: 100%; }
@media (min-width: 720px) {
  .folha { bottom: auto; top: 50%; left: 50%; right: auto; width: 420px; border-radius: 20px; transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s; }
  .folha.aberta { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
  .folha .alca { display: none; }
}
.aviso { position: fixed; z-index: 95; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.aviso.mostrar { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Visualizador ---------- */
.v-topo .wrap { gap: 8px; }
.v-titulo { min-width: 0; flex: 1; line-height: 1.2; }
.v-titulo strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-titulo span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-acoes-topo { display: none; gap: 8px; }
.v-intro { padding: 16px 0 6px; }
.v-intro .marca { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.v-intro h1 { font: 700 23px/1.2 var(--font-title); color: var(--navy); margin: 4px 0 6px; }
.v-intro p { margin: 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.v-intro .meta { margin-top: 8px; font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.v-paginas { display: flex; flex-direction: column; gap: 14px; padding: 12px 0 110px; max-width: 1180px; margin: 0 auto; }
.v-pagina { margin: 0; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 72px; }
.v-pagina .img { background: #e9ecf2; }
.v-pagina img { width: 100%; height: auto; }
.v-pagina figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 6px 14px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.v-pagina figcaption button { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; color: var(--navy); font-weight: 600; font-size: 13px; }
.v-pagina figcaption button:hover { background: #eef1f7; }
.v-pagina figcaption svg { width: 16px; height: 16px; }

.v-pagina .img { cursor: zoom-in; }
.v-pagina.retrato { width: 100%; max-width: 780px; margin: 0 auto; }
.zoom { position: fixed; inset: 0; z-index: 80; background: #0b1224; }
.zoom-area { position: absolute; inset: 0; overflow: auto; display: flex; align-items: center; justify-content: center; -webkit-overflow-scrolling: touch; }
.zoom-area img { max-width: 100%; max-height: 100%; width: auto; height: auto; cursor: zoom-in; }
.zoom.ampliado .zoom-area { display: block; }
.zoom.ampliado .zoom-area img { max-width: none; max-height: none; width: 260%; cursor: zoom-out; }
.zoom-barra { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 10px 16px; background: linear-gradient(rgba(11,18,36,.85), transparent); color: #fff; font-size: 14px; font-weight: 600; pointer-events: none; }
.zoom-barra button { pointer-events: auto; }
.zoom-dica { position: absolute; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 13px; padding: 6px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.zoom.ampliado .zoom-dica { display: none; }
@media (min-width: 900px) { .zoom.ampliado .zoom-area img { width: 180%; } }
.v-barra { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; }
.v-barra #enviar { flex: 1; height: 48px; font-size: 15px; }
.v-barra .btn-claro { height: 48px; }
.v-contador { height: 48px; min-width: 76px; border-radius: 999px; background: #eef1f7; color: var(--navy); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; padding: 0 12px; }

.ir-pagina label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.ir-pagina .linha { display: flex; gap: 8px; }
.ir-pagina input { flex: 1; height: 50px; border-radius: 12px; border: 1px solid var(--line); padding: 0 14px; font: 600 18px var(--font); color: var(--text); min-width: 0; }

@media (min-width: 600px) {
  .grade { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .hero h1 { font-size: 38px; }
}
@media (min-width: 900px) {
  .topo .wrap { height: 72px; }
  .topo .logo img { height: 44px; }
  .filtros { top: 72px; }
  .grade { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
  .hero .wrap { padding-top: 44px; padding-bottom: 92px; }
  .hero h1 { font-size: 46px; max-width: 20ch; }
  .hero::after { width: 420px; height: 420px; right: -80px; top: -90px; border-width: 52px; }
  .busca { max-width: 720px; }
  .chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0; }
  .card .info { padding: 12px 14px 14px; }
  .card h3 { font-size: 16px; }
  .v-barra { display: none; }
  .v-acoes-topo { display: flex; }
  .v-paginas { padding-bottom: 60px; gap: 20px; }
  .v-intro h1 { font-size: 30px; }
  .v-contador-flutuante { display: inline-flex !important; }
  .aviso { bottom: 32px; }
}
@media (min-width: 1200px) { .grade { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.v-contador-flutuante { display: none !important; position: fixed; z-index: 40; right: 24px; bottom: 24px; box-shadow: var(--shadow); background: var(--surface) !important; border: 1px solid var(--line); align-items: center; justify-content: center; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
