/* ==========================================================================
   Patchwork Pages — Site Stylesheet
   Design system based on April's brand style guide:
   colors, fonts, spacing, and type scale all come from that guide.
   Keep this file as the single source of styling truth — every page
   links to it instead of using inline <style> blocks.
   ========================================================================== */

/* ---- Brand tokens (colors, fonts, spacing) --------------------------- */
:root {
  /* Colors — from the Patchwork Pages style guide */
  --color-orange: #E85C0D;   /* primary accent: buttons, key highlights */
  --color-teal: #1F8A8A;     /* secondary: secondary buttons, feature sections */
  --color-lime: #B7D431;     /* playful accent: background blocks, dividers */
  --color-ink: #1E2A38;      /* text / base: headings, body text, footer bg */
  --color-cream: #F4EFE6;    /* main background */
  --color-gold: #E6B84C;     /* accent detail — tiny sparkles/micro-details ONLY */

  --color-cream-text: #FBF8F2; /* cream-tinted text for use on dark/colored backgrounds */
  --color-orange-text: #B04309; /* darker orange for text links — the brand orange
                                   is only ~3:1 on cream, too faint for text;
                                   this is ~5:1 (passes WCAG AA) */

  /* Fonts */
  --font-heading: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-body: "Cormorant Garamond", Georgia, "Times New Roman", serif;

  /* Type scale (per style guide) */
  --size-h1: clamp(2.5rem, 5vw, 4rem);      /* 48–64px */
  --size-h2: clamp(2rem, 3.5vw, 2.5rem);    /* 32–40px */
  --size-h3: clamp(1.5rem, 2.5vw, 1.75rem); /* 24–28px */
  --size-body: 1.25rem;                     /* ~20px — Cormorant's small x-height
                                               needs more size than a sans to
                                               read at the same apparent size */
  --size-small: 1rem;                       /* 16px */

  /* Spacing system */
  --space-section: clamp(3.5rem, 8vw, 7.5rem); /* section padding: 80–120px */
  --space-element: 2rem;                       /* element spacing: 24–40px */
  --space-grid-gap: 1.5rem;                    /* grid gap: 24px */

  --max-width: 1100px;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-cream);
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  font-weight: 500;
  line-height: 1.65;
}

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

a { color: var(--color-orange-text); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--color-ink);
  margin: 0 0 var(--space-element) 0;
}

h1 { font-size: var(--size-h1); }
h2 { font-size: var(--size-h2); }
h3 { font-size: var(--size-h3); }

p { margin: 0 0 1.25rem 0; }
p:last-child { margin-bottom: 0; }

.small { font-size: var(--size-small); }

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

/* ---- Buttons ------------------------------------------------------------
   Primary  -> orange background + cream text
   Secondary-> teal background + cream text
   Outline  -> transparent + ink border
--------------------------------------------------------------------------*/
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--size-small);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.9rem 1.75rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); opacity: 0.92; }
.btn .bi { font-size: 1.15em; line-height: 1; }

.btn-primary {
  background: var(--color-orange);
  color: var(--color-cream-text);
}

.btn-secondary {
  background: var(--color-teal);
  color: var(--color-cream-text);
}

.btn-outline {
  background: transparent;
  color: var(--color-ink);
  border-color: var(--color-ink);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: var(--space-element);
}

/* ---- Header / Nav ------------------------------------------------------ */
.site-header {
  background: var(--color-cream);
  border-bottom: 1px solid rgba(30, 42, 56, 0.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.1rem;
  padding-bottom: 1.1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.5rem;
  color: var(--color-ink);
}
.brand:hover { text-decoration: none; }
.brand-word-accent { color: var(--color-orange); }

.brand-mark {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 1.75rem;
  margin: 0;
  padding: 0;
}

.main-nav a {
  color: var(--color-ink);
  font-size: var(--size-small);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.main-nav a:hover { color: var(--color-orange); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--color-orange); }

.nav-toggle {
  display: none;
  background: none;
  border: 2px solid var(--color-ink);
  border-radius: 8px;
  padding: 0.2rem 0.45rem;
  color: var(--color-ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-cream);
    border-bottom: 1px solid rgba(30, 42, 56, 0.08);
  }
  .main-nav.is-open { display: block; }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }
  .main-nav li { border-top: 1px solid rgba(30, 42, 56, 0.08); }
  .main-nav a { display: block; padding: 1rem 1.5rem; }
}

/* ---- Sections ------------------------------------------------------------
   "Section rotation" per style guide: let one bold color take each section,
   backgrounds mostly cream, never orange+lime+teal together in one block.
--------------------------------------------------------------------------*/
section { padding: var(--space-section) 0; }

.section-cream { background: var(--color-cream); }
.section-lime  { background: var(--color-lime); }
.section-teal  { background: var(--color-teal); color: var(--color-cream-text); }
.section-teal h2, .section-teal h3 { color: var(--color-cream-text); }
.section-orange { background: var(--color-orange); color: var(--color-cream-text); }
.section-orange h2, .section-orange h3 { color: var(--color-cream-text); }
.section-ink { background: var(--color-ink); color: var(--color-cream-text); }
.section-ink h2, .section-ink h3, .section-ink a { color: var(--color-cream-text); }

.eyebrow {
  display: inline-block;
  font-size: var(--size-small);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-teal);
  margin-bottom: 0.75rem;
}

/* ---- Hero ---------------------------------------------------------------*/
.hero {
  text-align: center;
  padding-top: calc(var(--space-section) * 0.8);
}
/* The <h1> is the stacked wordmark image; alt text carries "Patchwork Pages". */
.hero-lockup {
  max-width: 420px;
  margin: 0 auto 1.5rem;
}
.hero-lockup img { width: 100%; }
.hero p.lede {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  font-size: 1.4rem;
}
.hero .btn-row { justify-content: center; }

/* ---- Placeholders (NO AI-generated imagery — swap these for real photos
   and real cover art. Hand-coded dashed boxes, nothing generated.) -------*/
.placeholder {
  border: 2px dashed rgba(30, 42, 56, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  color: var(--color-ink);
  padding: 1.5rem;
}
.placeholder svg { opacity: 0.6; }
.placeholder .placeholder-label {
  font-size: var(--size-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.placeholder-photo { aspect-ratio: 1 / 1; width: 100%; max-width: 320px; margin: 0 auto; }
.placeholder-cover { aspect-ratio: 3 / 4; width: 100%; }

/* ---- Real photos (replace the placeholders above once art/photos exist) - */
.author-photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  object-fit: cover;
  border-radius: 12px;
}
.book-cover {
  aspect-ratio: 3 / 4;
  width: 100%;
  object-fit: cover;
  border-radius: 12px;
}

/* ---- Grids ---------------------------------------------------------------*/
.grid {
  display: grid;
  gap: var(--space-grid-gap);
  align-items: start; /* cards size to their own content, not the tallest sibling */
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.about-split {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-element);
  align-items: center;
}
@media (max-width: 720px) {
  .about-split { grid-template-columns: 1fr; }
}
/* Long bios: pin the photo to the top instead of centering it on the text */
.about-split-top { align-items: start; }

/* ---- Full bio (about page) ----------------------------------------------*/
.bio-beat {
  font-style: italic;
  font-weight: 600;
  font-size: 1.4rem;
}
.bio-motto {
  margin-top: 1.5rem;
  padding-left: 1.25rem;
  border-left: 4px solid var(--color-orange);
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.4;
}
.bio-motto p:last-child { margin-bottom: 0; }
.bio-tagline {
  color: var(--color-teal);
  font-style: italic;
  font-weight: 600;
  font-size: 1.4rem;
}

/* ---- Featured book (cover + details side by side) ------------------------*/
.book-feature {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-element);
  align-items: center;
}
@media (max-width: 720px) {
  .book-feature { grid-template-columns: 1fr; }
  .book-feature .book-cover { max-width: 260px; margin: 0 auto; }
}

/* ---- Cards ---------------------------------------------------------------*/
.card {
  background: var(--color-cream);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 0 rgba(30, 42, 56, 0.06);
}
.card h3 { margin-bottom: 0.25rem; }
.card p { flex-grow: 1; }

/* ---- Compact "coming soon" cards (no cover art yet) -----------------------*/
.card-compact {
  padding: 1.25rem;
  gap: 0.6rem;
}
.card-compact h3 { margin-bottom: 0; }

.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  align-self: flex-start;
  font-size: var(--size-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-teal);
  background: rgba(31, 138, 138, 0.12);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
}

.book-genre {
  font-size: var(--size-small);
  font-style: italic;
  color: rgba(30, 42, 56, 0.75);
}

/* ---- Lists (e.g. "why these books are for you") --------------------------*/
.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, 1fr);
}
@media (max-width: 600px) { .check-list { grid-template-columns: 1fr; } }
.check-list li { display: flex; align-items: flex-start; gap: 0.85rem; }
.check-list .bi {
  color: var(--color-ink);
  font-size: 1.4rem;
  line-height: 1.2;
  flex-shrink: 0;
}
.audience-closer {
  margin-top: var(--space-element);
  max-width: 720px;
  font-style: italic;
  font-size: 1.35rem;
}

/* Contact details with a leading icon (contact page) */
.contact-list {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}
.contact-list li { display: flex; align-items: center; gap: 0.85rem; overflow-wrap: anywhere; }
.contact-list .bi { color: var(--color-teal); font-size: 1.4rem; flex-shrink: 0; }

/* ---- Retailer / "Buy List" badges -----------------------------------------*/
.retailer-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: var(--space-element) 0 0;
  padding: 0;
}
.retailer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  border: 2px solid var(--color-ink);
  font-weight: 600;
  font-size: var(--size-small);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-ink);
}
.retailer-badge:hover { background: var(--color-ink); color: var(--color-cream-text); text-decoration: none; }

/* ---- Newsletter / contact form --------------------------------------------*/
.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  max-width: 480px;
  margin: var(--space-element) auto 0;
}
.form-row input,
.form-row textarea,
.contact-form input,
.contact-form textarea {
  font-family: var(--font-body);
  font-size: var(--size-body);
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 2px solid var(--color-ink);
  background: var(--color-cream-text);
  color: var(--color-ink);
  flex: 1 1 220px;
}
.form-row textarea,
.contact-form textarea { width: 100%; min-height: 140px; resize: vertical; }
.contact-form input { width: 100%; }
.contact-form label { display: block; margin-bottom: 0.35rem; }
.contact-form { max-width: 480px; margin: var(--space-element) auto 0; display: grid; gap: 1rem; text-align: left; }
.contact-form label { font-weight: 700; font-size: var(--size-small); text-transform: uppercase; letter-spacing: 0.06em; }
.contact-form .btn { justify-self: start; }
.form-note { color: var(--color-ink); }

/* ---- Footer ---------------------------------------------------------------*/
.site-footer {
  background: var(--color-ink);
  color: var(--color-cream-text);
  padding: var(--space-element) 0;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.footer-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
/* The wordmark ships in ink; invert it to cream-white for the dark footer. */
.footer-mark { width: 240px; filter: brightness(0) invert(1); opacity: 0.95; }
.footer-note { color: rgba(251, 248, 242, 0.7); font-size: var(--size-small); }

/* Page links over social icons. Both rows use the same three equal-width
   columns, so each icon sits centered under the word above it. */
.footer-nav { --footer-col: 5.5rem; display: flex; flex-direction: column; gap: 0.85rem; }
.footer-links,
.footer-social {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, var(--footer-col));
  justify-items: center;
  align-items: center;
  margin: 0;
  padding: 0;
}
.footer-links a { color: var(--color-cream-text); font-size: var(--size-small); }
.footer-social a { display: block; color: var(--color-cream-text); font-size: 1.4rem; line-height: 1; }
.footer-social a:hover { color: var(--color-orange); text-decoration: none; }

/* Mobile: everything centered, links + icons first, logo + copyright last. */
@media (max-width: 600px) {
  .site-footer .container { flex-direction: column; align-items: center; gap: 1.75rem; }
  .footer-nav { order: 1; }
  .footer-brand { order: 2; align-items: center; text-align: center; }
}

/* ---- Brand seal as artwork (404 page, About page) --------------------------*/
.seal-art {
  width: min(240px, 55vw);
  height: auto;
  margin: var(--space-element) auto;
}
/* Left-aligned variant, for use above a heading in a left-aligned section. */
.seal-art-sm { width: min(140px, 35vw); margin: 0 0 1.25rem; }

/* ---- Utility --------------------------------------------------------------*/
.text-center { text-align: center; }
.text-teal { color: var(--color-teal); }
.mt-0 { margin-top: 0; }
.stack { display: flex; flex-direction: column; gap: var(--space-element); }
.stack-tight { gap: 1rem; }
