/* Maratona Marvel · Créditos finais
   Identidade do rodapé compartilhada por todas as páginas. */
.footer{
  --credits-bg:#f4f0ed;
  --credits-border:#e7deda;
  position:relative;display:block;
  width:100%;max-width:none;
  margin:clamp(44px,6vw,72px) 0 0;padding:0;
  border:0;border-top:1px solid var(--credits-border);border-radius:0;
  background:var(--credits-bg);color:var(--fg);
  font-size:14px;
}
html[data-theme="dark"] .footer{
  --credits-bg:#211d20;
  --credits-border:#373036;
}
/* O rodapé agora é irmão do contêiner editorial, sem espaço artificial abaixo dele. */
main.wrap,body>.wrap{padding-bottom:0}
.footer *, .footer *::before, .footer *::after{box-sizing:border-box}
.footer-inner{
  width:100%;max-width:940px;margin:0 auto;
  padding:clamp(35px,5vw,52px) 25px clamp(38px,5vw,55px);
}

.footer-top{display:grid;grid-template-columns:minmax(0,1fr);align-items:start;gap:36px}
.footer-top--with-tools{
  grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr);
  column-gap:clamp(28px,4vw,48px)
}
.footer-story{max-width:620px;min-width:0}
.footer-brand{
  display:inline-flex;align-items:center;gap:10px;
  color:var(--muted);font-size:10px;font-weight:750;
  letter-spacing:.16em;text-transform:uppercase
}
.footer-brand-icon{
  display:grid;place-items:center;width:24px;height:28px;
  color:var(--brand,#a32034)
}
.footer-brand-icon svg{display:block;width:19px;height:19px}
.footer-story h2{
  max-width:580px;margin:17px 0 12px;
  color:var(--fg);font-size:clamp(23px,2.9vw,31px);
  font-weight:760;line-height:1.22;letter-spacing:-.042em
}
.footer-story>p{
  max-width:490px;margin:0;
  color:var(--muted);font-size:13px;line-height:1.7
}
.footer-share-trigger{
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  min-height:44px;margin-top:14px;padding:4px 0;
  border:0;border-radius:0;background:transparent;color:var(--fg);
  font:650 13px/1.5 Inter,system-ui,-apple-system,'Segoe UI',sans-serif;
  text-decoration:underline;text-decoration-color:var(--brand,#a32034);
  text-decoration-thickness:1.5px;text-underline-offset:5px;
  cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
  transition:color .18s ease,text-decoration-color .18s ease
}
.footer-share-trigger svg{display:block;flex:none;width:17px;height:17px}
.footer-share-trigger .footer-share-arrow{width:15px;height:15px;opacity:.58;margin-left:-5px}
.footer-share-trigger:focus{outline:none;box-shadow:none}
.footer-share-trigger:focus-visible{outline:2px solid #8cae9b;outline-offset:3px}
@media(hover:none) or (pointer:coarse){
  .footer-share-trigger:focus-visible{outline:none;box-shadow:none}
}
@media(hover:hover) and (pointer:fine){
  .footer-share-trigger:hover{
    color:var(--brand,#a32034);
    text-decoration-color:currentColor
  }
}
.footer-backup{
  min-width:0;padding:8px 0 5px clamp(28px,3.7vw,38px);
  border-left:1px solid var(--credits-border)
}
.footer-backup-label{
  display:block;color:var(--muted);font-size:10px;
  letter-spacing:.15em;font-weight:750;text-transform:uppercase
}
.footer-backup h3{
  margin:15px 0 10px;color:var(--fg);
  font-size:20px;font-weight:720;line-height:1.3;letter-spacing:-.025em
}
.footer-backup>p{
  max-width:340px;margin:0 0 18px;
  color:var(--muted);font-size:13px;line-height:1.7
}
.footer-backup .utils{display:flex;align-items:center;flex-wrap:wrap;gap:9px}
.footer-backup .utils button,.footer-backup .importlabel{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:40px;padding:9px 13px;margin:0;
  border:1px solid var(--line);border-radius:9px;
  background:var(--surface);color:var(--fg);
  font:600 13px/1.5 Inter,system-ui,-apple-system,'Segoe UI',sans-serif;
  cursor:pointer;-webkit-tap-highlight-color:transparent
}
.footer-backup .utils svg{width:16px;height:16px;display:block;flex:none}
.footer-backup .utils button:focus-visible,.footer-backup .importlabel:focus-within{
  outline:2px solid #8cae9b;outline-offset:3px
}
@media(hover:hover) and (pointer:fine){
  .footer-backup .utils button:hover,.footer-backup .importlabel:hover{
    border-color:var(--brand,#a32034)
  }
}
.footer-pages{
  display:flex;align-items:center;justify-content:center;flex-wrap:wrap;
  gap:8px 20px;width:100%;margin:30px 0 0;
  padding:22px 0 0;border-top:1px solid var(--credits-border);
  font-size:12px;line-height:1.6
}
.footer-pages a{
  color:var(--muted);font-weight:600;text-decoration:none;
  text-underline-offset:4px;transition:color .18s ease;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation
}
.footer-pages a[aria-current="page"]{color:var(--fg);font-weight:750}
.footer-pages a:focus-visible{
  color:var(--fg);text-decoration:underline;outline:2px solid #8cae9b;outline-offset:3px
}
/* Hover real só com mouse; no Safari touch evita :hover retido após o toque. */
@media(hover:hover) and (pointer:fine){
  .footer-pages a:hover{color:var(--brand,#a32034);text-decoration:underline}
}
@media(hover:none), (pointer:coarse){
  .footer-pages a:not([aria-current="page"]):hover,
  .footer-pages a:not([aria-current="page"]):focus:not(:focus-visible){
    color:var(--muted);text-decoration:none
  }
}
.footer .dedication{
  display:block;width:auto;max-width:890px;
  margin:27px auto 0;padding:0;border:0;background:transparent;
  color:var(--muted);font-size:13px;line-height:1.85;
  letter-spacing:.004em;text-align:center
}
.footer .dedication .heart{font-size:14px}
.footer .dedication .signature{
  display:inline;margin:0;color:var(--fg);
  font-size:inherit;font-weight:500;white-space:nowrap
}
.footer .dedication a{
  color:var(--fg);font-weight:700;text-decoration:underline;
  text-decoration-color:var(--brand,#a32034);
  text-decoration-thickness:1.5px;text-underline-offset:3px;
  border-radius:2px;transition:color .18s ease
}
.footer .dedication a:focus-visible{
  outline:2px solid #8cae9b;outline-offset:3px
}
@media(hover:hover) and (pointer:fine){
  .footer .dedication a:hover{color:var(--brand,#a32034)}
}
@media(max-width:700px){
  .footer{margin-top:40px;padding:0;border-radius:0}
  .footer-inner{padding:30px 20px 38px}
  .footer-top--with-tools{grid-template-columns:minmax(0,1fr);row-gap:27px}
  .footer-story h2{font-size:clamp(23px,6.2vw,28px)}
  .footer-backup{border-left:0;border-top:1px solid var(--credits-border);padding:25px 0 0}
  .footer-pages{gap:11px 17px;margin-top:27px;padding-top:22px}
  .footer .dedication{margin-top:24px}
}
@media(max-width:380px){
  .footer-inner{padding:28px 18px 36px}
  .footer-pages{gap:10px 13px;font-size:12px}
}
@media(prefers-reduced-motion:reduce){
  .footer-share-trigger,.footer a{transition:none}
}

/* Acesso rápido ao início; configurável, adaptado ao safe area do iPhone. */
.back-to-top{
  position:fixed;right:clamp(15px,2.5vw,28px);
  bottom:calc(18px + env(safe-area-inset-bottom,0px));
  z-index:78;display:grid;place-items:center;
  width:46px;height:46px;margin:0;padding:0;
  border:1px solid var(--line);border-radius:50%;
  background:var(--surface);color:var(--fg);
  box-shadow:0 5px 23px rgba(0,0,0,.15);
  cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation;
  transition:background .18s ease,color .18s ease,box-shadow .18s ease
}
.back-to-top[hidden],html.drawer-open .back-to-top{display:none!important}
.back-to-top svg{display:block;width:21px;height:21px}
.back-to-top:focus-visible{outline:2px solid #8cae9b;outline-offset:3px}
@media(hover:hover) and (pointer:fine){
  .back-to-top:hover{
    color:var(--brand,#a32034);
    box-shadow:0 7px 26px rgba(0,0,0,.19)
  }
}
@media(max-width:700px){
  .back-to-top{width:44px;height:44px;right:16px;bottom:calc(15px + env(safe-area-inset-bottom,0px))}
}
@media(prefers-reduced-motion:reduce){.back-to-top{transition:none}}
