/* ========================================================================
   M.J. Fox / FoxJam Books — Author Site Styles
   Warm & playful rom-com aesthetic
   ======================================================================== */

:root {
  --cream: #FBF6EE;
  --cream-deep: #F4E8DA;
  --blush: #F8DDDD;
  --rose: #D45D79;
  --rose-deep: #B83960;
  --peach: #F4A988;
  --gold: #C9A96E;
  --ink: #2A1F1A;
  --body: #5A4A42;
  --muted: #8B7A6F;
  --line: #E6D9C7;
  --shadow-sm: 0 2px 12px rgba(42, 31, 26, 0.06);
  --shadow-md: 0 12px 40px rgba(42, 31, 26, 0.10);
  --shadow-lg: 0 24px 60px rgba(42, 31, 26, 0.14);
  --radius: 14px;
  --radius-lg: 24px;
  --max: 1180px;
  --serif: "Fraunces", "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--body);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--rose-deep); text-decoration: none; transition: color .2s; }
a:hover { color: var(--rose); }

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.4rem); font-weight: 700; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.2vw, 1.6rem); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--rose);
  font-family: var(--sans);
  margin-bottom: 0.8rem;
  display: inline-block;
}
.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  color: var(--rose-deep);
}

/* ---------- Layout ---------- */
.container { max-width: var(--max); margin: 0 auto; padding: 0 28px; }
section { padding: 88px 0; }
.section-alt { background: var(--cream-deep); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s, background .2s, color .2s;
  text-decoration: none;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--rose);
  color: #fff;
  box-shadow: 0 8px 22px rgba(212, 93, 121, 0.32);
}
.btn-primary:hover {
  background: var(--rose-deep);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(184, 57, 96, 0.40);
}
.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--cream);
}
.btn-amazon {
  background: #FF9900;
  color: #111;
}
.btn-amazon:hover { background: #ffb43a; color: #111; transform: translateY(-2px); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
  max-width: var(--max);
  margin: 0 auto;
}
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  width: 36px; height: 36px;
  background: var(--rose);
  color: #fff;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  font-family: var(--serif);
}
.nav-links { display: flex; gap: 28px; align-items: center; list-style: none; }
.nav-links a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.98rem;
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover { color: var(--rose); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--rose);
  border-radius: 2px;
}
.nav-cta { background: var(--rose); color: #fff !important; padding: 10px 20px; border-radius: 999px; }
.nav-cta:hover { background: var(--rose-deep); }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--ink); border-radius: 2px;
}

@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    flex-direction: column;
    padding: 20px 28px;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    display: none;
  }
  .nav-links.open { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  padding: 100px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  pointer-events: none;
}
.hero::before {
  width: 360px; height: 360px;
  background: var(--blush);
  top: -80px; left: -120px;
}
.hero::after {
  width: 420px; height: 420px;
  background: var(--peach);
  bottom: -160px; right: -140px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 70px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero h1 { margin-bottom: 18px; }
.hero h1 .swash { color: var(--rose); font-style: italic; }
.hero-lead {
  font-size: 1.15rem;
  margin-bottom: 32px;
  max-width: 540px;
  color: var(--body);
}
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stack {
  position: relative;
  height: 520px;
  display: flex; align-items: center; justify-content: center;
}
.hero-stack img {
  position: absolute;
  width: 240px;
  height: auto;
  border-radius: 6px;
  box-shadow: var(--shadow-lg);
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
}
.hero-stack img:nth-child(1) {
  transform: rotate(-8deg) translate(-90px, 10px);
  z-index: 1;
}
.hero-stack img:nth-child(2) {
  transform: rotate(2deg) translate(0, -20px);
  z-index: 3;
  width: 270px;
}
.hero-stack img:nth-child(3) {
  transform: rotate(9deg) translate(90px, 20px);
  z-index: 2;
}
.hero-stack:hover img:nth-child(1) { transform: rotate(-12deg) translate(-110px, 0); }
.hero-stack:hover img:nth-child(3) { transform: rotate(13deg) translate(110px, 10px); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-stack { height: 460px; }
}
@media (max-width: 520px) {
  .hero-stack img:nth-child(1) { width: 180px; transform: rotate(-8deg) translate(-60px, 10px); }
  .hero-stack img:nth-child(2) { width: 200px; transform: rotate(2deg) translate(0, -20px); }
  .hero-stack img:nth-child(3) { width: 180px; transform: rotate(9deg) translate(60px, 20px); }
  .hero-stack { height: 380px; }
}

/* ---------- Section heading ---------- */
.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 56px;
}
.section-head p { color: var(--muted); margin-top: 12px; font-size: 1.05rem; }

/* ---------- Book cards ---------- */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px;
}
.book-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}
.book-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.book-cover {
  aspect-ratio: 2 / 3;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-md);
  background: var(--cream-deep);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-card h3 { margin-bottom: 8px; }
.book-hook {
  color: var(--rose-deep);
  font-style: italic;
  font-family: var(--serif);
  font-size: 1.05rem;
  margin-bottom: 14px;
}
.book-card p { font-size: 0.96rem; margin-bottom: 18px; flex-grow: 1; }
.book-card .btn { align-self: flex-start; }
.book-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.book-tag {
  font-size: 0.74rem;
  background: var(--blush);
  color: var(--rose-deep);
  padding: 4px 12px;
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ---------- Long book entry (books.html) ---------- */
.book-feature {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 56px;
  align-items: start;
  padding: 60px 0;
  border-bottom: 1px solid var(--line);
}
.book-feature:last-child { border-bottom: none; }
.book-feature .cover-wrap {
  position: sticky;
  top: 100px;
}
.book-feature .cover-wrap img {
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
}
.book-feature .desc p { margin-bottom: 14px; }
.book-feature blockquote {
  border-left: 3px solid var(--rose);
  padding: 6px 0 6px 18px;
  margin: 16px 0;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink);
  font-size: 1.05rem;
}
.book-feature blockquote cite {
  display: block;
  font-style: normal;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 6px;
}
.book-feature .meta {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin-top: 22px;
}
@media (max-width: 760px) {
  .book-feature { grid-template-columns: 1fr; gap: 28px; }
  .book-feature .cover-wrap { position: static; max-width: 280px; margin: 0 auto; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 60px;
  align-items: center;
}
.about-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 5;
  background: var(--cream-deep);
}
.about-photo img { width: 100%; height: 100%; object-fit: cover; }
.about-grid p { margin-bottom: 16px; }
@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { max-width: 360px; margin: 0 auto; }
}

/* ---------- Newsletter ---------- */
.newsletter {
  background: linear-gradient(135deg, var(--blush), var(--peach));
  border-radius: var(--radius-lg);
  padding: 64px 48px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}
.newsletter::before {
  content: "♥";
  position: absolute;
  font-size: 240px;
  color: rgba(255,255,255,0.18);
  top: -40px; right: -10px;
  font-family: var(--serif);
  pointer-events: none;
}
.newsletter h2 { color: var(--ink); margin-bottom: 12px; }
.newsletter p { max-width: 520px; margin: 0 auto 28px; color: var(--ink); }
.newsletter-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.newsletter-form input[type="email"] {
  flex: 1 1 240px;
  padding: 14px 20px;
  border-radius: 999px;
  border: 2px solid #fff;
  background: #fff;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow-sm);
}
.newsletter-form input[type="email"]:focus { border-color: var(--rose); }
.newsletter-form button {
  border: none;
}
.newsletter-note {
  font-size: 0.82rem;
  color: var(--ink);
  opacity: 0.75;
  margin-top: 16px;
}

/* ---------- Blog ---------- */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}
.blog-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.blog-thumb {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--blush), var(--peach));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 3rem;
  color: rgba(255,255,255,0.9);
}
.blog-thumb.bg2 { background: linear-gradient(135deg, var(--peach), var(--gold)); }
.blog-thumb.bg3 { background: linear-gradient(135deg, var(--rose), var(--peach)); }
.blog-thumb.bg4 { background: linear-gradient(135deg, var(--gold), var(--blush)); }
.blog-body { padding: 24px 26px 28px; flex: 1; display: flex; flex-direction: column; }
.blog-meta {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.blog-card h3 { font-size: 1.25rem; margin-bottom: 10px; }
.blog-card p { font-size: 0.94rem; flex: 1; }
.blog-card .read-more {
  margin-top: 14px;
  color: var(--rose-deep);
  font-weight: 600;
  font-size: 0.92rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--cream);
  padding: 60px 0 30px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.site-footer h4 {
  color: var(--cream);
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-family: var(--sans);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.site-footer a { color: var(--cream); opacity: 0.78; }
.site-footer a:hover { opacity: 1; color: var(--peach); }
.site-footer ul { list-style: none; }
.site-footer ul li { margin-bottom: 8px; }
.site-footer p { color: var(--cream); opacity: 0.78; font-size: 0.94rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.7;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 30px; }
}

/* ---------- Page header (inner pages) ---------- */
.page-header {
  padding: 80px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--cream-deep), var(--cream));
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--rose), transparent);
}
.page-header h1 { margin-bottom: 14px; }
.page-header p { color: var(--muted); max-width: 620px; margin: 0 auto; font-size: 1.08rem; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.mt-32 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; }
