/* ============================================================
   Lillian Andrews — Author Website Stylesheet
   Brand: Enchanted Forest (Brighter) | Cinzel + Crimson Pro
   ============================================================ */

/* ----------------------------------------------------------
   Custom Properties
   ---------------------------------------------------------- */
:root {
  /* Six-role brand palette (WCAG 2.1 AA verified) */
  --color-primary:    #267A52;
  --color-primary-dark: #1d5c3e;
  --color-secondary:  #6FA06A;
  --color-accent:     #F0A12E;
  --color-accent-dark: #c97f10;
  --color-bg:         #FBF9F0;
  --color-text:       #232B26;
  --color-muted:      #DCE0D4;

  /* Typography */
  --font-heading: 'Cinzel', 'Trajan Pro', Georgia, serif;
  --font-body:    'Crimson Pro', Georgia, 'Times New Roman', serif;

  /* Type scale */
  --text-h1:      3rem;      /* 48px */
  --text-h2:      2.25rem;   /* 36px */
  --text-h3:      1.5rem;    /* 24px */
  --text-h4:      1.25rem;   /* 20px */
  --text-body:    1.125rem;  /* 18px */
  --text-caption: 0.875rem;  /* 14px */
  --text-eyebrow: 0.75rem;   /* 12px */

  /* Spacing (8px base) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */
  --space-16: 4rem;    /* 64px */
  --space-24: 6rem;    /* 96px */

  /* Layout */
  --max-width: 1080px;
  --max-prose:  42rem;  /* ~65–70ch for Crimson Pro at 18px */

  /* Corner radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-cover: 6px;

  /* Shadows */
  --shadow-subtle:    0 1px 3px rgba(35, 43, 38, .12);
  --shadow-card:      0 6px 16px rgba(35, 43, 38, .12);
  --shadow-cover:     0 12px 30px rgba(35, 43, 38, .35);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
}

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

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover { color: var(--color-primary-dark); }

/* ----------------------------------------------------------
   Accessibility
   ---------------------------------------------------------- */

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-2);
  z-index: 9999;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-body);
  border-radius: var(--radius-md);
  text-decoration: none;
}
.skip-link:focus {
  left: var(--space-4);
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Focus indicators (WCAG 2.1 AA: 3px gold, 2px offset) */
:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* Touch targets: min 44×44px */
a, button, input, select, textarea, [role="button"] {
  min-height: 44px;
}
nav a, .btn { min-height: 44px; min-width: 44px; }

/* ----------------------------------------------------------
   Typography
   ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.15;
  color: var(--color-text);
}

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

.eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-primary);
}

p { max-width: var(--max-prose); }
p + p { margin-top: var(--space-4); }

/* ----------------------------------------------------------
   Layout Utilities
   ---------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.section {
  padding-block: var(--space-16);
}

.section--alt {
  background-color: #F2F0E6;
}

.section--dark {
  background-color: var(--color-primary);
  color: #fff;
}

.section--dark h2,
.section--dark h3,
.section--dark p,
.section--dark .eyebrow { color: #fff; }

.section--dark .eyebrow { opacity: 0.8; }

.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-header h2 { margin-top: var(--space-2); }

/* ----------------------------------------------------------
   Buttons
   ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-heading);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.btn-primary:hover {
  background-color: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

.btn-accent {
  background-color: var(--color-accent);
  color: var(--color-text);
  border-color: var(--color-accent);
}
.btn-accent:hover {
  background-color: var(--color-accent-dark);
  border-color: var(--color-accent-dark);
  color: var(--color-text);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.btn-outline:hover {
  background-color: var(--color-primary);
  color: #fff;
}

.btn-outline-light {
  background-color: transparent;
  color: #fff;
  border-color: rgba(255,255,255,0.7);
}
.btn-outline-light:hover {
  background-color: rgba(255,255,255,0.15);
  color: #fff;
  border-color: #fff;
}

/* ----------------------------------------------------------
   Site Header & Navigation
   ---------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(35, 43, 38, .25);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: var(--space-6);
}

.site-logo {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 500;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.05em;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-logo:hover { color: var(--color-accent); }

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-2) var(--space-3);
  font-family: var(--font-heading);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background-color 0.15s;
  min-height: 44px;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: #fff;
  background-color: rgba(255,255,255,0.12);
}

.site-nav a[aria-current="page"] {
  color: var(--color-accent);
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: var(--space-2);
  min-height: 44px;
  min-width: 44px;
}

/* ----------------------------------------------------------
   Hero Section
   ---------------------------------------------------------- */
.hero {
  position: relative;
  background-color: var(--color-primary);
  color: #fff;
  padding-block: var(--space-24);
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1d5c3e 0%, #267A52 50%, #1a4a32 100%);
  opacity: 0.6;
  pointer-events: none;
}

/* Subtle sparkle-dots texture */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(240,161,46,0.15) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.hero .container { position: relative; z-index: 1; }

.hero .eyebrow { color: var(--color-accent); margin-bottom: var(--space-4); }

.hero h1 {
  color: #fff;
  font-size: clamp(2rem, 5vw, var(--text-h1));
  margin-bottom: var(--space-4);
}

.hero .tagline {
  font-family: var(--font-body);
  font-size: clamp(1.125rem, 2.5vw, 1.5rem);
  color: rgba(255,255,255,0.88);
  max-width: 38rem;
  margin-inline: auto;
  margin-bottom: var(--space-8);
  font-style: italic;
}

.hero-ctas {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* ----------------------------------------------------------
   Book Grid & Cards
   ---------------------------------------------------------- */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-8);
}

.book-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

.book-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-cover);
}

.book-card__cover {
  display: block;
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  border-radius: var(--radius-cover) var(--radius-cover) 0 0;
}

.book-card__body {
  padding: var(--space-6);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.book-card__series {
  font-family: var(--font-heading);
  font-size: var(--text-eyebrow);
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: var(--space-2);
}

.book-card__title {
  font-size: var(--text-h3);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.book-card__desc {
  font-size: 1rem;
  color: var(--color-text);
  opacity: 0.85;
  flex: 1;
  margin-bottom: var(--space-4);
  max-width: none;
}

.book-card__ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* Individual book page */
.book-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-12);
  align-items: start;
}

.book-detail__cover {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-cover);
}

.book-detail__meta { margin-bottom: var(--space-6); }
.book-detail__title { margin-bottom: var(--space-2); }
.book-detail__series { margin-bottom: var(--space-6); }

.book-detail__desc p { max-width: var(--max-prose); margin-bottom: var(--space-4); }

.buy-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

/* ----------------------------------------------------------
   Series Intro (homepage)
   ---------------------------------------------------------- */
.series-intro {
  text-align: center;
  max-width: 42rem;
  margin-inline: auto;
  margin-bottom: var(--space-12);
}

/* ----------------------------------------------------------
   Author Bio Snippet (homepage)
   ---------------------------------------------------------- */
.author-snippet {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-12);
  align-items: center;
}

.author-snippet__photo {
  width: 100%;
  border-radius: 50%;
  aspect-ratio: 1/1;
  object-fit: cover;
  box-shadow: var(--shadow-card);
  border: 4px solid var(--color-muted);
}

.author-snippet__photo--placeholder {
  background: var(--color-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  width: 220px;
  height: 220px;
}

.author-snippet__text h2 { margin-bottom: var(--space-4); }
.author-snippet__text p  { margin-bottom: var(--space-6); }

/* ----------------------------------------------------------
   About Page
   ---------------------------------------------------------- */
.about-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--space-12);
  align-items: start;
}

.about-photo {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-cover);
}

.about-photo--placeholder {
  width: 280px;
  height: 360px;
  background: var(--color-muted);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  opacity: 0.6;
  font-family: var(--font-body);
  font-style: italic;
  text-align: center;
  padding: var(--space-6);
}

.about-bio h2 { margin-bottom: var(--space-6); }
.about-bio p  { margin-bottom: var(--space-6); }

/* ----------------------------------------------------------
   Contact Page
   ---------------------------------------------------------- */
.contact-layout {
  max-width: 42rem;
}

.contact-layout h2 { margin-bottom: var(--space-6); }
.contact-layout p  { margin-bottom: var(--space-6); }

.contact-email-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-h3);
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: var(--space-8);
}
.contact-email-link:hover { color: var(--color-primary-dark); }

/* ----------------------------------------------------------
   Newsletter Section
   ---------------------------------------------------------- */
.newsletter-section {
  background-color: var(--color-primary);
  color: #fff;
  padding-block: var(--space-12);
  text-align: center;
}

.newsletter-section h2 {
  color: #fff;
  margin-bottom: var(--space-4);
}

.newsletter-section p {
  color: rgba(255,255,255,0.88);
  max-width: 32rem;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.newsletter-form {
  display: flex;
  gap: var(--space-3);
  justify-content: center;
  flex-wrap: wrap;
  max-width: 480px;
  margin-inline: auto;
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 200px;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-body);
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  color: #fff;
}

.newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,0.5); }

.newsletter-form input[type="email"]:focus {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-color: transparent;
}

.newsletter-placeholder {
  border: 2px dashed rgba(255,255,255,0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  max-width: 480px;
  margin-inline: auto;
  color: rgba(255,255,255,0.6);
  font-style: italic;
  font-size: 0.95rem;
}

/* MailerLite form — site-styled override */
.newsletter-ml-wrap {
  max-width: 560px;
  margin-inline: auto;
  margin-top: var(--space-8);
}

.newsletter-section small {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-caption);
  color: rgba(255,255,255,0.6);
  font-style: italic;
}

/* Inputs row + button below */
.newsletter-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.newsletter-field { min-width: 0; }

.newsletter-fields .btn {
  grid-column: 1 / -1;
  width: 100%;
  justify-content: center;
}

.newsletter-form input[type="text"],
.newsletter-form input[type="email"] {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-body);
  background: rgba(255,255,255,0.12);
  border: 2px solid rgba(255,255,255,0.35);
  border-radius: var(--radius-md);
  color: #fff;
  min-height: 44px;
}

.newsletter-form input[type="text"]::placeholder,
.newsletter-form input[type="email"]::placeholder {
  color: rgba(255,255,255,0.55);
}

.newsletter-form input[type="text"]:focus,
.newsletter-form input[type="email"]:focus {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
  border-color: transparent;
  background: rgba(255,255,255,0.18);
}

/* Opt-in checkbox row */
.newsletter-optin {
  margin-bottom: var(--space-4);
}

.newsletter-checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--space-3);
  cursor: pointer;
  font-size: var(--text-caption);
  color: rgba(255,255,255,0.8);
  line-height: 1.4;
  text-align: left;
}

.newsletter-checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.1);
  cursor: pointer;
  margin-top: 2px;
  position: relative;
  flex-shrink: 0;
}

.newsletter-checkbox input[type="checkbox"]:checked {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.newsletter-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--color-text);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.newsletter-checkbox input[type="checkbox"]:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

/* reCAPTCHA container */
.newsletter-recaptcha {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-4);
}

/* Success message */
.newsletter-success {
  padding: var(--space-8);
}

.newsletter-success__msg {
  font-family: var(--font-heading);
  font-size: var(--text-h3);
  color: var(--color-accent);
  max-width: none;
  margin-inline: auto;
}

@media (max-width: 480px) {
  .newsletter-fields { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------
   Footer
   ---------------------------------------------------------- */
.site-footer {
  background-color: var(--color-text);
  color: rgba(255,255,255,0.75);
  padding-block: var(--space-12);
}

.site-footer .container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-8);
  align-items: center;
}

.footer-brand .site-logo {
  font-size: 1rem;
  display: block;
  margin-bottom: var(--space-2);
}

.footer-brand .tagline-small {
  font-style: italic;
  font-size: var(--text-caption);
  color: rgba(255,255,255,0.5);
}

.footer-nav {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.footer-nav a {
  font-family: var(--font-heading);
  font-size: var(--text-eyebrow);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
}
.footer-nav a:hover { color: var(--color-accent); }

.footer-bottom {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.1);
  text-align: center;
  font-size: var(--text-caption);
  color: rgba(255,255,255,0.4);
}

/* ----------------------------------------------------------
   Page Hero (inner pages)
   ---------------------------------------------------------- */
.page-hero {
  background-color: var(--color-primary);
  color: #fff;
  padding-block: var(--space-12);
  text-align: center;
}

.page-hero h1 {
  color: #fff;
  font-size: clamp(1.75rem, 4vw, var(--text-h1));
}

.page-hero .eyebrow {
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.page-hero p {
  color: rgba(255,255,255,0.85);
  max-width: 38rem;
  margin-inline: auto;
  margin-top: var(--space-4);
}

/* ----------------------------------------------------------
   Divider / Sparkle Accent
   ---------------------------------------------------------- */
.divider-sparkle {
  text-align: center;
  color: var(--color-accent);
  font-size: 1.25rem;
  margin-block: var(--space-8);
  letter-spacing: 0.5rem;
  user-select: none;
}

/* ----------------------------------------------------------
   Books listing page
   ---------------------------------------------------------- */
.books-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-16);
}

.book-listing {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-8);
  align-items: start;
}

.book-listing:nth-child(even) .book-listing__cover-col { order: 2; }
.book-listing:nth-child(even) .book-listing__text-col  { order: 1; }

.book-listing__cover {
  width: 100%;
  border-radius: var(--radius-cover);
  box-shadow: var(--shadow-cover);
}

.book-listing__text-col h3 { margin-bottom: var(--space-2); }
.book-listing__text-col .eyebrow { margin-bottom: var(--space-3); }
.book-listing__text-col p { margin-bottom: var(--space-6); }

/* ----------------------------------------------------------
   Responsive Breakpoints
   ---------------------------------------------------------- */

/* Tablet (768px) */
@media (max-width: 768px) {
  :root {
    --text-h1: 2.25rem;
    --text-h2: 1.75rem;
  }

  .book-detail,
  .about-layout,
  .author-snippet,
  .book-listing {
    grid-template-columns: 1fr;
  }

  .book-listing:nth-child(even) .book-listing__cover-col,
  .book-listing:nth-child(even) .book-listing__text-col { order: unset; }

  .book-detail__cover,
  .about-photo {
    max-width: 260px;
    margin-inline: auto;
  }

  .author-snippet__photo,
  .author-snippet__photo--placeholder {
    margin-inline: auto;
  }

  .author-snippet__text { text-align: center; }

  .site-footer .container {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-nav { justify-content: center; }

  .nav-toggle { display: flex; }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background-color: var(--color-primary-dark);
    flex-direction: column;
    padding: var(--space-4);
    gap: var(--space-1);
    z-index: 99;
  }

  .site-nav.is-open { display: flex; }
  .site-nav a { width: 100%; justify-content: center; }
}

/* Mobile (375px) */
@media (max-width: 480px) {
  .container { padding-inline: var(--space-4); }

  .section { padding-block: var(--space-12); }

  .hero { padding-block: var(--space-16); }

  .book-grid { grid-template-columns: 1fr; }

  .buy-buttons,
  .book-card__ctas,
  .hero-ctas { flex-direction: column; align-items: stretch; }

  .btn { justify-content: center; }
}
