/* Sanctorum Press — stylesheet
   Edit colors and type in the :root block below. Everything else follows from it. */

:root {
  --paper:      #faf8f4;
  --paper-warm: #f3eee5;
  --ink:        #211d18;
  --ink-soft:   #4a4139;
  --muted:      #7a6f63;
  --line:       #e4dcd0;
  --accent:     #7c1d24;
  --accent-dk:  #5d151b;
  --gold:       #a8873f;

  --display: "Cormorant Garamond", "Hoefler Text", Garamond, "Times New Roman", serif;
  --body:    "EB Garamond", Garamond, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --ui:      -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --measure: 68ch;
  --shell:   1040px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 19px;
  line-height: 1.62;
  font-feature-settings: "liga" 1, "onum" 1;
}

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dk); }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: 24px;
}

/* ---------- masthead ---------- */

.masthead {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  padding: 26px 0 22px;
  text-align: center;
}

.wordmark {
  font-family: var(--display);
  font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  display: inline-block;
}

.masthead nav {
  margin-top: 12px;
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.masthead nav a {
  color: var(--muted);
  text-decoration: none;
  margin: 0 12px;
  display: inline-block;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}

.masthead nav a:hover { color: var(--accent); border-bottom-color: var(--gold); }

/* ---------- hero ---------- */

.hero {
  padding: clamp(48px, 8vw, 88px) 0 clamp(40px, 6vw, 64px);
  text-align: center;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.4rem);
  line-height: 1.15;
  margin: 0 auto 20px;
  max-width: 20ch;
  color: var(--ink);
}

.hero p {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--ink-soft);
  font-size: 1.06rem;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 26px auto 0;
  max-width: 260px;
  color: var(--gold);
}

.ornament::before,
.ornament::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.ornament span { font-size: 0.7rem; letter-spacing: 0.3em; }

/* ---------- section headers ---------- */

.section { padding: clamp(48px, 7vw, 76px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.section--warm { background: var(--paper-warm); }

.eyebrow {
  font-family: var(--ui);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
  text-align: center;
}

.section h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem);
  text-align: center;
  margin: 0 0 8px;
}

.section-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.98rem;
  margin: 0 auto clamp(32px, 5vw, 52px);
  max-width: 52ch;
}

/* ---------- book cards ---------- */

.books { display: grid; gap: clamp(30px, 4vw, 46px); }

.book {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: clamp(22px, 3.5vw, 40px);
  align-items: start;
  padding-bottom: clamp(30px, 4vw, 46px);
  border-bottom: 1px solid var(--line);
}

.books .book:last-child { border-bottom: 0; padding-bottom: 0; }

/* Default cover box suits 3D mockup images (transparent or white background):
   the art is fitted whole, never cropped. Set "cover_style": "flat" on a book
   in books.json when the image is a flat front-cover scan and you want it
   framed edge to edge with a drop shadow. */
.book__cover {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* mockup renders keep their natural proportions; the ones with a painted
   background get softened corners so they sit on the page like a photo */
.book__cover img {
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 290px;   /* keeps a portrait mockup the same visual size as a landscape one */
  border-radius: 4px;
}

/* the fallback needs a fixed shape, since there is no image to size it */
.book__cover:has(.cover-fallback) { aspect-ratio: 2 / 3; }

.book__cover--flat {
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(33, 29, 24, .10),
              0 10px 26px -12px rgba(33, 29, 24, .40);
}

.book__cover--flat img { object-fit: cover; }

/* typographic fallback used when no cover image file is present */
.cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  padding: 22px 16px 16px;
  border-radius: 2px;
  background: linear-gradient(160deg, #6f1a21 0%, #4d1218 100%);
  color: #f6ecd8;
  box-shadow: 0 1px 2px rgba(33, 29, 24, .10),
              0 10px 26px -12px rgba(33, 29, 24, .40);
}

.cover-fallback__rule { height: 1px; background: rgba(246, 236, 216, .45); margin: 0 auto; width: 46px; }

.cover-fallback__title {
  font-family: var(--display);
  font-size: 1.02rem;
  line-height: 1.25;
  font-weight: 600;
  margin: 14px 0;
  hyphens: auto;
}

.cover-fallback__imprint {
  font-family: var(--ui);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: .8;
}

.book__title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.45rem, 1.1rem + 1.3vw, 1.9rem);
  line-height: 1.2;
  margin: 0 0 6px;
}

.book__subtitle {
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 16px;
}

.book__blurb { margin: 0 0 14px; color: var(--ink-soft); max-width: var(--measure); }

.book__for {
  margin: 0 0 20px;
  color: var(--muted);
  font-style: italic;
  font-size: 0.96rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.btn {
  display: inline-block;
  font-family: var(--ui);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 2px;
  border: 1px solid var(--accent);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.btn--primary { background: var(--accent); color: #fdf8f2; }
.btn--primary:hover { background: var(--accent-dk); border-color: var(--accent-dk); color: #fdf8f2; }

.btn--ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-dk); background: rgba(124, 29, 36, .04); }

.tag {
  display: inline-block;
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
}

/* ---------- forthcoming series ---------- */

.series__intro { max-width: 60ch; margin: 0 auto clamp(30px, 4vw, 44px); text-align: center; color: var(--ink-soft); }
.series__intro em { color: var(--muted); }

.volumes { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(22px, 3vw, 36px); }

.volume {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 26px;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  align-items: start;
}

.volume .cover-fallback,
.volume .book__cover--flat { box-shadow: 0 1px 2px rgba(33,29,24,.10), 0 6px 16px -10px rgba(33,29,24,.35); }

.volume__number {
  font-family: var(--ui);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 6px;
}

.volume h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.22rem;
  line-height: 1.25;
  margin: 0 0 10px;
}

.volume p { margin: 0; font-size: 0.96rem; color: var(--ink-soft); }

/* ---------- about + footer ---------- */

.about p { max-width: 58ch; margin: 0 auto; text-align: center; color: var(--ink-soft); }

.contact-line { text-align: center; margin-top: 26px; font-family: var(--ui); font-size: 0.8rem; letter-spacing: 0.06em; }

/* ---------- social ---------- */

.social { text-align: center; margin: 28px 0 0; }

.social__link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--ui);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: border-color .15s ease, color .15s ease;
}

.social__link:hover { color: var(--accent); border-color: var(--accent); }
.social__icon { width: 20px; height: 20px; flex: none; }

.social__link--footer { border: 0; padding: 0; color: var(--muted); letter-spacing: 0.1em; font-size: 0.72rem; }
.social__link--footer:hover { color: var(--accent); }
.social__link--footer .social__icon { width: 16px; height: 16px; }

/* shown only when contact_mode is "form" in books.json */
.contact-form {
  max-width: 30rem;
  margin: 32px auto 0;
  display: grid;
  gap: 16px;
  text-align: left;
}

.contact-form label {
  display: grid;
  gap: 6px;
  font-family: var(--ui);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea {
  font-family: var(--body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 11px 13px;
  width: 100%;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

.contact-form textarea { resize: vertical; min-height: 7rem; }

.contact-form button { cursor: pointer; font-family: var(--ui); justify-self: start; }

/* honeypot: hidden from people, catches naive spam bots */
.contact-form input[name="_gotcha"] {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 38px 0 46px;
  text-align: center;
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--paper-warm);
}

.site-footer p { margin: 6px 0; }

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .book { grid-template-columns: minmax(0, 260px) 1fr; }
}

@media (max-width: 720px) {
  body { font-size: 18px; }
  /* stack: image full width above the text */
  .book { grid-template-columns: 1fr; gap: 20px; }
  .book__cover:has(.cover-fallback) { max-width: 200px; }
  .volumes { grid-template-columns: 1fr; }
  .masthead nav a { margin: 0 8px; }
}

@media (max-width: 480px) {
  .volume { grid-template-columns: 1fr; }
  .volume .book__cover { max-width: 110px; }
}

@media print {
  .masthead nav, .actions { display: none; }
  body { background: #fff; font-size: 12pt; }
}
