/* ════════════════════════════════════════════════════════════════
   WhyShouldIReadThisBook? — Main Stylesheet
   ════════════════════════════════════════════════════════════════ */

/* ── Reset / Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  background: #fafaf8;
  color: #1a1a1a;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid #e5e5e5;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.site-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

.site-title:hover { color: #00c805; }

/* ── Search bar ───────────────────────────────────────────────── */
.search-bar {
  flex: 1;
  min-width: 200px;
  max-width: 480px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  border: 1.5px solid #d0d0d0;
  border-radius: 8px;
  background: #f5f5f3;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.search-bar:focus {
  border-color: #00c805;
  background: #ffffff;
}

.search-bar::placeholder { color: #999; }

/* ── Main content ─────────────────────────────────────────────── */
main {
  flex: 1;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

/* ── Book list (index page) ───────────────────────────────────── */
#book-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.book-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 13px 16px;
  border-radius: 8px;
  transition: background 0.1s;
  cursor: pointer;
}

.book-row:hover { background: #f0f0ec; }

.book-index {
  font-size: 0.78rem;
  font-weight: 600;
  color: #aaa;
  min-width: 36px;
  flex-shrink: 0;
}

.book-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.retail-badge {
  flex-shrink: 0;
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
}

.book-author {
  font-size: 0.88rem;
  color: #666;
  flex-shrink: 0;
}

.book-price {
  font-size: 0.88rem;
  color: #00a804;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 52px;
  text-align: right;
}

.no-results {
  padding: 40px 16px;
  color: #888;
  font-size: 0.95rem;
}

/* ── Detail page ──────────────────────────────────────────────── */
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  font-size: 0.9rem;
  color: #888;
  transition: color 0.15s;
}
.back-link:hover { color: #1a1a1a; }

.book-detail-top {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.book-cover-img {
  width: 180px;
  min-width: 140px;
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  object-fit: cover;
}

.book-detail-right {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.book-detail-index {
  font-size: 0.8rem;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.05em;
}

.book-detail-title {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.book-detail-author {
  font-size: 1rem;
  color: #555;
  margin-top: 2px;
}

.book-detail-price {
  font-size: 1.1rem;
  font-weight: 600;
  color: #00a804;
  margin-top: 4px;
}

/* ── Reasons section ──────────────────────────────────────────── */
.reasons-section {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid #e5e5e5;
}

.reasons-header {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #1a1a1a;
}

.reason-text {
  font-family: 'Architects Daughter', cursive;
  font-size: 1.05rem;
  line-height: 1.75;
  color: #2e2e2e;
  margin-bottom: 18px;
  padding-left: 4px;
  border-left: 3px solid #e0e0d8;
  padding-left: 14px;
}

/* ── Not found ────────────────────────────────────────────────── */
.not-found {
  padding: 40px 0;
  font-size: 1rem;
  color: #888;
}
.not-found a { color: #00a804; text-decoration: underline; }

/* ── Footer ───────────────────────────────────────────────────── */
footer {
  border-top: 1px solid #e5e5e5;
  padding: 16px 24px;
  text-align: center;
  font-size: 0.75rem;
  color: #999;
  background: #ffffff;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 600px) {
  .book-author, .book-price { display: none; }
  .book-detail-top { flex-direction: column; }
  .book-cover-img { width: 140px; }
  .book-detail-title { font-size: 1.3rem; }
}
