/* ============================================================
   CEPEA Livros — storefront v0
   Tema: sóbrio, acolhedor, serifado, tons terrosos/dourados.
   ============================================================ */

:root {
  --bg:        #fbf7ef;   /* pergaminho claro */
  --bg-alt:    #f3ead9;
  --ink:       #2e2620;   /* marrom-tinta */
  --ink-soft:  #5b5046;
  --gold:      #a9802f;   /* dourado terroso */
  --gold-deep: #7c5c1d;
  --terra:     #8c4a2f;   /* terracota */
  --line:      #e2d6bf;
  --card:      #fffdf8;
  --shadow:    rgba(60, 45, 25, 0.14);
  --maxw:      1140px;
  --serif:     "EB Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --display:   "Cormorant Garamond", "EB Garamond", Georgia, serif;
}

/* Títulos no display serifado refinado */
.brand .mark, .hero h1, .section-title, .card-body h3,
.book-detail h1, .about h2, .buybox h4 { font-family: var(--display); letter-spacing: .01em; }
body { font-size: 18px; }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold-deep); text-decoration: none; }
a:hover { color: var(--terra); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  position: sticky; top: 0; z-index: 20;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand .mark {
  font-size: 1.55rem; letter-spacing: .06em; font-weight: 700;
  color: var(--ink);
}
.brand .mark em { color: var(--gold); font-style: normal; }
.brand .sub {
  font-size: .72rem; letter-spacing: .28em; text-transform: uppercase;
  color: var(--ink-soft); margin-top: 4px;
}
.nav a { margin-left: 26px; font-size: .95rem; letter-spacing: .02em; }

/* ---------- Hero ---------- */
.hero {
  background:
    linear-gradient(180deg, rgba(251,247,239,.90) 0%, rgba(251,247,239,.66) 50%, rgba(251,247,239,.88) 100%),
    url("../assets/art/hero.jpg") center 35% / cover no-repeat;
  border-bottom: 1px solid var(--line);
  padding: 104px 0 96px;
  text-align: center;
}
.hero h1 { color: #2a3d1f; text-shadow: 0 1px 10px rgba(251,247,239,.7); }
.hero .kicker {
  font-size: .8rem; letter-spacing: .3em; text-transform: uppercase;
  color: var(--terra); margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0 auto 18px; max-width: 18ch; font-weight: 700;
  line-height: 1.15;
}
.hero p.lead {
  font-size: 1.18rem; color: var(--ink-soft);
  max-width: 60ch; margin: 0 auto 30px;
}
.hero .ornament {
  color: var(--gold); letter-spacing: .5em; margin-bottom: 26px; font-size: 1.1rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block; cursor: pointer;
  font-family: var(--serif); font-size: 1rem;
  padding: 12px 26px; border-radius: 2px;
  border: 1px solid var(--gold-deep);
  transition: all .18s ease;
}
.btn-primary { background: var(--gold-deep); color: #fff; }
.btn-primary:hover { background: var(--terra); border-color: var(--terra); color:#fff; }
.btn-ghost { background: transparent; color: var(--gold-deep); }
.btn-ghost:hover { background: var(--bg-alt); color: var(--terra); }
.btn-sm { padding: 8px 16px; font-size: .9rem; }

/* ---------- Section ---------- */
.section { padding: 64px 0; }
.section-title {
  text-align: center; margin: 0 0 8px;
  font-size: 2rem; font-weight: 700;
}
.section-sub {
  text-align: center; color: var(--ink-soft);
  margin: 0 auto 44px; max-width: 56ch;
}

/* ---------- Book grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 34px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 1px 2px var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 28px var(--shadow); }

.cover {
  aspect-ratio: 2 / 3;
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Text-only fallback cover */
.cover-text {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 22px;
  color: #fdf6e6;
  background:
    linear-gradient(160deg, var(--gold-deep), var(--terra) 130%);
  position: relative;
}
.cover-text::before {
  content: ""; position: absolute; inset: 12px;
  border: 1px solid rgba(253,246,230,.45);
}
.cover-text .ct-orn { font-size: .8rem; letter-spacing: .4em; opacity: .75; margin-bottom: 12px; }
.cover-text .ct-title { font-size: 1.35rem; font-weight: 700; line-height: 1.2; }
.cover-text .ct-author { margin-top: 14px; font-size: .8rem; letter-spacing: .12em; opacity: .9; }

.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.card-body h3 { margin: 0 0 4px; font-size: 1.18rem; line-height: 1.25; }
.card-body .authors {
  font-size: .82rem; letter-spacing: .04em; color: var(--terra);
  margin-bottom: 10px;
}
.card-body .blurb { font-size: .94rem; color: var(--ink-soft); flex: 1; margin: 0 0 16px; }
.card-actions { display: flex; gap: 10px; }

.badge {
  display: inline-block; font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--gold-deep);
  border: 1px solid var(--line); border-radius: 2px;
  padding: 2px 8px; margin-bottom: 10px; align-self: flex-start;
}

/* ---------- Book detail page ---------- */
.book-detail { padding: 56px 0; }
.book-detail .layout {
  display: grid; grid-template-columns: 320px 1fr; gap: 48px;
}
.book-detail .cover-col .cover {
  border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 10px 30px var(--shadow);
}
.book-detail h1 { font-size: 2.3rem; margin: 0 0 6px; line-height: 1.15; }
.book-detail .authors { color: var(--terra); font-size: 1.05rem; margin-bottom: 22px; }
.book-detail .meta {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  padding: 16px 0; margin: 24px 0; display: grid; gap: 8px;
}
.book-detail .meta div { display: flex; gap: 10px; font-size: .96rem; }
.book-detail .meta .k { color: var(--ink-soft); min-width: 120px; }
.book-detail .synopsis p { font-size: 1.05rem; margin: 0 0 14px; }

.buybox {
  background: var(--bg-alt); border: 1px solid var(--line);
  border-radius: 4px; padding: 24px; margin-top: 26px;
}
.buybox h4 { margin: 0 0 6px; font-size: 1.2rem; }
.buybox .price { font-size: 1.5rem; color: var(--gold-deep); margin: 6px 0 4px; }
.buybox .todefine {
  display: inline-block; background: #f6e7c9; color: var(--gold-deep);
  border: 1px dashed var(--gold); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 2px; margin-bottom: 14px;
}
.buybox .note { font-size: .85rem; color: var(--ink-soft); margin-top: 14px; }
.back-link { display:inline-block; margin-bottom: 22px; font-size: .9rem; }

/* ---------- Author / about strip ---------- */
.about {
  background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.about .wrap { padding: 56px 24px; max-width: 800px; text-align: center; }
.about h2 { font-size: 1.8rem; margin: 0 0 14px; }
.about p { font-size: 1.06rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink); color: #e9ddc8;
  padding: 44px 0; margin-top: 0; font-size: .9rem;
}
.site-footer a { color: var(--gold); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; }
.site-footer .muted { color: #b3a589; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .book-detail .layout { grid-template-columns: 1fr; }
  .book-detail .cover-col { max-width: 280px; margin: 0 auto; }
  .nav { display: none; }
}
