/* ==========================================================================
   zimering.com — styles.css
   The official author website of Howard Zimering.

   Design notes
   - One stylesheet, no build step, no dependencies.
   - System serif stack for reading; a monospaced face appears only in a few
     small, deliberate places (a nod to Eli Sayer's hand-written comments).
   - Colours are defined once as custom properties; a dark scheme follows the
     visitor's system preference.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --paper:      #f7f3ec;   /* page background */
  --paper-deep: #efe9df;   /* slightly darker panels */
  --ink:        #23201c;   /* body text */
  --ink-soft:   #4a453e;   /* secondary text */
  --muted:      #6f685e;   /* captions, notes (AA on paper) */
  --rule:       #d9d2c5;   /* hairlines */
  --accent:     #7a2e2e;   /* oxblood — links, buttons */
  --accent-ink: #ffffff;   /* text on accent */
  --focus:      #b5533f;

  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
                Charter, "Bitstream Charter", Georgia, "Times New Roman", serif;
  --font-mono:  ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas,
                "Liberation Mono", "DejaVu Sans Mono", monospace;

  --measure: 38rem;        /* comfortable line length for prose */
  --wrap:    66rem;        /* overall page width */
  --gutter:  clamp(1.25rem, 4vw, 2.5rem);
  --radius:  2px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #1b1916;
    --paper-deep: #23201c;
    --ink:        #ebe5da;
    --ink-soft:   #cfc7ba;
    --muted:      #a39a8d;
    --rule:       #3a352f;
    --accent:     #d49a8c;
    --accent-ink: #1b1916;
    --focus:      #e4b3a6;
  }
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

main { flex: 1 0 auto; }

img, svg { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }

p, ul, ol, dl { margin: 0 0 1.2em; }
ul, ol { padding-left: 1.25em; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--radius);
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

em { font-style: italic; }
strong { font-weight: 600; }

/* Prose measure */
.prose { max-width: var(--measure); }
.prose > :last-child { margin-bottom: 0; }

/* Quiet monospaced notes — used sparingly. */
.note {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  color: var(--muted);
}
.note::before { content: "// "; }

.muted { color: var(--muted); }

/* Layout wrapper */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Visually hidden but available to assistive technology */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Header & navigation
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  z-index: 100;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.site-header {
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 1.1rem;
}

.site-title {
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.site-title:hover { color: var(--accent); }

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.site-nav__list a {
  display: inline-block;
  padding: 0.35rem 0;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px solid transparent;
}
.site-nav__list a:hover { color: var(--ink); border-bottom-color: var(--rule); }
.site-nav__list a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* Menu button — shown only when JavaScript is running on a narrow screen.
   Without JavaScript the links simply wrap; nothing is lost. */
.nav-toggle {
  display: none;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  min-height: 44px;
}

@media (max-width: 40em) {
  .js .nav-toggle { display: inline-block; }
  /* Let the button and the list participate directly in the header row:
     the button sits beside the site title; the list spans the full width below. */
  .js .site-nav { display: contents; }
  .js .site-nav__list {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    padding-top: 0.5rem;
  }
  .js .site-nav__list.is-open { display: flex; }
  .js .site-nav__list a {
    display: block;
    padding: 0.75rem 0;
    border-top: 1px solid var(--rule);
    border-bottom: 0;
    min-height: 44px;
  }
  .js .site-nav__list a[aria-current="page"] { color: var(--accent); }
  .js .site-header__inner { padding-block: 0.75rem; }
}

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-block;
  font: inherit;
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.8rem 1.3rem;
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* A purchase option whose URL does not exist yet. Rendered as a <span>, not a link. */
.btn--pending {
  border-style: dashed;
  border-color: var(--muted);
  color: var(--muted);
  cursor: default;
}
.btn--pending:hover { background: transparent; color: var(--muted); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

/* --------------------------------------------------------------------------
   5. Page sections
   -------------------------------------------------------------------------- */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section + .section { border-top: 1px solid var(--rule); }
.section--tint { background: var(--paper-deep); }

.section__heading { margin-bottom: 1.25rem; }

.eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Two-column arrangements that collapse on small screens */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}
@media (min-width: 48em) {
  .split { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: clamp(2rem, 5vw, 4rem); }
  .split--reverse > :first-child { order: 2; }
  .split--narrow { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
}

/* --------------------------------------------------------------------------
   6. Hero (home)
   -------------------------------------------------------------------------- */
.hero { padding-block: clamp(2.5rem, 7vw, 5.5rem); }

.hero__author {
  font-size: 1.05rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}
.hero__title {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin-bottom: 0.4em;
}
.hero__kicker {
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.15rem;
  margin-bottom: 1.5rem;
}
.hero__lede { font-size: 1.15rem; }

/* --------------------------------------------------------------------------
   7. Book cover & author photo
   -------------------------------------------------------------------------- */
.cover {
  max-width: 22rem;
  margin-inline: auto;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.12),
    6px 7px 0 -1px rgba(35, 32, 28, 0.22),       /* hard offset edge: page-block thickness */
    14px 18px 30px -10px rgba(35, 32, 28, 0.38); /* soft cast shadow */
  border-radius: var(--radius);
  overflow: hidden;
}
.cover img { width: 100%; aspect-ratio: 5 / 8; object-fit: cover; }

@media (min-width: 48em) {
  .cover { margin-inline: 0; }
}

.portrait {
  max-width: 18rem;
  border-radius: var(--radius);
  overflow: hidden;
}
.portrait img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

.caption {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

/* --------------------------------------------------------------------------
   8. Definition lists (book details)
   -------------------------------------------------------------------------- */
.details {
  margin: 1.5rem 0 0;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
}
.details div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--rule);
}
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* --------------------------------------------------------------------------
   9. Purchase area
   -------------------------------------------------------------------------- */
.purchase__list {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --------------------------------------------------------------------------
   10. FAQ (native <details>, no JavaScript required)
   -------------------------------------------------------------------------- */
.faq { border-top: 1px solid var(--rule); margin-top: 1.5rem; }

.faq details { border-bottom: 1px solid var(--rule); }

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 2rem 1rem 0;
  font-size: 1.1rem;
  position: relative;
  min-height: 44px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  color: var(--muted);
}
.faq details[open] summary::after { content: "\2212"; } /* minus sign */
.faq summary:hover { color: var(--accent); }

.faq__answer { padding: 0 0 1.25rem; max-width: var(--measure); }
.faq__answer > :last-child { margin-bottom: 0; }

/* A clearly marked placeholder block (remove when real content arrives) */
.placeholder {
  border: 1px dashed var(--muted);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   11. Contact
   -------------------------------------------------------------------------- */
.contact-email {
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  word-break: break-word;
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.25rem 2.5rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.site-footer__inner {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 48em) {
  .site-footer__inner { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
}
.site-footer p { margin: 0 0 0.35em; }
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--accent); }

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.footer-nav a { text-decoration: none; display: inline-block; padding: 0.25rem 0; }
.footer-nav a:hover { text-decoration: underline; }

.site-footer .note { margin-top: 1.25rem; }

/* --------------------------------------------------------------------------
   13. Motion & print
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header, .site-footer, .btn-row, .nav-toggle, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  a { color: inherit; text-decoration: none; }
}
