/* =====================================================================
   Onyapidi David lok'Ebere — Author Website & Bookstore
   Design language: premium literary editorial. Deep forest, charcoal and
   warm brown grounded in parchment and muted gold, with a recurring
   "shadow → light" gradient motif tying the site to the author's work.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,500&family=Archivo:wght@400;500;600;700&display=swap');

:root {
  --ink: #1C1A17;         /* charcoal, never pure black */
  --forest: #1F3B2E;      /* deep forest green */
  --forest-dark: #142821;
  --brown: #6B4226;       /* warm brown */
  --parchment: #F2EBDA;   /* ivory / parchment */
  --parchment-deep: #E7DCC2;
  --gold: #A9834A;        /* muted gold */
  --terracotta: #A65B3D;  /* sparing accent */
  --line: rgba(28, 26, 23, 0.14);
  --line-light: rgba(242, 235, 218, 0.24);

  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --max-width: 1180px;
  --radius: 3px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }

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

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 500; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h3 { font-size: 1.35rem; }

p { margin: 0 0 1em; max-width: 68ch; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--forest);
  font-weight: 600;
  margin-bottom: 0.75em;
  display: block;
}

.lede {
  font-size: 1.15rem;
  color: #47433C;
  max-width: 56ch;
}

.serif-quote {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--forest-dark);
  border-left: 2px solid var(--gold);
  padding-left: 1.2em;
  margin: 1.5em 0;
}

/* ---------------------------------------------------------------- */
/* Buttons                                                            */
/* ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85em 1.6em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--forest);
  color: var(--parchment);
}
.btn-primary:hover { background: var(--forest-dark); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--parchment); }

.btn-gold {
  background: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { background: #957038; }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.55em 1.1em; font-size: 0.85rem; }

/* ---------------------------------------------------------------- */
/* Header / Nav                                                       */
/* ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 235, 218, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}

.nav-brand {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.nav-brand span { color: var(--forest); font-style: italic; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.nav-links a:hover { border-color: var(--gold); }

.nav-cart {
  position: relative;
}
.nav-cart .count {
  position: absolute;
  top: -8px;
  right: -14px;
  background: var(--terracotta);
  color: var(--parchment);
  font-size: 0.68rem;
  min-width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

@media (max-width: 860px) {
  .nav-links { position: fixed; inset: 64px 0 0 0; background: var(--parchment); flex-direction: column; align-items: flex-start; padding: 32px 24px; gap: 22px; transform: translateX(100%); transition: transform 0.25s ease; }
  .nav-links.open { transform: translateX(0); }
  .nav-toggle { display: block; }
}

/* ---------------------------------------------------------------- */
/* Hero — shadow → light motif                                        */
/* ---------------------------------------------------------------- */

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  min-height: 88vh;
  background: var(--ink);
}

.hero-copy {
  color: var(--parchment);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8vw 6vw;
}

.hero-copy h1 { color: var(--parchment); }

.hero-copy .lede { color: #C9C2B4; }

.hero-actions { display: flex; gap: 16px; margin-top: 2em; flex-wrap: wrap; }

.hero-visual {
  position: relative;
  overflow: hidden;
  background: linear-gradient(200deg, var(--ink) 0%, var(--forest-dark) 38%, var(--forest) 62%, var(--gold) 100%);
}

.hero-visual .ridge {
  position: absolute;
  left: -10%;
  right: -10%;
  width: 120%;
}
.hero-visual .ridge-1 { bottom: -4%; fill: var(--forest-dark); opacity: 0.9; }
.hero-visual .ridge-2 { bottom: -12%; fill: var(--forest); opacity: 0.7; }
.hero-visual .ridge-3 { bottom: -18%; fill: var(--ink); opacity: 0.5; }

.hero-visual .author-frame {
  position: absolute;
  bottom: 8%;
  left: 8%;
  right: 8%;
  border: 1px solid var(--line-light);
  padding: 18px;
  color: var(--parchment);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-visual { height: 46vh; }
  .hero-copy { padding: 12vw 7vw; }
}

/* ---------------------------------------------------------------- */
/* Section rhythm                                                     */
/* ---------------------------------------------------------------- */

section { padding: 6.5rem 0; }
.section-tight { padding: 3.5rem 0; }
.section-dark { background: var(--ink); color: var(--parchment); }
.section-dark h2, .section-dark h3 { color: var(--parchment); }
.section-forest { background: var(--forest-dark); color: var(--parchment); }
.section-forest h2, .section-forest h3 { color: var(--parchment); }

.section-head { max-width: 640px; margin-bottom: 3rem; }

/* ---------------------------------------------------------------- */
/* Book index (editorial catalog list, not cards)                     */
/* ---------------------------------------------------------------- */

.book-index { border-top: 1px solid var(--line); }

.book-row {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 2.2rem;
  align-items: center;
  padding: 2.6rem 0;
  border-bottom: 1px solid var(--line);
}

.book-row .cover {
  aspect-ratio: 5 / 7.5;
  background: linear-gradient(160deg, var(--forest) 0%, var(--forest-dark) 100%);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--parchment);
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8rem;
  text-align: center;
  padding: 10px;
  overflow: hidden;
}
.book-row .cover img { width: 100%; height: 100%; object-fit: cover; }

.book-row .meta h3 { margin-bottom: 0.3em; }
.book-row .meta .subtitle { font-family: var(--serif); font-style: italic; color: var(--brown); display: block; margin-bottom: 0.5em; }
.book-row .meta p { color: #47433C; font-size: 0.97rem; }

.book-row .formats { display: flex; flex-direction: column; gap: 0.6rem; align-items: flex-end; min-width: 220px; }
.book-row .price-line { font-size: 0.85rem; color: #5b564c; display: flex; justify-content: space-between; width: 100%; gap: 12px; }
.book-row .price-line strong { color: var(--ink); }

@media (max-width: 720px) {
  .book-row { grid-template-columns: 88px 1fr; }
  .book-row .formats { grid-column: 1 / -1; align-items: stretch; flex-direction: row; flex-wrap: wrap; margin-top: 0.5rem; }
}

/* ---------------------------------------------------------------- */
/* Book detail page                                                   */
/* ---------------------------------------------------------------- */

.book-detail {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 4rem;
  padding: 4rem 0;
}

.book-detail .cover-large {
  aspect-ratio: 5 / 7.5;
  background: linear-gradient(160deg, var(--forest) 0%, var(--forest-dark) 100%);
  border: 1px solid var(--line);
  color: var(--parchment);
  font-family: var(--serif);
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  position: sticky;
  top: 100px;
  align-self: start;
}
.book-detail .cover-large img { width: 100%; height: 100%; object-fit: cover; }

.purchase-box {
  border: 1px solid var(--line);
  padding: 1.6rem;
  margin: 2rem 0;
  background: #fff8;
}
.purchase-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.purchase-option:last-child { border-bottom: none; }
.purchase-option .label { font-weight: 600; }
.purchase-option .price { font-family: var(--serif); font-size: 1.2rem; color: var(--forest-dark); margin-right: 1rem; }

.theme-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1rem 0 2rem; }
.theme-tag {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4em 0.9em;
  border: 1px solid var(--gold);
  color: var(--brown);
  border-radius: 999px;
}

.outline-part { margin-bottom: 1.6rem; }
.outline-part h4 { font-family: var(--serif); font-style: italic; color: var(--forest-dark); margin-bottom: 0.5rem; }
.outline-part ul { margin: 0; padding-left: 1.2rem; }
.outline-part li { margin-bottom: 0.3rem; }

@media (max-width: 800px) {
  .book-detail { grid-template-columns: 1fr; }
  .book-detail .cover-large { position: static; max-width: 260px; margin: 0 auto; }
}

/* ---------------------------------------------------------------- */
/* Theme cards (Society / Power / Faith / Service / Time…)            */
/* ---------------------------------------------------------------- */

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.theme-card {
  background: var(--parchment);
  padding: 2.2rem;
}
.theme-card h3 { margin-bottom: 0.5em; }
.theme-card p { font-size: 0.93rem; color: #4b453c; margin: 0; }

/* ---------------------------------------------------------------- */
/* Shadow -> Light arc (Sorrow / Reflection / Responsibility / Hope)  */
/* ---------------------------------------------------------------- */

.arc {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 2.5rem;
}
.arc-step {
  flex: 1 1 220px;
  padding: 1.6rem 1.8rem;
  border-top: 2px solid var(--line-light);
  position: relative;
}
.arc-step:nth-child(1) { border-top-color: #46433c; }
.arc-step:nth-child(2) { border-top-color: #6b5d47; }
.arc-step:nth-child(3) { border-top-color: var(--brown); }
.arc-step:nth-child(4) { border-top-color: var(--gold); }
.arc-step .word { font-family: var(--serif); font-style: italic; font-size: 1.4rem; display: block; margin-bottom: 0.3rem; }
.arc-step p { font-size: 0.88rem; color: #C9C2B4; margin: 0; }

/* ---------------------------------------------------------------- */
/* Author bio page                                                    */
/* ---------------------------------------------------------------- */

.bio-grid { display: grid; grid-template-columns: 280px 1fr; gap: 3rem; }
.bio-photo {
  aspect-ratio: 4/5;
  background: repeating-linear-gradient(135deg, var(--parchment-deep), var(--parchment-deep) 10px, var(--parchment) 10px, var(--parchment) 20px);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--brown);
  padding: 20px;
}
.bio-photo img { width: 100%; height: 100%; object-fit: cover; }
.bio-section { margin-bottom: 2.2rem; }
.bio-section h3 { color: var(--forest-dark); }

@media (max-width: 760px) { .bio-grid { grid-template-columns: 1fr; } .bio-photo { max-width: 220px; margin: 0 auto; } }

/* ---------------------------------------------------------------- */
/* Posts / blog                                                       */
/* ---------------------------------------------------------------- */

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 2.2rem; }
.post-card { border-top: 1px solid var(--line); padding-top: 1.2rem; }
.post-card .cat { font-size: 0.75rem; font-weight: 600; color: var(--forest); }
.post-card h3 { margin: 0.4em 0; }
.post-card .meta { font-size: 0.8rem; color: #756f63; }

.post-body { max-width: 68ch; margin: 0 auto; }
.post-body p { font-size: 1.05rem; }

/* ---------------------------------------------------------------- */
/* Reviews                                                             */
/* ---------------------------------------------------------------- */

.review { border-top: 1px solid var(--line); padding: 1.4rem 0; }
.review .stars { color: var(--gold); letter-spacing: 2px; }
.review .name { font-weight: 600; font-size: 0.9rem; margin-top: 0.4rem; }

/* ---------------------------------------------------------------- */
/* Forms                                                               */
/* ---------------------------------------------------------------- */

label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], textarea, select {
  width: 100%;
  padding: 0.75em 0.9em;
  border: 1px solid var(--line);
  background: #fffdf9;
  font-family: var(--sans);
  font-size: 0.95rem;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
}
textarea { min-height: 120px; resize: vertical; }
fieldset { border: none; padding: 0; margin: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.mpesa-box {
  background: var(--forest-dark);
  color: var(--parchment);
  padding: 1.6rem;
  border-radius: var(--radius);
  margin: 1.5rem 0;
}
.mpesa-box .number { font-family: var(--serif); font-size: 1.6rem; letter-spacing: 0.02em; margin: 0.3em 0; }
.copy-btn { background: var(--gold); color: var(--ink); border: none; padding: 0.5em 1em; border-radius: var(--radius); cursor: pointer; font-weight: 600; font-size: 0.85rem; }

/* ---------------------------------------------------------------- */
/* Cart / checkout tables                                             */
/* ---------------------------------------------------------------- */

table.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 2rem; }
table.cart-table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: #756f63; border-bottom: 1px solid var(--line); padding-bottom: 0.6rem; }
table.cart-table td { padding: 1rem 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cart-item-title { font-family: var(--serif); font-size: 1.05rem; }
.cart-item-format { font-size: 0.8rem; color: #756f63; }
.qty-input { width: 60px; }
.remove-link { font-size: 0.8rem; color: var(--terracotta); }

.order-summary { border: 1px solid var(--line); padding: 1.6rem; background: #fffdf9; }
.summary-line { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.95rem; }
.summary-line.total { border-top: 1px solid var(--line); margin-top: 0.5rem; padding-top: 1rem; font-family: var(--serif); font-size: 1.3rem; }

/* ---------------------------------------------------------------- */
/* Cards (why read, contact options)                                  */
/* ---------------------------------------------------------------- */

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2rem; }
.simple-card { padding-right: 1rem; }
.simple-card h3 { color: var(--forest-dark); }
.simple-card p { color: #4b453c; font-size: 0.95rem; }

/* ---------------------------------------------------------------- */
/* Footer                                                              */
/* ---------------------------------------------------------------- */

.site-footer { background: var(--ink); color: var(--parchment); padding: 4.5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 3rem; }
.footer-grid h4 { color: var(--parchment); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 1rem; font-family: var(--sans); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 0.6rem; font-size: 0.9rem; color: #C9C2B4; }
.footer-brand { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.3rem; }
.footer-tagline { color: var(--gold); font-size: 0.9rem; margin-bottom: 1.5rem; }
.footer-bottom { border-top: 1px solid var(--line-light); padding-top: 1.5rem; font-size: 0.8rem; color: #94897a; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- */
/* Misc                                                                */
/* ---------------------------------------------------------------- */

.alert { padding: 1rem 1.2rem; border-radius: var(--radius); margin-bottom: 1.5rem; font-size: 0.92rem; }
.alert-success { background: #e4ede4; color: var(--forest-dark); border: 1px solid var(--forest); }
.alert-error { background: #f4e3dd; color: var(--terracotta); border: 1px solid var(--terracotta); }

.badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.25em 0.7em; border-radius: 999px; }
.badge-pending { background: #ece3cf; color: var(--brown); }
.badge-confirmed { background: #dfe9df; color: var(--forest-dark); }
.badge-shipped { background: #dbe6ee; color: #2a4a63; }
.badge-cancelled { background: #f0dad3; color: var(--terracotta); }

.empty-state { text-align: center; padding: 4rem 1rem; color: #756f63; }
