/* ==========================================================================
   trevor-croft.com — theme
   Replicates the Divi "fairy-tale" theme: Milonga everywhere, crimson accent,
   cream/yellow section bands, ornamental drop-caps and divider flourishes.
   ========================================================================== */

@font-face {
  font-family: "Milonga";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/milonga-regular.woff2") format("woff2");
}

:root {
  --crimson: #990033;
  --navy: #1f2a44;
  --ink: #1a1a1a;
  --band-yellow: #f3e8b2;
  --band-cream: #fff9e2;
  --white: #ffffff;
  --rule: #e4ddc4;
  --maxw: 1080px;
  --font: "Milonga", "Palatino Linotype", Palatino, Georgia, serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
}

h1, h2, h3, h4 {
  font-family: var(--font);
  color: var(--navy);
  font-weight: 400;
  line-height: 1.2;
  margin: 0 0 0.4em;
}

h1 { font-size: 2.6rem; }
h2 { font-size: 2.1rem; }
h3 { font-size: 1.5rem; }

p { margin: 0 0 1.2em; }

a { color: var(--crimson); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--crimson);
  color: #fff;
  padding: 0.6em 1em;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  justify-content: center;
}
.nav-menu {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(1rem, 4vw, 3.25rem);
  margin: 0;
  padding: 1.6rem 0;
}
.nav-item a {
  color: var(--navy);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.nav-item a:hover { color: var(--crimson); text-decoration: none; }
.nav-item.current a { color: var(--crimson); }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 1.1rem 0;
  width: 44px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--navy);
  margin: 5px 0;
}

/* ---------- Sections / bands ---------- */
.section { padding: 4.5rem 1.25rem; }
.section .inner { max-width: var(--maxw); margin: 0 auto; }
.band-white  { background: var(--white); }
.band-yellow { background: var(--band-yellow); }
.band-cream  { background: var(--band-cream); }

.section-title { text-align: center; }

/* Ornamental divider under headings */
.divider {
  display: block;
  margin: 0.6rem auto 1.4rem;
  width: 205px;
  max-width: 60%;
  height: auto;
}

.subtitle {
  font-size: 1.35rem;
  color: var(--navy);
  text-align: center;
  margin-top: -0.4rem;
}

/* ---------- Two-column book row ---------- */
.book-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.book-row .text { max-width: 34rem; }
.book-cover { text-align: center; }
/* Cover images are 3-D mockups with their own shadow baked in — no extra box-shadow. */

/* Drop cap */
.dropcap::first-letter {
  color: var(--crimson);
  font-size: 3.6em;
  line-height: 0.8;
  float: left;
  padding: 0.05em 0.08em 0 0;
}

.blockquote-quote {
  position: relative;
  padding-left: 2.4rem;
}
.blockquote-quote::before {
  content: "\201C";
  position: absolute;
  left: 0;
  top: -0.3em;
  font-size: 3rem;
  color: #b9b9b9;
}
.quote-attr { font-size: 1rem; }

/* Two-column row with content aligned to the top (e.g. The Author: text + images) */
.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
@media (max-width: 780px) { .cols-2 { grid-template-columns: 1fr; gap: 1.5rem; } }
.author-media { text-align: center; }
.author-media img { margin-bottom: 1.5rem; max-width: 100%; height: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  border: 2px solid var(--crimson);
  color: var(--crimson);
  background: transparent;
  padding: 0.7rem 1.6rem;
  font-family: var(--font);
  font-size: 1.05rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover {
  background: var(--crimson);
  color: #fff;
  text-decoration: none;
}

.buy-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0;
}

/* ---------- Gallery + lightbox ---------- */
/* Gallery: show only the FIRST illustration as a clickable thumbnail; the rest
   live in the DOM (hidden) so the lightbox can cycle through every image. */
.gallery { text-align: center; margin: 1.5rem 0 0.5rem; line-height: 0; }
.gallery a { display: inline-block; position: relative; cursor: zoom-in; }
.gallery a:not(:first-child) { display: none; }
.gallery img {
  max-width: 360px;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gallery a:first-child:hover img { transform: scale(1.02); box-shadow: 0 6px 18px rgba(0,0,0,0.25); }
/* Magnifier cue overlaid on the thumbnail */
.gallery a:first-child::after {
  content: "\1F50D";
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 1.3rem;
  background: rgba(153, 0, 51, 0.9);
  color: #fff;
  width: 2rem;
  height: 2rem;
  line-height: 2rem;
  text-align: center;
  border-radius: 50%;
}
.gallery-hint {
  text-align: center;
  color: var(--crimson);
  font-size: 1.05rem;
  margin: 0.4rem 0 0;
  line-height: 1.5;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
.lightbox figcaption {
  position: absolute;
  bottom: 4vh;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 1rem;
  padding: 0 1rem;
}
.lightbox button {
  position: absolute;
  background: none;
  border: 0;
  color: #fff;
  font-size: 2.6rem;
  cursor: pointer;
  padding: 0.5rem 1rem;
  line-height: 1;
}
.lb-close { top: 1.5vh; right: 1vw; }
.lb-prev { left: 1vw; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1vw; top: 50%; transform: translateY(-50%); }

/* ---------- Contact form ---------- */
.form-wrap { max-width: 640px; margin: 0 auto; }
.form-field { margin-bottom: 1.3rem; }
.form-field label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--navy);
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid #c9c2a6;
  background: #fffdf5;
}
.form-field textarea { min-height: 160px; resize: vertical; }
.required { color: var(--crimson); }
.form-note { font-size: 0.95rem; }
.form-status { margin-top: 1rem; font-size: 1.05rem; }
.form-status.error { color: var(--crimson); }
.cf-turnstile { margin: 1rem 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: #2c2c2c;
  color: #eee;
  text-align: center;
  padding: 2.5rem 1.25rem;
}
.site-footer h3 { color: #fff; margin-bottom: 1rem; }
.amazon-button img { display: inline-block; }

/* ---------- Prose helpers ---------- */
.prose { max-width: 780px; margin: 0 auto; }
.prose h2, .prose h3 { margin-top: 1.8rem; }
.text-center { text-align: center; }

/* ---------- Responsive ---------- */
@media (max-width: 780px) {
  body { font-size: 18px; }
  h1 { font-size: 2.1rem; }
  h2 { font-size: 1.8rem; }
  .book-row { grid-template-columns: 1fr; gap: 2rem; }
  .book-cover { order: -1; }

  .site-nav { justify-content: space-between; align-items: center; }
  .nav-toggle { display: block; }
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 0 0 1rem;
  }
  .nav-menu.open { display: flex; }
  .nav-item { text-align: center; padding: 0.5rem 0; }
}
