/* ═══════════════════════════════════════════════════
   home.css — BibliotecaSA · Upgrade Visual Premium
   Paleta, fontes e estrutura: preservadas integralmente
   ═══════════════════════════════════════════════════ */

/* ── Tokens globais ── */
:root {
  /* Cores existentes — não alteradas */
  --blue-primary:   #090e3f;
  --blue-mid:       #0d1450;
  --blue-navy:      #1b2688;
  --accent:         #70a3f0;
  --accent-light:   #7aadff;
  --accent-soft:    rgba(112, 163, 240, 0.15);
  --accent-glow:    rgba(112, 163, 240, 0.07);
  --white:          #e8ecf4;
  --muted:          #8892b4;
  --charcoal:       #333333;

  /* Tipografia existente */
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans:  'DM Sans', sans-serif;

  /* Input — preservado */
  --input-bg:          rgba(255, 255, 255, 0.06);
  --input-border:      1px solid rgba(112, 163, 240, 0.22);
  --input-focus-color: #70a3f0;
  --input-placeholder: rgba(136, 146, 180, 0.7);
  --input-radius:      10px;

  /* Espaçamento */
  --section-pad: 120px 80px;
}

/* ── Reset base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--blue-primary);
  color: var(--white);
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════════════════
   HERO SECTION
   ════════════════════════════════════════════════════ */

.sessao-input {
  position: relative;
}

.card-input {
  background-color: var(--blue-primary);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(27, 38, 136, 0.55) 0%, transparent 70%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
  background-size: auto, 160px;
  background-repeat: no-repeat, repeat;
  padding-top: 300px;
  padding-bottom: 300px;
  width: 100%;
  min-height: 820px;
  text-align: center;
  position: relative;
  overflow: hidden;
  
}

/* Borda inferior suave para transição */
.card-input::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 220px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(9, 14, 63, 0.4) 40%,
    rgba(9, 14, 63, 0.85) 75%,
    var(--blue-primary) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* ── SVG animado ── */
.wrapper {
  background-color: transparent;
  margin-top: 0;
  padding: 0 20px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

svg {
  font-family: 'Cormorant Garamond', Georgia, serif;
  width: 100%;
  max-width: 900px;
  height: 140px;
}

svg text {
  animation: stroke 5s infinite alternate;
  stroke-width: 1.5;
  stroke: rgba(160, 160, 160, 0.9);
  font-size: 68px;
  letter-spacing: 2px;
}

@keyframes stroke {
  0% {
    fill: rgba(204, 204, 204, 0);
    stroke: rgba(160, 160, 160, 1);
    stroke-dashoffset: 25%;
    stroke-dasharray: 0 50%;
    stroke-width: 1.5;
  }
  70% {
    fill: rgba(204, 204, 204, 0);
    stroke: rgba(160, 160, 160, 1);
  }
  80% {
    fill: rgba(204, 204, 204, 0);
    stroke: rgba(160, 160, 160, 1);
    stroke-width: 2;
  }
  100% {
    fill: rgba(204, 204, 204, 1);
    stroke: rgba(160, 160, 160, 0);
    stroke-dashoffset: -25%;
    stroke-dasharray: 50% 0;
    stroke-width: 0;
  }
}

/* ── Subtítulo hero ── */
.card-input h3 {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.5px;
  margin: 0 auto 48px;
  max-width: 420px;
  line-height: 1.6;
  position: relative;
  z-index: 3;
}

/* ── Barra de pesquisa ── */
.input-search {
  position: relative;
  display: inline-block;
  z-index: 3;
}

.input-search::before {
  content: '\f002';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 18px;
  top: 23px;
  transform: none;
  color: var(--accent);
  font-size: 13px;
  pointer-events: none;
  opacity: 0.7;
  z-index: 4;
}

.custom-input {
  width: 520px;
  max-width: 90vw;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  padding: 14px 20px 14px 44px;
  border-radius: var(--input-radius);
  background: var(--input-bg);
  color: var(--white);
  border: var(--input-border);
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  margin-bottom: 32px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  letter-spacing: 0.2px;
}

.custom-input::placeholder {
  color: var(--input-placeholder);
  font-weight: 300;
}

.custom-input:focus {
  border-color: rgba(112, 163, 240, 0.55);
  box-shadow: 0 0 0 3px rgba(112, 163, 240, 0.12), 0 4px 20px rgba(9, 14, 63, 0.4);
  background: rgba(255, 255, 255, 0.09);
}

/* ── Tags de categoria ── */
.tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  position: relative;
  z-index: 3;
  padding: 0 20px;
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(112, 163, 240, 0.18);
  color: rgba(136, 146, 180, 0.9);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
  user-select: none;
}

.tag:hover {
  background: rgba(112, 163, 240, 0.12);
  color: #a8c8ff;
  border-color: rgba(112, 163, 240, 0.4);
  transform: translateY(-1px);
}

/* ════════════════════════════════════════════════════
   TRANSIÇÃO HERO → SOBRE  (elemento ponte)
   ════════════════════════════════════════════════════ */

.hero-to-sobre-bridge {
  height: 80px;
  background: linear-gradient(
    to bottom,
    var(--blue-primary) 0%,
    rgba(9, 14, 63, 0.6) 50%,
    transparent 100%
  );
  position: relative;
  z-index: 1;
  margin-bottom: -80px;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════
   SEÇÃO SOBRE — flutua sobre o hero
   ════════════════════════════════════════════════════ */

.sobre-section {
  position: relative;
  z-index: 10;
  margin-top: -100px;
  padding: 0 40px 80px;
}

.sobre-container {
  max-width: 1100px;
  margin: 0 auto;
  background: linear-gradient(
    135deg,
    rgba(13, 20, 80, 0.96) 0%,
    rgba(9, 14, 63, 0.98) 100%
  );
  border: 1px solid rgba(112, 163, 240, 0.14);
  border-radius: 20px;
  padding: 72px 80px;
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 1px 0 rgba(112, 163, 240, 0.1) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ── Header da seção ── */
.lib-header {
  text-align: center;
  margin-bottom: 60px;
}

.lib-sup {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.8;
  display: block;
  margin-bottom: 16px;
}

.lib-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  color: var(--white);
  margin: 0 0 28px;
  letter-spacing: 0.5px;
}

.lib-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.lib-rule-line {
  width: 60px;
  height: 1px;
  background: rgba(112, 163, 240, 0.25);
}

.lib-rule-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.6;
}

/* ── Body da seção ── */
.sobre-body {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 80px;
  align-items: start;
}

.sobre-lead {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  color: rgba(232, 236, 244, 0.9);
  line-height: 1.55;
  margin: 0 0 24px;
}

.sobre-body-text {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.8;
  margin: 0 0 24px;
}

.sobre-inline-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
}

.sobre-inline-rule-line {
  flex: 1;
  height: 1px;
  background: rgba(112, 163, 240, 0.15);
}

.sobre-inline-rule-label {
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.6;
  white-space: nowrap;
}

/* ── Stats ── */
.sobre-stats-col {
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding-top: 8px;
}

.sobre-stat {
  padding: 28px 24px;
  border: 1px solid rgba(112, 163, 240, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.sobre-stat:hover {
  border-color: rgba(112, 163, 240, 0.25);
  background: rgba(112, 163, 240, 0.04);
}

.sobre-stat-number {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 400;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 8px;
}

.sobre-stat-label {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--white);
  display: block;
  margin-bottom: 6px;
}

.sobre-stat-desc {
  font-size: 11px;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.5;
}

/* ════════════════════════════════════════════════════
   SEÇÃO LIVROS RECENTES
   ════════════════════════════════════════════════════ */

.livros-home-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 80px 60px;
}

.livros-home-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 48px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(112, 163, 240, 0.1);
}

.livros-home-header h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 400;
  color: var(--white);
  margin: 0;
  letter-spacing: 0.3px;
}

.livros-home-header a {
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease;
  opacity: 0.8;
}

.livros-home-header a:hover {
  color: #a8c8ff;
  opacity: 1;
}

/* Grid de livros */
.livros-home-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}

/* Card de livro */
.lh-card {
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.25s ease;
}

.lh-card:hover {
  transform: translateY(-6px);
}

.lh-card:hover img {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(112, 163, 240, 0.15);
}

.lh-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  margin-bottom: 12px;
  transition: box-shadow 0.25s ease;
}

.lh-card h4 {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 400;
  color: rgba(232, 236, 244, 0.9);
  line-height: 1.35;
  margin: 0 0 5px;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.lh-card p {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: rgba(136, 146, 180, 0.6);
  margin: 0;
}

/* Skeleton loader */
.sk-card { display: flex; flex-direction: column; gap: 10px; }

.sk-img {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

.sk-line {
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

.sk-line.short { width: 65%; }

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ════════════════════════════════════════════════════
   TRANSIÇÃO LIVROS → CONTATO
   ════════════════════════════════════════════════════ */

.livros-to-contato-bridge {
  height: 120px;
  background: linear-gradient(
    to bottom,
    var(--blue-primary) 0%,
    rgba(9, 14, 63, 0.7) 60%,
    rgba(13, 20, 80, 0.3) 100%
  );
  position: relative;
  pointer-events: none;
}

/* ════════════════════════════════════════════════════
   SEÇÃO CONTATO — retorno gradual ao azul
   ════════════════════════════════════════════════════ */

.contato-section {
  position: relative;
  background: linear-gradient(
    180deg,
    var(--blue-primary)     0%,
    rgba(11, 17, 55, 1)     25%,
    rgba(13, 20, 75, 1)     55%,
    rgba(15, 22, 90, 1)     80%,
    rgba(9,  14, 63, 1)    100%
  );
  padding: 100px 40px 120px;
  overflow: hidden;
}

/* Glow azul extremamente suave no fundo */
.contato-section::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(112, 163, 240, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.contato-container {
  max-width: 1100px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.contato-header {
  text-align: center;
  margin-bottom: 64px;
}

.contato-sup {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.75;
  display: block;
  margin-bottom: 14px;
}

.contato-title {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 400;
  color: var(--white);
  margin: 0;
  letter-spacing: 0.5px;
}

.contato-body {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 72px;
  align-items: start;
}

/* Info col */
.contato-item {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 32px;
}

.contato-item-icon {
  font-size: 14px;
  color: var(--accent);
  opacity: 0.7;
  margin-top: 3px;
  flex-shrink: 0;
}

.contato-item-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.contato-item-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.contato-item-value {
  font-size: 13px;
  color: rgba(232, 236, 244, 0.85);
  font-weight: 300;
}

.contato-rule {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 36px 0 28px;
}

.contato-rule-line {
  flex: 1;
  height: 1px;
  background: rgba(112, 163, 240, 0.12);
}

.contato-rule-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0.5;
  white-space: nowrap;
}

.contato-socials {
  display: flex;
  gap: 12px;
}

.contato-social-btn {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(112, 163, 240, 0.18);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(136, 146, 180, 0.7);
  font-size: 14px;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.contato-social-btn:hover {
  border-color: rgba(112, 163, 240, 0.45);
  color: var(--accent-light);
  background: rgba(112, 163, 240, 0.08);
  transform: translateY(-2px);
}

/* Form col */
.contato-form-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contato-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.contato-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contato-form-group label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

.contato-form-group input,
.contato-form-group select,
.contato-form-group textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(112, 163, 240, 0.15);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  -webkit-appearance: none;
}

.contato-form-group input::placeholder,
.contato-form-group textarea::placeholder {
  color: rgba(136, 146, 180, 0.45);
}

.contato-form-group select {
  cursor: pointer;
  color: rgba(232, 236, 244, 0.7);
}

.contato-form-group select option {
  background: var(--blue-mid);
  color: var(--white);
}

.contato-form-group input:focus,
.contato-form-group select:focus,
.contato-form-group textarea:focus {
  border-color: rgba(112, 163, 240, 0.45);
  box-shadow: 0 0 0 3px rgba(112, 163, 240, 0.08);
  background: rgba(255, 255, 255, 0.06);
}

.contato-form-group textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.contato-btn-wrap {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.contato-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 32px;
  background: var(--blue-navy);
  border: 1px solid rgba(112, 163, 240, 0.3);
  border-radius: 8px;
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease, border-color 0.25s ease;
}

.contato-btn:hover {
  background: var(--blue-mid);
  box-shadow: 0 8px 28px rgba(9, 14, 63, 0.55), 0 0 0 1px rgba(112, 163, 240, 0.25);
  border-color: rgba(112, 163, 240, 0.5);
  transform: translateY(-2px);
}

.contato-btn:active {
  transform: scale(0.98) translateY(0);
}

/* ════════════════════════════════════════════════════
   RESPONSIVIDADE
   ════════════════════════════════════════════════════ */

@media (max-width: 1200px) {
  .livros-home-grid { grid-template-columns: repeat(4, 1fr); }
  .sobre-body { grid-template-columns: 1fr; gap: 48px; }
  .sobre-stats-col { flex-direction: row; gap: 20px; }
  .sobre-stat { flex: 1; }
}

@media (max-width: 900px) {
  :root { --section-pad: 80px 40px; }

  .card-input { padding-top: 130px; padding-bottom: 80px; min-height: 680px; }
  .sobre-section { margin-top: -60px; padding: 0 20px 60px; }
  .sobre-container { padding: 52px 40px; }
  .lib-title { font-size: 28px; }
  .livros-home-section { padding: 60px 40px 40px; }
  .livros-home-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
  .contato-body { grid-template-columns: 1fr; gap: 48px; }
  .sobre-stats-col { flex-direction: column; }
}

@media (max-width: 640px) {
  .custom-input { width: 100%; max-width: 340px; }
  .sobre-container { padding: 40px 24px; border-radius: 14px; }
  .lib-title { font-size: 24px; }
  .livros-home-section { padding: 48px 24px 32px; }
  .livros-home-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .contato-section { padding: 72px 24px 80px; }
  .contato-form-row { grid-template-columns: 1fr; }
  .livros-home-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
