/* =========================================================================
   livro.css — peças do formato "livro em capítulos" (piloto: Os Egípcios)

   Só o que é NOVO: barra do livro e pontinhos de progresso, hero de capítulo,
   sumário, "Na sua Bíblia", ponte e navegação de rodapé.
   Tokens (--purple-*, --gold-*, --cream-*, --display/--serif/--sans) e todas as
   classes dos estudos vêm de /estudos/estudos.css. Este arquivo é ligado DEPOIS
   dele e não redefine nenhuma classe de lá.
   ========================================================================= */

/* Texto só para leitor de tela */
.lv-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Fim do capítulo: ponte e "Na sua Bíblia" (site e PDF) ---------- */
.ponte {
  max-width: 560px; margin: 34px auto 0; padding-top: 22px; text-align: center;
  font-family: var(--display); font-style: italic; font-weight: 500; font-size: 23px; line-height: 1.3; color: var(--purple-600);
  border-top: 1px solid var(--cream-200);
}
.ponte::before { content: '✦'; display: block; margin-bottom: 8px; font-style: normal; font-size: 15px; letter-spacing: 8px; color: var(--gold-500); }

.na-biblia { max-width: 760px; margin: 12px auto 0; padding: 0 24px; }
.nb-box {
  position: relative; padding: 28px 26px 26px;
  background: linear-gradient(180deg, #fff, var(--cream-100)); border: 1px solid var(--cream-200); border-radius: 20px;
  box-shadow: 0 18px 44px -30px rgba(26,14,46,.5);
}
.nb-box::before { /* fitilho de marcador de página */
  content: ''; position: absolute; top: -1px; right: 28px; width: 24px; height: 40px;
  background: linear-gradient(180deg, var(--gold-400), var(--gold-500));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
}
.nb-kicker { font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-600); }
.nb-tit { margin: 4px 0 6px; font-family: var(--display); font-weight: 600; font-size: 32px; line-height: 1.05; color: var(--purple-700); }
.nb-sub { margin: 0 0 16px; font-size: 17px; line-height: 1.5; color: var(--sepia-700); }
.nb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nb-chip {
  font-family: var(--sans); font-weight: 600; font-size: 13.5px; line-height: 1; white-space: nowrap;
  padding: 9px 14px; border-radius: 999px; text-decoration: none;
  background: #fff; color: var(--purple-600); border: 1px solid var(--purple-100);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.nb-chip:hover { background: var(--purple-50); border-color: var(--purple-400); color: var(--purple-700); }

/* Crédito da imagem de abertura do capítulo (no rodapé) */
footer .fn-cred { max-width: 640px; margin: 12px auto 0; font-size: 12px; line-height: 1.5; color: var(--sepia-500); }
footer .fn-cred b { font-weight: 600; color: var(--sepia-700); }

@media screen {

  /* Âncoras (#download, #sobre, #sumario) não ficam escondidas atrás da barra fixa */
  body.livro [id] { scroll-margin-top: 72px; }

  /* ---------- Barra do livro (só nos capítulos) ---------- */
  .livro-bar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 6px 12px 6px 10px;
    background: rgba(250,247,240,.92);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--cream-200);
  }
  .lb-back { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 8px 4px 4px; border-radius: 12px; text-decoration: none; color: var(--purple-600); }
  .lb-chev {
    flex: none; display: flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding-bottom: 2px; border-radius: 50%;
    background: var(--purple-50); border: 1px solid var(--purple-100);
    font-family: var(--sans); font-weight: 700; font-size: 18px; line-height: 1; color: var(--purple-600);
    transition: background .15s ease;
  }
  .lb-back:hover .lb-chev { background: var(--purple-100); }
  .lb-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.1; }
  .lb-txt b { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.1px; color: var(--purple-700); white-space: nowrap; }
  .lb-txt i { margin-top: 2px; font-family: var(--sans); font-style: normal; font-weight: 600; font-size: 11px; letter-spacing: .5px; color: var(--sepia-500); white-space: nowrap; }

  /* Pontinhos: celular = bolinhas (a atual vira uma pílula dourada→roxa); computador = números */
  .lb-dots { display: flex; align-items: center; flex: none; }
  .lb-dot { position: relative; display: block; padding: 14px 3px; text-decoration: none; }
  .lb-dot::before { content: ''; display: block; width: 7px; height: 7px; border-radius: 99px; background: var(--cream-300); transition: width .2s ease, background .2s ease; }
  a.lb-dot::before { background: var(--purple-400); }
  a.lb-dot:hover::before { background: var(--purple-600); }
  .lb-dot.is-here::before { width: 20px; background: linear-gradient(90deg, var(--gold-400), var(--purple-500)); }
  .lb-dot .n { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lb-pdf { display: none; }

  @media (min-width: 720px) {
    .livro-bar { padding: 8px 22px 8px 18px; gap: 16px; }
    .lb-dots { gap: 4px; }
    .lb-dot { padding: 0; }
    .lb-dot::before { display: none; }
    .lb-dot .n {
      position: static; clip: auto; overflow: visible; width: 26px; height: 26px;
      display: flex; align-items: center; justify-content: center; border-radius: 50%;
      font-family: var(--sans); font-weight: 700; font-size: 12px;
      border: 1.5px solid var(--cream-300); color: var(--cream-300);
      transition: background .15s ease, color .15s ease, border-color .15s ease;
    }
    a.lb-dot .n { border-color: var(--purple-400); color: var(--purple-600); }
    a.lb-dot:hover .n { background: var(--purple-50); }
    .lb-dot.is-here .n { background: linear-gradient(135deg, var(--purple-500), var(--purple-700)); border-color: var(--gold-400); color: #fff; box-shadow: 0 0 0 3px rgba(212,166,69,.28); }
    .lb-pdf { display: none; align-items: center; gap: 6px; font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--purple-600); border: 1.5px solid var(--purple-100); padding: 6px 13px; border-radius: 999px; text-decoration: none; transition: background .15s ease; }
    .lb-pdf:hover { background: var(--purple-50); }
  }
  @media (min-width: 1000px) {
    .livro-bar { padding: 8px 28px 8px 22px; gap: 20px; }
    .lb-dots { gap: 6px; }
    .lb-dot .n { width: 30px; height: 30px; font-size: 13px; }
    .lb-pdf { display: inline-flex; }
  }
  @media (max-width: 340px) {
    .lb-txt b { font-size: 16px; }
    .lb-chev { width: 28px; height: 28px; }
    .lb-back { gap: 6px; }
  }

  /* ---------- Hero de capítulo (mais baixo que o da abertura) ---------- */
  .hero.hero-cap { min-height: 55vh; }
  .hero-cap .hero-inner { padding: 64px 24px 40px; }
  .hero-cap h1 { font-size: clamp(42px, 10.5vw, 88px); line-height: .98; }
  .hero-cap .epithet { font-size: clamp(21px, 4.6vw, 32px); }
  .hero-cap .lede { max-width: 600px; }
  .hero-cap .bg.foco-c01 { object-position: 50% 42%; }
  .hero-cap .bg.foco-c02 { object-position: 50% 58%; }
  .hero-cap .bg.foco-c03 { object-position: 50% 30%; }
  .hero-cap .bg.foco-c04 { object-position: 50% 55%; }
  .hero-cap .bg.foco-c05 { object-position: 50% 40%; }
  .hero-cap .bg.foco-c06 { object-position: 50% 62%; }
  .hero-cap .bg.foco-c07 { object-position: 50% 30%; }
  .hero-cap .bg.foco-c08 { object-position: 50% 65%; }
  .hero-cap .bg.foco-c09 { object-position: 50% 22%; }
  .hero-cap .bg.foco-c10 { object-position: 50% 55%; }
  .hero-cap .bg.foco-c11 { object-position: 50% 56%; }
  .cap-num {
    position: absolute; z-index: 1; top: 6px; right: 14px;
    font-family: var(--display); font-weight: 600; line-height: .8;
    font-size: clamp(150px, 38vw, 300px); color: var(--gold-400); opacity: .2; font-variant-numeric: lining-nums;
    pointer-events: none; user-select: none;
  }

  /* ---------- Abertura: botões do hero e ficha solta ---------- */
  .hero-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
  .btn-livro {
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--sans); font-weight: 700; font-size: 16px; line-height: 1.2;
    padding: 15px 28px; border-radius: 999px; text-decoration: none;
    background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--purple-900);
    box-shadow: 0 12px 30px -10px rgba(212,166,69,.6);
    transition: transform .15s ease, box-shadow .15s ease;
  }
  .btn-livro .seta { font-size: 19px; line-height: 1; transition: transform .15s ease; }
  .btn-livro.fantasma { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.4); box-shadow: none; }
  .btn-livro.grande { font-size: 18px; padding: 18px 36px; }
  .factcard.fc-livro { margin-top: 38px; }

  /* ---------- Sumário (a vitrine da abertura) ---------- */
  .livro-toc { max-width: 1040px; margin: 0 auto; padding: 56px 22px 8px; }
  .toc-head { max-width: 620px; margin: 0 auto 30px; text-align: center; }
  .toc-intro { margin: 12px 0 0; font-size: 18px; color: var(--sepia-700); }
  .toc-list { list-style: none; display: grid; grid-template-columns: 1fr; gap: 14px; }
  @media (min-width: 820px) {
    .toc-list { grid-template-columns: 1fr 1fr; gap: 18px; }
    .toc-list > li:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 9px); }
  }

  .toc-card {
    position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 18px; align-items: start;
    height: 100%; padding: 20px 20px 18px 22px; overflow: hidden;
    background: #fff; border: 1px solid var(--cream-200); border-radius: 20px;
    color: var(--sepia-800); text-decoration: none;
    box-shadow: 0 14px 34px -26px rgba(26,14,46,.55);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
  a.toc-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: linear-gradient(180deg, var(--gold-400), var(--purple-500)); }
  .toc-num { display: flex; flex-direction: column; align-items: center; min-width: 46px; padding-top: 2px; }
  .toc-num small { font-family: var(--sans); font-weight: 700; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-600); }
  .toc-num b {
    font-family: var(--display); font-weight: 600; font-size: 66px; line-height: .9; color: var(--purple-500); font-variant-numeric: lining-nums;
    background: linear-gradient(180deg, var(--gold-400), var(--purple-500) 70%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  }
  .toc-body { display: block; min-width: 0; }
  .toc-tit { display: block; font-family: var(--display); font-weight: 600; font-size: 27px; line-height: 1.05; letter-spacing: -.2px; color: var(--purple-700); }
  .toc-sub { display: block; margin-top: 6px; font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.3; color: var(--sepia-700); }
  .toc-meta { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--cream-100); }
  .toc-min { font-family: var(--sans); font-weight: 600; font-size: 12.5px; color: var(--sepia-500); }
  .toc-ler { margin-left: auto; font-family: var(--sans); font-weight: 700; font-size: 13px; color: var(--purple-600); white-space: nowrap; }
  .toc-ler .seta { display: inline-block; transition: transform .15s ease; }
  .toc-livros { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 12px; }
  .toc-livros .ico { font-size: 13px; margin-right: 2px; }
  .toc-livros .lv {
    font-family: var(--sans); font-size: 11.5px; font-weight: 600; line-height: 1.5;
    background: var(--purple-50); color: var(--purple-600); border: 1px solid var(--purple-100);
    border-radius: 6px; padding: 0 6px;
  }

  .toc-cta { margin-top: 34px; text-align: center; }
  .toc-cta-sub { margin-top: 14px; font-family: var(--sans); font-size: 13px; color: var(--sepia-500); }
  .livro-fim { max-width: 760px; margin: 0 auto; padding: 8px 24px 0; text-align: center; }
  .lf-tit { margin-bottom: 18px; font-family: var(--display); font-style: italic; font-weight: 500; font-size: 28px; line-height: 1.2; color: var(--purple-600); }

  /* ---------- Fim do capítulo: navegação ---------- */
  .livro-nav { max-width: 760px; margin: 34px auto 0; padding: 0 24px; display: flex; flex-direction: column-reverse; gap: 14px; }
  @media (min-width: 640px) { .livro-nav { flex-direction: row; } .livro-nav > * { flex: 1 1 0; } }
  .ln-card {
    position: relative; display: flex; align-items: center; gap: 16px; min-width: 0;
    padding: 20px 22px; border-radius: 20px; text-decoration: none;
    background: #fff; border: 1px solid var(--cream-200); color: var(--sepia-800);
    box-shadow: 0 14px 34px -26px rgba(26,14,46,.55);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  }
  .ln-txt { display: block; flex: 1; min-width: 0; }
  .ln-dir { display: block; font-family: var(--sans); font-weight: 700; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-600); }
  .ln-tit { display: block; margin-top: 4px; font-family: var(--display); font-weight: 600; font-size: 26px; line-height: 1.08; color: var(--purple-700); }
  .ln-sub { display: block; margin-top: 4px; font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.35; color: var(--sepia-700); }
  .ln-seta {
    flex: none; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%;
    font-family: var(--sans); font-weight: 700; font-size: 20px; line-height: 1;
    background: var(--purple-50); color: var(--purple-600); border: 1px solid var(--purple-100);
    transition: transform .18s ease;
  }
  .ln-next { background: linear-gradient(150deg, var(--purple-700), var(--purple-900)); border-color: transparent; color: #fff; box-shadow: 0 18px 40px -22px rgba(26,14,46,.8); }
  .ln-next .ln-dir { color: var(--gold-400); }
  .ln-next .ln-tit { color: #fff; }
  .ln-next .ln-sub { color: #e7dcf3; }
  .ln-next .ln-seta { background: linear-gradient(135deg, var(--gold-400), var(--gold-500)); color: var(--purple-900); border-color: transparent; }
  .ln-todos { max-width: 760px; margin: 18px auto 0; padding: 0 24px; text-align: center; }
  .ln-todos a { display: inline-flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 600; font-size: 14px; color: var(--purple-600); text-decoration: none; padding: 10px 16px; border-radius: 999px; }
  .ln-todos a:hover { background: var(--purple-50); }

  /* Quebra de linha mais bonita (onde o navegador sabe; nos outros, quebra normal) */
  .toc-intro, .toc-tit, .lf-tit, .ponte, .ln-tit, .nb-tit { text-wrap: balance; }
  .toc-sub, .ln-sub, .nb-sub { text-wrap: pretty; }

  /* ---------- Interação: só onde há mouse; foco sempre visível ---------- */
  @media (hover: hover) {
    a.toc-card:hover { transform: translateY(-3px); border-color: var(--purple-100); box-shadow: 0 24px 46px -26px rgba(26,14,46,.6); }
    a.toc-card:hover .toc-ler .seta { transform: translateX(4px); }
    .btn-livro:hover { transform: translateY(-2px); box-shadow: 0 16px 34px -10px rgba(212,166,69,.7); }
    .btn-livro:hover .seta { transform: translateX(4px); }
    .btn-livro.fantasma:hover { background: rgba(255,255,255,.1); box-shadow: none; }
    a.ln-card:hover { transform: translateY(-3px); box-shadow: 0 24px 46px -26px rgba(26,14,46,.6); }
    a.ln-card:hover .ln-seta { transform: translateX(3px); }
    a.ln-prev:hover .ln-seta { transform: translateX(-3px); }
  }
  .toc-card:focus-visible, .btn-livro:focus-visible, .ln-card:focus-visible, .nb-chip:focus-visible,
  .lb-back:focus-visible, .lb-dot:focus-visible, .lb-pdf:focus-visible, .ln-todos a:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 3px; }
  @media (prefers-reduced-motion: reduce) {
    .toc-card, .btn-livro, .btn-livro .seta, .ln-card, .ln-seta, .toc-ler .seta, .lb-dot::before { transition: none; }
    a.toc-card:hover, .btn-livro:hover, a.ln-card:hover { transform: none; }
  }

  /* ---------- Celular estreito ---------- */
  @media (max-width: 420px) {
    .livro-toc { padding: 44px 16px 8px; }
    .toc-card { column-gap: 14px; padding: 18px 16px 16px 20px; }
    .toc-num { min-width: 40px; }
    .toc-num b { font-size: 58px; }
    .toc-tit { font-size: 25px; }
    .nb-box { padding: 26px 20px 22px; }
    .nb-tit { font-size: 29px; }
    .ln-card { padding: 18px 18px; gap: 14px; }
    .ponte { font-size: 21px; }
    .hero-btns .btn-livro { flex: 1 1 100%; justify-content: center; }
  }
}

/* ---------- PDF / impressão: some o que é só do site ---------- */
@media print {
  .livro-bar, .hero-btns, .cap-num, .livro-toc, .livro-nav, .ln-todos, .livro-fim, .lb-pdf { display: none !important; }
  .na-biblia { break-inside: avoid; margin-top: 14px; }
  .nb-box { padding: 16px 18px 16px; box-shadow: none; background: #fff; }
  .nb-box::before { display: none; }
  .nb-tit { font-size: 22pt; }
  .nb-sub { font-size: 10.5pt; margin-bottom: 10px; }
  .nb-chip { padding: 5px 10px; font-size: 9pt; }
  .ponte { break-inside: avoid; font-size: 13pt; }
}

/* Negrito legível sobre o roxo do hero e do quadro do PDF (o estudos.css que está no ar ainda deixa marrom-escuro).
   Na impressão o fundo é branco, então volta ao escuro. */
.hero .lede strong, .hero .lede b, .cta p strong { color: #fff; }
@media print { .hero .lede strong, .hero .lede b { color: #333; } .cta p strong { color: var(--purple-900); } }
