/* =============================================
   LIVROS.CSS — Entre Tempos · Página de Livros
   ============================================= */


html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  position: relative; /* garante que os absolutos sejam contidos aqui */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  position: relative;
  background-color: #f2e8d5;
  font-family: 'Special Elite', serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Imagem de fundo — aparece só uma vez, canto inferior direito */
body::after {
  content: "";
  position: fixed;
  bottom: 0;
  right: 0;
  width: 380px;
  height: 480px;
  background-image: url('img/wallpaper_fundo.webp');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: bottom right;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
}

/* Textura papel */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: url('https://www.transparenttextures.com/patterns/aged-paper.webp');
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}

/* ─── HEADER ─── */
header {
  position: relative;
  z-index: 10;
  padding: 18px 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  border-bottom: 2px solid #c4a96b;
}

header a {
  text-decoration: none;
  color: #3e4a59;
  font-weight: bold;
  font-family: 'Special Elite', serif;
  font-size: 14px;
  letter-spacing: 1px;
  transition: color 0.2s;
}

header a:hover { color: #c0392b; }

/* ─── TÍTULO PRINCIPAL ─── */
.page-titulo {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 30px 20px 10px;
}

.page-titulo h1 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(60px, 12vw, 130px);
  color: #1a1a1a;
  letter-spacing: 8px;
  line-height: 1;
  text-shadow: 4px 4px 0 #c4a96b;
}

.page-titulo .subtitulo {
  font-family: 'Special Elite', serif;
  font-size: 14px;
  color: #7a6a50;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 8px;
}

/* ─── DIVISOR ─── */
.divisor {
  position: relative;
  z-index: 5;
  width: 80%;
  margin: 10px auto 30px;
  height: 2px;
  background: linear-gradient(to right, transparent, #c0392b, #c4a96b, #c0392b, transparent);
}

/* ─── WRAPPER DE PÁGINA (largura total, base para as decorações) ─── */
.pagina-livros {
  position: relative;
  z-index: 1;
  min-height: 760px;
}

/* ─── MURAL CONTAINER ─── */
.mural-livros {
  position: relative;
  z-index: 5;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 30px 80px;
}

/* ─── NAVEGAÇÃO DE MÊS ─── */
.nav-mes {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.top10-titulo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 48px;
  color: #1a1a1a;
  letter-spacing: 4px;
  border-left: 5px solid #c0392b;
  padding-left: 15px;
  line-height: 1;
}

.top10-titulo .mes-label {
  font-family: 'Special Elite', serif;
  font-size: 18px;
  color: #8c3b3b;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: capitalize;
  display: block;
  margin-top: 4px;
}

.seta-mes {
  background: #c0392b;
  color: #fff;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.15s;
  box-shadow: 0 4px 12px rgba(192, 57, 43, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.seta-mes:hover {
  background: #922b21;
  transform: scale(1.1);
}

.seta-mes:active {
  transform: scale(0.93);
}

/* ─── LAYOUT WRAPPER ─── */
.top10-wrapper {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.top10-lista {
  flex: 1;
  min-width: 280px;
  padding-left: 120px;
}

/* ─── ITENS DA LISTA ─── */
.lista-livros {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.livro-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px dashed #c4a96b;
  transition: transform 0.2s;
  animation: entrar 0.35s ease both;
  cursor: pointer;
}

.livro-item:hover { transform: translateX(6px); }

@keyframes entrar {
  from { opacity: 0; transform: translateX(-18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.livro-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 32px;
  color: #c0392b;
  min-width: 45px;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}

.livro-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.livro-titulo {
  font-family: 'Special Elite', serif;
  font-size: 17px;
  color: #1a1a1a;
  font-weight: bold;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.livro-autor {
  font-family: 'Special Elite', serif;
  font-size: 13px;
  color: #7a6a50;
  font-style: italic;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Mensagem quando não há livros */
.vazio {
  text-align: center;
  color: #b0a090;
  font-style: italic;
  padding: 40px 0;
  font-size: 16px;
  letter-spacing: 1px;
}

/* ─── COLUNA DIREITA (DECORAÇÃO) ─── */
.decoracao-direita {
  width: 280px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

/* ─── IMAGENS DECORATIVAS ─── */
.deco-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.img-deco {
  position: absolute;
  pointer-events: none;
}

/* pilha de livros — esquerda, um terço de cima */
.img-deco-01 {
  top: 8%;
  left: -25px;
  width: 175px;
  transform: rotate(5deg);
  filter: drop-shadow(4px 4px 8px rgba(0,0,0,0.25));
}

/* livros abertos — direita, dois terços de baixo */
.img-deco-02 {
  bottom: 12%;
  right: 20px;
  width: 190px;
  transform: rotate(-6deg);
  opacity: 0.92;
  filter: drop-shadow(3px 3px 8px rgba(0,0,0,0.25));
}

/* xícara de café — direita, topo */
.img-deco-03 {
  top: 6%;
  right: -15px;
  width: 160px;
  transform: rotate(-8deg);
  filter: drop-shadow(2px 2px 6px rgba(0,0,0,0.18));
}

/* balança — esquerda, baixo */
.img-deco-04 {
  bottom: 8%;
  left: 10px;
  width: 140px;
  transform: rotate(10deg);
  filter: drop-shadow(2px 3px 6px rgba(0,0,0,0.2));
}

/* mão segurando livro — direita, meio */
.img-deco-05 {
  top: 44%;
  right: -10px;
  width: 140px;
  transform: rotate(-12deg);
  filter: drop-shadow(2px 2px 8px rgba(0,0,0,0.3));
}

/* capa em destaque na coluna direita */
.capa-destaque {
  width: 200px;
  margin: 0 auto;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.4));
  transform: rotate(-4deg);
  transition: transform 0.3s;
}

.capa-destaque:hover { transform: rotate(0deg) scale(1.05); }

/* imagem lateral — é a única imagem que deve permanecer
   semi-transparente, tanto no PC quanto no celular */
.deco-lateral {
  width: 150px;
  filter: drop-shadow(3px 3px 10px rgba(0,0,0,0.4));
  transform: rotate(5deg);
  opacity: 0.85;
}

/* ─── SÍMBOLOS DE FUNDO ─── */
.simbolos-fundo {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.simbolo {
  position: absolute;
  font-size: 26px;
  opacity: 0.05;
  color: #1a1a1a;
  animation: flutuar 9s infinite ease-in-out;
}

@keyframes flutuar {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%       { transform: translateY(-20px) rotate(8deg); }
}

/* ═══════════════════════════════════════════════════
   MODAL DE DESCRIÇÃO DO LIVRO — abre ao clicar em um
   item da lista. Mostra capa, título, autor, descrição
   e o link de download/compra daquele livro.
   ═══════════════════════════════════════════════════ */

.modal-livro-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 20, 10, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-livro-overlay.aberto {
  opacity: 1;
  visibility: visible;
}

.modal-livro-caixa {
  position: relative;
  background-color: #f2e8d5;
  background-image: url('https://www.transparenttextures.com/patterns/aged-paper.webp');
  max-width: 640px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  border: 2px solid #c4a96b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  padding: 36px;
  transform: scale(0.92) translateY(10px);
  transition: transform 0.25s ease;
}

.modal-livro-overlay.aberto .modal-livro-caixa {
  transform: scale(1) translateY(0);
}

.modal-fechar {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: #c0392b;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s;
}

.modal-fechar:hover {
  background: #922b21;
  transform: scale(1.08);
}

.modal-livro-conteudo {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.modal-livro-capa {
  width: 160px;
  flex-shrink: 0;
  filter: drop-shadow(4px 6px 14px rgba(0, 0, 0, 0.4));
  transform: rotate(-3deg);
}

.modal-livro-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.modal-livro-titulo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 30px;
  letter-spacing: 1px;
  color: #1a1a1a;
  line-height: 1.1;
}

.modal-livro-autor {
  font-family: 'Special Elite', serif;
  font-size: 14px;
  font-style: italic;
  color: #7a6a50;
}

.modal-livro-desc {
  font-family: 'Special Elite', serif;
  font-size: 14px;
  line-height: 1.75;
  color: #5a4a38;
}

.modal-livro-botoes {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.modal-livro-link {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #8c3b3b;
  color: #f2e8d5;
  text-decoration: none;
  font-family: 'Special Elite', serif;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 2px solid #c0392b;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.modal-livro-link:hover {
  background: #c0392b;
  transform: translate(-2px, -2px);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.22);
}

.modal-livro-link-compra {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: #8c3b3b;
  color: #f2e8d5;
  text-decoration: none;
  font-family: 'Special Elite', serif;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border: 2px solid #c0392b;
  box-shadow: 3px 4px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.modal-livro-link-compra:hover {
  background: #c0392b;
  transform: translate(-2px, -2px);
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.22);
}

@media (max-width: 600px) {
  .modal-livro-caixa {
    padding: 26px 20px;
  }

  .modal-livro-conteudo {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .modal-livro-capa {
    width: 130px;
  }

  .modal-livro-info {
    align-items: center;
  }

  .modal-livro-botoes {
    justify-content: center;
  }

  .modal-livro-link,
  .modal-livro-link-compra {
    align-self: center;
    justify-content: center;
    min-width: 132px;
  }
}

/* Editor como ficha literária presa ao mural. */
.btn-gerenciar-top { color: #6d4c2f; border-style: dashed; background: rgba(255, 253, 247, .55); }
.btn-gerenciar-top:hover { background: #6d4c2f; color: #fffdf7; }
.editor-top__caixa {
  border: 1px dashed #c4a96b;
  border-left: 7px solid #6d4c2f;
  background-image: repeating-linear-gradient(transparent 0 30px, rgba(122, 106, 80, .08) 31px);
  transform: rotate(-.25deg);
}
.editor-top__titulo { text-shadow: 2px 2px 0 #c4a96b; }
@media (max-width: 600px) { .editor-top__caixa { transform: none; } }

/* ─── RODAPÉ ─── */
.rodape-livros {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 20px;
  font-family: 'Special Elite', serif;
  font-size: 12px;
  color: #b0a090;
  letter-spacing: 2px;
  border-top: 1px solid #c4a96b;
}

.carimbo {
  display: inline-block;
  border: 3px solid #c0392b;
  color: #c0392b;
  padding: 4px 14px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 3px;
  transform: rotate(-3deg);
  opacity: 0.6;
  margin-top: 10px;
}

/* ╔══════════════════════════════════════════════╗ */
/* ║  NOTEBOOK / TELAS MÉDIAS (601px – 1500px)     ║ */
/* ║  Em Full HD (1920px) a margem lateral do      ║ */
/* ║  mural é grande e as decorações cabem soltas; ║ */
/* ║  em notebooks (ex.: 1366px) essa margem é     ║ */
/* ║  bem menor e as mesmas imagens invadiam o     ║ */
/* ║  texto da lista. Aqui elas ficam menores.     ║ */
/* ╚══════════════════════════════════════════════╝ */
@media (min-width: 601px) and (max-width: 1500px) {
  .img-deco-01 { top: 8%;    left: -12px; width: 85px;  }
  .img-deco-02 { bottom: 12%; right: 8px;  width: 90px;  }
  .img-deco-03 { top: 6%;    right: -8px; width: 80px;  }
  .img-deco-04 { bottom: 8%; left: 5px;   width: 70px;  }
  .img-deco-05 { top: 44%;   right: -6px; width: 70px;  }

  .top10-lista { padding-left: 90px; }
}

/* ╔══════════════════════════════════════════════╗ */
/* ║  MOBILE (TELA <= 600px)                       ║ */
/* ╚══════════════════════════════════════════════╝ */
@media (max-width: 600px) {

  .nav-mes { gap: 10px; }
  .seta-mes { width: 32px; height: 32px; font-size: 15px; }
  .top10-titulo { font-size: 36px; }

  /* lista ocupa toda a largura */
  .top10-lista { padding-left: 0; }

  /* coluna direita some no mobile (não tem espaço) */
  .decoracao-direita { display: none; }

  /* ── IMAGENS DECORATIVAS NO MOBILE ──
     Continuam dentro do deco-container (position: absolute,
     relativo ao conteúdo da página, igual ao desktop) — por
     isso rolam junto com o resto do conteúdo, sem usar
     position: fixed. Mantidas com a MESMA opacidade do PC
     (sem transparência extra) — só o tamanho é reduzido para
     caber na tela. */

  .deco-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
  }

  /* todas as imagens decorativas aparecem no mobile,
     do mesmo jeito que aparecem no PC (sem opacity reduzida) */
  .img-deco-01,
  .img-deco-02,
  .img-deco-03,
  .img-deco-04,
  .img-deco-05 {
    display: block;
    opacity: 1;
  }

  /* pilha de livros — canto superior esquerdo */
  .img-deco-01 {
    top: auto;
    bottom: 38%;
    left: -18px;
    width: 90px;
    transform: rotate(8deg);
  }

  /* livros abertos — canto inferior direito */
  .img-deco-02 {
    bottom: 4%;
    right: -10px;
    width: 110px;
    transform: rotate(-6deg);
    opacity: 0.92; /* mesma opacidade usada no PC */
  }

  /* xícara — canto superior direito */
  .img-deco-03 {
    top: 10%;
    right: -12px;
    width: 80px;
    transform: rotate(-10deg);
  }

  /* balança — canto inferior esquerdo, acima do deco_06 */
  .img-deco-04 {
    bottom: 24%;
    left: -8px;
    width: 85px;
    transform: rotate(10deg);
  }

  /* mão segurando livro — canto direito, meio */
  .img-deco-05 {
    top: 42%;
    right: -8px;
    width: 85px;
    transform: rotate(-12deg);
  }

}
/* ═══════ FIM — NÃO ADICIONE NADA DEPOIS DESTA LINHA ═══════ */
/* =============================================
   SISTEMA DE VOTOS — estilo Reddit
   ============================================= */
.voto-coluna {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 28px;
  flex-shrink: 0;
}

.voto-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  color: #b0a090;
  padding: 3px;
  transition: color 0.15s, transform 0.15s;
}

.voto-btn:hover {
  color: #c0392b;
  transform: scale(1.2);
}

.voto-btn.voto-up.ativo {
  color: #c0392b;
}

.voto-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 15px;
  color: #4a3f2c;
  min-width: 18px;
  text-align: center;
}

@media (max-width: 600px) {
  .livro-item {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
  }
  .livro-num {
    order: 1;
    flex-shrink: 0;
  }
  .livro-info {
    order: 2;
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
  }
  .voto-coluna {
    order: 3;
    flex-direction: row;
    flex-basis: auto;
    min-width: auto;
    margin-top: 0;
    margin-left: auto;
    margin-right: 4px;
    gap: 6px;
  }
  .voto-btn { font-size: 18px; padding: 5px; }
  .voto-btn:active { transform: scale(0.9); }
  .voto-score { font-size: 15px; }
}


/* O item inteiro já é clicável; não exibe rótulo redundante de detalhes. */
.livro-abrir {
  display: none !important;
}
