/* Tailor's End Press: site styles.
   Palette: cream page, ink text, Suffolk pink accent, gold detail on dark only. */

@font-face { font-family: "EB Garamond"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/eb-garamond-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/eb-garamond-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "EB Garamond"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/eb-garamond-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/source-serif-4-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; font-display: swap; src: url("../fonts/source-serif-4-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Source Sans 3"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2"); }

:root {
  --cream: #F6F2EA;
  --panel: #EDE7DA;
  --ink: #222020;
  --grey: #5A5550;
  --pink: #A5483F;
  --gold: #B28C0B;
  --rule: #D8D0BF;
  --head: "EB Garamond", Garamond, Georgia, serif;
  --body: "Source Serif 4", Georgia, serif;
  --ui: "Source Sans 3", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); font-size: 1.0625rem; line-height: 1.6; }
img { max-width: 100%; height: auto; }
a { color: var(--pink); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.site-header :focus-visible, .contact-band :focus-visible { outline-color: var(--cream); }

.wrap { max-width: 1120px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.muted { color: var(--grey); }
.small { font-size: 0.875rem; }
.skip { position: absolute; left: -999px; top: 0; background: var(--cream); color: var(--ink); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.trap { position: absolute; left: -9999px; height: 0; overflow: hidden; }

h1, h2, h3 { font-family: var(--head); font-weight: 500; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.section-title { font-size: 2.25rem; }
.eyebrow { margin: 0; font-family: var(--ui); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--pink); }
.lede { font-size: 1.1875rem; color: var(--grey); max-width: 40rem; margin: 0; }

/* Beta bar and header */
.site-banner { margin: 0; padding: 6px 24px; text-align: center; background: var(--gold); color: var(--ink); font-family: var(--ui); font-size: 0.875rem; font-weight: 600; }
.site-banner .banner-msg { margin: 0; }
.site-banner .banner-msg[hidden] { display: none; }
.site-banner a { color: inherit; text-decoration: underline; }
/* No message: a thin gold line */
.site-banner:not(:has(.banner-msg:not([hidden]))), .site-banner.is-empty { padding: 0; height: 12px; }
.site-header { background: var(--ink); color: var(--cream); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; padding-top: 20px; padding-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 14px; color: var(--cream); text-decoration: none; font-family: var(--head); font-size: 1.875rem; font-weight: 500; line-height: 1.1; }
.brand:hover, .brand:focus-visible { color: var(--cream); }
.brand img { height: 38px; width: auto; flex: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-family: var(--ui); font-size: 1.0625rem; }
.site-header nav a { color: var(--cream); text-decoration: none; padding: 10px 0; border-bottom: 2px solid transparent; }
.site-header nav a:hover { border-bottom-color: var(--cream); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--gold); }

/* Buttons */
.btn { display: inline-block; background: var(--pink); color: var(--cream); text-decoration: none; font-family: var(--ui); font-size: 1.0625rem; font-weight: 600; padding: 12px 24px; border: 2px solid var(--pink); border-radius: 4px; cursor: pointer; line-height: 1.3; text-align: center; }
.btn:hover { background: var(--ink); border-color: var(--ink); color: var(--cream); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--cream); }
.btn-light { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.btn-light:hover { background: var(--panel); border-color: var(--panel); color: var(--ink); }
.btn-block { display: block; padding: 11px 16px; font-size: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 0; }

/* Home */
.hero { padding-top: 72px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 20px; }
.hero h1 { max-width: 46rem; }
.catalogue { padding-top: 24px; padding-bottom: 64px; }
.catalogue .section-title { border-top: 1px solid var(--rule); padding-top: 28px; margin-bottom: 28px; }
.cards { display: flex; flex-wrap: wrap; gap: 28px; align-items: stretch; }
.card { flex: 1 1 320px; min-width: 0; background: var(--panel); border-radius: 6px; display: flex; flex-direction: column; }
.cover-frame { display: flex; align-items: center; justify-content: center; height: 340px; padding: 24px; }
.cover-frame img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: 0 6px 18px rgba(34, 32, 32, 0.28); }
.card-body { padding: 4px 28px 28px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card h3 { font-size: 1.75rem; line-height: 1.15; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--pink); text-decoration: underline; }
.subtitle { margin: 0; font-style: italic; color: var(--grey); }
.blurb { margin: 0; font-size: 1rem; }
.facts { margin: 0; font-family: var(--ui); font-size: 0.875rem; color: var(--grey); }
.buy { margin-top: auto; padding-top: 8px; display: flex; flex-direction: column; gap: 10px; }
.note { margin: 0; font-family: var(--ui); font-size: 0.875rem; color: var(--grey); }

.band { background: var(--panel); padding: 64px 0; }
.two-col { display: flex; flex-wrap: wrap; gap: 24px 64px; }
.two-col > * { flex: 1 1 340px; min-width: 0; }
.band .two-col > div > p { margin-top: 14px; }
.steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; }
.about-teaser { padding-top: 64px; padding-bottom: 64px; }
.contact-band { background: var(--ink); color: var(--cream); }
.band-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; padding-top: 48px; padding-bottom: 48px; }
.contact-band h2 { font-size: 1.875rem; margin-bottom: 6px; }
.contact-band p { margin: 0; color: #E4DDCF; font-size: 1rem; }

/* Pages */
.page-head { padding-top: 56px; padding-bottom: 28px; display: flex; flex-direction: column; gap: 14px; }
.prose { padding-bottom: 72px; }
.prose > * { max-width: 46rem; }
.prose h2 { font-size: 1.75rem; margin: 32px 0 10px; }
.prose h2:first-child { margin-top: 0; }

/* Book page */
.book-page { padding-top: 32px; padding-bottom: 72px; }
.book-layout { display: flex; flex-wrap: wrap; gap: 40px 64px; align-items: flex-start; margin-top: 20px; }
.book-cover { flex: 1 1 320px; min-width: 0; max-width: 440px; background: var(--panel); border-radius: 6px; padding: 40px; display: flex; align-items: center; justify-content: center; }
.book-cover img { box-shadow: 0 8px 24px rgba(34, 32, 32, 0.3); }
.book-info { flex: 2 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.book-info p { margin: 0; }
.book-info h1 { font-size: clamp(2.2rem, 4.5vw, 3.25rem); }
.book-subtitle { font-size: 1.3125rem; font-style: italic; color: var(--grey); }
.facts-list { margin: 8px 0 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 24px; font-family: var(--ui); font-size: 0.9375rem; border-top: 1px solid var(--rule); padding-top: 18px; }
.facts-list dt { color: var(--grey); }
.facts-list dd { margin: 0; }
.where { background: var(--panel); border-radius: 6px; padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.where h2 { font-size: 1.75rem; }
.where-row { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.where-more { border-top: 1px solid var(--rule); padding-top: 16px; display: flex; flex-direction: column; gap: 10px; font-family: var(--ui); font-size: 1rem; }
.where-more strong { font-weight: 600; }

/* Order form */
.order-layout { display: flex; flex-wrap: wrap; gap: 32px 48px; align-items: flex-start; padding-bottom: 72px; }
.order-form { flex: 2 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; font-family: var(--ui); }
.field-group { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.field-group legend { padding: 0; margin-bottom: 12px; font-family: var(--head); font-size: 1.625rem; font-weight: 500; }
.book-row { background: var(--panel); border-radius: 6px; padding: 14px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.book-row img { width: 56px; height: 64px; object-fit: contain; flex: none; box-shadow: 0 2px 6px rgba(34, 32, 32, 0.3); }
.book-row-text { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; }
.book-row-text label { font-family: var(--head); font-size: 1.375rem; font-weight: 500; line-height: 1.2; }
.qty-wrap { display: flex; align-items: center; gap: 4px; }
.qty-btn { width: 44px; height: 44px; border: 1px solid var(--ink); border-radius: 4px; background: var(--cream); color: var(--ink); font-size: 1.375rem; line-height: 1; cursor: pointer; font-family: var(--ui); }
.qty-btn:hover { background: var(--ink); color: var(--cream); }
.qty { width: 64px; height: 44px; text-align: center; font-family: var(--ui); font-size: 1.25rem; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid #8A8378; border-radius: 4px; }
.qty-wrap .qty { width: 52px; border-color: transparent; background: transparent; -moz-appearance: textfield; appearance: textfield; }
.qty-wrap .qty::-webkit-outer-spin-button, .qty-wrap .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.choice input { width: 20px; height: 20px; accent-color: var(--pink); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input, .field textarea { font-family: var(--ui); font-size: 1.0625rem; color: var(--ink); background: #fff; border: 1px solid #8A8378; border-radius: 4px; padding: 10px 12px; width: 100%; }
.submit-row { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.form-error { margin: 0; padding: 10px 14px; border-left: 4px solid var(--pink); background: var(--panel); font-family: var(--ui); }
.summary { flex: 1 1 280px; min-width: 0; background: var(--panel); border-radius: 6px; padding: 28px; display: flex; flex-direction: column; gap: 14px; font-family: var(--ui); }
.summary h2 { font-size: 1.625rem; }
.summary p { margin: 0; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 1.0625rem; }
.sum-total { border-top: 1px solid #C9C0AD; padding-top: 12px; font-size: 1.25rem; font-weight: 600; }

/* Footer */
.site-footer { background: var(--ink); color: #CFC7B8; font-family: var(--ui); font-size: 0.875rem; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 28px; padding-bottom: 28px; }

@media (max-width: 520px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero { padding-top: 48px; }
  .brand { font-size: 1.5rem; }
  .brand img { height: 32px; }
  .card-body { padding: 4px 20px 24px; }
  .book-cover { padding: 24px; }
  .where { padding: 20px; }
}

/* Look inside (book sample pages) */
.look-inside { margin-top: 56px; border-top: 1px solid var(--rule); padding-top: 32px; display: flex; flex-direction: column; gap: 16px; }
.look-inside h2 { font-size: 1.75rem; }
.look-inside p { margin: 0; }
.thumbs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 16px; }
@media (max-width: 520px) { .thumbs { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; } .thumbs a { padding: 6px; } }
.thumbs a { display: block; background: var(--panel); padding: 8px; border-radius: 4px; }
.thumbs img { display: block; width: 100%; height: auto; box-shadow: 0 2px 8px rgba(34, 32, 32, 0.25); }
.thumbs a:hover { background: #E2DACA; }

.viewer { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; overflow: visible; }
.viewer::backdrop { background: rgba(34, 32, 32, 0.9); }
.viewer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 16px; }
.viewer-img { display: block; width: auto; height: auto; max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); background: #fff; box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5); }
.viewer-bar { display: flex; align-items: center; gap: 10px; color: var(--cream); font-family: var(--ui); }
.viewer-count { min-width: 8.5rem; text-align: center; font-size: 1rem; }
.viewer-btn { min-width: 44px; height: 44px; padding: 0 16px; border: 2px solid var(--cream); border-radius: 4px; background: transparent; color: var(--cream); font-family: var(--ui); font-size: 1rem; font-weight: 600; cursor: pointer; }
.viewer-btn:hover:not(:disabled) { background: var(--cream); color: var(--ink); }
.viewer-btn:disabled { opacity: 0.4; cursor: default; }
.viewer-btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.viewer-close { margin-left: 10px; }

/* "Preview" jump link near the top of a book page */
.preview-link { margin: 0 0 16px; font-family: var(--ui); font-size: 0.9375rem; font-weight: 600; }
.preview-link a { text-decoration: underline; text-underline-offset: 3px; }
.look-inside { scroll-margin-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Collapsible contents list on a book page: styled like the "Preview" link */
.contents { margin: 16px 0 24px; font-family: var(--ui); font-size: 0.9375rem; }
.contents summary { font-weight: 600; color: var(--pink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.contents summary:hover { color: var(--ink); }
.contents ul { margin: 12px 0 0; padding: 0; list-style: none; line-height: 1.6; font-weight: 400; color: var(--ink); }
.contents li ul { margin: 4px 0 6px; padding-left: 1.5em; font-style: italic; }
.contents li { margin-bottom: 6px; }

/* Paperback and hardback buy buttons: equal width, stacked */
.buy-buttons { display: inline-grid; gap: 12px; }

/* Landscape books (e.g. A Man of Perseverance): wider thumbnails */
.thumbs.thumbs-landscape { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
@media (max-width: 520px) { .thumbs.thumbs-landscape { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
