/* ==========================================================================
 * PÁGINA AUTÓNOMA: /autores (Sobre os Autores — Objeto Universal para Todos os Livros)
 * Caixa-Filtro Dourada + Folhas de Arte-Final Sem Desperdício de Espaço (Desktop & Mobile)
 * ========================================================================== */
:root {
  --bg-page: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-elevated: #F1F5F9;
  --border-card: #CBD5E1;
  --text-page: #0F172A;
  --text-page-muted: #475569;
  --text-heading: #0F172A;
  --text-card-title: #1E293B;
  --text-card-body: #1E293B;
  --accent-cyan: #0284C7;
  --accent-blue-ring: #2B98F0;
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.06);
}

:root[data-theme="dark"] {
  --bg-page: #060D1A;
  --bg-card: #0F172A;
  --bg-card-elevated: #1E293B;
  --border-card: #334155;
  --text-page: #F8FAFC;
  --text-page-muted: #94A3B8;
  --text-heading: #F8FAFC;
  --text-card-title: #F1F5F9;
  --text-card-body: #E2E8F0;
  --accent-cyan: #38BDF8;
  --accent-blue-ring: #38BDF8;
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.50);
}

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

body {
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-page);
  min-height: 100vh;
  line-height: 1.48;
  overflow-x: hidden;
}

.autores-container {
  max-width: calc(var(--cgd-mancha-max, 880px) + (2 * var(--cgd-page-pad, 4px)));
  margin: 0 auto;
  padding: 6px var(--cgd-page-pad, 4px) 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Barra Rápida de Regresso */
.autores-top-return-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 6px;
}

.btn-return-prev {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  color: var(--text-page);
  font-family: 'Fira Sans Condensed', 'Fira Sans', sans-serif;
  font-size: 0.90rem;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.16s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
  white-space: nowrap;
}

.btn-return-prev:hover {
  border-color: var(--accent-blue-ring);
  color: var(--accent-cyan);
  transform: translateY(-1px);
}

/* ==========================================================================
   CAIXA DOS AUTORES & FILTRO DE LIVRO / EDIÇÃO (DRAFTS CARLOS DIAS)
   ========================================================================== */
.autores-filter-wrap {
  position: relative;
  width: 100%;
  z-index: 90;
}

.autores-filter-bar {
  width: 100%;
  min-height: 50px;
  padding: 5px 14px 5px 12px;
  border-radius: 12px;
  border: 1.5px solid #D97706;
  background: linear-gradient(90deg, #FEF9C3 0%, #FDE68A 42%, #FBBF24 85%, #F59E0B 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), 0 3px 10px rgba(217, 119, 6, 0.18);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  user-select: none;
}

:root[data-theme="dark"] .autores-filter-bar {
  background: linear-gradient(90deg, #FEF3C7 0%, #FDE68A 40%, #F59E0B 88%, #D97706 100%);
  border-color: #F59E0B;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}

.autores-filter-bar:hover {
  border-color: #B45309;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 4px 14px rgba(217, 119, 6, 0.28);
}

.autores-filter-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.05;
  flex-shrink: 0;
}

.autores-filter-left-top {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.autores-filter-book-emoji {
  font-size: 1.05rem;
  line-height: 1;
}

.autores-filter-left-title {
  font-family: 'Fira Sans Condensed', 'Fira Sans', sans-serif;
  font-size: 1.12rem;
  font-weight: 900;
  color: #451A03;
  letter-spacing: -0.01em;
  line-height: 1;
}

.autores-filter-left-sub {
  font-family: 'Fira Sans Condensed', 'Fira Sans', sans-serif;
  font-size: 0.74rem;
  font-weight: 600;
  color: #78350F;
  line-height: 1.1;
  margin-top: 1px;
}

.autores-filter-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-width: 0;
  line-height: 1.04;
}

.autores-filter-book-title {
  font-family: 'Fira Sans Condensed', 'Fira Sans', sans-serif;
  font-size: 1.38rem;
  font-weight: 900;
  color: #3B1502;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.02;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.autores-filter-book-sub {
  font-family: 'Fira Sans Condensed', 'Fira Sans', sans-serif;
  font-size: 0.80rem;
  font-weight: 600;
  color: #5C2406;
  line-height: 1.12;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.autores-filter-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.autores-filter-bar[aria-expanded="true"] .autores-filter-arrow {
  transform: rotate(180deg);
}

/* Menu Dropdown de Livros e Edições */
.autores-filter-menu {
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1.5px solid #D97706;
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.24);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 200;
}

.autores-filter-menu.open {
  display: flex;
}

.autores-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-page);
  cursor: pointer;
  text-align: left;
  transition: all 0.14s ease;
}

.autores-filter-item:hover {
  background: var(--bg-card-elevated);
  border-color: rgba(217, 119, 6, 0.35);
}

.autores-filter-item.active {
  background: linear-gradient(90deg, rgba(254, 243, 199, 0.65) 0%, rgba(253, 230, 138, 0.45) 100%);
  border-color: #D97706;
}

:root[data-theme="dark"] .autores-filter-item.active {
  background: rgba(245, 158, 11, 0.18);
  border-color: #F59E0B;
}

.autores-item-texts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.autores-item-title {
  font-family: 'Fira Sans Condensed', 'Fira Sans', sans-serif;
  font-size: 1.02rem;
  font-weight: 900;
  color: var(--text-heading);
  line-height: 1.1;
  text-transform: uppercase;
}

.autores-item-sub {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.80rem;
  font-weight: 600;
  color: var(--text-page-muted);
  line-height: 1.15;
}

.autores-item-check {
  font-size: 0.95rem;
  font-weight: 900;
  color: #D97706;
  opacity: 0;
  flex-shrink: 0;
}

:root[data-theme="dark"] .autores-item-check {
  color: #FBBF24;
}

.autores-filter-item.active .autores-item-check {
  opacity: 1;
}

.autores-filter-divider {
  height: 1px;
  background: var(--border-card);
  margin: 3px 6px;
}

.autores-filter-group-label {
  font-family: 'Fira Sans Condensed', 'Fira Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-page-muted);
  padding: 4px 12px 1px;
}

/* ==========================================================================
   CAIXAS DE AUTOR (.book-bio-sheet): ZERO DESPERDÍCIO DE ESPAÇO À VOLTA
   ========================================================================== */
.book-bio-sheet {
  background: var(--bg-card);
  border: 1.5px solid var(--border-card);
  border-radius: 16px;
  padding: 12px 14px 14px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Topo da Caixa 1: "Os autores deste livro" à esquerda + Ilustração à direita (Zero colisão) */
.book-bio-top-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px 2px 62px;
  min-height: 112px;
}

.book-bio-section-kicker {
  font-family: 'Fira Sans', sans-serif;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text-heading);
  line-height: 1.05 !important;
  margin: 0 !important;
  letter-spacing: -0.01em;
}

.book-bio-emblem {
  width: 146px;
  height: auto;
  max-height: 138px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.08));
}

:root[data-theme="dark"] .book-bio-emblem {
  opacity: 0.94;
  border-radius: 12px;
}

/* Linha da Foto Circular à Esquerda + Nome e Função à Direita */
.book-bio-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  position: relative;
  z-index: 2;
  width: 100%;
}

.book-bio-avatar-circle {
  width: 96px;
  height: 96px;
  min-width: 96px;
  min-height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 3.5px solid #2B98F0;
  box-shadow: 0 0 0 2px rgba(43, 152, 240, 0.20), 0 6px 14px rgba(15, 23, 42, 0.14);
  background: #0F172A;
  flex-shrink: 0;
  display: block;
}

.book-bio-header-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  flex: 1;
}

.book-bio-author-name {
  font-family: 'Fira Sans', sans-serif;
  font-size: 1.42rem;
  font-weight: 900;
  color: #5A626A;
  line-height: 1.08 !important;
  margin: 0 0 3px 0 !important;
  letter-spacing: -0.01em;
}

:root[data-theme="dark"] .book-bio-author-name {
  color: #CBD5E1;
}

.book-bio-author-role {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.94rem;
  font-weight: 800;
  font-style: italic;
  color: var(--text-heading);
  line-height: 1.18 !important;
  margin: 0 !important;
}

/* Corpo Biográfico em Itálico Editorial Sem Espaço Vazio Lateral */
.book-bio-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  z-index: 2;
}

.book-bio-body p {
  font-family: 'Fira Sans', sans-serif;
  font-size: 0.98rem;
  font-style: italic;
  font-weight: 400;
  color: var(--text-card-body);
  line-height: 1.44 !important;
  text-align: left;
  margin: 0 !important;
}

footer {
  border-top: 1px solid var(--border-card);
  padding: 12px 10px;
  font-size: 0.82rem;
  color: var(--text-page-muted);
  text-align: center;
  margin-top: 10px;
}

/* ==========================================================================
   RESPONSIVIDADE MOBILE (ZERO MARGENS DESPERDIÇADAS, ALINHAMENTO AO MILÍMETRO)
   ========================================================================== */
@media (max-width: 768px) {
  .autores-container {
    padding: 4px 4px 20px !important;
    gap: 6px !important;
  }

  .btn-return-prev {
    padding: 5px 11px;
    font-size: 0.84rem;
  }

  .autores-filter-bar {
    min-height: 46px;
    padding: 4px 10px 4px 9px;
    border-radius: 10px;
    gap: 6px;
  }

  .autores-filter-left-title {
    font-size: 1.02rem;
  }

  .autores-filter-left-sub {
    font-size: 0.68rem;
  }

  .autores-filter-book-title {
    font-size: 1.22rem;
  }

  .autores-filter-book-sub {
    font-size: 0.74rem;
  }

  .book-bio-sheet {
    padding: 8px 8px 10px;
    border-radius: 14px;
    gap: 6px;
  }

  .book-bio-top-hero {
    padding: 2px 2px 0 48px;
    min-height: 104px;
    gap: 8px;
  }

  .book-bio-section-kicker {
    font-size: 1.38rem;
  }

  .book-bio-emblem {
    width: 122px;
    max-height: 118px;
  }

  .book-bio-header-row {
    gap: 10px;
  }

  .book-bio-avatar-circle {
    width: 82px;
    height: 82px;
    min-width: 82px;
    min-height: 82px;
    border-width: 3px;
  }

  .book-bio-author-name {
    font-size: 1.24rem;
    margin-bottom: 2px !important;
  }

  .book-bio-author-role {
    font-size: 0.85rem;
    line-height: 1.16 !important;
  }

  .book-bio-body {
    gap: 8px;
  }

  .book-bio-body p {
    font-size: 0.93rem;
    line-height: 1.38 !important;
  }
}
