/* antepub.org: a printed catalogue on white paper.
   Paper #fff, ink #000, the ark's red #961819, leader grey #9a9a9a. */
@font-face { font-family: "EB Garamond"; src: url(fonts/eb-garamond-400-normal.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(fonts/eb-garamond-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(fonts/eb-garamond-600-normal.woff2) format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --paper: #fff;
  --ink: #000;
  --red: #961819;
  --leader: #9a9a9a;
  --rule: #d0d0d0;
  --measure: 42rem;
  --wide: 56rem;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { font-size: 125%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; padding: 0 1rem;
  background: var(--paper); color: var(--ink);
  font: 400 1rem/1.5 "EB Garamond", "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  font-variant-numeric: oldstyle-nums;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--red); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* Title page */
.mast { max-width: var(--measure); margin: 0 auto; padding: 4.5rem 0 2rem; text-align: center; border-bottom: 3px double var(--red); }
.mast h1 {
  margin: 0; font-weight: 400; font-size: clamp(1.7rem, 7.2vw, 3.1rem); line-height: 1.12;
  text-transform: uppercase; letter-spacing: .14em; margin-right: -.14em;
  font-variant-numeric: lining-nums;
}
.mast h1 span { display: block; font-size: .62em; letter-spacing: .32em; margin: .5em -.32em 0 0; }
.mast .tag { margin: 1.4rem 0 0; font-style: italic; font-size: 1.15rem; }
.mast .ark { display: block; width: 9rem; height: 4.6rem; object-fit: cover; object-position: 50% 52%; margin: 1.6rem auto 0; }

/* Book pages: a running head instead of the title page */
.mast.mini { padding: 1.6rem 0 1rem; border-bottom: 1px solid var(--red); }
.mast.mini a { display: flex; justify-content: space-between; align-items: baseline; text-decoration: none; }
.mast.mini .name { text-transform: uppercase; letter-spacing: .14em; font-size: .95rem; }
.mast.mini .name span { color: var(--red); }
.mast.mini .back { font-style: italic; font-size: .95rem; color: var(--red); }
.mast.mini .back::before { content: "\2190\00a0"; font-style: normal; }
main.single { margin-top: 1rem; }
main.single .book { border-top: 0; }
.shelf.more { margin-top: 2.6rem; padding-top: 2rem; border-top: 1px solid var(--ink); }
.shelf.more h2 { margin: 0 0 1.2rem; text-align: center; font-weight: 400; font-style: italic; font-size: 1.15rem; }
.shelf.more ol { grid-template-columns: repeat(7, 1fr); }
.text h2 a { text-decoration: none; }
.text h2 a:hover { color: var(--red); }

/* Preface */
.about { max-width: 34rem; margin: 2.4rem auto 0; }
.about p { margin: 0; }
.about p + p { text-indent: 1.4em; }
.about p:first-child::first-letter { color: var(--red); font-size: 3.1em; float: left; line-height: .8; margin: .08em .08em 0 0; }

/* The shelf: every cover, linking to its entry */
.shelf { max-width: var(--wide); margin: 2.8rem auto 0; }
.shelf ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 1.1rem; }
.shelf a { display: block; text-decoration: none; text-align: center; }
.shelf img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); transition: transform .15s, box-shadow .15s; }
.shelf a:hover img { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.shelf span { display: block; margin-top: .45rem; font-size: .72rem; line-height: 1.25; font-variant-caps: small-caps; letter-spacing: .03em; }

/* Each book's editions */
.buy { list-style: none; margin: 0; padding: 0; }
.buy a { display: flex; align-items: baseline; gap: .45em; text-decoration: none; padding: .12em 0; }
.dots { flex: 1 1 1.5rem; min-width: 1.5rem; border-bottom: 1px dotted var(--leader); transform: translateY(-.28em); }
.price { white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.buy a:hover .dots { border-bottom-color: var(--red); }
.buyhead { margin: 1.2rem 0 .2rem !important; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }

/* Catalogue entries */
main:not(.home), .catalogue { max-width: var(--measure); margin: 3rem auto 0; }
.book { display: grid; grid-template-columns: 12rem 1fr; column-gap: 2rem; padding: 2.6rem 0; border-top: 1px solid var(--ink); scroll-margin-top: 1rem; }
.cover { display: block; align-self: start; }
.cover img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.text h2 { margin: -.2rem 0 0; font-weight: 400; font-size: 1.75rem; line-height: 1.15; }
.by { margin: .25rem 0 .9rem; font-style: italic; }
.text p { margin: 0; }
.text .contents { margin-top: .7rem; font-size: .85rem; line-height: 1.45; color: #333; }
.buy { max-width: 24rem; }
.buy .price { font-weight: 600; color: var(--red); }

/* Pages from the book */
.pages { --pw: min(var(--wide), calc(100vw - 3rem)); grid-column: 1 / -1; width: var(--pw); margin: 2rem calc((100% - var(--pw)) / 2) 0; }
.pages figcaption { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .6rem; font-style: italic; font-size: .9rem; }
.pages figcaption::after { content: ""; flex: 1; border-bottom: 1px solid var(--rule); transform: translateY(-.3em); order: 1; }
.ink { order: 2; font: inherit; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; font-style: italic; text-decoration: underline; text-decoration-color: var(--rule); text-decoration-thickness: 1px; text-underline-offset: .18em; }
.ink:hover { color: var(--red); }
.pages figcaption { flex-wrap: wrap; column-gap: 1.2rem; }
.shuffle { order: 2; font: inherit; color: var(--red); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.4rem; }
.strip a { display: block; cursor: zoom-in; }
.strip img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); box-shadow: 0 1px 3px rgba(0,0,0,.08); transition: box-shadow .15s; }
.strip a:hover img { box-shadow: 0 3px 12px rgba(0,0,0,.18); }

/* Page viewer */
.viewer { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; width: 100%; height: 100%; overflow: hidden; }
.viewer::backdrop { background: rgba(20,20,20,.86); }
.viewer figure { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1rem 3.4rem; }
.viewer img { display: block; max-width: 100%; max-height: calc(100% - 2.4rem); width: auto; height: auto; background: #fff; box-shadow: 0 6px 30px rgba(0,0,0,.5); }
.viewer figcaption { margin-top: .6rem; color: #eee; font-style: italic; font-size: .9rem; }
.viewer button { position: absolute; font: 400 2.2rem/1 "EB Garamond", Georgia, serif; color: #eee; background: none; border: 0; cursor: pointer; padding: .4rem .8rem; }
.viewer button:hover { color: #fff; }
.viewer .prev { left: 0; top: 50%; transform: translateY(-50%); }
.viewer .next { right: 0; top: 50%; transform: translateY(-50%); }
.viewer .close { right: 0; top: 0; }

/* Floating currency menu, top right */
.currency { position: fixed; top: .7rem; right: .7rem; z-index: 10; display: flex; align-items: baseline; gap: .4em;
  padding: .25rem .3rem .25rem .7rem; background: rgba(255,255,255,.94); border: 1px solid var(--rule);
  box-shadow: 0 1px 4px rgba(0,0,0,.08); font-size: .8rem; font-style: italic; }
.currency[hidden] { display: none; }
.currency select { font: inherit; font-style: normal; letter-spacing: .06em; color: var(--red); background: transparent;
  border: 0; padding: .1rem .2rem; cursor: pointer; }
.currency select:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }

/* Errata */
.errata-link { margin-top: .2rem !important; font-size: .9rem; font-style: italic; }
.errata-link a { color: var(--red); }
main.errata { margin-top: 2rem; }
main.errata h2 { margin: 0 0 .6rem; font-weight: 400; font-size: 1.75rem; }
main.errata .intro { margin: 0 0 1.6rem; font-style: italic; }
main.errata section { padding: 1rem 0; border-top: 1px solid var(--rule); scroll-margin-top: 3rem; }
main.errata h3 { margin: 0 0 .3rem; font-weight: 400; font-size: 1.2rem; }
main.errata h3 a { text-decoration: none; }
main.errata ul { margin: 0; padding: 0; list-style: none; }
main.errata li { margin: .2rem 0; }
main.errata .loc { font-variant-caps: small-caps; color: var(--red); }
main.errata .none { margin: 0; font-style: italic; color: #555; }

/* Site menu: Books, Errata, Contact */
.menu { display: flex; justify-content: center; gap: 1.6rem; margin-top: 1.4rem; }
.menu a { text-decoration: none; font-size: .82rem; letter-spacing: .16em; text-transform: uppercase; }
.menu a:hover, .menu a[aria-current] { color: var(--red); }
.menu a[aria-current] { border-bottom: 1px solid var(--red); }
.mast.mini { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .6rem 1.5rem; }
.mast.mini .home { text-decoration: none; }
.mast.mini .menu { margin: 0; gap: 1.2rem; justify-self: end; }
.mid-ark img { display: block; width: 3.6rem; height: 1.85rem; object-fit: cover; object-position: 50% 52%; }
@media (max-width: 44rem) { .mast.mini { grid-template-columns: 1fr auto; } .mid-ark { display: none; } }
@media (max-width: 80rem) { .mast.mini { padding-top: 3.4rem; } }  /* clear the fixed currency menu */
.foot-ark { display: block; width: fit-content; margin: 1.6rem auto 0; }
.foot-ark img { display: block; width: 4.4rem; height: 2.25rem; object-fit: cover; object-position: 50% 52%; }
.mast.mini .menu a { font-size: .78rem; }

/* Previous and next book */
.turn { display: flex; justify-content: space-between; gap: 1.5rem; max-width: var(--measure); margin: 2.4rem auto 0;
  padding-top: 1rem; border-top: 1px solid var(--rule); }
.turn a { text-decoration: none; font-style: italic; max-width: 48%; }
.turn a span { display: block; font-style: normal; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.turn .prev span::before { content: "\2190\00a0"; }
.turn .next { text-align: right; margin-left: auto; }
.turn .next span::after { content: "\00a0\2192"; }

/* Format notes beside the prices (book pages) */
.buy .what small { display: block; font-size: .8rem; font-style: italic; color: #555; line-height: 1.3; }
.buy a:has(small) { padding: .25em 0; }

/* Paperback cover spread (book pages) */
.spread { grid-column: 1 / -1; margin: 2rem 0 0; }
.spread figcaption { display: flex; align-items: baseline; gap: 1rem; margin-bottom: .7rem; font-style: italic; }
.spread figcaption::after { content: ""; flex: 1; border-bottom: 1px solid var(--rule); transform: translateY(-.3em); }
.spread a { display: block; max-width: 46rem; margin: 0 auto; }
.spread img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.spread a:hover img { box-shadow: 0 3px 10px rgba(0,0,0,.18); }

/* Free reading pages (/<book>/read/) */
.read-link { margin-top: .3rem !important; font-style: italic; }
.read-link a { color: var(--red); }
main.reading { max-width: 36rem; margin: 2.6rem auto 3.5rem; }
.rhead { text-align: center; margin-bottom: 2.4rem; }
.rhead .kicker { margin: 0; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.rhead h1 { margin: .5rem 0 .2rem; font-weight: 400; font-size: 2.1rem; line-height: 1.15; }
.rhead .sec { margin: 0; font-style: italic; font-size: 1.2rem; }
.rhead .from { margin: 1rem auto 0; max-width: 30rem; font-size: .9rem; color: #555; }
.rtext h2 { margin: 2.4rem 0 1rem; text-align: center; font-weight: 400; font-size: 1.15rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.rtext h2:first-child { margin-top: 0; }
.rtext .sub { margin: -.4rem 0 1.2rem; text-align: center; font-size: .9rem; letter-spacing: .1em; color: var(--red); }
.rtext h3.note { margin: 1.4rem 0 .5rem; text-align: center; font-weight: 400; font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: #777; }
.rtext h3.part { margin: 2rem 0 .8rem; text-align: center; font-weight: 400; font-style: italic; font-size: 1.1rem; }
.rtext p { margin: 0; text-indent: 1.3em; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.rtext h2 + p, .rtext h3 + p, .rtext .sub + p, .rtext .verse + p { text-indent: 0; }
.rtext h3.note + p { font-size: .92rem; margin-bottom: 1.6rem; }
.rtext .verse { margin: .8rem 0; }
.rtext blockquote.quote { margin: .8rem 1.5em; }
.rtext blockquote.quote p { text-indent: 0; }
.rtext blockquote.quote + p { text-indent: 0; }
.rtext .verse p.l { text-indent: -1.5em; padding-left: 1.5em; text-align: left; hyphens: manual; }
.rtext .verse p.l.in { padding-left: 2.6em; }
.rtext .dc { float: left; font-size: 3.2em; line-height: .8; margin: .06em .08em 0 0; color: var(--red); }
.rtext .verse .dc { float: none; font-size: 1.6em; line-height: 0; margin: 0; }
.rtext sup.v { font-size: .62em; color: var(--red); font-variant-numeric: lining-nums; }
.rtext .r { color: var(--red); }
.more-of { margin: 3rem 0 0; padding: 1.4rem 0 0; border-top: 3px double var(--red); }
.more-of > p:first-child { margin: 0 0 .8rem; font-style: italic; }
.more-of .back { margin: 1rem 0 0; }
.more-of .back a { color: var(--red); }

/* About this edition (book pages) */
.edition { margin: 1.2rem 0; padding: .9rem 0 .2rem; border-top: 1px solid var(--rule); }
.edition h3 { margin: 0 0 .4rem; font-weight: 400; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.edition p { margin: 0; font-size: .95rem; }

/* Suggestions */
main.page { margin-top: 2rem; margin-bottom: 3rem; }
main.page h2 { margin: 0 0 .6rem; font-weight: 400; font-size: 1.75rem; }
main.page .intro { margin: 0 0 1.6rem; }
main.page .sent { font-style: italic; color: var(--red); }
.suggest p { margin: 0 0 1.1rem; }
.suggest label { display: block; margin-bottom: .25rem; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.suggest label i { text-transform: none; letter-spacing: 0; color: #555; }
.suggest input, .suggest select, .suggest textarea { display: block; width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--rule); padding: .4rem .55rem; border-radius: 0; }
.suggest textarea { resize: vertical; line-height: 1.45; }
.suggest input:focus, .suggest select:focus, .suggest textarea:focus { outline: 2px solid var(--red); outline-offset: 0; border-color: var(--red); }
.suggest .two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.suggest button { font: inherit; letter-spacing: .12em; text-transform: uppercase; font-size: .85rem; color: #fff; background: var(--red);
  border: 0; padding: .55rem 1.6rem; cursor: pointer; }
.suggest button:disabled { opacity: .6; cursor: default; }
.suggest .status { margin-left: .8rem; font-style: italic; font-size: .9rem; }
.suggest .hp { position: absolute; left: -9999px; }
@media (max-width: 36rem) { .suggest .two { grid-template-columns: 1fr; } }

.sample { margin-top: .7rem !important; font-size: .9rem; font-style: italic; }
.sample a { color: var(--red); }

.notice { max-width: var(--measure); margin: 1.4rem auto 0; padding: .7rem 1rem; text-align: center; font-style: italic;
  font-size: .9rem; line-height: 1.45; color: var(--red); border: 1px solid var(--red); }
.notice[hidden] { display: none; }
.forthcoming { max-width: 34rem; margin: 2.2rem auto 0; padding: 1.3rem 0 0; border-top: 1px solid var(--rule); text-align: center; }
.forthcoming h2, .colophon h2 { margin: 0 0 .5rem; font-weight: 400; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.forthcoming p { margin: 0 auto; max-width: 32rem; }
.forthcoming { scroll-margin-top: 1rem; }
.notify { max-width: 26rem; margin: 1.1rem auto 0; }
.notify label { display: block; margin-bottom: .45rem; font-style: italic; font-size: .9rem; }
.notify .row { display: flex; }
.notify input[type=email] { flex: 1; min-width: 0; font: inherit; font-size: .95rem; color: var(--ink); background: #fff;
  border: 1px solid var(--rule); border-right: 0; padding: .35rem .55rem; border-radius: 0; }
.notify input[type=email]:focus { outline: 2px solid var(--red); outline-offset: 0; }
.notify button { font: inherit; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: #fff; background: var(--red);
  border: 0; padding: .35rem 1rem; cursor: pointer; white-space: nowrap; }
.notify button:disabled { opacity: .6; }
.notify .status { display: block; margin-top: .4rem; font-style: italic; font-size: .85rem; }
.notify .hp { position: absolute; left: -9999px; }
.forthcoming .notified { margin-top: 1rem; font-style: italic; color: var(--red); }

.colophon { max-width: 30rem; margin: 3rem auto 2.4rem; text-align: center; }
.colophon h2 { margin: 0 0 .5rem; font-weight: 400; font-size: .78rem; letter-spacing: .2em; text-transform: uppercase; color: var(--red); }
.colophon p { margin: 0; font-size: .9rem; font-style: italic; line-height: 1.55; }

footer .contact { margin-top: .4rem; }
footer { max-width: var(--measure); margin: 0 auto; padding: 2rem 0 4rem; border-top: 3px double var(--red); text-align: center; }
footer p { margin: 0; }
footer .fine { margin-top: .5rem; font-size: .85rem; font-style: italic; }

@media (min-width: 46rem) {
  .text > p:not(.by):not(.contents), .about p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; }
}
@media (max-width: 36rem) {
  html { font-size: 112.5%; }
  .mast { padding-top: 3rem; }
  .mast.mini { padding-top: 3.2rem; }
  .book { grid-template-columns: 1fr; row-gap: 1.2rem; padding: 2.2rem 0; }
  .cover { width: 8.5rem; }
  .pages { width: auto; margin: .6rem 0 0; }
  .strip { grid-template-columns: 1fr; }
  .shelf ol { grid-template-columns: repeat(4, 1fr); gap: .9rem .7rem; }
  .viewer figure { padding: 3rem .5rem 1rem; }
  .viewer .prev, .viewer .next { top: auto; bottom: 0; transform: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } .shelf a:hover img, .shelf a:focus img, a:hover > img, a:focus > img { transform: none !important; } }
@media (max-width: 60rem) and (min-width: 36.01rem) { .shelf ol { grid-template-columns: repeat(4, 1fr); } }
@media print { .shelf, .pages, .viewer { display: none; } }

/* the Homilies, read online: contents */
.toc { margin: 1rem 0 2.5rem; }
.toc h2 { font-size: .95rem; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: #b22222; text-align: center; margin: 2rem 0 .8rem; }
.toc ol, .toc ul { margin: 0 auto; padding: 0 0 0 1.6rem; max-width: 24rem; }
.toc ul { list-style: none; padding: 0; text-align: center; }
.toc li { margin: .25rem 0; font-size: 1.08rem; }
.toc a { color: inherit; text-decoration: none; border-bottom: 1px solid #ddd; }
.toc a:hover { color: #b22222; border-color: #b22222; }
.turn .up { text-align: center; }
