@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400;1,700&family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap');

:root {
  --sand:   #f4ebd0;
  --ink:    #2c2a25;
  --sea:    #3a7b92;
  --rope:   #a67c52;
  --accent: #b84b29;
  --white:  #ffffff;
  --muted:  #666;
  --rule:   rgba(0,0,0,0.09);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Lora', Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: url('/images_cache/bondi_pattern.svg') repeat;
  background-color: var(--sand);
  background-size: 500px;
  line-height: 1.6;
  font-size: 1rem;
}

h1, h2, h3, .nav-brand {
  font-family: 'Playfair Display', serif;
}

/* ── Navigation ─────────────────────────────────────────── */
nav {
  background: var(--ink);
  padding: 0 1.5rem;
}
.nav-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 0;
}
.nav-brand {
  color: var(--sand);
  text-decoration: none;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin-right: auto;
  white-space: nowrap;
}
nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
nav ul a {
  color: #c8bfa8;
  text-decoration: none;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  transition: color 0.15s;
}
nav ul a:hover,
nav ul a.active { color: var(--sand); }
nav ul a.cta-link {
  color: #e8a87c;
}
nav ul a.cta-link:hover { color: var(--sand); }

/* ── Page header ─────────────────────────────────────────── */
.page-header {
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--rule);
}
.page-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.page-header .subtitle {
  color: var(--sea);
  font-style: italic;
  margin: 0;
  font-size: 1.1rem;
}

/* ── Hero (home only) ────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 5rem 1.5rem 4rem;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(rgba(244, 235, 208, 0.75), rgba(244, 235, 208, 0.95)), url('/images_cache/photos/photo_bondi_beach_crowd.jpg') center/cover no-repeat;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  margin: 0 0 0.4rem;
  letter-spacing: 0.02em;
}
.hero .tagline {
  color: var(--sea);
  font-style: italic;
  font-size: 1.25rem;
  margin: 0 0 2rem;
}
.hero .lead {
  max-width: 560px;
  margin: 0 auto 2.5rem;
  font-size: 1.1rem;
  color: #444;
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.85rem 2rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1.05rem;
  transition: background 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: var(--white);
}
.btn-primary:hover { background: #a83f1f; }
.btn-secondary {
  background: var(--sea);
  color: var(--white);
}
.btn-secondary:hover { background: #245a73; }

/* ── Main content wrapper ────────────────────────────────── */
main {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}
main.narrow {
  max-width: 720px;
}

/* ── Section spacing ─────────────────────────────────────── */
section { margin-bottom: 3.5rem; }
section h2 {
  font-size: 1.5rem;
  color: var(--sea);
  margin: 0 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}

/* ── Series card (home + books grid) ────────────────────── */
.series-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  gap: 1.5rem;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s;
}
.series-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.series-card img {
  width: 120px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 3px;
}
.series-card-body h3 {
  margin: 0 0 0.3rem;
  font-size: 1.3rem;
  color: var(--ink);
}
.series-card-body .series-sub {
  color: var(--rope);
  font-style: italic;
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}
.series-card-body p {
  margin: 0 0 1rem;
  color: #444;
  font-size: 0.95rem;
}
.series-card-body .card-link {
  color: var(--sea);
  font-weight: bold;
  font-size: 0.95rem;
}

/* ── Books grid (series page) ────────────────────────────── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}
.book-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.book-card img {
  width: 100%;
  display: block;
  aspect-ratio: 2/3;
  object-fit: cover;
}
.book-card-body {
  padding: 1rem 1.25rem 1.25rem;
}
.book-card-body .book-num {
  color: var(--rope);
  font-size: 0.85rem;
  font-weight: bold;
  margin: 0 0 0.2rem;
}
.book-card-body h3 {
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
}
.book-card-body .blurb {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.55;
  margin: 0 0 1rem;
}
.book-card-body .status {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

/* ── CTA box ─────────────────────────────────────────────── */
.cta-box {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 2.5rem 2rem;
  text-align: center;
  margin: 3rem 0;
}
.cta-box h2 {
  border: none;
  color: var(--ink);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}
.cta-box p {
  color: var(--muted);
  margin: 0 0 1.5rem;
}

/* ── Per-page wallpaper overrides ────────────────────────── */
body.page-series {
  background-image: url('/images_cache/wallpapers/wallpaper_dogs.png');
  background-size: 420px;
}
body.page-newsletter {
  background-image: none;
  position: relative;
}
body.page-newsletter::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('/images_cache/wallpapers/wallpaper_letters.png');
  background-size: 600px;
  opacity: 0.18;
  z-index: -1;
  pointer-events: none;
}

/* ── Scattered photos ────────────────────────────────────── */
.photo-scatter {
  position: relative;
  height: 380px;
  max-width: 900px;
  margin: 0 auto 1rem;
  pointer-events: none;
}
.photo-scatter .snap {
  position: absolute;
  box-shadow: 3px 6px 22px rgba(0,0,0,0.22);
  max-height: 300px;
  width: auto;
}
.photo-scatter .snap:nth-child(1) {
  width: 270px;
  left: 2%;
  top: 55px;
  transform: rotate(-5deg);
  z-index: 1;
}
.photo-scatter .snap:nth-child(2) {
  width: 420px;
  left: 22%;
  top: 15px;
  transform: rotate(2.5deg);
  z-index: 3;
}
.photo-scatter .snap:nth-child(3) {
  width: 360px;
  right: 1%;
  top: 65px;
  transform: rotate(-2deg);
  z-index: 2;
}
/* Series page — 2-photo scatter */
.photo-scatter.two-up {
  height: 440px;
}
.photo-scatter.two-up .snap:nth-child(1) {
  width: 520px;
  left: 3%;
  top: 25px;
  transform: rotate(-3deg);
  z-index: 1;
}
.photo-scatter.two-up .snap:nth-child(2) {
  width: 480px;
  right: 2%;
  top: 55px;
  transform: rotate(3.5deg);
  z-index: 2;
}

/* ── Featured standalone photo ───────────────────────────── */
.photo-feature {
  display: block;
  margin: 2.5rem auto;
  max-width: 700px;
  width: 100%;
  box-shadow: 4px 7px 24px rgba(0,0,0,0.2);
}
.photo-feature.tilt-left  { transform: rotate(-2deg); }
.photo-feature.tilt-right { transform: rotate(2deg); }

/* ── Illustration banner ─────────────────────────────────── */
.illustration-banner {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 3px 14px rgba(0,0,0,0.15);
  display: block;
  margin: 0 0 2.5rem;
}

/* ── World page ──────────────────────────────────────────── */
.world-intro p {
  font-size: 1.05rem;
  max-width: 680px;
}

/* ── Footer ──────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.88rem;
  border-top: 1px solid var(--rule);
}
footer a { color: var(--sea); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .series-card { flex-direction: column; }
  .series-card img { width: 100%; height: 200px; }
  .books-grid { grid-template-columns: 1fr; }
  .nav-brand { font-size: 0.95rem; }
  .photo-scatter {
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 0 2rem;
  }
  .photo-scatter .snap,
  .photo-scatter.two-up .snap {
    position: static;
    width: 88%;
    max-width: 360px;
    max-height: none;
  }
  .photo-scatter .snap:nth-child(odd)  { transform: rotate(-2deg); }
  .photo-scatter .snap:nth-child(even) { transform: rotate(2deg); }
}
