/* Family Paperwork, Whitfield House Press */
:root {
  --navy: #10203A;
  --navy-2: #1A2D4F;
  --green: #183629;
  --burgundy: #621D28;
  --gold: #C4A266;
  --ink: #1C2230;
  --muted: #4A5264;
  --paper: #FFFFFF;
  --mist: #EFF2F6;
  --line: #CDD3DD;
  --display: "EB Garamond", Garamond, "Times New Roman", serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.1875rem;          /* 19px: generous for older readers */
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); text-underline-offset: 0.18em; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  line-height: 1.12;
  text-wrap: balance;            /* keeps a last word from sitting alone */
  margin: 0 0 0.4em;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); }
h2 { font-size: clamp(2rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); }
p { margin: 0 0 1em; max-width: 66ch; text-wrap: pretty; }

.wrap { width: min(1120px, 100% - 3rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: .5rem 1rem; z-index: 10; }

/* Top bar */
.topbar { background: var(--navy); color: #fff; }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: #F3EBDA; text-decoration: none; font-family: var(--display); font-size: 1.55rem; }
.brand img { height: 38px; width: auto; }
.desk-nav { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.mnav { display: none; }
.topbar nav a { color: #E6E9EF; text-decoration: none; font-size: 1rem; }
.topbar nav a:hover { color: #fff; text-decoration: underline; }

/* Hero */
.hero { background: var(--navy); color: #F3EBDA; padding-block: clamp(3rem, 7vw, 6rem) clamp(3.5rem, 8vw, 6.5rem); }
.hero .wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3rem; }
.hero h1 { color: #F3EBDA; }
.hero .lede { font-size: 1.35rem; color: #E6E9EF; max-width: 40ch; }
.hero .byline { color: #B9C2D2; font-size: 1.05rem; }
.hero .key { height: clamp(260px, 34vw, 400px); width: auto; margin-right: clamp(0rem, 4vw, 4rem); }

.buttons { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.btn {
  display: inline-block; padding: 0.8rem 1.35rem; border-radius: 6px;
  font-family: var(--body); font-weight: 700; font-size: 1.05rem;
  text-decoration: none; border: 2px solid transparent; line-height: 1.2;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); color: #fff; }
.btn-outline { border-color: var(--navy); color: var(--navy); background: transparent; }
.btn-outline:hover { background: var(--navy); color: #fff; }
.hero .btn-primary { background: #F3EBDA; color: var(--navy); }
.hero .btn-primary:hover { background: #fff; }
.hero .btn-outline { border-color: #F3EBDA; color: #F3EBDA; }
.hero .btn-outline:hover { background: #F3EBDA; color: var(--navy); }

/* Sections */
section { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.intro { max-width: 60ch; margin-bottom: 3rem; }
.intro p { color: var(--muted); }
.tint { background: var(--mist); }

/* The three stages */
.book-row {
  display: grid; grid-template-columns: minmax(180px, 300px) 1fr; column-gap: clamp(1.8rem, 5vw, 4rem);
  grid-template-areas: "cover head" "cover body"; grid-template-rows: auto 1fr;
  align-items: start; padding-block: 3rem; border-top: 1px solid var(--line);
}
.book-row .cover-link { grid-area: cover; }
.row-head { grid-area: head; }
.row-body { grid-area: body; }
.book-row:first-of-type { border-top: 0; padding-top: 0; }
.cover-link img { box-shadow: 0 14px 30px -12px rgba(16, 32, 58, 0.45); border-radius: 2px; }
.stage { font-family: var(--display); font-style: italic; font-size: clamp(2.1rem, 4vw, 2.9rem); line-height: 1; margin: 0 0 0.35em; }
.stage-navy { color: var(--navy); }
.stage-green { color: var(--green); }
.stage-burgundy { color: var(--burgundy); }
.book-row h3 a { color: var(--ink); text-decoration: none; }
.book-row h3 a:hover { text-decoration: underline; }
.subtitle { color: var(--muted); font-size: 1.1rem; margin-bottom: 1rem; }
.formats { font-size: 1rem; color: var(--muted); margin-top: 1rem; }
.more { display: inline-block; margin-top: 0.4rem; font-weight: 700; }

/* Two formats */
.format-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
.format-grid h3 { font-size: 1.8rem; }

/* Author */
.author { max-width: 70ch; }

/* Book detail page */
.detail { display: grid; grid-template-columns: minmax(220px, 360px) 1fr; column-gap: clamp(2rem, 5vw, 4.5rem);
  grid-template-areas: "cover head" "cover body"; grid-template-rows: auto 1fr; align-items: start; }
.detail aside { grid-area: cover; position: sticky; top: 1.5rem; }
.detail-head { grid-area: head; }
.detail-body { grid-area: body; min-width: 0; }
.detail h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); }
.buybox { border: 1px solid var(--line); border-radius: 8px; padding: 1.3rem 1.4rem; margin: 1.5rem 0 2.5rem; background: var(--mist); }
.buybox p { margin: 0 0 0.3rem; font-size: 1rem; color: var(--muted); }
.buybox .buttons { margin-top: 0.9rem; }
.opener { font-family: var(--display); font-size: 1.6rem; line-height: 1.3; color: var(--ink); }
.detail h2 { font-size: 2rem; margin-top: 2.2rem; }
.detail ul { padding-left: 1.3em; max-width: 66ch; }
.detail li { margin-bottom: 0.55em; }
.specs { width: 100%; max-width: 640px; border-collapse: collapse; font-size: 1rem; }
.specs th, .specs td { text-align: left; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { font-weight: 700; width: 38%; }
.note { font-size: 0.98rem; color: var(--muted); font-style: italic; }
.back { display: inline-block; margin-bottom: 1.5rem; font-size: 1rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.5rem; font-size: 1.05rem; }

/* Footer */
footer { background: var(--navy); color: #C9D0DC; font-size: 1rem; padding-block: 2.8rem; }
footer .rule { border-top: 3px double rgba(196, 162, 102, 0.55); margin-bottom: 2rem; }
footer a { color: #F3EBDA; }
footer p { max-width: 80ch; }

@media (max-width: 800px) {
  body { font-size: 1.125rem; }
  .wrap { width: min(1120px, 100% - 2.2rem); }

  /* Compact header with a tap-to-open menu */
  .desk-nav { display: none; }
  .mnav { display: block; position: relative; }
  .mnav summary {
    list-style: none; cursor: pointer; color: #F3EBDA; font-weight: 700; font-size: 1.05rem;
    border: 2px solid #F3EBDA; border-radius: 6px; padding: 0.5rem 1rem; min-height: 44px;
    display: flex; align-items: center;
  }
  .mnav summary::-webkit-details-marker { display: none; }
  .mnav[open] summary { background: #F3EBDA; color: var(--navy); }
  .mnav nav {
    position: absolute; right: 0; top: calc(100% + 0.5rem); z-index: 5; min-width: 15rem;
    background: var(--navy); border: 1px solid rgba(243, 235, 218, 0.35); border-radius: 8px;
    display: flex; flex-direction: column; padding: 0.4rem 0;
  }
  .mnav nav a { color: #fff; text-decoration: none; padding: 0.85rem 1.2rem; font-size: 1.1rem; }
  .mnav nav a:hover, .mnav nav a:focus-visible { background: var(--navy-2); }
  .brand { font-size: 1.35rem; }
  .brand img { height: 32px; }

  /* Hero */
  .hero { padding-block: 2.2rem 2.8rem; }
  .hero .wrap { grid-template-columns: 1fr; }
  .hero .key { display: none; }
  .hero .lede { font-size: 1.2rem; }

  /* Full-width, easy-to-tap buttons */
  .buttons { flex-direction: column; }
  .btn { width: 100%; text-align: center; padding: 1rem 1.2rem; font-size: 1.1rem; }

  section { padding-block: 2.8rem; }
  .intro { margin-bottom: 1.8rem; }

  /* Book rows: small cover beside the title, details below */
  .book-row {
    grid-template-columns: 104px 1fr; column-gap: 1.1rem; row-gap: 1rem;
    grid-template-areas: "cover head" "body body"; grid-template-rows: auto auto; padding-block: 2.2rem;
  }
  .book-row .stage { font-size: 1.7rem; }
  .book-row h3 { font-size: 1.45rem; }
  .book-row .subtitle { font-size: 0.98rem; margin-bottom: 0; }

  /* Book pages: small cover beside the title, buy buttons right away */
  .detail {
    grid-template-columns: 110px 1fr; column-gap: 1.1rem; row-gap: 1.2rem;
    grid-template-areas: "cover head" "body body"; grid-template-rows: auto auto;
  }
  .detail aside { position: static; }
  .detail .stage { font-size: 1.7rem; }
  .detail h1 { font-size: 1.9rem; }
  .detail .subtitle { font-size: 0.98rem; margin-bottom: 0.4rem; }
  .buybox { margin: 0 0 2rem; padding: 1.1rem; }
  .opener { font-size: 1.4rem; }
  .detail h2 { font-size: 1.7rem; }

  .specs th, .specs td { display: block; width: 100%; padding: 0.2rem 0; border: 0; }
  .specs tr { display: block; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }

  .format-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .pager { flex-direction: column; }
  .pager a { padding: 0.5rem 0; }
}

@media print {
  .topbar nav, .buttons, footer { display: none; }
}
