/* ---------------------------------------------------------------
   The Haven Creek Sagas — site styles
   Palette sampled from the Book One cover: warm cream and amber off
   the prairie, the deep garnet of the spine as the accent, and the
   slate of Kate's dress. Literary book-jacket typography.
   --------------------------------------------------------------- */

:root {
  --paper: #f4efe6;        /* warm cream ground */
  --paper-deep: #ece5d5;   /* slightly deeper panel */
  --ink: #2a2520;          /* near-black warm ink */
  --ink-soft: #5d554a;     /* secondary text */
  /* Sampled from the Book One cover. The spine garnet is the book's
     signature colour and carries the accents here; the cover has no
     green in it, which is why the old sage tones are gone. */
  --garnet: #5a1f25;       /* spine — the book's accent colour */
  --garnet-soft: #7a3a3e;  /* lighter garnet for rules and borders */
  --slate: #303945;        /* Kate's dress */
  --gold: #b07c4e;         /* cover amber / lit prairie grass */
  --wood: #6b4a30;         /* warm umber from the cover foreground */
  --line: #d7cdba;         /* hairline rules */
  --serif-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --serif-text: "EB Garamond", "Iowan Old Style", Georgia, serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 1.125rem;
  line-height: 1.65;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ----- header / nav ----- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 1.4rem 0 1.2rem;
  box-shadow: 0 1px 6px rgba(42, 37, 32, 0.06);
}

/* keep anchored sections from hiding under the sticky header */
[id] { scroll-margin-top: 5.5rem; }

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.wordmark {
  font-family: var(--serif-display);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
}

.wordmark span { color: var(--garnet); }

.site-nav a {
  font-family: var(--serif-text);
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  margin-left: 1.6rem;
  padding-bottom: 0.2rem;
}

.site-nav a:first-child { margin-left: 0; }

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom: 1px solid var(--gold);
}

/* ----- shared type ----- */

h1, h2, h3 {
  font-family: var(--serif-display);
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--garnet);
  margin-bottom: 0.9rem;
}

.rule {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0;
}

a { color: var(--slate); }

/* ----- buttons ----- */

.btn {
  display: inline-block;
  font-family: var(--serif-text);
  font-size: 0.9rem;
  line-height: 1.4;          /* keeps <button> and <a> buttons the same height */
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--wood);
  color: var(--wood);
  background: transparent;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn:hover { background: var(--wood); color: var(--paper); }

.btn-solid {
  background: var(--slate);
  border-color: var(--slate);
  color: var(--paper);
}

.btn-solid:hover { background: var(--ink); border-color: var(--ink); }

/* ----- hero ----- */

.hero {
  padding: 5.5rem 0 5rem;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg,
      rgba(244, 239, 230, 0.96) 0%,
      rgba(244, 239, 230, 0.88) 50%,
      rgba(244, 239, 230, 0.62) 100%),
    url("valley-header.jpg") center / cover no-repeat;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4rem);
  margin-bottom: 1.2rem;
}

.hero .hook {
  max-width: 34em;
  font-size: 1.25rem;
  color: var(--ink-soft);
  margin-bottom: 2.2rem;
}

.hero .actions { display: flex; flex-wrap: wrap; gap: 1rem; }

/* ----- sections ----- */

.section { padding: 4rem 0; }

.section + .section { border-top: 1px solid var(--line); }

/* a slightly deeper ground, so two book blocks in a row read as two */
.section-alt { background: var(--paper-deep); }

.section h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

/* ----- book feature (Book 1) ----- */

.book-feature {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 720px) {
  .book-feature { grid-template-columns: 1fr; }
  .cover-placeholder, .cover-img { margin: 0 auto; }
}

.cover-img {
  display: block;
  width: 260px;
  height: auto;
  border: 1px solid var(--wood);
  box-shadow: 0 10px 28px rgba(42, 37, 32, 0.22);
}

/* Typographic stand-in until the real cover art is added.
   Replace this whole block with: <img src="images/book1-cover.jpg" ...> */
.cover-placeholder {
  width: 260px;
  aspect-ratio: 2 / 3;
  background: var(--slate);
  color: var(--paper);
  border: 1px solid var(--wood);
  outline: 1px solid var(--gold);
  outline-offset: -10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  padding: 2.2rem 1.4rem;
}

.cover-placeholder .cover-series {
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #c8cdd2;
}

.cover-placeholder .cover-title {
  font-family: var(--serif-display);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.2;
}

.cover-placeholder .cover-author {
  font-size: 0.8rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: #c8cdd2;
}

.book-meta {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.6rem;
}

.book-feature h3, .book-block h3 {
  font-size: 1.7rem;
  margin-bottom: 1rem;
}

.book-copy p { margin-bottom: 1rem; max-width: 38em; }

.placeholder-note {
  border-left: 3px solid var(--gold);
  background: var(--paper-deep);
  padding: 0.9rem 1.2rem;
  font-style: italic;
  color: var(--ink-soft);
  margin: 1.2rem 0;
  max-width: 38em;
}

.content-note {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: 1.2rem;
}

/* The buy buttons are the site's own .btn-solid — they used to copy the
   Lulu widget's styling, but the direct-sales button has been removed. */
.buy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1.6rem;
}

/* ----- Buy Direct popup ----- */

.modal[hidden] { display: none; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(42, 37, 32, 0.62);
}

.modal-panel {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--wood);
  box-shadow: 0 20px 60px rgba(42, 37, 32, 0.4);
  width: 100%;
  max-width: 640px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2rem 2rem 2.2rem;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.9rem;
  background: none;
  border: 0;
  font-family: var(--serif-text);
  font-size: 2rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
}

.modal-close:hover { color: var(--ink); }

.modal-loading { color: var(--ink-soft); padding: 2rem 0; }

@media (max-width: 520px) {
  .modal { padding: 0.75rem; }
  .modal-panel { padding: 1.5rem 1.2rem 1.8rem; max-height: 92vh; }
}

/* ----- ARC offer callout (temporary — remove with its HTML section) ----- */

.arc-section { padding: 3.2rem 0; }

.arc-card {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: 2.2rem 2.4rem 2.4rem;
  max-width: 44em;
}

.arc-card h2 { font-size: 1.85rem; margin-bottom: 1rem; }

.arc-card p { max-width: 38em; margin-bottom: 1rem; }

.arc-card .arc-note {
  font-size: 0.95rem;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 1.6rem;
}

@media (max-width: 520px) {
  .arc-card { padding: 1.6rem 1.4rem 1.8rem; }
  .arc-card .btn { display: block; text-align: center; }
}

/* ----- full-width photographic band ----- */

/* Height scales with width so the crop stays proportional — a fixed height
   crops harder on wide screens and was cutting off the teacher's head. */
.band {
  height: clamp(200px, 22vw, 460px);
  background-position: center 40%;
  background-size: cover;
  background-repeat: no-repeat;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* ----- series list ----- */

.series-list { list-style: none; }

.series-list li {
  display: grid;
  grid-template-columns: 3.2rem 1fr auto;
  gap: 1.5rem;
  align-items: baseline;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--line);
}

.series-list .num {
  font-family: var(--serif-display);
  font-size: 1.9rem;
  color: var(--garnet);
}

.series-list .title {
  font-family: var(--serif-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.series-list .title a { color: var(--ink); text-decoration: none; }
.series-list .title a:hover { border-bottom: 1px solid var(--gold); }

.series-list .years { color: var(--ink-soft); font-size: 1rem; }

.status {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  white-space: nowrap;
}

.status.available {
  border-color: var(--garnet);
  color: var(--garnet);
}

@media (max-width: 620px) {
  .series-list li { grid-template-columns: 2.4rem 1fr; }
  .series-list .status { grid-column: 2; justify-self: start; }
}

/* ----- news ----- */

.news-item { padding: 2rem 0; border-bottom: 1px solid var(--line); }

.news-item time {
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--garnet);
}

.news-item h3 { font-size: 1.5rem; margin: 0.5rem 0 0.8rem; }

.news-item h3 a { color: var(--ink); text-decoration: none; }
.news-item h3 a:hover { border-bottom: 1px solid var(--gold); }

.news-item p { max-width: 40em; color: var(--ink-soft); margin-bottom: 1rem; }

.news-item p:last-child { margin-bottom: 0; }

.all-posts-link { margin-top: 2rem; }

.all-posts-link a {
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
}

.all-posts-link a:hover { color: var(--ink); }

/* ----- about ----- */

.about-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

.author-photo {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--wood);
  box-shadow: 0 10px 28px rgba(42, 37, 32, 0.22);
}

@media (max-width: 720px) {
  .about-grid { grid-template-columns: 1fr; }
  .author-photo { max-width: 320px; margin: 0 auto; }
}

.about-body p { max-width: 38em; margin-bottom: 1.1rem; }

.dedication {
  font-family: var(--serif-display);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--slate);
  border-left: 3px solid var(--garnet-soft);
  padding-left: 1.4rem;
  margin: 2.2rem 0;
  max-width: 32em;
}

.dedication cite {
  display: block;
  font-family: var(--serif-text);
  font-style: normal;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.7rem;
}

/* ----- newsletter ----- */

.newsletter {
  background:
    linear-gradient(rgba(38, 47, 55, 0.88), rgba(38, 47, 55, 0.92)),
    url("valley-sunset.jpg") center 55% / cover no-repeat;
  color: var(--paper);
  padding: 4rem 0;
}

.newsletter h2 { color: var(--paper); font-size: 1.9rem; margin-bottom: 0.7rem; }

.newsletter p { color: #cdd3d8; max-width: 36em; margin-bottom: 1.6rem; }

.newsletter form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  max-width: 34em;
}

.newsletter input[type="email"],
.newsletter input[type="text"] {
  flex: 1 1 14em;
  font-family: var(--serif-text);
  font-size: 1rem;
  padding: 0.75rem 1rem;
  border: 1px solid #6b7883;
  background: #f4efe6;
  color: var(--ink);
}

.newsletter .btn {
  border-color: var(--gold);
  color: var(--paper);
  background: transparent;
}

.newsletter .btn:hover { background: var(--gold); color: var(--ink); }

.newsletter .fine-print {
  font-size: 0.9rem;
  color: #aab3ba;
  margin-top: 1rem;
  margin-bottom: 0;
}

/* ----- Kit (kit.com) signup form -----
   Kit draws its own form into this section and ships it with inline
   styles plus a stylesheet it injects after ours, so these overrides
   need !important to land. Class names below are Kit's, not ours — if
   the form ever stops matching the page, Kit changed its markup. */

.newsletter .formkit-form {
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  /* Kit ships a pale drop shadow that reads as a grey panel on this
     dark band */
  box-shadow: none !important;
  max-width: 34em !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Kit's own heading, sub-heading and template artwork repeat what the
   section already says above the form — the page supplies those. */
.newsletter .formkit-form [data-element="header"],
.newsletter .formkit-form [data-element="subheader"],
.newsletter .formkit-form [data-element="guarantee"],
.newsletter .formkit-form .formkit-image,
.newsletter .formkit-form .formkit-background {
  display: none !important;
}

/* Kit's "full" template is a two-column grid — artwork on the left,
   fields on the right. With the artwork hidden the left column would
   still hold its half of the grid, so collapse the grid to a single
   flow and let the empty column fall to nothing. */
.newsletter .formkit-form [data-style="full"] {
  display: block !important;
}

.newsletter .formkit-form .formkit-column {
  background-color: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.newsletter .formkit-form .seva-fields {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 0.8rem !important;
  margin: 0 !important;
}

.newsletter .formkit-form .formkit-field {
  flex: 1 1 16em;
  margin: 0 !important;
}

.newsletter .formkit-form .formkit-input {
  /* block, so its wrapper isn't padded out by the line box under an
     inline-block — that gap is what would leave the button short */
  display: block !important;
  width: 100% !important;
  font-family: var(--serif-text) !important;
  font-size: 1rem !important;
  padding: 0.75rem 1rem !important;
  border: 1px solid #6b7883 !important;
  border-radius: 0 !important;
  background: #f4efe6 !important;
  color: var(--ink) !important;
}

/* matches .newsletter .btn */
.newsletter .formkit-form .formkit-submit {
  flex: 0 0 auto !important;
  align-self: stretch !important;
  width: auto !important;
  font-family: var(--serif-text) !important;
  font-size: 0.9rem !important;
  line-height: 1.4 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase !important;
  padding: 0.75rem 1.5rem !important;
  /* Kit's 15px bottom margin would inflate the flex row and leave the
     button standing shorter than the field beside it */
  margin: 0 !important;
  border: 1px solid var(--gold) !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  color: var(--paper) !important;
  font-weight: 400 !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Kit puts its own padding on the label inside the button, which would
   stack with the button's and make it taller than the input beside it. */
.newsletter .formkit-form .formkit-submit > div,
.newsletter .formkit-form .formkit-submit > span {
  padding: 0 !important;
  margin: 0 !important;
}

.newsletter .formkit-form .formkit-submit:hover {
  background-color: var(--gold) !important;
  color: var(--ink) !important;
}

/* success / error notices, on the dark band */
.newsletter .formkit-form .formkit-alert {
  font-family: var(--serif-text) !important;
  border-radius: 0 !important;
  margin: 0 0 0.8rem !important;
}

.newsletter .formkit-form .formkit-powered-by-convertkit-container {
  margin: 1rem 0 0 !important;
  justify-content: flex-start !important;
  text-align: left !important;
}

.newsletter .formkit-form .formkit-powered-by-convertkit {
  margin-left: 0 !important;
  margin-right: auto !important;
  color: #aab3ba !important;
  opacity: 0.75;
}

/* ----- footer ----- */

.site-footer {
  padding: 2.5rem 0 3rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 2rem;
}

.social-row {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.social-row a {
  color: var(--ink-soft);
  display: inline-flex;
  transition: color 0.15s ease;
}

.social-row a:hover { color: var(--ink); }

.social-row svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
}

.footer-link a {
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.footer-link a:hover { color: var(--ink); border-bottom-color: var(--gold); }

/* ----- long-form post page (a-note-on-ai.html) ----- */

.post { padding: 4rem 0 4.5rem; }

.post-head { max-width: 34em; margin-bottom: 2.6rem; }

.post-head h1 {
  font-size: clamp(2.1rem, 5vw, 3rem);
  margin: 0.6rem 0 1rem;
}

.post-head .byline {
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.post-body { max-width: 34em; }

.post-body p { margin-bottom: 1.35rem; }

.post-body p.lede {
  font-size: 1.25rem;
  line-height: 1.55;
  color: var(--slate);
}

.post-body hr.rule { margin: 2.6rem 0; }

.post-foot {
  max-width: 34em;
  margin-top: 3rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}
