/* Watertree Press — site stylesheet */

:root {
  --bg: #fafaf8;
  --bg-card: #ffffff;
  --bg-alt: #eef3f4;
  --text: #22303a;
  --text-muted: #5b6b76;
  --brand: #205d9c;
  --brand-dark: #17456f;
  --accent: #3a76ad;
  --border: #dde4e7;
  --shadow: 0 1px 3px rgba(20, 48, 60, 0.08), 0 4px 16px rgba(20, 48, 60, 0.06);
  --radius: 10px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14191d;
    --bg-card: #1c2329;
    --bg-alt: #1a2228;
    --text: #dde4e8;
    --text-muted: #93a3ad;
    --brand: #6aa7dc;
    --brand-dark: #8ec1ea;
    --accent: #7fb3e0;
    --border: #2c363e;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 16px rgba(0, 0, 0, 0.3);
  }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; }

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

h1, h2, h3 { font-family: var(--serif); line-height: 1.25; }

.wrap {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 48px;
  width: auto;
  max-width: 100%;
}

@media (prefers-color-scheme: dark) {
  /* Lift the navy logo art so it stays legible on the dark header */
  .logo img { filter: brightness(1.7) saturate(0.75); }
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
}

.site-nav a:hover { color: var(--brand); background: var(--bg-alt); }
.site-nav a[aria-current="page"] { color: var(--brand); background: var(--bg-alt); }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--brand-dark), var(--brand));
  color: #f2f7f8;
  padding: 1.1rem 0;
}

.hero .wrap { text-align: center; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (prefers-color-scheme: dark) {
  .hero { background: linear-gradient(160deg, #0f2c47, #205d9c); color: #e6f0f2; }
}

.hero p.sub {
  font-size: 1rem;
  opacity: 0.92;
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--bg-card);
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.btn:hover { transform: translateY(-1px); color: var(--brand-dark); }

.btn.solid {
  background: var(--brand);
  color: #ffffff;
  border-color: transparent;
}

.btn.solid:hover { background: var(--brand-dark); color: #ffffff; }

@media (prefers-color-scheme: dark) {
  .btn.solid { color: #10181c; }
  .btn.solid:hover { color: #10181c; }
}

/* Sections */
.section { padding: 3rem 0; }
.section.alt { background: var(--bg-alt); }

.section > .wrap > h2,
.page-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 1.5rem;
}

.section-intro { max-width: 46rem; color: var(--text-muted); margin-bottom: 2rem; }

/* Book grid */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}

.book-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem;
  display: flex;
  gap: 1.1rem;
}

.book-card .cover {
  flex-shrink: 0;
  width: 110px;
}

.book-card .cover img {
  width: 110px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.book-card h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }

.book-card h3 a { text-decoration: none; color: var(--text); }
.book-card h3 a:hover { color: var(--brand); }

.book-card .byline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.book-card .desc { font-size: 0.92rem; color: var(--text-muted); }

.book-card .more {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.45rem;
}

/* Book detail pages */
.book-detail {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding: 3rem 0;
}

.book-detail aside { position: sticky; top: 5.5rem; }

.book-detail aside img {
  width: 100%;
  max-width: 240px;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
}

.buy-box {
  margin-top: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  font-size: 0.92rem;
}

.buy-box h3 {
  font-family: var(--sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.buy-box ul { list-style: none; }
.buy-box li { margin-bottom: 0.45rem; }

.buy-box .isbn {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.83rem;
}

.book-detail h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-bottom: 0.35rem; }

.book-detail .byline { color: var(--text-muted); font-size: 1.05rem; margin-bottom: 1.5rem; }

.book-detail .prose p { margin-bottom: 1rem; }

.book-detail h2 {
  font-size: 1.35rem;
  margin: 2rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

blockquote {
  border-left: 3px solid var(--brand);
  background: var(--bg-alt);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.9rem 1.2rem;
  margin: 0 0 1rem;
  font-size: 0.97rem;
}

blockquote cite {
  display: block;
  margin-top: 0.5rem;
  font-style: normal;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Generic content pages */
.page { padding: 3rem 0; max-width: 46rem; }
.page p, .page ul, .page ol { margin-bottom: 1rem; }
.page h2 { font-size: 1.35rem; margin: 2rem 0 0.75rem; }
.page ul, .page ol { padding-left: 1.4rem; }

/* Contact cards */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.contact-card h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }
.contact-card p { margin-bottom: 0.5rem; font-size: 0.95rem; }
.contact-card address { font-style: normal; color: var(--text-muted); }

/* Companion materials */
.materials details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.materials summary {
  cursor: pointer;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 1rem 1.25rem;
  list-style-position: inside;
}

.materials summary:hover { color: var(--brand); }

.materials details > div { padding: 0 1.5rem 1.25rem; }

.materials h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }

.materials ul {
  list-style: none;
  columns: 2;
  column-gap: 2rem;
  font-size: 0.93rem;
}

.materials ul.single { columns: 1; }
.materials li { margin-bottom: 0.35rem; break-inside: avoid; }
.materials p { font-size: 0.95rem; color: var(--text-muted); margin: 0.4rem 0; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-card);
  margin-top: 3rem;
  padding: 2rem 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2.5rem;
  justify-content: space-between;
}

.site-footer p { max-width: 34rem; }
.site-footer a { color: var(--text-muted); }
.site-footer a:hover { color: var(--brand); }

/* Responsive */
@media (max-width: 720px) {
  .book-detail { grid-template-columns: 1fr; }
  .book-detail aside { position: static; display: flex; flex-direction: column; align-items: center; }
  .buy-box { width: 100%; }
  .materials ul { columns: 1; }
  .site-header .wrap { justify-content: center; text-align: center; }
}
