/* ============================================
   Agloe Publishing — shared stylesheet
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=Public+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --bg: #F6F7F1;
  --bg-warm: #FBFAF4;
  --card: #FFFFFF;
  --ink: #212A1E;
  --ink-soft: #4B5A42;
  --ink-faint: #55654C;
  --sage: #5C7355;
  --sage-deep: #35472E;
  --sage-pale: #E4E9DB;
  --gold: #B8922F;
  --gold-pale: #F1E6C8;
  --line: #DBDFCC;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-w: 1120px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; }

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 32px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  margin: 0;
  color: var(--sage-deep);
}

h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 400; line-height: 1.05; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.7rem, 3vw, 2.2rem); font-weight: 400; }
h3 { font-size: 1.25rem; font-weight: 500; }

p { margin: 0 0 1em; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  display: inline-block;
  margin-bottom: 14px;
}

/* Focus visibility — two-ring style stays visible on light, dark, or gold backgrounds */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--bg-warm);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px var(--sage-deep);
  border-radius: 2px;
}

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

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo svg { flex-shrink: 0; }

.logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--sage-deep);
  line-height: 1;
}

.logo-text small {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 3px;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

nav.main-nav a {
  text-decoration: none;
  font-size: 0.95rem;
  color: var(--ink-soft);
  position: relative;
  padding-bottom: 4px;
}

nav.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--sage);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

nav.main-nav a:hover::after,
nav.main-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

nav.main-nav a[aria-current="page"] { color: var(--sage-deep); font-weight: 600; }

.nav-toggle { display: none; }

@media (max-width: 720px) {
  nav.main-nav ul { gap: 20px; }
  nav.main-nav { display: none; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 22px;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.btn-primary { background: var(--sage-deep); color: var(--bg-warm); }
.btn-primary:hover { background: var(--sage); transform: translateY(-1px); }

.btn-secondary { background: transparent; color: var(--sage-deep); border-color: var(--sage-deep); }
.btn-secondary:hover { background: var(--sage-pale); }

.btn-ghost { background: transparent; color: var(--ink-soft); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--sage); color: var(--sage-deep); }

.btn-small { padding: 8px 14px; font-size: 0.82rem; }

/* ---------- Vine / trail divider (signature element) ---------- */
.vine {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 64px 0;
  color: var(--sage);
  opacity: 0.9;
}

.vine .trail-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

.vine svg path.route { stroke-dasharray: 900; stroke-dashoffset: 900; animation: grow 1.6s ease forwards; }
.vine svg path.route-dashed { stroke-dasharray: 3 6; }
.vine svg .marker { opacity: 0; animation: bud 0.5s ease forwards; }
.vine svg .marker:nth-of-type(1) { animation-delay: 0.4s; }
.vine svg .marker:nth-of-type(2) { animation-delay: 0.85s; }
.vine svg .marker:nth-of-type(3) { animation-delay: 1.3s; }

@keyframes grow { to { stroke-dashoffset: 0; } }
@keyframes bud { to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .vine svg path.route { stroke-dashoffset: 0; animation: none; }
  .vine svg .marker { opacity: 1; animation: none; }
}

/* ---------- Topographic texture ---------- */
.topo-bg {
  background-image:
    repeating-radial-gradient(circle at 82% 15%, transparent 0, transparent 26px, rgba(92,115,85,0.09) 27px, rgba(92,115,85,0.09) 28px, transparent 29px, transparent 54px, rgba(92,115,85,0.07) 55px, rgba(92,115,85,0.07) 56px, transparent 57px, transparent 80px, rgba(92,115,85,0.05) 81px, rgba(92,115,85,0.05) 82px);
}

.site-header.topo-bg { background-color: var(--bg-warm); }

/* ---------- Compass rose ---------- */
.compass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compass-caption {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #B4C1A8;
}

/* ---------- Coordinates strip (map-pin style caption) ---------- */
.coords {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  color: var(--sage-deep);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Pin badge on book/author cards ---------- */
.pin-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pin-badge svg { flex-shrink: 0; }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 72px;
  position: relative;
  overflow: hidden;
}

.hero-vine-bg {
  position: absolute;
  right: -60px;
  top: -40px;
  width: 420px;
  opacity: 0.5;
  pointer-events: none;
}

.hero-content { max-width: 640px; position: relative; }

.hero p.lede {
  font-size: 1.15rem;
  margin-top: 22px;
  color: var(--ink-soft);
  max-width: 520px;
}

.hero-actions { display: flex; gap: 14px; margin-top: 32px; flex-wrap: wrap; }

/* ---------- Tags ---------- */
.tag-row { display: flex; flex-wrap: wrap; gap: 10px; }

.tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--sage-pale);
  color: var(--sage-deep);
  padding: 6px 12px;
  border-radius: 999px;
}

.tag.gold { background: var(--gold-pale); color: #7A5F1D; }

/* ---------- Sections ---------- */
section.block { padding: 64px 0; }
section.block.tight { padding: 40px 0; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.section-head p { margin: 6px 0 0; max-width: 480px; }

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: 1fr; }
}

.book-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -18px rgba(33,42,30,0.35); }

.book-cover {
  aspect-ratio: 2/3;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.2;
  position: relative;
}

.book-cover h3 {
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  margin: 0;
}

.book-cover span.author-credit {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  margin-top: 0;
}

.book-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.book-body .tag { align-self: flex-start; margin-bottom: 10px; }
.book-body p { font-size: 0.92rem; flex: 1; }
.book-body .buy-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* palette rotation for cover placeholders */
.cover-1 { background: linear-gradient(160deg, #5C7355, #35472E); }
.cover-2 { background: linear-gradient(160deg, #B8922F, #7A5F1D); }
.cover-3 { background: linear-gradient(160deg, #6B7A9B, #2E3A52); }
.cover-4 { background: linear-gradient(160deg, #A2685A, #5E3730); }
.cover-5 { background: linear-gradient(160deg, #4B5A42, #212A1E); }
.cover-6 { background: linear-gradient(160deg, #8C7355, #4B3A26); }

/* ---------- Author rows ---------- */
.author-row {
  display: flex;
  gap: 22px;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.author-row:last-child { border-bottom: none; }

.author-photo-slot {
  width: 100px;
  aspect-ratio: 4/5;
  border-radius: var(--radius);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
}

.author-photo-slot svg { opacity: 0.9; }

.author-photo-slot .photo-hint {
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
  text-align: center;
  padding: 0 6px;
  line-height: 1.3;
}

.author-row-info { padding-top: 2px; }
.author-row-info h3 { margin-bottom: 6px; }
.author-row-info p { margin-bottom: 10px; }
.author-row-info .tag-row { margin-top: 4px; }

/* ---------- Callout / band ---------- */
.band {
  background: var(--sage-deep);
  color: var(--bg-warm);
  padding: 56px 0;
}

.band h2 { color: var(--bg-warm); }
.band p { color: #D7DECC; }

.band-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* ---------- Storefront note ---------- */
.notice {
  background: var(--bg-warm);
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage);
  padding: 20px 24px;
  border-radius: var(--radius);
  margin-bottom: 40px;
}

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

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--sage-deep);
  color: #C9D3BC;
  padding: 0 0 32px;
  margin-top: 0;
}

footer.site-footer .wrap {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

@media (max-width: 720px) {
  footer.site-footer .wrap { grid-template-columns: 1fr; gap: 32px; }
}

footer.site-footer h3 { color: #fff; font-size: 0.95rem; margin-bottom: 14px; }
footer.site-footer .footer-tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.95rem;
  color: #B9C79F;
  margin: 6px 0 16px;
}
footer.site-footer a { text-decoration: none; color: #C9D3BC; }
footer.site-footer a:hover { color: #fff; }
footer.site-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

.footer-bottom {
  max-width: var(--max-w);
  margin: 40px auto 0;
  padding: 20px 32px 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #B4C1A8;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.newsletter-embed {
  width: 100%;
  max-width: 100%;
  display: flex;
  justify-content: center;
}
.newsletter-embed > *, .newsletter-embed iframe {
  margin-left: auto;
  margin-right: auto;
  max-width: 100%;
}

/* ---------- Origin story block ---------- */
.origin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
@media (max-width: 800px) { .origin { grid-template-columns: 1fr; } }

.origin-figure {
  background: var(--sage-pale);
  border-radius: var(--radius);
  padding: 32px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--sage-deep);
  line-height: 1.7;
}

/* ---------- Legal pages ---------- */
.legal { padding: 56px 0 64px; line-height: 1.7; color: var(--ink-soft); }
.legal-inner { max-width: 800px; }
.legal h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: 8px; }
.legal h2 { font-size: 1.35rem; margin: 40px 0 12px; scroll-margin-top: 90px; }
.legal h3 { font-size: 1.1rem; margin: 28px 0 10px; scroll-margin-top: 90px; }
.legal p { margin: 0 0 1em; }
.legal ul, .legal ol { padding-left: 1.4rem; margin: 0 0 1em; }
.legal ul.indent { margin-left: 1.4rem; }
.legal li { margin-bottom: 0.4em; }
.legal a { color: var(--sage-deep); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.legal .legal-updated { color: var(--ink-faint); font-family: var(--font-mono); font-size: 0.8rem; margin-bottom: 2rem; }
.legal .table-wrap { overflow-x: auto; margin: 1rem 0 1.5rem; }
.legal table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.legal th, .legal td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; }
.legal th { background: var(--sage-pale); color: var(--sage-deep); }
.legal section { border: 1px solid var(--line); border-radius: 3px; padding: 6px 14px; margin: 0 0 12px; background: var(--bg-warm); }
.legal section table { margin: 4px 0; }
.legal section th, .legal section td { border: 0; padding: 3px 8px; background: transparent; }
.legal section th { white-space: nowrap; width: 1%; }
.legal .termly-badge { max-width: 100%; }

/* ---------- Footer newsletter strip ---------- */
.band + footer.site-footer { border-top: 1px solid rgba(255,255,255,0.14); }
.footer-newsletter { padding: 48px 0 40px; margin-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.14); }
.footer-newsletter-inner { max-width: var(--max-w); margin: 0 auto; padding: 0 32px; }

/* ---------- Submissions form ---------- */
.submit-form { max-width: 720px; }
.submit-form fieldset { border: 1px solid var(--line); border-radius: 3px; padding: 20px 22px 6px; margin: 0 0 24px; background: var(--bg-warm); }
.submit-form legend { font-family: var(--font-display); font-size: 1.1rem; color: var(--sage-deep); padding: 0 8px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 0.92rem; color: var(--ink); margin-bottom: 6px; }
.field .hint { display: block; font-weight: 400; color: var(--ink-faint); font-size: 0.82rem; }
.field input[type=text], .field input[type=email], .field input[type=number], .field select, .field textarea { width: 100%; font: inherit; padding: 11px 13px; border: 1px solid #6B7A62; border-radius: 3px; background: #fff; color: var(--ink); }
.field textarea { min-height: 140px; resize: vertical; }
.field input[type=file] { font: inherit; max-width: 100%; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 24px; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex-shrink: 0; }
.check label { font-size: 0.95rem; }
.check a { color: var(--sage-deep); text-decoration: underline; }
.req { color: #8A3B2F; }
.req-note { font-size: 0.85rem; color: var(--ink-faint); margin-bottom: 18px; }
.hp { position: absolute; left: -9999px; }

/* ---------- Real covers and photos ---------- */
.book-cover.has-image { padding: 0; display: block; background: none; }
.book-cover.has-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.author-photo-slot.has-image { padding: 0; background: none; overflow: hidden; display: block; }
.author-photo-slot.has-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
