.book-offer {
  background: #f9f5f1;
  border-block: 1px solid #e9dfd7;
  padding-block: clamp(2rem, 5vw, 4.5rem);
}

.book-offer-inner, .book-samples-inner, .edition {
  max-width: 1080px;
}

.book-offer-heading { margin-bottom: clamp(1.25rem, 3vw, 2.1rem); }
.book-offer-heading h1 {
  font-size: clamp(2.2rem, 5vw, 3.75rem);
  text-wrap: initial;
}
.book-offer-heading p { margin-top: .35rem; color: var(--muted); }

.book-samples-section { padding-block: clamp(2.25rem, 5.5vw, 4.5rem); }
.book-samples-section h2 { margin-bottom: 1.1rem; font-size: clamp(1.9rem, 4vw, 2.9rem); text-wrap: initial; }
.book-sample-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.edition-blue { --edition-ink: #2b4565; --edition-paper: #f0f3f8; --edition-line: #d8e1eb; }
.edition-rose { --edition-ink: #74394d; --edition-paper: #f8eff2; --edition-line: #ebdce1; }

.book-sample {
  display: grid;
  grid-template-columns: minmax(65px, 8rem) minmax(0, 1fr);
  align-items: center;
  gap: .8rem;
  padding: .9rem;
  border: 1px solid var(--edition-line);
  border-radius: 8px;
  background: var(--edition-paper);
}

.book-sample > a { display: block; border: 1px solid var(--edition-line); border-radius: 4px; overflow: hidden; }
.book-sample img { aspect-ratio: 4 / 5; object-fit: contain; background: #fff; }
.book-sample strong { font: 650 clamp(1.03rem, 2vw, 1.28rem)/1.2 var(--serif); }
.book-sample .sample-note { font-size: .94rem; line-height: 1.4; }
.book-sample .text-link { color: var(--edition-ink); }

.edition { padding-block: .5rem 3rem; }
.edition-main { display: grid; gap: 1rem; }
.edition-intro h1 {
  font-size: clamp(1.85rem, 7.6vw, 3.5rem);
  line-height: 1.08;
  text-wrap: initial;
}
.edition-format { margin-top: .45rem; color: var(--muted); }
.edition-photo {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}
.reader-frame {
  position: relative;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
}
.reader-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.reader-frame .is-outgoing { position: absolute; inset: 0; pointer-events: none; }
.reader-controls {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr) minmax(80px, 1fr);
  align-items: center;
  gap: .35rem;
  text-align: center;
  color: var(--muted);
  font-size: .875rem;
}
.reader-layout button {
  min-height: 44px;
  padding: .3rem .55rem;
  background: transparent;
  color: var(--dark);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 650;
}
.reader-layout button:disabled { opacity: .55; cursor: default; }
.edition-purchase { display: grid; gap: .5rem; }
.edition-purchase .price { font-size: 1.75rem; line-height: 1.1; }
.edition-purchase button { background: transparent; }
.edition-reading {
  border-top: 1px solid var(--line);
  margin-top: clamp(1.5rem, 4vw, 2.6rem);
  padding-top: clamp(1.25rem, 3vw, 2rem);
}
.edition-reading h2 { font-size: clamp(1.65rem, 4vw, 2.45rem); }
.edition-copy-body, .edition-specs {
  max-width: 60ch;
  font-size: max(17px, 1.0625rem);
  line-height: 1.65;
  text-align: left;
}
.edition-copy-body { margin-top: .85rem; color: var(--dark); }
.edition-copy-body h3 { margin-top: 1.15rem; font-size: 1.2rem; }
.edition-copy-body ul { margin: .45rem 0 0; padding-inline-start: 1.35em; }
.edition-copy-body li + li { margin-top: .45rem; }
.edition-copy-body li::marker { color: var(--accent); }
.edition-specs {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.edition-specs h3 { font-size: 1.2rem; }
.edition-specs dl { margin: .45rem 0; }
.edition-specs dl div { display: flex; flex-wrap: wrap; gap: 0 .35em; }
.edition-specs dt { font-weight: 650; }
.edition-specs dd { margin: 0; }
.edition-specs p { color: var(--muted); }

@media (min-width: 741px) {
  .edition-main {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    grid-template-areas: "gallery intro" "gallery purchase";
    grid-template-rows: auto 1fr;
    align-items: start;
    column-gap: clamp(1.5rem, 5vw, 4rem);
  }
  .edition-intro { grid-area: intro; margin-top: 1rem; }
  .edition-photo { grid-area: gallery; }
  .edition-purchase { grid-area: purchase; max-width: 330px; }
}

html:has(#sample-dialog[open]) { overflow: hidden; }
#sample-dialog {
  width: min(calc(100% - .75rem), 760px);
  max-width: none;
  max-height: calc(100dvh - .75rem);
  border-radius: 9px;
}
.reader-layout { display: grid; gap: .45rem; padding: clamp(.5rem, 2vw, 1rem); }
.reader-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.reader-header h2 { margin: 0; font-size: 1.35rem; }
.reader-frame {
  width: 100%;
  height: min(70dvh, max(120px, calc(100dvh - 11rem)));
  background: #efede9;
  border-radius: 4px;
  overscroll-behavior: contain;
}
.reader-frame.is-zoomed { overflow: auto; touch-action: auto; }
.reader-frame.is-zoomed img { width: 180%; max-width: none; height: auto; }
#sample-zoom { justify-self: center; padding-inline: .9rem; }
#sample-error { text-align: center; font-size: .875rem; }

@media (max-width: 530px) {
  .book-offer { padding-block: 1.1rem 1.8rem; }
  .book-offer-heading { margin-bottom: .7rem; }
  .book-sample-grid { grid-template-columns: 1fr; }
  .book-sample { grid-template-columns: 82px minmax(0, 1fr); }
}

.purchase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(.75rem, 2vw, 1.35rem);
}
.purchase-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: .8rem;
  padding: clamp(.8rem, 2.5vw, 1.4rem);
  border: 1px solid var(--edition-line, #d6a9b0);
  border-radius: 12px;
  background: var(--paper);
}
.purchase-kit { box-shadow: inset 0 3px 0 var(--accent); }
.purchase-covers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .35rem;
  min-height: 160px;
  padding: .6rem;
  border-radius: 8px;
  background: var(--edition-paper, #fbf2f3);
}
.purchase-covers img {
  width: min(100%, 125px);
  border-radius: 3px;
}
.purchase-kit .purchase-covers img { width: min(48%, 104px); }
.purchase-card-copy h2 {
  font-size: clamp(1.2rem, 2.4vw, 1.62rem);
  text-wrap: initial;
}
.purchase-card-copy > p { margin-top: .35rem; color: var(--muted); font-size: .95rem; }
.purchase-price strong { color: var(--accent); font-size: 1.35rem; white-space: nowrap; }
.purchase-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .15rem .55rem;
}
#kit-savings { white-space: nowrap; }
.purchase-actions { display: grid; justify-items: stretch; }
.purchase-actions .text-link { justify-content: center; }
.purchase-status, .payment-note {
  text-align: center;
  color: var(--muted);
  margin: .85rem 0 0;
  font-size: .93rem;
}
.payment-note {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: .45rem;
  margin: 1rem 0 0;
}
.payment-note img { width: 16px; }
@media (max-width: 740px) {
  .shop-page .wrap { width: calc(100% - 1.75rem); }
  .shop-page .site-nav { min-height: 56px; }
  .shop-page .site-nav .brand { font-size: 1.1rem; }
  .shop-page .site-nav .brand img { width: 27px; }
  .shop-page .nav-actions { gap: .7rem; }

  .book-offer { padding-block: 1.3rem 1.5rem; }
  .book-offer-heading h1 { font-size: clamp(1.85rem, 5.5vw, 2.55rem); }
  .book-offer-heading { margin-bottom: .9rem; }
  .purchase-grid { grid-template-columns: minmax(0, 1fr); gap: .75rem; }
  .purchase-card {
    grid-template-columns: clamp(88px, 27vw, 132px) minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
    gap: .65rem .8rem;
    padding: .8rem;
  }
  .purchase-kit { grid-template-columns: minmax(0, 1fr); }
  .purchase-covers {
    padding: 0;
    min-height: 0;
    background: transparent;
  }
  .purchase-covers img { width: 100%; border-radius: 6px; }
  .purchase-kit .purchase-covers {
    padding: .65rem;
    gap: .55rem;
    background: #f9f0ef;
  }
  .purchase-kit .purchase-covers img { width: min(40%, clamp(84px, 25vw, 116px)); }
  .purchase-card-copy { align-self: center; min-width: 0; }
  .purchase-card-copy h2 { font-size: clamp(1.13rem, 4.3vw, 1.48rem); }
  .purchase-card-copy > p { line-height: 1.35; }
  .purchase-card-copy .purchase-price { margin-top: .45rem; }
  .purchase-price strong { font-size: clamp(1.22rem, 4.6vw, 1.45rem); }
  #kit-savings { color: var(--accent); }
  .purchase-actions {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: .5rem;
  }
  .purchase-actions .button { min-height: 44px; padding: .5rem; }
  .purchase-actions .text-link { padding-inline: .35rem; white-space: nowrap; }
  .payment-note { margin-top: .85rem; }

  .book-samples-section, .shop-page .author-story, .shop-page .delivery-section .section,
  .shop-page .help { padding-block: 1.45rem; }
  .book-samples-section h2, .shop-page .author-story h2,
  .shop-page .delivery-section h2, .shop-page .help h2 { font-size: clamp(1.55rem, 5.1vw, 2rem); }
  .book-samples-section h2 { margin-bottom: .75rem; }
  .book-sample-grid { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
  .book-sample { grid-template-columns: 68px minmax(0, 1fr); gap: .65rem; padding: .65rem; }
  .book-sample .sample-note { margin-top: .2rem; }
  .shop-page .section-heading { margin-bottom: .7rem; }
  .shop-page .author-story { gap: 0; }
  .shop-page .author-story p, .shop-page .delivery-steps p { font-size: 1rem; line-height: 1.45; }
  .shop-page .delivery-steps { gap: .75rem; }
  .shop-page .delivery-steps h3 { margin-bottom: .15rem; }
  .shop-page .faq summary { padding-block: .7rem; }
}

@media (max-width: 355px) {
  .shop-page .site-nav .brand { font-size: 1rem; }
  .shop-page .site-nav .brand img { width: 23px; }
  .shop-page .site-nav .nav-actions { gap: .4rem; }
}
