/* ──────────────────────────────────────────────────────────
 * Julien St. James — author site
 * Palette: warm ivory bg, deep charcoal text, oxblood accent
 * Type:    EB Garamond (display + body), Inter (UI/meta)
 * ────────────────────────────────────────────────────────── */

:root {
  --bg: #0b0b0b;          /* deep black, not pure */
  --surface: #181818;     /* slightly lifted, for cards */
  --surface-alt: #141414; /* alternating section */
  --text: #f2eee5;        /* warm off-white — easier on the eyes than #fff */
  --muted: #8a8580;       /* neutral warm gray */
  --accent: #d4a76a;      /* warm brass — keeps the cover gradient working */
  --accent-hover: #e2b87f;
  --on-accent: #0b0b0b;   /* black on brass */
  --border: #2a2a2a;
  --max-width: 1100px;
  --radius: 4px;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

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

/* ── Header ───────────────────────────────────────────────── */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 11, 11, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1rem 1.5rem;
  gap: 2rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  white-space: nowrap;
}
.brand:hover { color: var(--accent-hover); text-decoration: none; }

.site-nav {
  display: flex;
  gap: 1.75rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.site-nav-left { justify-content: flex-end; }
.site-nav-right { justify-content: flex-start; }
.site-nav a { color: var(--text); }
.site-nav a:hover { color: var(--accent); text-decoration: none; }

/* ── Hero ─────────────────────────────────────────────────── *
 * Atmospheric backdrop + 3-column featured-book layout (cover |
 * giant gradient title | cover), modeled on kathyreichs.com.
 * Swap `--hero-bg` for an `url()` once you have real artwork. */

.hero {
  position: relative;
  padding: 4rem 0 5rem;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  isolation: isolate;
  --hero-bg: linear-gradient(160deg, #0b0b0b 0%, #1a1410 35%, #3a1f1c 70%, #4a261d 100%);
}

/* Stack of cycling hero photos. main.js sets the src on each layer and
 * toggles .hero-bg-img.is-active to fade between them. */
.hero-bg-stack {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--hero-bg);   /* fallback while images load */
}
.hero-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2.5s ease-in-out;
}
.hero-bg-img.is-active { opacity: 1; }

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.45) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2.5rem;
  align-items: center;
}

/* ── Edition columns (US / UK covers flanking the title) ─── */

.hero-edition {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}
.hero-cover-img {
  aspect-ratio: 2 / 3 !important;
  width: 100%;
  max-width: 180px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.edition-label {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0.6rem 0 0;
  font-weight: 500;
}
.preorder {
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.preorder:hover { color: var(--accent); }

/* ── Title block (center) ─────────────────────────────────── */

.hero-title-block { text-align: center; }
.kicker {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.85;
  margin: 0 0 1.5rem;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  font-weight: 700;
  line-height: 0.95;
  margin: 0 0 1.5rem;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #f5d896 0%, #f59e58 45%, #f7c4a6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero-availability {
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text);
  opacity: 0.85;
  margin: 0;
}

/* ── Buy links ────────────────────────────────────────────── */

.buy-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.buy {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  background: transparent;
}
.buy:hover {
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
}
.buy-links.small .buy {
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
}

/* ── Section shell ────────────────────────────────────────── */

.section {
  padding: 4rem 0;
}
.section-alt {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 2rem;
  margin: 0 0 2rem;
  letter-spacing: -0.01em;
}

/* ── Books grid ───────────────────────────────────────────── */

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.5rem;
}
.book-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1.2rem;
  align-items: start;
}
.book-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0 0 0.2rem;
}
.book-card .book-meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}
.book-card .book-blurb {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ── WIP grid ─────────────────────────────────────────────── */

.wip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.wip-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.4rem;
}
.wip-card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 0.4rem 0 0.5rem;
}
.wip-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
}
.status {
  display: inline-block;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
  font-weight: 500;
}
.status-drafting { background: #2a2a2a; color: #d8d2c4; }
.status-editing  { background: #353535; color: #ece6d6; }
.status-publishing { background: var(--accent); color: var(--on-accent); }

/* ── Sketches (blog-style column) ─────────────────────────── */

.section-lede {
  font-style: italic;
  color: var(--muted);
  margin: -1rem 0 2.5rem;
  max-width: 60ch;
}
.sketch-column {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}
.sketch-entry { display: flex; flex-direction: column; gap: 0.75rem; }
.sketch-image {
  aspect-ratio: 4 / 3 !important;
  width: 100% !important;
}
.sketch-meta {
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.sketch-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0;
  letter-spacing: -0.005em;
}
.sketch-entry p:not(.sketch-meta) {
  margin: 0;
  font-size: 1rem;
  max-width: 62ch;
}
.sketch-more {
  max-width: 720px;
  margin: 2.5rem auto 0;
  font-family: var(--sans);
  font-size: 0.9rem;
}

/* ── About ────────────────────────────────────────────────── */

.about-inner {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 3rem;
  align-items: start;
}
.about-portrait .cover-placeholder { aspect-ratio: 4 / 5; }
.about-text p { max-width: 60ch; }
.about-contact { font-family: var(--sans); font-size: 0.95rem; color: var(--muted); margin-top: 1.5rem; }

/* ── Newsletter ───────────────────────────────────────────── */

.newsletter-inner { text-align: center; }
.newsletter-pitch {
  max-width: 50ch;
  margin: 0 auto 1.5rem;
  color: var(--muted);
}
.newsletter-form {
  display: flex;
  gap: 0.5rem;
  max-width: 460px;
  margin: 0 auto;
}
.newsletter-form input {
  flex: 1;
  font-family: var(--sans);
  font-size: 1rem;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
}
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form button {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.6rem 1.2rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius);
  cursor: pointer;
}
.newsletter-form button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.newsletter-note { font-family: var(--sans); font-size: 0.78rem; color: var(--muted); margin: 1rem 0 0; }

/* ── Footer ───────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 2rem 0;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-nav {
  display: flex;
  gap: 1.25rem;
}
.footer-nav a { color: var(--muted); }
.footer-nav a:hover { color: var(--accent); text-decoration: none; }

/* ── Placeholders for missing imagery ─────────────────────── */

.cover-placeholder {
  background: linear-gradient(135deg, #1f1f1f 0%, #2f2f2f 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  aspect-ratio: 2 / 3;
}
.cover-placeholder.small { width: 110px; }
.cover-placeholder.portrait { aspect-ratio: 4 / 5; }

/* ── Responsive ───────────────────────────────────────────── */

@media (max-width: 860px) {
  .header-inner {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    text-align: center;
  }
  .site-nav-left, .site-nav-right {
    justify-content: center;
  }
  .brand { order: -1; }

  .hero { padding: 2.5rem 0 3rem; }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
  }
  .hero-cover-img { max-width: 160px; }
  .hero-title { font-size: clamp(2.2rem, 12vw, 3.5rem); }

  .about-inner { grid-template-columns: 1fr; gap: 2rem; }
  .about-portrait { max-width: 240px; margin: 0 auto; }
  .book-card { grid-template-columns: 90px 1fr; gap: 1rem; }
  .cover-placeholder.small { width: 90px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
