/* The Longbourn Years: the shared stylesheet of tawelham.com and ludgatebooks.com.
   Colours and type follow the covers (production/covers/build_wrap.py): the navy ground, gold, cream, EB Garamond. */

@font-face { font-family: "EB Garamond"; src: url("/assets/fonts/EBGaramond-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/assets/fonts/EBGaramond-Italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url("/assets/fonts/EBGaramond-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  --navy: #1F2933;
  --navy-deep: #161D25;
  --gold: #C8A96E;
  --gold-ink: #85692C; /* gold for small text on the light paper: 4.8:1 against --paper */
  --cream: #F4EFE6;
  --paper: #FAF7F1;
  --body-light: #EAE3D5;
  --ink: #1F2933;
  --ink-soft: #4A5560;
  --rule: #D9CFBD;
  --seal: #6B2529;
  --measure: 36rem;
  --wide: 70rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "EB Garamond", Garamond, "Times New Roman", serif;
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.22rem); line-height: 1.6;
  font-variant-numeric: oldstyle-nums proportional-nums;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
p, li { text-wrap: pretty; }
h1, h2, .lede { text-wrap: balance; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--seal); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.site-header :focus-visible, .hero :focus-visible, .site-footer :focus-visible { outline-color: var(--gold); }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 1rem; top: 1rem; background: var(--cream); color: var(--ink); padding: 0.4rem 0.8rem; z-index: 10; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header and footer: the dark ground of the covers. */
.site-header { background: var(--navy); color: var(--cream); border-bottom: 1px solid #2E3A46; }
.site-header .inner, .site-footer .inner { max-width: var(--wide); margin: 0 auto; padding: 0.9rem 1.25rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.6rem; align-items: baseline; justify-content: space-between; }
.brand { font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.92rem; color: var(--gold); text-decoration: none; }
.brand:hover { color: var(--cream); }
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 1.3rem; margin: 0; padding: 0; }
.site-nav a { color: var(--body-light); text-decoration: none; font-size: 1rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--gold); }
.site-footer { background: var(--navy-deep); color: var(--body-light); margin-top: 4rem; font-size: 0.95rem; }
.site-footer .inner { padding: 1.6rem 1.25rem 2rem; }
.site-footer a { color: var(--body-light); }
.site-footer a:hover { color: var(--gold); }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; margin: 0; padding: 0; }

/* The opening band of a page. */
.hero { background: var(--navy); color: var(--cream); text-align: center; padding: clamp(2.6rem, 6vw, 4.6rem) 1.25rem clamp(2.4rem, 5vw, 3.6rem); }
.hero .kicker { color: var(--gold); }
.hero h1 { font-weight: 400; font-size: clamp(2.3rem, 1.6rem + 3.2vw, 3.9rem); line-height: 1.08; margin: 0.35rem 0 0.6rem; letter-spacing: 0.01em; }
.hero .lede { font-size: clamp(1.18rem, 1.05rem + 0.6vw, 1.45rem); color: var(--body-light); margin: 0 auto 0.4rem; max-width: 34rem; }
.hero p { max-width: 34rem; margin-left: auto; margin-right: auto; text-wrap: balance; }
.hero .mark { margin: 0 0 0.6rem; }
.hero .mark .seal { width: 1.5rem; height: 1.5rem; margin: 0; vertical-align: middle; border-width: 2px; }
.rule { width: 5.5rem; height: 1px; background: var(--gold); margin: 1.2rem auto; border: 0; }
.kicker { font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; font-size: 0.82rem; margin: 0; }
.button { display: inline-block; margin-top: 1rem; padding: 0.55rem 1.3rem; border: 1px solid var(--gold); color: var(--gold); text-decoration: none; letter-spacing: 0.06em; }
.button:hover { background: var(--gold); color: var(--navy); }

/* Sections and text. */
.section { max-width: var(--wide); margin: 0 auto; padding: clamp(2rem, 4vw, 3.2rem) 1.25rem 0; }
.section > h2, .prose h2 { font-weight: 500; font-size: 1.35rem; letter-spacing: 0.02em; margin: 0 0 1rem; }
.prose { max-width: var(--measure); margin: 0 auto; padding: clamp(2rem, 4vw, 3rem) 1.25rem 0; }
.prose p { margin: 0 0 1em; }
.prose h1 { font-weight: 400; font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); line-height: 1.12; margin: 0 0 1.2rem; }
.prose h2 { margin-top: 2rem; }

/* The four volumes in a row. */
.volumes { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.2rem 1.6rem; grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.volumes li { display: flex; flex-direction: column; }
.volumes a.cover-link { display: block; text-decoration: none; }
.volumes img { box-shadow: 0 0.35rem 1.2rem rgba(22, 29, 37, 0.28); aspect-ratio: 2 / 3; width: 100%; background: var(--navy); }
.volumes .vol { display: block; margin-top: 0.9rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.78rem; color: var(--gold-ink); }
.volumes .title { display: block; font-size: 1.45rem; line-height: 1.2; margin-top: 0.1rem; }
.volumes p { margin: 0.6rem 0 0; font-size: 1rem; color: var(--ink-soft); }
/* On a phone: the cover small at the left, the volume and title beside it, the text below. */
@media (max-width: 33.99rem) {
  .volumes { gap: 2.4rem; }
  .volumes a.cover-link { display: grid; grid-template-columns: 7.5rem 1fr; grid-template-rows: 1fr auto auto; column-gap: 1.1rem; }
  .volumes a.cover-link img { grid-row: 1 / 4; }
  .volumes .vol { grid-column: 2; grid-row: 2; margin-top: 0; }
  .volumes .title { grid-column: 2; grid-row: 3; }
  .volumes p { margin-top: 0.9rem; }
}

/* A book's page. */
.book { max-width: var(--wide); margin: 0 auto; padding: clamp(2rem, 4vw, 3.2rem) 1.25rem 0; display: grid; gap: 2rem 3rem; grid-template-columns: 1fr; }
@media (min-width: 52rem) { .book { grid-template-columns: minmax(16rem, 23rem) minmax(0, 1fr); align-items: start; } .book-cover { position: sticky; top: 1.5rem; } }
.book-cover img { box-shadow: 0 0.5rem 1.6rem rgba(22, 29, 37, 0.3); width: 100%; max-width: 23rem; margin: 0 auto; aspect-ratio: 2 / 3; background: var(--navy); }
@media (max-width: 51.99rem) { .book-cover img { max-width: 15rem; } }
.book-text { max-width: var(--measure); }
.book-text .kicker { color: var(--gold-ink); }
.book-text h1 { font-weight: 400; font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.2rem); line-height: 1.08; margin: 0.3rem 0 0.2rem; }
.byline { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 1.6rem; }
.copy p { margin: 0 0 1em; }
.copy .frame { font-style: italic; }
.copy .frame .roman, .copy .series .roman { font-style: normal; }
.copy .series { font-style: italic; color: var(--ink-soft); }
.book-text h2 { font-weight: 500; font-size: 1.15rem; letter-spacing: 0.04em; margin: 2rem 0 0.6rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.editions { margin: 0; display: grid; gap: 0.35rem; }
.editions div { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.6rem; }
.editions dt { color: var(--ink-soft); }
.editions dd { margin: 0; }
.isbn { font-variant-numeric: lining-nums tabular-nums; letter-spacing: 0.01em; white-space: nowrap; }
.retailers { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.retailers a { display: inline-block; padding: 0.4rem 1rem; border: 1px solid var(--ink); text-decoration: none; }
.retailers a:hover { background: var(--ink); color: var(--cream); }
.note { color: var(--ink-soft); }
.book-nav { width: calc(100% - 2.5rem); max-width: calc(var(--wide) - 2.5rem); margin: 3rem auto 0; padding: 1.2rem 0 0; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--rule); font-size: 1rem; }
.book-nav a { text-decoration: none; }
.book-nav .next { margin-left: auto; text-align: right; }
.book-nav .label { display: block; color: var(--ink-soft); font-size: 0.85rem; letter-spacing: 0.12em; text-transform: uppercase; }

/* The publisher's catalogue. */
.table-wrap { overflow-x: auto; }
.catalogue { border-collapse: collapse; width: 100%; font-size: 1rem; min-width: 34rem; }
.catalogue th, .catalogue td { text-align: left; padding: 0.55rem 0.8rem 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.catalogue th { font-weight: 500; color: var(--ink-soft); font-size: 0.9rem; letter-spacing: 0.04em; }
/* On a phone, each book's row becomes a small card, each value with its label. */
@media (max-width: 39.99rem) {
  .catalogue { min-width: 0; }
  .catalogue thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .catalogue tr { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
  .catalogue td { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.6rem; padding: 0.1rem 0; border: 0; }
  .catalogue td::before { content: attr(data-label); color: var(--ink-soft); font-size: 0.9rem; }
}
.seal { display: inline-block; width: 0.9em; height: 0.9em; border-radius: 50%; background: var(--seal); border: 1px solid #A96F58; vertical-align: -0.05em; margin-right: 0.45em; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.contact-list strong { display: block; font-weight: 500; }
