/* ===========================================================
   JOHN PULVER, Author Site
   Dark Cinematic Noir theme
   =========================================================== */

:root {
  --bg: #0b0a0d;
  --bg-alt: #151319;
  --bg-card: #18151d;
  --border: #2b2731;
  --text: #ece6da;
  --text-dim: #9d9689;
  --text-faint: #665f57;
  --accent: #c9a24b;
  --accent-bright: #e3bd63;
  --accent-2: #7c1f2b;
  --accent-2-bright: #a12c3b;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  --radius: 2px;
  --maxw: 1180px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

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

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

p { margin: 0 0 1.1em; color: var(--text); }
p.lede { color: var(--text-dim); }

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

.eyebrow {
  display: inline-block;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 500;
}

.section {
  padding: 96px 0;
  border-top: 1px solid var(--border);
}
.section--tight { padding: 64px 0; }
.section-head { max-width: 640px; margin-bottom: 56px; }
.section-head h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  font-family: var(--sans);
  font-size: 0.94rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  border: 1px solid var(--accent);
  color: var(--accent-bright);
  background: transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn:hover { background: var(--accent); color: #100c05; }

.btn--solid {
  background: var(--accent);
  color: #100c05;
  border-color: var(--accent);
}
.btn--solid:hover { background: var(--accent-bright); border-color: var(--accent-bright); }

.btn--ghost {
  border-color: transparent;
  color: var(--text-dim);
  padding-left: 4px;
  padding-right: 4px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.btn--ghost:hover { border-bottom-color: var(--accent); background: transparent; color: var(--text); }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(11, 10, 13, 0.96);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.logo {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  font-weight: 600;
  color: var(--text);
}
.logo-name { color: var(--text); }
.logo-sub {
  font-family: var(--serif);
  font-size: 1.35rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--accent);
  font-weight: 600;
  margin-top: 1px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 40px;
}
.nav-links {
  display: flex;
  gap: 34px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links > li { position: relative; }
.nav-links a {
  font-family: var(--serif);
  font-size: 1.02rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-dim);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); border-color: var(--accent); }

/* Desktop-only hover dropdown. Scoped with min-width so its higher
   specificity (the :hover pseudo-class) can never leak into and override
   the mobile click-toggle dropdown rules below. */
@media (min-width: 861px) {
  .has-dropdown .dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 10px 0;
    min-width: 190px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: var(--shadow);
  }
  .has-dropdown:hover .dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
}
.dropdown a {
  display: block;
  padding: 9px 20px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.88rem;
}
.dropdown a:hover { color: var(--accent-bright); border: none; background: rgba(201,162,75,0.06); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed;
    inset: 84px 0 0 0;
    background: var(--bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 36px 32px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
  }
  .nav.open { transform: translateX(0); }
  .nav-links { flex-direction: column; gap: 22px; width: 100%; }
  .has-dropdown .dropdown {
    position: static;
    transform: none;
    opacity: 1;
    pointer-events: auto;
    display: none;
    border: none;
    background: none;
    padding: 12px 0 0 16px;
    min-width: 0;
    box-shadow: none;
  }
  .has-dropdown.open .dropdown { display: block; }
  .nav-cta { margin-top: 12px; }
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 90px 0 110px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 64px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  margin-bottom: 22px;
}
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-sub {
  color: var(--text-dim);
  font-size: 1.08rem;
  max-width: 460px;
  margin-bottom: 34px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.hero-cover {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero-cover-frame {
  position: relative;
  width: 320px;
}
.hero-cover-frame img {
  width: 100%;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.hero-cover-badge {
  display: block;
  margin-top: 14px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.92rem;
  color: var(--accent);
}

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-cover { order: -1; margin-bottom: 20px; }
  .hero-cover-frame { width: 220px; }
}

/* ---------------- Book grid ---------------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  align-items: start;
}
@media (max-width: 980px) { .book-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .book-grid { grid-template-columns: 1fr; } }

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.25s ease;
}
.book-card:hover { border-color: var(--accent); }
.book-card-cover { overflow: hidden; aspect-ratio: 2/3; background: #100e13; }
.book-card-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.book-card-body { padding: 22px 20px 26px; }
.book-card-tag { font-family: var(--serif); font-style: italic; font-size: 0.9rem; color: var(--accent); margin-bottom: 6px; display: block; }
.book-card h3 { font-size: 1.25rem; margin-bottom: 8px; }
.book-card p { color: var(--text-dim); font-size: 0.92rem; margin-bottom: 14px; }
.book-card-link { font-size: 0.85rem; color: var(--text); border-bottom: 1px solid var(--accent); padding-bottom: 3px; }

/* ---------------- Book detail page ---------------- */
.book-detail {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 72px;
  align-items: start;
}
@media (max-width: 900px) { .book-detail { grid-template-columns: 1fr; gap: 40px; } }
.book-detail--home { grid-template-columns: 300px 1fr; }
@media (max-width: 700px) { .book-detail--home { grid-template-columns: 1fr; } }
.book-detail-cover img { width: 100%; box-shadow: var(--shadow); border: 1px solid var(--border); }
.book-detail-meta { position: sticky; top: 120px; }
.book-detail h1 { font-size: clamp(2.2rem, 4vw, 3.1rem); margin-bottom: 8px; }
.book-detail .tagline { color: var(--accent); font-family: var(--serif); font-size: 1.3rem; font-style: italic; margin-bottom: 24px; }
.book-award {
  font-family: var(--serif);
  font-style: italic;
  padding: 0 0 4px;
  margin-bottom: 26px;
  font-size: 1.05rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}
.book-award a { color: var(--accent-bright); border-bottom: 1px solid currentColor; }
.book-award strong { color: var(--text); }

blockquote.pullquote {
  border-left: 3px solid var(--accent-2);
  padding: 6px 0 6px 22px;
  margin: 30px 0;
  font-family: var(--serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text);
}
blockquote.pullquote cite {
  display: block;
  margin-top: 10px;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-faint);
}

/* ---------------- About / bio ---------------- */
.bio-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: start;
}
@media (max-width: 860px) { .bio-grid { grid-template-columns: 1fr; } }
.bio-photo img { width: 100%; border: 1px solid var(--border); box-shadow: var(--shadow); }
.bio-photo figcaption { color: var(--text-faint); font-size: 0.82rem; margin-top: 12px; font-style: italic; }
.bio-copy h3 { margin-top: 1.6em; font-size: 1.3rem; color: var(--accent-bright); }

/* ---------------- Blog ---------------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 34px;
  align-items: start;
}
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: border-color 0.25s ease;
}
.post-card:hover { border-color: var(--accent); }
.post-card-img { overflow: hidden; aspect-ratio: 4/3; background: #100e13; }
.post-card-img img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.post-card-body { padding: 22px; }
.post-cat { font-family: var(--serif); font-style: italic; font-size: 0.85rem; color: var(--accent); }
.post-date { color: var(--text-faint); font-size: 0.78rem; margin-left: 10px; }
.post-card h3 { font-size: 1.12rem; margin: 10px 0 8px; }
.post-card p { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0; }

.post-detail { max-width: 720px; margin: 0 auto; }
.post-detail-img { margin-bottom: 40px; border: 1px solid var(--border); }
.post-detail h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.post-detail .post-meta { color: var(--text-faint); font-size: 0.9rem; margin-bottom: 30px; font-style: italic; font-family: var(--serif); }
.post-detail p { font-size: 1.08rem; color: var(--text); }
.post-nav {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  padding-top: 30px;
}
.post-nav a { color: var(--text-dim); font-size: 0.85rem; }
.post-nav a:hover { color: var(--accent); }

/* ---------------- Newsletter / CTA ---------------- */
.cta-band {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 90px 0;
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.9rem, 3.5vw, 2.7rem); max-width: 640px; margin: 0 auto 16px; }
.cta-band p { color: var(--text-dim); max-width: 520px; margin: 0 auto 34px; }
.cta-actions { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }

.newsletter-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 44px;
  max-width: 560px;
  margin: 0 auto;
}
.newsletter-box h3 { font-size: 1.4rem; margin-bottom: 10px; }
.newsletter-box p { color: var(--text-dim); font-size: 0.95rem; }

/* ---------------- Connect page ---------------- */
.connect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}
@media (max-width: 860px) { .connect-grid { grid-template-columns: 1fr; } }
.connect-photo img { border: 1px solid var(--border); box-shadow: var(--shadow); }
.connect-photo figcaption { color: var(--text-faint); font-size: 0.82rem; margin-top: 12px; font-style: italic; }

.social-list { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--border); }
.social-list li { border-bottom: 1px solid var(--border); }
.social-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 4px;
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--text);
  transition: color 0.2s ease, padding-left 0.2s ease;
}
.social-list a:hover { color: var(--accent-bright); padding-left: 8px; }
.social-list a span.arrow { font-family: var(--sans); color: var(--accent); font-size: 1rem; }

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 56px 0 40px;
}
.footer-grid {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 30px;
  margin-bottom: 40px;
}
.footer-logo { font-family: var(--serif); font-size: 1.2rem; }
.footer-social { display: flex; gap: 24px; list-style: none; padding: 0; margin: 0; }
.footer-social a { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-dim); }
.footer-social a:hover { color: var(--accent); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.footer-bottom a { color: var(--text-faint); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------------- Utility / reveal ---------------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

.breadcrumb { font-size: 0.78rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 30px; }
.breadcrumb a:hover { color: var(--accent); }

.tag-nav { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.tag-nav a {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px solid var(--border);
  padding: 7px 14px;
}
.tag-nav a:hover, .tag-nav a.active { color: var(--accent); border-color: var(--accent); }
