/* ══════════════════════════════════════════════════
   apes_base.css — Pretentious Apes shared styles
   Used by every page. Pair with:
     apes_chapter.css  → chapter pages
     apes_about.css    → about / static pages
══════════════════════════════════════════════════ */

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

:root {
  --cream:        #faf9f6;
  --white:        #ffffff;
  --ink:          #1a1a1a;
  --ink-soft:     #3a3a3a;
  --muted:        #666;
  --rule:         #d4cfc8;
  --rule-light:   #e8e4df;
  --accent:       #c0392b;
  --nav-bg:       #1a1a1a;
  --nav-fg:       #f0ede8;
  --header-bg:    #f4f1ec;
  --footer-bg:    #1a1a1a;
  --footer-fg:    #b0a898;
  --max-w:        1100px;
  --prose-w:      680px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: inherit; text-decoration: none; }

/* ── Top navigation ── */
.site-nav {
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 2px solid var(--accent);
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}

.nav-brand {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--nav-fg);
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-family: 'Raleway', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--footer-fg);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--nav-fg); }

/* ── Book header — two-column Penguin style ── */
.book-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--rule);
}

.book-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 2.5rem;
  display: flex;
  gap: 3.5rem;
  align-items: flex-start;
}

.book-cover-col {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.25rem;
}

.book-cover-img {
  width: 200px;
  box-shadow: 4px 6px 20px rgba(0,0,0,0.22);
  border: 1px solid var(--rule);
}

.book-details {
  width: 100%;
  border-top: 2px solid var(--ink);
  padding-top: 0.9rem;
}

.book-detail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--rule-light);
  font-size: 0.82rem;
  line-height: 1.4;
}

.detail-label {
  font-family: 'Raleway', sans-serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  min-width: 64px;
}

.detail-value {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.cover-buy-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 0.6rem 0.8rem;
  background: var(--accent);
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.2s, transform 0.1s;
}

.cover-buy-btn:hover {
  background: #a52d22;
  transform: translateY(-1px);
}

.book-meta-col {
  flex: 1;
  padding-top: 0.25rem;
}

.book-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.book-subtitle {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 400;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.book-author {
  font-family: 'Raleway', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.6rem;
}

.book-about {
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
}

.about-text {
  font-size: 1.6rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 0.85rem;
}

.about-text:last-child { margin-bottom: 0; }

/* ── Buy / subscribe strips ── */
.buy-wrap {
  background: var(--header-bg);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  text-align: center;
  padding: 1.6rem 1.5rem;
  margin-bottom: 2px;
}

.buy-label {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.buy-btn {
  display: inline-block;
  padding: 0.65rem 2rem;
  background: var(--ink);
  color: #fff;
  font-family: 'Raleway', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: background 0.2s, transform 0.1s;
}

.buy-btn:hover {
  background: var(--accent);
  transform: translateY(-1px);
}

.buy-sub {
  margin-top: 0.6rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem;
  color: var(--muted);
}

.buy-sub a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.buy-sub a:hover { color: var(--accent); }

/* ── Site footer ── */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-fg);
  padding: 3rem 2rem 0;
  margin-top: 2px;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem 4rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #333;
}

.footer-brand { flex: 1 1 220px; }

.footer-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #e8e4df;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}

.footer-tagline {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--footer-fg);
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.footer-author {
  font-family: 'Raleway', sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #666;
}

.footer-col { flex: 0 1 160px; }

.footer-col-head {
  font-family: 'Raleway', sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e8e4df;
  margin-bottom: 0.8rem;
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: 0.45rem; }

.footer-col a {
  font-family: 'Raleway', sans-serif;
  font-size: 0.78rem;
  color: var(--footer-fg);
  transition: color 0.2s;
}

.footer-col a:hover { color: #fff; }

.footer-base {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.1rem 0 1.4rem;
  font-family: 'Raleway', sans-serif;
  font-size: 0.72rem;
  color: #555;
  text-align: center;
}

/* ── Responsive ── */
@media (max-width: 720px) {
  .book-header-inner {
    flex-direction: column;
    gap: 2rem;
  }

  .book-cover-col {
    flex: none;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .book-cover-img { width: 130px; }
  .book-details   { flex: 1; }
  .nav-links      { gap: 1.2rem; }
}

@media (max-width: 480px) {
  .book-cover-col { flex-direction: column; }
  .book-cover-img { width: 160px; }
  .nav-brand      { font-size: 1rem; }
  .nav-links a    { font-size: 0.7rem; }
}
