:root {
  --color-bg: #aebfce;
  --color-bg-deep: #8fa4b8;
  --color-surface: #f7f4ee;
  --color-text: #2b3540;
  --color-text-muted: #36424d;
  --color-ink: #243447;
  --color-ink-soft: #35495f;
  --color-accent: #8a1f1f;
  --color-accent-contrast: #ffffff;
  --font-display: "Poppins", "Segoe UI", Arial, sans-serif;
  --font-body: "Poppins", "Segoe UI", Arial, sans-serif;
  /* Deliberate exception to the site's "no script fonts" rule (see CLAUDE.md) —
     used only for the header brand name, to read as the author's signature. */
  --font-signature: "Parisienne", cursive;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(36, 52, 71, 0.12), 0 8px 24px rgba(36, 52, 71, 0.14);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --max-width: 72rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(ellipse 60rem 40rem at 10% 0%, color-mix(in srgb, var(--color-bg-deep) 55%, transparent) 0%, transparent 60%),
    radial-gradient(ellipse 55rem 45rem at 95% 100%, color-mix(in srgb, var(--color-bg-deep) 45%, transparent) 0%, transparent 55%),
    radial-gradient(ellipse 40rem 30rem at 60% 10%, color-mix(in srgb, #ffffff 15%, transparent) 0%, transparent 45%);
  line-height: 1.6;
  font-size: 1rem;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.2;
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  text-wrap: balance;
}

main h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); margin-bottom: 1rem; }
main h2 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
main p, main li, main dd { max-width: 70ch; }

::selection { background: var(--color-accent); color: var(--color-accent-contrast); }
input, textarea, select { caret-color: var(--color-accent); accent-color: var(--color-accent); }
html { scrollbar-color: var(--color-ink-soft) var(--color-bg); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 2000;
  background: var(--color-surface);
  color: var(--color-accent);
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

a { color: var(--color-accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.site-header {
  background: var(--color-ink);
  padding: 0.9rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

.site-nav__brand {
  font-family: var(--font-signature);
  font-size: 2.4rem;
  line-height: 1;
  color: var(--color-surface);
  text-decoration: none;
}

.site-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__links a {
  display: inline-block;
  color: var(--color-surface);
  text-decoration: none;
  font-weight: 600;
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
  border-bottom: 2px solid transparent;
  transition: background-color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.site-nav__links a:hover { background: rgba(255, 255, 255, 0.12); }

.site-nav__links a.is-active {
  border-bottom-color: var(--color-surface);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

main > * + * { margin-top: 2rem; }

.site-footer {
  background: var(--color-ink);
  color: var(--color-surface);
  padding: 2.5rem 1.25rem 2rem;
  text-align: center;
}

.site-footer a { color: var(--color-surface); }
.site-footer a:hover { color: #ffffff; }

.footer-subscribe {
  max-width: 34rem;
  margin: 0 auto 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid rgba(247, 244, 238, 0.2);
}
.footer-subscribe__title { color: var(--color-surface); font-size: 1.35rem; margin-bottom: 0.35rem; }
.footer-subscribe__label { margin: 0 0 1rem; color: #d5dde5; }
.footer-subscribe__row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.footer-subscribe input[type="email"],
.footer-subscribe input[type="text"] {
  flex: 1 1 14rem;
  max-width: 20rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  background: var(--color-surface);
  color: var(--color-text);
}
.footer-subscribe .form-success,
.footer-subscribe .form-error { margin: 0 0 0.75rem; }
.site-footer .form-success { color: #b9e6c6; }
.site-footer .form-error { color: #ffc2c2; }
.site-footer :focus-visible { outline-color: var(--color-surface); }
.footer-legal { margin: 0; font-size: 0.9rem; color: #d5dde5; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-panel {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 24rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.3;
  border: 2px solid var(--color-accent);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(36, 52, 71, 0.25);
  transition: background-color 0.2s var(--ease-out), transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.btn-primary:hover {
  background: #6f1919;
  border-color: #6f1919;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(36, 52, 71, 0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius);
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.btn-secondary:hover { background: var(--color-accent); color: var(--color-accent-contrast); }

.btn-lg { padding: 0.9rem 2rem; font-size: 1.1rem; }

.card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

@media (max-width: 40rem) {
  main { padding: 1.25rem 1rem 3rem; }
  .site-nav { justify-content: center; }
  .site-nav__links { justify-content: center; }
}

.admin-main {
  max-width: none;
}

.admin-grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.admin-grid th,
.admin-grid td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
}

.admin-grid thead th {
  background: var(--color-bg-deep);
  color: var(--color-surface);
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
}

.admin-grid tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--color-bg) 20%, transparent);
}

.admin-grid tbody tr:hover {
  background: color-mix(in srgb, var(--color-accent) 8%, transparent);
}

.admin-grid td { border-top: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent); }

.admin-grid th:nth-child(1),
.admin-grid td:nth-child(1),
.admin-grid th:nth-child(3),
.admin-grid td:nth-child(3) {
  white-space: nowrap;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.book-card .card { display: flex; flex-direction: column; height: 100%; transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out); }
.book-card .card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(36, 52, 71, 0.14), 0 14px 32px rgba(36, 52, 71, 0.2); }
.book-card-link { text-decoration: none; color: inherit; display: block; flex: 1; }
.book-card-link h2 { margin-bottom: 0.35rem; }
.book-card__cta { margin-top: 1rem; text-align: center; }

.book-grid .book-cover-img,
.book-grid .book-cover-placeholder {
  width: 60%;
  margin-left: auto;
  margin-right: auto;
}

.status-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 15px;
}

.book-grid .status-badge-row {
  justify-content: center;
}

.status-badge-disabled,
.btn-primary-disabled {
  cursor: default;
  opacity: 0.8;
  background: var(--color-ink-soft);
  border-color: var(--color-ink-soft);
  box-shadow: none;
}

.status-badge {
  display: inline-block;
  background: var(--color-accent);
  color: var(--color-accent-contrast);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.status-badge:hover { text-decoration: none; }

.edition-cta { margin-top: 0.75rem; }

.book-cover-placeholder {
  aspect-ratio: 5 / 8;
  background: var(--color-bg-deep);
  color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.book-hero,
.hero {
  display: grid;
  gap: 2.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2.5rem;
}

.book-hero { grid-template-columns: minmax(0, 18rem) 1fr; align-items: start; }
.hero { grid-template-columns: minmax(0, 16rem) 1fr; align-items: center; }

.book-hero .book-cover-img,
.hero .book-cover-img,
.hero .book-cover-placeholder { margin-bottom: 0; }

.book-hero dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1.25rem;
  margin: 1.25rem 0;
}
.book-hero dt { font-weight: 700; }
.book-hero dd { margin: 0; }
.book-hero ul { list-style: none; padding: 0; margin: 0; }

.book-cover-img {
  width: 100%;
  display: block;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(36, 52, 71, 0.2), 0 12px 28px rgba(36, 52, 71, 0.25);
  margin-bottom: 20px;
}

.hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.75rem; }
.hero__hook { font-size: 1.35rem; margin: 0 0 1rem; }
.precis p { margin: 0 0 0.9rem; }
.precis p:nth-last-child(-n+2) { font-style: italic; margin-bottom: 0.25rem; }
.precis p:last-child { font-weight: 700; font-style: normal; color: var(--color-accent); margin-bottom: 1.25rem; }

.hero__release { color: var(--color-text-muted); font-weight: 600; margin: 0 0 1.5rem; }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1rem; }

@media (prefers-reduced-motion: no-preference) {
  .hero, .book-hero { animation: rise 0.7s var(--ease-out) both; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
  }
}

@media (max-width: 40rem) {
  .hero, .book-hero { grid-template-columns: 1fr; padding: 1.5rem; gap: 1.5rem; text-align: center; }
  .hero .book-cover-img, .hero .book-cover-placeholder,
  .book-hero .book-cover-img, .book-hero .book-cover-placeholder { max-width: 12rem; margin: 0 auto; }
  .hero__actions { justify-content: center; }
  .hero__hook { font-size: 1.15rem; }
  .book-hero dl { text-align: left; }
  .book-hero ul { text-align: center; }
}

.author-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: center;
}
.author-card h2 { margin-bottom: 0.75rem; }
.author-card p { margin: 0 0 0.75rem; }
.author-card__links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin: 0; }

.headshot-photo {
  border-radius: var(--radius-lg);
  object-fit: cover;
  display: block;
  box-shadow: 0 2px 4px rgba(36, 52, 71, 0.2), 0 8px 20px rgba(36, 52, 71, 0.2);
}
.headshot-photo--small { width: 9rem; height: auto; }
.about-hero .headshot-photo { width: 12rem; max-width: 100%; height: auto; }

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 12rem) 1fr;
  gap: 2.5rem;
  align-items: start;
}
.about-hero p:first-child { margin-top: 0; }

@media (max-width: 40rem) {
  .author-card, .about-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .author-card__links { justify-content: center; }
  .headshot-photo--small { width: 7rem; }
}

.review-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; }
.review-list .card { display: grid; gap: 0.35rem; }
.review-rating { color: var(--color-accent); font-weight: 700; }

form { max-width: 40rem; }
.form-field { margin-bottom: 1.1rem; display: grid; gap: 0.35rem; }
.form-field label { font-weight: 600; }
.form-field-inline { display: flex; align-items: center; gap: 0.5rem; }
.form-field-inline label { margin: 0; }
.form-field input, .form-field select, .form-field textarea {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid #6b7b89;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--color-text);
  font: inherit;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.form-field textarea { min-height: 9rem; resize: vertical; }
.form-field input:hover, .form-field select:hover, .form-field textarea:hover { border-color: var(--color-ink); }
.form-field input[type="checkbox"] { width: auto; }
.input-narrow { max-width: 16rem; }
.form-error { color: #7a1515; font-weight: 600; }
.form-success { color: #1b4d26; font-weight: 600; }

/* In the Press */
.press-intro h1 { margin-bottom: 0.5rem; }
.press-intro p { margin: 0; font-size: 1.1rem; color: var(--color-text-muted); }

.press-clip {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.75rem 2rem;
}

.press-clip--featured { padding: 2.5rem; }
.press-clip--featured.has-cover {
  display: grid;
  grid-template-columns: minmax(0, 10rem) 1fr;
  gap: 2.75rem;
  align-items: center;
}

/* The book laid on its own clipping: a slight tilt reads as a physical object, not a thumbnail. */
.press-clip__cover {
  width: 100%;
  display: block;
  aspect-ratio: 5 / 8;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: 0 2px 4px rgba(36, 52, 71, 0.2), 0 14px 30px rgba(36, 52, 71, 0.28);
  transform: rotate(-3deg);
  transition: transform 0.5s var(--ease-out);
}
.press-clip--featured:hover .press-clip__cover { transform: rotate(-1deg) translateY(-3px); }

.press-clip__headline { font-size: clamp(1.2rem, 2vw, 1.45rem); line-height: 1.3; }
.press-clip--featured .press-clip__headline { font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.2; max-width: 30ch; }
.press-clip__headline a { color: var(--color-text); text-decoration: none; }
.press-clip__headline a:hover { color: var(--color-accent); text-decoration: underline; text-decoration-thickness: 2px; }

main .press-clip__meta {
  max-width: none;
  margin: 0.9rem 0 0;
  padding-top: 0.8rem;
  border-top: 1px solid color-mix(in srgb, var(--color-ink) 18%, transparent);
  font-size: 0.92rem;
  color: var(--color-text-muted);
}
.press-clip__outlet { font-weight: 700; color: var(--color-ink); }
.press-clip__excerpt { margin: 1rem 0 0; font-size: 1.05rem; }
.press-clip__more { display: inline-block; margin-top: 1.25rem; font-weight: 600; }

.press-earlier h2 { margin-bottom: 1rem; }
.press-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }

@media (prefers-reduced-motion: no-preference) {
  .press-clip--featured { animation: rise 0.7s var(--ease-out) both; }
}

@media (prefers-reduced-motion: reduce) {
  .press-clip__cover, .press-clip--featured:hover .press-clip__cover { transition: none; transform: rotate(-3deg); }
}

@media (max-width: 40rem) {
  .press-clip, .press-clip--featured { padding: 1.5rem; }
  .press-clip--featured.has-cover { grid-template-columns: 1fr; gap: 1.75rem; }
  .press-clip__cover { max-width: 8rem; margin: 0.5rem auto 0; }
}

/* Home hero: newest press item sits under the cover, in the space the taller text column leaves free. */
.hero__aside { display: grid; gap: 1.75rem; align-content: center; }
.hero-press {
  display: grid;
  gap: 0.3rem;
  padding-top: 1.1rem;
  border-top: 1px solid color-mix(in srgb, var(--color-ink) 18%, transparent);
  font-size: 0.9rem;
  line-height: 1.45;
}
.hero-press p { margin: 0; }
.hero-press__title { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--color-ink); }
.hero-press__headline { font-weight: 600; color: var(--color-text); text-decoration: none; }
.hero-press__headline:hover { color: var(--color-accent); text-decoration: underline; }
.hero-press__meta { color: var(--color-text-muted); }
.hero-press__outlet { font-weight: 700; color: var(--color-ink); }
.hero-press__all { margin-top: 0.35rem; font-weight: 600; }

/* On the single-column mobile hero, unwrap the aside so the press note can follow the order buttons. */
@media (max-width: 40rem) {
  .hero__aside { display: contents; }
  .hero-press { order: 1; width: 100%; max-width: 22rem; margin: 0 auto; }
}

.press-teaser h2 { margin-bottom: 0.5rem; }
.press-teaser__list { list-style: none; padding: 0; margin: 0; }
.press-teaser__list li {
  display: grid;
  gap: 0.15rem;
  padding: 0.85rem 0;
  border-top: 1px solid color-mix(in srgb, var(--color-ink) 15%, transparent);
}
.press-teaser__list li:first-child { border-top: 0; }
.press-teaser__list a { font-weight: 600; }
.press-teaser__meta { font-size: 0.9rem; color: var(--color-text-muted); }
.press-teaser__outlet { font-weight: 700; color: var(--color-ink); }
.press-teaser__all { margin: 0.75rem 0 0; }

/* Admin: In the Press */
.admin-heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.admin-heading-row h1 { margin: 0; }
.admin-grid--press td:nth-child(3) { white-space: normal; }
.modal-panel--wide { max-width: 38rem; max-height: 90vh; overflow-y: auto; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 1rem; }
.form-hint { font-weight: 400; color: var(--color-text-muted); font-size: 0.9rem; }
