/* ============================================================
   Biblioteca Bradel — estilos
   ============================================================ */
:root {
  --paper:        #f7f3ec;
  --paper-2:      #fffdf9;
  --ink:          #241f1a;
  --ink-soft:     #5f574d;
  --ink-faint:    #8c8377;
  --line:         #e4dccf;
  --accent:       #9a2f28;   /* vermelho terroso, editorial */
  --accent-deep:  #7a231d;
  --gold:         #b8843a;
  --card:         #ffffff;
  --shadow-sm:    0 1px 2px rgba(36,31,26,.06), 0 2px 8px rgba(36,31,26,.05);
  --shadow-md:    0 8px 24px rgba(36,31,26,.10), 0 2px 6px rgba(36,31,26,.06);
  --shadow-lg:    0 24px 60px rgba(36,31,26,.22);
  --radius:       14px;
  --radius-sm:    10px;
  --max:          1180px;
  --serif:        "Fraunces", Georgia, "Times New Roman", serif;
  --sans:         "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(247,243,236,.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar__inner {
  max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand__mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 600; font-size: 20px;
  box-shadow: var(--shadow-sm);
}
.brand__name { font-size: 18px; letter-spacing: .2px; color: var(--ink-soft); }
.brand__name strong { color: var(--ink); }
.topbar__nav { display: flex; gap: 26px; }
.topbar__nav a {
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  padding: 4px 0; border-bottom: 2px solid transparent; transition: .2s;
}
.topbar__nav a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, rgba(184,132,58,.14), transparent 60%),
    radial-gradient(900px 380px at 5% 0%, rgba(154,47,40,.10), transparent 55%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero__inner {
  max-width: 820px; margin: 0 auto;
  padding: 72px 24px 60px; text-align: center;
}
.hero__eyebrow {
  text-transform: uppercase; letter-spacing: .28em; font-size: 12px;
  font-weight: 600; color: var(--gold); margin: 0 0 14px;
}
.hero__title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(52px, 11vw, 104px); line-height: .92;
  margin: 0; letter-spacing: -.02em; color: var(--ink);
}
.hero__subtitle {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(18px, 3vw, 24px); color: var(--ink-soft);
  margin: 18px 0 34px;
}
.hero__stats { font-size: 13px; color: var(--ink-faint); margin-top: 18px; }
.hero__stats span { color: var(--accent); font-weight: 600; }

/* ---------- Busca ---------- */
.search {
  position: relative; display: flex; align-items: center;
  max-width: 560px; margin: 0 auto;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, border-color .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(154,47,40,.12); }
.search__icon { width: 20px; height: 20px; color: var(--ink-faint); margin-left: 20px; flex: none; }
.search input {
  flex: 1; border: 0; outline: 0; background: transparent;
  padding: 16px 14px; font-size: 16px; color: var(--ink);
}
.search__clear {
  border: 0; background: transparent; font-size: 26px; line-height: 1;
  color: var(--ink-faint); padding: 0 18px 0 4px;
}
.search__clear:hover { color: var(--accent); }

/* ---------- Section headers ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -.01em;
  margin: 0; color: var(--ink);
}
.section-lead { color: var(--ink-soft); margin: 6px 0 0; }

/* ---------- Destaque ---------- */
.featured { margin: 56px 0; }
.featured__card {
  display: grid; grid-template-columns: 220px 1fr; gap: 40px;
  background: linear-gradient(180deg, #fffefb, #fbf6ee);
  border: 1px solid var(--line); border-radius: 20px;
  padding: 36px; box-shadow: var(--shadow-md); align-items: center;
}
.featured__cover {
  width: 220px; aspect-ratio: 2/3; border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.featured__cover img { width: 100%; height: 100%; object-fit: cover; }
.featured__tag {
  display: inline-block; text-transform: uppercase; letter-spacing: .18em;
  font-size: 11px; font-weight: 700; color: var(--gold); margin-bottom: 12px;
}
.featured__title {
  font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 4vw, 40px);
  line-height: 1.05; margin: 0 0 8px; letter-spacing: -.01em;
}
.featured__author { color: var(--ink-soft); font-size: 16px; margin: 0 0 14px; }
.featured__author strong { color: var(--ink); font-weight: 600; }
.featured__pitch { font-size: 16px; color: var(--ink-soft); max-width: 52ch; margin: 0 0 22px; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 999px; font-weight: 600; font-size: 14.5px;
  padding: 12px 22px; transition: transform .15s, box-shadow .2s, background .2s;
}
.btn--primary { background: var(--accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--line); }
.btn--ghost:hover { border-color: var(--accent); }

/* ---------- Chips ---------- */
.filters { margin: 48px 0 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.chip {
  border: 1.5px solid var(--line); background: var(--paper-2);
  color: var(--ink-soft); border-radius: 999px;
  padding: 9px 16px; font-size: 13.5px; font-weight: 500; transition: .18s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Recomendações ---------- */
.recs { margin: 60px 0 8px; }
.recs__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px;
}
.rec-card {
  text-align: left; border: 1px solid var(--line); background: var(--paper-2);
  border-radius: var(--radius); padding: 18px 18px 20px; transition: .18s;
  display: flex; flex-direction: column; gap: 6px; min-height: 104px;
}
.rec-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.rec-card__emoji { font-size: 20px; }
.rec-card__label { font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.2; color: var(--ink); }

/* ---------- Grade ---------- */
.catalog { margin: 60px 0 40px; scroll-margin-top: 80px; }
.catalog__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.catalog__count { color: var(--ink-faint); font-size: 14px; white-space: nowrap; }
.grid {
  display: grid; gap: 26px 22px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
.card {
  display: flex; flex-direction: column; cursor: pointer;
  background: transparent; border: 0; text-align: left; padding: 0;
  transition: transform .16s;
}
.card:hover { transform: translateY(-4px); }
.card__cover {
  position: relative; aspect-ratio: 2/3; border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow-md); background: #efe7d9;
}
.card__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card__cover img { transform: scale(1.04); }
.card__badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(36,31,26,.82); color: #fff; backdrop-filter: blur(4px);
  font-size: 11px; font-weight: 600; padding: 5px 10px; border-radius: 999px;
  display: flex; align-items: center; gap: 5px;
}
.card__body { padding: 12px 4px 0; }
.card__title {
  font-family: var(--serif); font-weight: 600; font-size: 16px; line-height: 1.22;
  color: var(--ink); margin: 0 0 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card__author { font-size: 13px; color: var(--ink-soft); margin: 0 0 6px; }
.card__cat { font-size: 11.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }

/* Placeholder de capa */
.cover-ph {
  width: 100%; height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
  padding: 18px; gap: 10px;
  background:
    repeating-linear-gradient(45deg, rgba(154,47,40,.04) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #fbf6ee, #efe4d2);
  border: 1px dashed var(--line);
}
.cover-ph__title { font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--ink-soft); line-height: 1.2; }
.cover-ph__note { font-size: 10.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 700; }
.cover-ph__mark { font-family: var(--serif); font-size: 30px; color: var(--line); }

.empty { text-align: center; color: var(--ink-soft); padding: 60px 0; font-size: 16px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 40px 24px; text-align: center; color: var(--ink-soft); }
.footer p { margin: 4px 0; }
.footer__note { font-size: 12.5px; color: var(--ink-faint); max-width: 620px; margin: 8px auto 0; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(28,22,17,.55); backdrop-filter: blur(3px); animation: fade .2s ease; }
.modal__dialog {
  position: relative; z-index: 1; width: min(760px, 100%);
  max-height: 90vh; overflow-y: auto; background: var(--paper-2);
  border-radius: 20px; box-shadow: var(--shadow-lg); animation: pop .22s ease;
}
.modal__close {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm);
  font-size: 26px; line-height: 1; color: var(--ink-soft);
}
.modal__close:hover { color: var(--accent); }
.modal__body { padding: 0; }

.detail__head { display: grid; grid-template-columns: 180px 1fr; gap: 28px; padding: 36px 36px 24px; }
.detail__cover { width: 180px; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-lg); }
.detail__cover img { width: 100%; height: 100%; object-fit: cover; }
.detail__cat { text-transform: uppercase; letter-spacing: .16em; font-size: 11px; font-weight: 700; color: var(--gold); }
.detail__title { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 4vw, 34px); line-height: 1.08; margin: 10px 0 6px; letter-spacing: -.01em; }
.detail__author { color: var(--ink-soft); font-size: 16px; margin: 0 0 14px; }
.detail__author strong { color: var(--ink); }
.detail__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: #f0e7d8; color: var(--ink-soft); }
.pill--film { background: rgba(154,47,40,.10); color: var(--accent); }
.pill--review { background: rgba(184,132,58,.14); color: var(--gold); }

.detail__sections { padding: 8px 36px 36px; }
.detail__block { padding: 20px 0; border-top: 1px solid var(--line); }
.detail__block h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .14em;
  color: var(--accent); margin: 0 0 8px; font-weight: 700;
}
.detail__block p { margin: 0; color: var(--ink-soft); font-size: 15.5px; line-height: 1.65; }
.detail__profiles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.detail__profiles li {
  font-size: 13.5px; color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.detail__film { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 15px; }
.detail__film strong { color: var(--ink); }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .recs__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .topbar__nav { display: none; }
  .hero__inner { padding: 52px 20px 44px; }
  .featured__card { grid-template-columns: 1fr; text-align: center; gap: 22px; padding: 26px; }
  .featured__cover { width: 160px; margin: 0 auto; }
  .featured__pitch { margin-left: auto; margin-right: auto; }
  .detail__head { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 44px 22px 20px; }
  .detail__cover { width: 150px; }
  .detail__pills, .detail__profiles { justify-content: center; }
  .detail__sections { padding: 8px 22px 30px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 16px; }
}
@media (max-width: 480px) {
  .hero__eyebrow { letter-spacing: .16em; font-size: 11px; }
  .hero__title { font-size: clamp(46px, 15vw, 72px); }
  .hero__subtitle { font-size: 17px; }
  .search input { font-size: 15px; padding: 14px 10px; }
}
@media (max-width: 420px) {
  .recs__grid { grid-template-columns: 1fr; }
}
