/* ==========================================================================
   Z. A. Aweke — author site
   Direction: "Detective's Notebook"
   Colors and fonts are defined once in the :root block below.
   Fonts (Fraunces + Nunito) load from Google Fonts in each page's <head>.
   ========================================================================== */

/* ---------- Theme A (default): Detective's Notebook ---------- */
:root {
  --bg: #fbf6ea;          /* notebook paper */
  --bg-alt: #f3ead2;      /* darker paper band */
  --surface: #ffffff;
  --ink: #1f2a44;         /* navy ink */
  --ink-soft: #46516d;
  --accent: #ffd84d;      /* highlighter yellow */
  --accent-ink: #1f2a44;  /* text on accent */
  --pop: #c93a3a;         /* red-pen */
  --line: #e0d4b4;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(31, 42, 68, 0.12);
}

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}
h1 { font-size: clamp(2.2rem, 6vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 700; }

p { margin: 0 0 1em; }
a { color: var(--ink); text-decoration-color: var(--pop); text-underline-offset: 3px; }
a:hover { color: var(--pop); }

:focus-visible {
  outline: 3px solid var(--pop);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: var(--bg);
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap { width: min(1080px, 100% - 2rem); margin-inline: auto; }
.narrow { width: min(720px, 100% - 2rem); margin-inline: auto; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--bg);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 0.75rem;
}
.brand {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.4rem;
  text-decoration: none;
  color: var(--ink);
}
.brand span {
  background: linear-gradient(transparent 55%, var(--accent) 55%);
  padding: 0 0.15em;
}
.site-nav ul {
  list-style: none;
  display: flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  display: block;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}
.site-nav a:hover { background: var(--bg-alt); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  background: var(--ink);
  color: var(--bg);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: var(--bg); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { color: var(--accent-ink); }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { color: var(--ink); background: var(--bg-alt); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.25rem; }

/* ---------- Hero ---------- */
.hero { padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(2rem, 6vw, 3.5rem); }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
.eyebrow {
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: var(--pop);
  margin-bottom: 0.75rem;
}
.lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 34rem; }
.hl { background: linear-gradient(transparent 58%, var(--accent) 58%); padding: 0 0.1em; }

@media (min-width: 800px) {
  .hero .wrap { grid-template-columns: 1.2fr 0.8fr; }
}

/* ---------- Book image (transparent cut-out of the paperback mockup) ---------- */
.book-mock {
  width: min(360px, 84%);
  height: auto;
  margin-inline: auto;
  filter: drop-shadow(0 20px 18px rgba(31, 42, 68, 0.28));
}

/* ---------- Sections ---------- */
.section { padding: clamp(2.5rem, 6vw, 4rem) 0; }
.section.alt { background: var(--bg-alt); }
.section-title { text-align: center; margin-bottom: 2rem; }

.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.grid-3 { display: grid; gap: 1.25rem; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card h3 { margin-bottom: 0.4rem; }
.card p:last-child { margin-bottom: 0; }

/* ---------- Author bio ---------- */
.bio-layout { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 800px) { .bio-layout { grid-template-columns: 0.9fr 1.1fr; } }
.bio-photo { margin: 0; }
.bio-photo img {
  width: 100%;
  border-radius: var(--radius);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 var(--accent);
}
.bio-text h2 { margin-bottom: 0.6em; }

/* ---------- Book page ---------- */
.book-layout { display: grid; gap: 2.5rem; align-items: start; }
@media (min-width: 800px) { .book-layout { grid-template-columns: 0.8fr 1.2fr; } }
.book-sub { font-size: 1.25rem; color: var(--ink-soft); font-style: italic; margin-bottom: 1rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0; margin: 0 0 1.25rem; list-style: none; }
.tags li {
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
}
.buy-box {
  background: var(--surface);
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}
.buy-box h2 { font-size: 1.3rem; margin-bottom: 0.25rem; }
.buy-box .btn-row { margin-top: 0.75rem; }
.small { font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- Contact form ---------- */
.form-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: clamp(1.25rem, 4vw, 2rem); }
.field { margin-bottom: 1.15rem; }
label { display: block; font-weight: 800; margin-bottom: 0.3rem; }
input[type="text"], input[type="email"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
}
textarea { min-height: 9rem; resize: vertical; }
.hp { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; } /* spam honeypot */
.form-status { margin-top: 1rem; font-weight: 700; min-height: 1.5em; }
.form-status.ok { color: #1c6b3a; }
.form-status.err { color: var(--pop); }
.note {
  background: var(--bg-alt);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--bg);
  padding: 2rem 0;
  margin-top: 2rem;
  font-size: 0.95rem;
}
.site-footer a { color: var(--bg); text-decoration-color: var(--accent); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn:hover { transition: none; transform: none; }
}
