/* Michael Lynes — Isaac Alvarez Mysteries.
   Editorial, image-led reskin: Andalusian tilework + a Seville skyline
   photo carry the historical-fiction mood instead of generic template
   chrome. Two backgrounds alternate — warm parchment for reading
   sections, deep ink for the hero/newsletter/footer punctuation. */

:root {
  --paper: #f6f1e6;
  --paper-alt: #ece2ca;
  --ink: #1c1712;
  --ink-soft: #4a4038;
  --ink-faint: #8a7d6c;
  --rule: #ddd0b3;

  --night: #17130f;
  --night-alt: #241d16;
  --cream: #f3ead6;
  --cream-soft: #cfc0a0;

  --terracotta: #a8432c;
  --terracotta-soft: #c25a3f;
  --gold: #b8944f;
  --gold-soft: #d3b876;

  --light: #fffdf8;
  --max: 68rem;
  --measure: 38rem;
  --radius: 3px;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--terracotta); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--terracotta-soft); }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); margin-top: 0; }
h3 { font-size: 1.4rem; margin-top: 0; }
p { margin: 0 0 1em; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: var(--measure); }
.eyebrow { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--terracotta); margin: 0 0 1rem; font-weight: 600; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; background: var(--night); color: var(--cream); padding: 0.5rem 1rem; z-index: 999; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }

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

/* Full-bleed helper: escapes any max-width/padding ancestor */
.bleed { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); }

/* A thin repeating strip of Andalusian tilework, used as an ornamental
   seam between sections instead of a plain rule. */
.tile-seam { height: 10px; background-image: url('assets/tile-red.jpg'); background-size: 180px auto; background-repeat: repeat-x; background-position: center; }
.tile-seam.is-blue { background-image: url('assets/tile-blue.jpg'); }

.site-header {
  background: var(--night);
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.5rem; gap: 1rem;
}
.site-header-inner { max-width: var(--max); margin: 0 auto; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; font-family: var(--font-serif); font-weight: 600; font-size: 1.05rem; text-decoration: none; color: var(--cream); }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; background: var(--terracotta); color: var(--cream); font-family: var(--font-serif); font-size: 0.9rem; font-weight: 600; border-radius: 50%; }
nav#site-nav { display: flex; align-items: center; gap: 1.75rem; }
nav#site-nav a { text-decoration: none; color: var(--cream-soft); font-size: 0.92rem; letter-spacing: 0.02em; }
nav#site-nav a:hover { color: var(--cream); }
.menu-toggle { display: none; background: none; border: 0; padding: 0.5rem; cursor: pointer; flex-direction: column; gap: 5px; }
.menu-toggle i { display: block; width: 22px; height: 2px; background: var(--cream); }
.menu-toggle[aria-expanded="true"] i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero: full-bleed Seville skyline, dark gradient for legibility */
.hero {
  background-image: linear-gradient(180deg, rgba(23,19,15,0.55) 0%, rgba(23,19,15,0.82) 65%, var(--night) 100%), url('assets/seville-skyline.jpg');
  background-size: cover;
  background-position: center 65%;
  color: var(--cream);
  padding: 5.5rem 1.5rem 4.5rem;
}
.hero-inner { max-width: var(--max); margin: 0 auto; }
.hero .eyebrow { color: var(--gold-soft); }
.hero h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); max-width: 22ch; margin-bottom: 0.35em; }
.hero .lead { color: var(--cream-soft); font-size: 1.2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 2.25rem 0 0; }

.button {
  display: inline-flex; align-items: center; gap: 0.6rem;
  background: var(--ink); color: var(--paper);
  padding: 0.9rem 1.6rem; border-radius: var(--radius);
  text-decoration: none; font-weight: 500; border: 0; cursor: pointer;
  font-size: 0.98rem; font-family: inherit; letter-spacing: 0.01em;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.button:hover { background: var(--terracotta); color: var(--cream); }
.button-invert { background: var(--gold); color: var(--night); }
.button-invert:hover { background: var(--gold-soft); color: var(--night); }
.button-outline { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.button-outline:hover { background: var(--paper-alt); color: var(--ink); }
.button.is-disabled, .button.is-disabled:hover { background: transparent; color: var(--ink-faint); border: 1px dashed var(--rule); cursor: default; }

.section { padding: 4.5rem 0; }
.section-head { max-width: var(--measure); margin: 0 0 2.5rem; }
.placeholder-note { color: var(--ink-faint); font-style: italic; font-size: 0.95rem; }

/* About */
.about-grid { display: grid; grid-template-columns: 13rem 1fr; gap: 3rem; align-items: start; }
.about-portrait-frame { border-radius: 50%; padding: 6px; background: linear-gradient(160deg, var(--gold-soft), var(--terracotta)); }
.about-portrait { border-radius: 50%; aspect-ratio: 1 / 1; object-fit: cover; width: 100%; height: auto; display: block; border: 4px solid var(--paper); }
.about-copy p { max-width: var(--measure); }
.about-copy .lead-in { font-family: var(--font-serif); font-size: 1.25rem; color: var(--ink); }

/* Books: alternating editorial rows */
.book-rows { margin-top: 1rem; }
.book-row { display: grid; grid-template-columns: minmax(12rem, 19rem) 1fr; gap: 3rem; align-items: center; padding: 3rem 0; border-top: 1px solid var(--rule); }
.book-row:first-child { border-top: 0; padding-top: 0.5rem; }
.book-row:nth-child(even) { grid-template-columns: 1fr minmax(12rem, 19rem); }
.book-row:nth-child(even) .book-row-cover { grid-column: 2; grid-row: 1; }
.book-row:nth-child(even) .book-row-copy { grid-column: 1; grid-row: 1; }
.book-index { font-family: var(--font-serif); font-size: 1rem; color: var(--gold); letter-spacing: 0.08em; margin-bottom: 0.5rem; }
.book-row-cover { position: relative; }
.book-cover { width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 2px; background: var(--paper-alt); box-shadow: 0 1.5rem 3rem -1.2rem rgba(28, 23, 18, 0.45); }
.book-row-copy h3 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.book-hook { color: var(--ink-soft); font-size: 1.05rem; }
.book-quote { font-family: var(--font-serif); font-style: italic; color: var(--ink); font-size: 1.05rem; border-left: 2px solid var(--gold); padding-left: 1rem; margin: 1.25rem 0 1.5rem; }
.book-rating { display: flex; align-items: center; gap: 0.35rem; font-size: 0.92rem; color: var(--ink-soft); margin: 0 0 1.25rem; }
.book-rating > span[aria-hidden] { color: var(--gold); }
.book-rating-count { color: var(--ink-faint); }
.book-row .button { margin-top: 0.25rem; }

/* Newsletter: dark interlude */
.newsletter { background: var(--night); color: var(--cream); }
.newsletter .eyebrow { color: var(--gold-soft); }
.newsletter h2 { color: var(--cream); }
.newsletter-form { display: flex; flex-wrap: wrap; gap: 0.75rem; max-width: 28rem; margin-top: 1.5rem; }
.newsletter-form input { flex: 1 1 14rem; padding: 0.8rem 1rem; border: 1px solid var(--cream-soft); border-radius: var(--radius); font-family: inherit; font-size: 1rem; background: var(--night-alt); color: var(--cream); }
.newsletter-form input::placeholder { color: var(--ink-faint); }
.newsletter-form input:disabled { opacity: 0.55; }
.newsletter .placeholder-note { color: var(--cream-soft); opacity: 0.8; max-width: var(--measure); }

/* Contact: single, wide column, understated underline fields */
.contact-copy { max-width: var(--measure); margin: 0 auto 2.5rem; text-align: center; }
.contact-copy .eyebrow { display: block; }
.contact-form { max-width: 34rem; margin: 0 auto; }
.contact-form .field { margin-bottom: 1.5rem; }
.contact-form label { display: block; font-weight: 500; font-size: 0.9rem; color: var(--ink-soft); margin-bottom: 0.4rem; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 0.65rem 0.1rem; border: 0; border-bottom: 1px solid var(--rule);
  border-radius: 0; font-family: inherit; font-size: 1.05rem; background: transparent; color: var(--ink);
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-bottom-color: var(--terracotta); }
.contact-form .button { display: block; margin: 0 auto; }
.cf-turnstile { margin: 1rem 0; display: flex; justify-content: center; }
.form-status { font-size: 0.95rem; min-height: 1.5em; margin: 1rem 0 !important; text-align: center; }
.form-status[data-state="success"] { color: var(--terracotta); }
.form-status[data-state="error"] { color: #b03a2e; }

footer { background: var(--night); color: var(--cream-soft); }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 2.5rem 1.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.9rem; }
footer p { margin: 0; }
footer .brand { color: var(--cream); }

@media (max-width: 800px) {
  body { font-size: 16px; }
  .menu-toggle { display: flex; }
  nav#site-nav { position: absolute; top: 4rem; right: 1rem; left: 1rem; background: var(--night-alt); border: 1px solid var(--night); border-radius: var(--radius); padding: 1.5rem; flex-direction: column; align-items: stretch; gap: 0.5rem; display: none; }
  nav#site-nav[data-open="true"] { display: flex; }
  nav#site-nav a { padding: 0.65rem 0.5rem; min-height: 44px; }
  .section { padding: 3rem 0; }
  .about-grid { grid-template-columns: 1fr; }
  .about-portrait-frame { width: 8rem; }
  .book-row, .book-row:nth-child(even) { grid-template-columns: 1fr; }
  .book-row:nth-child(even) .book-row-cover, .book-row:nth-child(even) .book-row-copy { grid-column: 1; grid-row: auto; }
  .book-row-cover { max-width: 14rem; }
}
