/* Main design values: change colors, spacing, radius, and max width here first. */
:root {
  --bg: #f1f7ee;
  --bg-alt: #e6f1e2;
  --card: #ffffff;
  --text: #262626;
  --muted: #5f6b63;
  --green: #6faf6f;
  --green-dark: #5f9d5f;
  --green-ink: #3f7f4d;
  --green-soft: #a8d5a2;
  --border: #dbe7d8;
  --cream: #f4efe6;
  --soft: #f0f7ed;
  --shadow: 0 10px 30px rgba(30, 50, 30, 0.08);
  --radius: 8px;
  --radius-sm: 8px;
  --container: 1120px;
}

/* Base reset and default page behavior. */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

/* Shared layout and section typography. */
.container {
  width: min(var(--container), calc(100% - 2rem));
  margin-inline: auto;
}

.narrow {
  width: min(860px, calc(100% - 2rem));
}

.section {
  padding: 58px 0;
}

.alt-bg {
  background: var(--bg-alt);
}

/* Makes nested green sections stretch full-width instead of looking like a framed block. */
.container > .section.alt-bg {
  margin-inline: calc(50% - 50vw);
  padding-inline: max(1rem, calc((100vw - var(--container)) / 2));
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-family: "Playfair Display", serif;
  line-height: 1.12;
}

.section-heading h1 {
  font-size: 3rem;
}

.section-heading h2 {
  font-size: 2.35rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead {
  max-width: 620px;
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 1.05rem;
}

.section-subtitle,
.book-subtitle,
.book-subtitle-lg {
  margin: 8px 0 0;
  color: var(--muted);
}

.book-subtitle,
.book-subtitle-lg {
  font-weight: 700;
}

.book-subtitle-lg {
  font-size: 1.1rem;
  margin-bottom: 14px;
}

/* Reusable card surfaces. */
.card,
.story-card,
.contact-card,
.library-card,
.newsletter-box,
.buy-box,
.info-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.card {
  padding: 22px;
  box-shadow: var(--shadow);
}

/* Sticky header, logo, and navigation buttons. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(241, 247, 238, 0.92);
  border-bottom: 1px solid rgba(219, 231, 216, 0.9);
  backdrop-filter: blur(10px);
}

.nav-wrap {
  width: calc(100% - 1.25rem);
  max-width: none;
  min-height: 92px;
  margin-inline: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(20px, 3vw, 44px);
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
}

.brand img {
  width: 300px;
  height: 78px;
  object-fit: contain;
  object-position: left center;
}

.site-nav {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  align-items: center;
  gap: 10px;
  max-width: 680px;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid #d4e6d0;
  border-radius: 999px;
  background: #e8f3e4;
  color: var(--green-ink);
  font-family: "Playfair Display", serif;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.menu-toggle {
  display: none;
  border: 1px solid var(--green-soft);
  border-radius: var(--radius);
  background: #f8fcf6;
  color: var(--green-ink);
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
}

/* Main button styles used by links, forms, and slider controls. */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 10px 15px;
  cursor: pointer;
  font-weight: 800;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

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

.btn-secondary {
  background: white;
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--soft);
}

.btn-small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.92rem;
}

.btn:disabled,
button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
  transform: none;
}

a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.7;
}

/* Homepage hero area. */
.hero {
  padding-top: 42px;
  padding-bottom: 46px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.65fr);
  gap: 28px;
  align-items: center;
}

.hero-copy h1 {
  max-width: 700px;
  margin: 0 0 14px;
  font-family: "Playfair Display", serif;
  font-size: 3.25rem;
  line-height: 1.06;
}

.hero-actions,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.hero-meta span {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: white;
  padding: 6px 10px;
}

.hero-card {
  max-width: 315px;
  justify-self: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f5fbf3, #eef6ea);
  box-shadow: var(--shadow);
}

.hero-card.has-cover,
.featured-book-cover.has-cover,
.book-cover-panel.has-cover {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.hero-card.has-cover,
.book-cover-panel.has-cover {
  padding: 0;
}

.book-cover {
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border-radius: var(--radius);
}

/* Homepage three-book slider. */
.book-slider {
  position: relative;
}

.book-slider-section {
  padding-top: 30px;
}

.slider-frame {
  min-height: 380px;
  position: relative;
}

.slider-slides {
  position: relative;
  min-height: 380px;
}

.book-slide {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  position: absolute;
  inset: 0;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f5fbf3, #eef6ea);
  box-shadow: var(--shadow);
  min-height: 380px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.book-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.slider-cover {
  min-height: 320px;
  display: grid;
  place-items: center;
  perspective: 900px;
}

.slider-cover.has-cover,
.library-cover.has-cover {
  background: transparent;
  border: 0;
}

.slider-cover img,
.library-cover img,
.book-cover-panel img,
.featured-book-cover img,
.book-cover {
  width: auto;
  border-radius: 4px;
  box-shadow:
    0 18px 34px rgba(30, 50, 30, 0.18),
    0 3px 8px rgba(30, 50, 30, 0.10);
  object-fit: contain;
}

.slider-cover img {
  max-width: 240px;
  max-height: 320px;
  transform: rotateY(-4deg) rotateZ(-0.5deg);
  transform-origin: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.book-slide.is-active .slider-cover img:hover {
  box-shadow:
    0 22px 42px rgba(30, 50, 30, 0.22),
    0 4px 10px rgba(30, 50, 30, 0.12);
  transform: rotateY(-2deg) rotateZ(-0.25deg) translateY(-2px);
}

.slider-copy h3,
.library-copy h3,
.contact-card h2,
.story-card h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
  line-height: 1.18;
}

.slider-copy h3 {
  font-size: 2.2rem;
}

.slider-copy p:last-of-type,
.library-copy p:last-of-type {
  color: var(--muted);
}

/* Compact Amazon-like price option for library cards. */
.book-price {
  display: inline-grid;
  gap: 3px;
  width: fit-content;
  margin: 12px 0 2px;
  min-width: 132px;
  padding: 9px 12px;
  border: 2px solid rgba(63, 127, 77, 0.62);
  border-radius: var(--radius);
  background: #f7fcf5;
  font-family: Arial, Helvetica, sans-serif;
}

.book-price span {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
}

.book-price strong {
  color: var(--text);
  font-size: 1.18rem;
  line-height: 1.1;
}

.slider-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.slider-arrow {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding: 8px 12px;
}

.slider-arrow:hover {
  background: var(--soft);
}

.slider-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c7dcc2;
  cursor: pointer;
}

.slider-dot.is-active {
  background: var(--green);
}

.cover-placeholder {
  width: 100%;
  min-height: 260px;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 22px;
  border: 1px dashed #c7dcc2;
  border-radius: var(--radius);
  background: #f8fcf6;
  color: var(--muted);
  text-align: center;
}

.cover-placeholder span {
  color: var(--text);
  font-family: "Playfair Display", serif;
  font-size: 1.45rem;
  font-weight: 700;
}

.detail-placeholder {
  min-height: 420px;
}

/* Searchable book library and filter controls. */
.book-library {
  scroll-margin-top: 92px;
}

.library-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px 220px;
  gap: 12px;
  margin-bottom: 20px;
}

.library-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.library-controls input,
.library-controls select,
.newsletter-form input {
  min-height: 46px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  padding: 0 13px;
  outline: none;
}

.library-controls input:focus,
.library-controls select:focus,
.newsletter-form input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(111, 175, 111, 0.12);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.library-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.library-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(30, 50, 30, 0.14);
}

.library-card:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(30, 50, 30, 0.14);
}

.library-cover {
  min-height: 250px;
  display: grid;
  place-items: center;
  background: var(--soft);
  border-bottom: 1px solid var(--border);
  padding: 14px;
  position: relative;
}

.library-cover-link {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.library-cover-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(111, 175, 111, 0.24);
}

.library-cover.has-cover {
  min-height: auto;
  padding: 18px 18px 0;
}

.library-cover img {
  max-width: 150px;
  max-height: 240px;
  transition: transform 180ms ease;
}

.library-card:hover .library-cover img,
.library-card:focus-within .library-cover img {
  transform: translateY(-4px);
}

.library-copy {
  display: grid;
  align-content: start;
  padding: 18px;
}

.library-copy h3 {
  font-size: 1.45rem;
}

.library-more {
  justify-content: center;
  margin-top: 22px;
}

.featured-book {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.featured-book-cover {
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f4faef;
}

.featured-book-cover.has-cover {
  padding: 0;
}

.featured-book-cover img {
  max-width: 150px;
  max-height: 235px;
}

.featured-book h3 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 1.6rem;
}

/* Larger Amazon-like selected price option for book detail pages. */
.price-card {
  display: inline-grid;
  gap: 4px;
  width: fit-content;
  margin: 14px 0;
  min-width: 190px;
  padding: 13px 16px;
  border: 2px solid var(--green-ink);
  border-radius: var(--radius);
  background: #f7fcf5;
  box-shadow: none;
  font-family: Arial, Helvetica, sans-serif;
}

.price-label {
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 900;
  line-height: 1;
}

.price-card strong {
  color: var(--text);
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
}

.book-rating,
.book-rating-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 12px 0 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.book-rating strong,
.book-rating-summary strong {
  color: var(--text);
  font-size: 1rem;
}

.book-rating-summary {
  margin-bottom: 18px;
  padding: 10px 12px;
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f7fcf5;
}

.rating-stars,
.review-stars {
  color: #d89b20;
  letter-spacing: 0;
  line-height: 1;
}

.rating-empty {
  color: var(--muted);
  font-weight: 800;
}

.empty-state {
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--muted);
  text-align: center;
}

.review-empty {
  grid-column: 1 / -1;
}

/* Reader reviews: static grid on book pages and rotating carousel on the homepage. */
.reviews-block,
.review-list,
.review-track {
  display: grid;
  gap: 16px;
}

.review-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.review-carousel {
  max-width: 860px;
  margin-inline: auto;
}

.review-track {
  grid-template-columns: 1fr;
}

.review-carousel .review-card {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.review-carousel .review-card.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  visibility: visible;
}

.review-card {
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.review-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.review-topline strong {
  color: var(--text);
  font-size: 1rem;
}

.review-topline span {
  color: var(--green-ink);
  font-weight: 900;
}

.review-stars {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.review-card h3 {
  margin: 0 0 8px;
  font-family: "Playfair Display", serif;
  font-size: 1.45rem;
  line-height: 1.18;
}

.review-meta {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.review-body {
  margin-top: 14px;
}

.review-body p {
  margin: 0 0 12px;
  color: var(--text);
}

.review-body p:last-child {
  margin-bottom: 0;
}

.review-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.review-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.review-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #c7dcc2;
  cursor: pointer;
}

.review-dot.is-active {
  background: var(--green);
}

.review-arrow {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--green-ink);
  cursor: pointer;
  font-family: "Playfair Display", serif;
  font-weight: 800;
  padding: 8px 14px;
}

.review-arrow:hover {
  background: var(--soft);
}

.review-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f7fcf5;
}

.review-sort {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-weight: 800;
}

.review-sort span,
.review-tools-actions span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.review-sort select {
  min-width: 190px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  padding: 10px 12px;
}

.review-tools-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.review-form {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f7fcf5);
  box-shadow: var(--shadow);
}

.review-form-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr;
  gap: 14px;
}

.review-form label,
.review-textarea {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-weight: 800;
}

.review-form small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.review-form input,
.review-form select,
.review-form textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  padding: 12px 13px;
}

.review-form .review-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}

.review-form .review-consent input[type="checkbox"] {
  width: auto;
  min-width: 18px;
  height: 18px;
  padding: 0;
  margin-top: 3px;
  accent-color: var(--green);
}

.review-form textarea {
  resize: vertical;
  min-height: 130px;
}

.review-form input:focus,
.review-form select:focus,
.review-form textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(111, 175, 111, 0.13);
}

.review-form-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.review-form .form-note {
  margin: 0;
}

/* Newsletter and free guide call-to-action blocks. */
.newsletter-box {
  padding: 26px;
  background: linear-gradient(180deg, #ffffff, #f5fbf3);
  box-shadow: var(--shadow);
}

.alt-bg .newsletter-box {
  max-width: var(--container);
  margin-inline: auto;
  padding-block: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.newsletter-box h2 {
  margin: 0 0 8px;
  font-family: "Playfair Display", serif;
  font-size: 2.25rem;
  line-height: 1.12;
}

.newsletter-text {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.newsletter-form {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  margin-top: 18px;
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-note a {
  color: var(--green);
  text-decoration: underline;
}

/* Legal pages (Privacy Policy, etc.) */
.legal-main {
  padding-top: 48px;
  padding-bottom: 72px;
}

.legal-hero {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 28px;
}

.legal-hero h1 {
  margin-bottom: 10px;
}

.legal-hero .section-subtitle {
  margin-top: 0;
}

.legal-updated {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin: 20px auto 0;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.legal-updated-label {
  color: var(--text);
}

.legal-card.card {
  padding: 0;
  overflow: hidden;
}

.legal-toc-intro {
  margin: 0;
  padding: 16px 20px 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.legal-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, var(--soft) 0%, var(--card) 100%);
}

.legal-toc a {
  display: inline-flex;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-ink);
  background: var(--card);
  border: 1px solid var(--border);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.legal-toc a:hover {
  background: var(--green-soft);
  border-color: var(--green);
}

.legal-toc a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(111, 175, 111, 0.22);
}

.legal-sections {
  padding: 6px 20px 22px;
}

.legal-section {
  padding: 22px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 96px;
}

.legal-section:first-child {
  padding-top: 18px;
  border-top: none;
}

.legal-section.is-highlighted {
  animation: legal-section-flash 1.4s ease-in-out forwards;
  border-radius: 12px;
}

@keyframes legal-section-flash {
  0% {
    background-color: rgba(168, 213, 162, 0.42);
  }
  100% {
    background-color: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .legal-section.is-highlighted {
    animation: none;
    background-color: rgba(168, 213, 162, 0.32);
  }
}

.legal-section h2 {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 12px;
  font-family: "Playfair Display", serif;
  font-size: 1.28rem;
  line-height: 1.28;
  color: var(--green-ink);
}

.legal-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  height: 2.35rem;
  margin-top: 2px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--soft);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--green);
  font-family: "Inter", sans-serif;
}

.legal-section p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.65;
}

.legal-section a {
  color: var(--green);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.legal-callout {
  margin: 0;
  padding: 16px 20px 20px;
  border-top: 1px dashed var(--border);
  background: var(--cream);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.legal-actions {
  margin-top: 28px;
  justify-content: center;
}

@media (min-width: 701px) {
  .legal-toc-intro {
    padding: 18px 26px 0;
  }

  .legal-toc {
    padding: 12px 26px 18px;
  }

  .legal-sections {
    padding: 10px 26px 28px;
  }

  .legal-callout {
    padding: 18px 26px 22px;
  }
}

.form-message {
  min-height: 1.2em;
  margin: 10px 0 0;
  font-weight: 800;
}

.form-message.success {
  color: var(--green-dark);
}

.form-message.error {
  color: #b33f3f;
}

.split-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 24px;
  align-items: start;
}

.grid-2,
.grid-3 {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.check-list,
.meta-list {
  margin: 14px 0 0;
  padding-left: 1.1rem;
}

.check-list li,
.meta-list li {
  margin-bottom: 8px;
}

.book-list {
  display: grid;
  gap: 12px;
}

.book-list p {
  margin: 0;
  color: var(--muted);
}

.book-list strong {
  color: var(--text);
}

/* Book detail page layout, cover gallery, metadata, and buy box. */
.book-page-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
  gap: 28px;
  align-items: start;
}

.book-cover-panel {
  padding: 14px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.book-cover-panel img {
  max-width: min(100%, 340px);
  max-height: 560px;
}

.book-cover-gallery {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.book-cover-stage {
  display: grid;
  place-items: center;
}

.book-cover-stage img {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.book-cover-stage img.is-active {
  opacity: 1;
  pointer-events: auto;
}

.cover-gallery-controls {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.cover-gallery-button {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #e8f3e4;
  color: var(--green-ink);
  cursor: pointer;
  font-family: "Playfair Display", serif;
  font-weight: 700;
  padding: 8px 16px;
}

.cover-gallery-button.is-active,
.cover-gallery-button:hover {
  background: var(--green);
  border-color: var(--green);
  color: white;
}

.book-details h1 {
  margin: 0;
  font-family: "Playfair Display", serif;
  font-size: 3rem;
  line-height: 1.08;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.info-item {
  padding: 12px;
}

.info-item .label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

/* Book detail: editions sit below spec cards, separated by a rule (not grid cells). */
.book-editions {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.book-editions-heading {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.book-editions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.edition-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--soft);
  color: var(--green-ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.edition-pill--muted {
  background: var(--card);
  color: var(--muted);
  font-weight: 600;
}

.edition-meta {
  font-size: 0.88rem;
  color: var(--muted);
}

.buy-box {
  margin-top: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.buy-box h2 {
  margin: 0 0 8px;
  font-family: "Playfair Display", serif;
}

.buy-box p {
  margin: 0 0 12px;
  color: var(--muted);
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.book-description {
  margin-top: 18px;
}

.book-description p:first-child {
  margin-top: 0;
  font-weight: 800;
}

.book-description p:last-child {
  margin-bottom: 0;
}

.story-card {
  padding: 18px;
  box-shadow: var(--shadow);
}

.story-card span {
  display: inline-flex;
  margin-bottom: 12px;
  color: var(--green);
  font-weight: 900;
}

.story-card p {
  color: var(--muted);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.contact-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  align-content: start;
  gap: 10px;
  min-height: 100%;
  padding: 20px;
  box-shadow: var(--shadow);
}

.contact-card span {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.contact-card p {
  margin: 0;
  color: var(--muted);
}

.contact-card a {
  width: fit-content;
  align-self: end;
  margin-top: 6px;
  color: var(--green-ink);
  font-weight: 900;
  text-decoration: none;
  border-bottom: 1px solid rgba(63, 127, 77, 0.25);
}

.contact-signup-section {
  padding-top: 24px;
  padding-bottom: 0;
}

.contact-signup-box {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.contact-signup-copy {
  max-width: 760px;
}

.contact-newsletter-form {
  max-width: 720px;
}

/* Footer links and copyright area. */
.site-footer {
  border-top: 1px solid var(--border);
  background: #f3f8f0;
  margin-top: 18px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 24px;
  padding: 30px 0 12px;
}

.footer-grid h3,
.footer-grid h4 {
  margin: 0 0 8px;
  font-family: "Playfair Display", serif;
}

.footer-grid p {
  margin: 0;
  color: var(--muted);
}

.footer-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li {
  margin-bottom: 6px;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  padding: 12px 0 24px;
  color: var(--muted);
  font-size: 0.92rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Reveal animations. JS only adds visibility classes; CSS controls the movement. */
.reveal {
  opacity: 1;
  transform: none;
}

body.reveal-ready .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

body.reveal-ready .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

body.reveal-ready .reveal-left {
  transform: translateX(-42px);
}

body.reveal-ready .reveal-right {
  transform: translateX(42px);
}

body.reveal-ready .reveal-up {
  transform: translateY(28px);
}

body.reveal-ready .reveal-scale {
  transform: scale(0.98);
}

body.reveal-ready .reveal.is-visible.reveal-left,
body.reveal-ready .reveal.is-visible.reveal-right,
body.reveal-ready .reveal.is-visible.reveal-up,
body.reveal-ready .reveal.is-visible.reveal-scale {
  transform: translate(0, 0) scale(1);
}

.delay-1 {
  transition-delay: 0.08s;
}

.delay-2 {
  transition-delay: 0.16s;
}

.delay-3 {
  transition-delay: 0.24s;
}

/* Tablet layout adjustments. */
@media (max-width: 980px) {
  .hero-grid,
  .book-slide,
  .featured-book,
  .library-controls,
  .split-panel,
  .book-page-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-card {
    justify-self: start;
  }

  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .library-grid,
  .story-grid,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slider-frame {
    min-height: 610px;
  }

  .slider-slides,
  .book-slide {
    min-height: 610px;
  }
}

/* Header switches to the mobile menu. */
@media (max-width: 860px) {
  .brand img {
    width: 220px;
    height: 58px;
  }

  .nav-wrap {
    width: calc(100% - 1rem);
    min-height: 76px;
    margin-inline: 0.5rem;
    justify-content: space-between;
    gap: 16px;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .site-nav {
    position: absolute;
    top: 76px;
    right: 0.75rem;
    left: 0.75rem;
    display: none;
    max-width: none;
    flex-direction: column;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    background: #f8fcf6;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 13px 14px;
    font-size: 1.08rem;
    text-align: center;
  }
}

/* Phone layout: simpler animation, stacked grids, and full-width controls. */
@media (max-width: 700px) {
  body {
    padding-top: 0;
  }

  .container,
  .narrow {
    width: min(100% - 1rem, var(--container));
  }

  .section {
    padding: 34px 0;
  }

  .section-heading {
    margin-bottom: 16px;
  }

  .section-heading h1,
  .book-details h1 {
    font-size: 1.95rem;
  }

  .section-heading h2,
  .newsletter-box h2 {
    font-size: 1.72rem;
  }

  .hero {
    padding-top: 26px;
    padding-bottom: 28px;
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(118px, 0.35fr);
    gap: 16px;
    align-items: center;
  }

  .book-slider-section {
    padding-top: 18px;
  }

  .hero-copy h1 {
    margin-bottom: 10px;
    font-size: 2.08rem;
    line-height: 1.08;
  }

  .lead {
    margin-bottom: 16px;
    font-size: 0.98rem;
    line-height: 1.56;
  }

  .brand img {
    width: 190px;
    height: 50px;
  }

  .site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    backdrop-filter: none;
    background: rgba(241, 247, 238, 0.98);
  }

  .nav-wrap {
    width: calc(100% - 1rem);
    min-height: 64px;
    margin-inline: 0.5rem;
    justify-content: space-between;
    gap: 8px;
  }

  .menu-toggle {
    display: inline-flex;
    min-height: 42px;
    padding: 8px 12px;
    font-size: 0.96rem;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    right: 0.5rem;
    left: 0.5rem;
    display: none;
    max-width: none;
    flex-direction: column;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 4px;
    padding: 10px;
    background: #f8fcf6;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .site-nav a {
    padding: 13px 14px;
    font-size: 1.08rem;
    text-align: center;
  }

  .newsletter-form {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 14px;
  }

  .hero-actions .btn {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    padding-inline: 12px;
    font-size: 0.96rem;
    line-height: 1.18;
    text-align: center;
  }

  .newsletter-form .btn,
  .slider-arrow {
    width: 100%;
  }

  .inline-actions .btn {
    width: auto;
  }

  .hero-meta {
    display: none;
  }

  .hero-card {
    display: none;
  }

  .book-cover-panel img {
    max-width: min(100%, 250px);
    max-height: 360px;
  }

  .slider-frame {
    min-height: auto;
  }

  .slider-slides {
    min-height: auto;
  }

  .book-slide {
    position: relative;
    inset: auto;
    display: none;
    min-height: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    transition: none;
  }

  .book-slide {
    gap: 16px;
    padding: 16px;
  }

  .book-slide.is-active {
    display: grid;
  }

  .slider-cover {
    min-height: 230px;
  }

  .slider-cover img,
  .library-cover img {
    max-height: 220px;
  }

  .slider-copy h3 {
    font-size: 1.8rem;
  }

  .slider-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .slider-dots {
    justify-content: center;
    order: -1;
  }

  .library-grid,
  .story-grid,
  .review-list,
  .review-form-grid,
  .grid-2,
  .grid-3,
  .contact-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .library-cover {
    min-height: 220px;
  }

  .newsletter-box,
  .card,
  .review-card,
  .contact-card,
  .story-card {
    padding: 18px;
  }

  body.reveal-ready .reveal,
  body.reveal-ready .reveal-left,
  body.reveal-ready .reveal-right,
  body.reveal-ready .reveal-up,
  body.reveal-ready .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 560px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .hero-copy h1 {
    max-width: 13ch;
    font-size: 2.18rem;
  }

  .lead {
    max-width: 34ch;
  }

  .featured-book-cover {
    justify-self: center;
  }

  .featured-book-cover img {
    max-width: 170px;
    max-height: 260px;
  }

  .book-slide {
    padding: 15px;
  }

  .slider-cover {
    min-height: 210px;
  }
}

@media (max-width: 380px) {
  .brand img {
    width: 168px;
    height: 46px;
  }

  .menu-toggle {
    min-height: 40px;
    padding-inline: 10px;
  }

  .hero-copy h1 {
    font-size: 2rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .review-controls {
    flex-wrap: wrap;
  }

  .review-dots {
    order: -1;
    width: 100%;
  }

  .review-tools,
  .review-tools-actions,
  .review-sort,
  .review-sort select {
    width: 100%;
  }

  .review-tools-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Respect browser-level reduced motion preferences. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  body.reveal-ready .reveal,
  body.reveal-ready .reveal-left,
  body.reveal-ready .reveal-right,
  body.reveal-ready .reveal-up,
  body.reveal-ready .reveal-scale {
    opacity: 1 !important;
    transform: none !important;
  }
}
