/* jhmira Bookshelf — theme inspired by the Odrin WordPress theme.
   Palette: cream #e5dcc3, coral #faab9f, gold #d38d45, near-black ink.
   Fonts:  Cinzel Decorative (display), Mulish (sans body), Gentium Book Plus (serif). */

:root {
  --cream: #e5dcc3;
  --cream-soft: #efe8d7;
  --surface: #fbf8f1;
  --ink: #221d17;
  --ink-soft: #4a4136;
  --muted: #8a7f6c;
  --coral: #faab9f;
  --coral-deep: #ef8b7b;
  --gold: #d38d45;
  --line: #d8cdb4;
  --shadow: 0 14px 38px rgba(45, 35, 20, 0.16);
  --radius: 10px;

  --font-display: "Cinzel Decorative", Georgia, serif;
  --font-sans: "Mulish", "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Gentium Book Plus", Georgia, serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  width: min(1140px, 92vw);
  margin-inline: auto;
}

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

h1, h2, h3 { color: var(--ink); line-height: 1.2; }

/* ----- header / footer ----- */
.site-header {
  background: var(--cream-soft);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.brand {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--ink);
  letter-spacing: 0.5px;
}
.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 1.7em; height: 1.7em;
  margin-right: 2px;
  border: 2px solid var(--coral);
  color: var(--coral-deep);
  border-radius: 4px;
  transform: translateY(2px);
}
.site-nav a { color: var(--ink-soft); font-weight: 600; margin-left: 20px; }
.site-nav a:hover { color: var(--coral-deep); }

.site-main { min-height: 60vh; padding-bottom: 64px; }

.site-footer {
  background: var(--cream-soft);
  border-top: 1px solid var(--line);
  padding: 26px 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ----- buttons ----- */
.btn {
  display: inline-block;
  background: var(--coral);
  color: var(--ink);
  font-weight: 700;
  padding: 11px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: background 0.15s ease, transform 0.15s ease;
}
.btn:hover { background: var(--coral-deep); color: var(--ink); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  border: 2px solid var(--gold);
  color: var(--gold);
}
.btn--ghost:hover { background: var(--gold); color: #fff; }

/* ----- flash messages ----- */
.flash-wrap { margin-top: 18px; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border-left: 4px solid var(--gold);
  margin-bottom: 10px;
}
.flash--success { border-left-color: #4f9d69; }
.flash--error { border-left-color: var(--coral-deep); }

/* ----- hero / shelf header ----- */
.hero, .shelf-hero { padding: 56px 0 32px; text-align: center; }
.hero__title, .shelf-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  margin: 0 0 14px;
}
.shelf-hero__title::after {
  content: "";
  display: block;
  width: 64px; height: 3px;
  margin: 16px auto 0;
  background: var(--coral);
  border-radius: 2px;
}
.hero__intro, .shelf-hero__intro { color: var(--ink-soft); font-family: var(--font-serif); font-size: 1.1rem; }
.hero__cta { margin-top: 24px; }
.hero__cta .btn { margin: 0 6px; }

/* ----- category chips ----- */
.chips {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin: 8px 0 36px;
}
.chip {
  padding: 7px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}
.chip:hover { border-color: var(--coral); color: var(--coral-deep); }
.chip--active { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.chip--active:hover { color: var(--cream); }

/* ----- book grid (the shelf) ----- */
.book-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 32px 28px;
}
.book-card__link { color: inherit; display: block; }
.book-card__cover {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--surface);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.book-card__link:hover .book-card__cover {
  transform: translateY(-6px);
  box-shadow: 0 22px 46px rgba(45, 35, 20, 0.24);
}
.book-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-card__placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  padding: 16px; text-align: center;
  background: linear-gradient(160deg, var(--coral) 0%, var(--gold) 100%);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
}
.book-card__meta { padding: 14px 4px 0; }
.book-card__title { font-family: var(--font-serif); font-size: 1.1rem; margin: 0 0 4px; }
.book-card__author { color: var(--muted); font-size: 0.9rem; margin: 0; }
.book-card__rating { margin: 6px 0 0; display: flex; align-items: center; gap: 6px; font-size: 0.85rem; color: var(--muted); }

/* ----- star rating (CSS-only via --rating 0..5) ----- */
.stars {
  --rating: 0;
  display: inline-block;
  position: relative;
  font-size: 1rem;
  line-height: 1;
  color: var(--line);
  letter-spacing: 1px;
}
.stars::before {
  content: "★★★★★";
  position: absolute; left: 0; top: 0;
  width: calc(var(--rating) / 5 * 100%);
  overflow: hidden;
  color: var(--gold);
}

.empty, .reviews__empty {
  text-align: center;
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  padding: 48px 0;
}

/* ----- reader ----- */
.reader { padding-top: 24px; }
.reader__head {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 18px;
}
.reader__back { font-weight: 600; }
.reader__title { font-family: var(--font-display); font-size: clamp(1.5rem, 4vw, 2.4rem); margin: 0; }
.reader__author { color: var(--muted); margin: 0; font-family: var(--font-serif); }

.reader__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: min(1140px, 96vw);
  margin: 0 auto;
  padding: 12px;
  background: var(--ink);
  border-radius: var(--radius);
}
.reader__stage:fullscreen { background: var(--ink); padding: 24px; }
.flipbook {
  width: 100%;
  max-width: 1100px;
  height: clamp(420px, 70vh, 760px);
}
.reader__nav {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--coral);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.reader__nav:hover { background: var(--coral-deep); }

.reader__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}
.reader__pageinfo { color: var(--muted); font-size: 0.9rem; }

/* ----- blurb / reviews ----- */
.blurb {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--ink-soft);
  margin-top: 40px;
  max-width: 720px;
}
.reviews { margin-top: 48px; max-width: 760px; }
.reviews__heading {
  font-family: var(--font-display);
  font-size: 1.6rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.reviews__summary { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; }
.review { padding: 16px 0; border-bottom: 1px solid var(--line); }
.review__head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.review__name { font-weight: 700; }
.review__date { color: var(--muted); font-size: 0.85rem; margin-left: auto; }
.review__body { margin: 0; font-family: var(--font-serif); color: var(--ink-soft); }

/* ----- responsive ----- */
@media (max-width: 600px) {
  .reader__nav { width: 38px; height: 38px; font-size: 1.3rem; }
  .reader__stage { padding: 8px; gap: 6px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px 18px; }
}
