/* ==========================================================================
   Diversity Books — "Woven Heritage" design system
   Handcrafted CSS (no framework). Fonts: Spectral (display) + Public Sans (text)
   Palette: ink indigo / heritage maroon / parchment / aged gold
   ========================================================================== */

:root {
  --ink: #27395f;
  --ink-deep: #1c2a47;
  --ink-soft: #3d5180;
  --maroon: #8c2f39;
  --maroon-deep: #6f222b;
  --gold: #c9a227;
  --gold-soft: #e3c766;
  --teal: #3f6f5e;
  --terracotta: #c06a3c;
  --plum: #6d4a7c;
  --parchment: #faf6ee;
  --parchment-deep: #f1e9d8;
  --paper: #fffdf8;
  --text: #2a2520;
  --text-soft: #5d564c;
  --line: #e0d6bf;
  --radius: 6px;
  --shadow: 0 2px 12px rgba(39, 57, 95, 0.10);
  --shadow-lift: 0 10px 28px rgba(39, 57, 95, 0.16);
  --font-display: "Spectral", Georgia, "Times New Roman", serif;
  --font-text: "Public Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ribbon: repeating-linear-gradient(90deg,
    var(--ink) 0 48px, var(--maroon) 48px 96px, var(--gold) 96px 132px,
    var(--teal) 132px 176px, var(--terracotta) 176px 216px, var(--plum) 216px 252px);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--parchment);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--maroon); text-decoration-color: rgba(140, 47, 57, 0.35); text-underline-offset: 2px; }
a:hover { color: var(--maroon-deep); text-decoration-color: currentColor; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-deep);
  line-height: 1.22;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.9rem); font-weight: 600; margin-top: 1.8em; }
h3 { font-size: 1.2rem; font-weight: 600; margin-top: 1.4em; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.4em; }
li { margin-bottom: 0.45em; }
figure { margin: 1.8rem 0; }
figcaption { font-size: 0.85rem; color: var(--text-soft); padding-top: 0.55rem; font-style: italic; }
figure img { border-radius: var(--radius); box-shadow: var(--shadow); }
blockquote { border-left: 4px solid var(--gold); margin: 1.4em 0; padding: 0.3em 0 0.3em 1.2em; color: var(--text-soft); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.4rem; }
.container.narrow { max-width: 800px; }

/* ---------- Woven ribbon accent ---------- */
.ribbon { height: 7px; background: var(--ribbon); }

/* ---------- Header ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.25s ease;
}
.site-header.scrolled { box-shadow: var(--shadow); }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.4rem;
  max-width: 1120px;
  margin: 0 auto;
}
.brand { display: flex; align-items: baseline; gap: 0.6rem; text-decoration: none; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink-deep);
  letter-spacing: 0.01em;
}
.brand-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--maroon);
  font-weight: 600;
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.45rem 0.7rem;
  font-size: 1.05rem;
  color: var(--ink);
  cursor: pointer;
}
.site-nav ul { display: flex; gap: 0.2rem; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; }
.site-nav a {
  display: block;
  padding: 0.45rem 0.75rem;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius);
}
.site-nav a:hover { background: var(--parchment-deep); color: var(--maroon-deep); }
.site-nav a.active { background: var(--ink); color: var(--paper); }

/* ---------- Hero (homepage) ---------- */
.hero { position: relative; isolation: isolate; color: #fff; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(28, 42, 71, 0.92) 0%, rgba(28, 42, 71, 0.72) 45%, rgba(111, 34, 43, 0.55) 100%);
}
.hero-inner { max-width: 1120px; margin: 0 auto; padding: 5.5rem 1.4rem 5rem; }
.hero h1 { color: #fff; max-width: 21ch; }
.kicker {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 600;
  color: var(--gold-soft);
  margin-bottom: 1rem;
}
.lede { font-size: 1.18rem; line-height: 1.65; color: inherit; max-width: 62ch; }
main .lede { color: var(--text-soft); }
.hero .lede { color: #f0ead9; }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.8rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.btn-primary { background: var(--gold); color: var(--ink-deep); }
.btn-primary:hover { background: var(--gold-soft); color: var(--ink-deep); }
.btn-secondary { background: var(--maroon); color: #fff; }
.btn-secondary:hover { background: var(--maroon-deep); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.65); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ---------- Bands (homepage sections) ---------- */
.band { padding: 3.6rem 0; }
.band-intro { background: var(--paper); border-bottom: 1px solid var(--line); }
.band-series { background: var(--parchment); }
.band-feature { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.band-articles { background: var(--parchment); }
.section-sub { color: var(--text-soft); max-width: 70ch; margin-top: -0.4rem; }
.center { text-align: center; }

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.3rem;
  margin: 1.8rem 0 0.4rem;
}
.card-grid.three { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.series-card, .article-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 5px solid var(--ink);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.2rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.series-card:hover, .article-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.series-card:nth-child(6n+2), .article-card:nth-child(6n+2) { border-top-color: var(--maroon); }
.series-card:nth-child(6n+3), .article-card:nth-child(6n+3) { border-top-color: var(--gold); }
.series-card:nth-child(6n+4), .article-card:nth-child(6n+4) { border-top-color: var(--teal); }
.series-card:nth-child(6n+5), .article-card:nth-child(6n+5) { border-top-color: var(--terracotta); }
.series-card:nth-child(6n), .article-card:nth-child(6n) { border-top-color: var(--plum); }
.series-card h3, .article-card h2, .article-card h3 { margin-top: 0; font-size: 1.18rem; }
.series-card h3 a, .article-card h2 a, .article-card h3 a { color: var(--ink-deep); text-decoration: none; }
.series-card h3 a:hover, .article-card h2 a:hover, .article-card h3 a:hover { color: var(--maroon); }
.series-card .vol {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 0.6rem;
}
.series-card p, .article-card p { font-size: 0.94rem; color: var(--text-soft); margin-bottom: 0.7em; }
.more { font-weight: 600; font-size: 0.92rem; }

/* ---------- Split / promo ---------- */
.split { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.6rem; align-items: start; }
.promo-card {
  background: var(--ink-deep);
  color: #ece5d3;
  border-radius: var(--radius);
  padding: 1.8rem 1.7rem;
  box-shadow: var(--shadow-lift);
  border-top: 6px solid var(--gold);
}
.promo-card h3 { color: #fff; margin-top: 0; }
.promo-card p { font-size: 0.95rem; }

/* ---------- Article / interior pages ---------- */
.page-main { padding: 3rem 0 4rem; }
.page-main .container { max-width: 820px; }
.page-main.wide .container { max-width: 1120px; }
.breadcrumb { font-size: 0.84rem; color: var(--text-soft); margin-bottom: 1.6rem; }
.breadcrumb a { color: var(--text-soft); }
.breadcrumb a:hover { color: var(--maroon); }

/* Reference details list */
.ref-details {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.45rem 1.4rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  margin: 1.4rem 0 1.6rem;
}
.ref-details dt { font-weight: 700; color: var(--ink); }
.ref-details dd { margin: 0; }

.resource-list { list-style: none; padding-left: 0; }
.resource-list li {
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.7rem;
}
.resource-list li:nth-child(3n+2) { border-left-color: var(--maroon); }
.resource-list li:nth-child(3n) { border-left-color: var(--ink); }

/* ---------- Contact form ---------- */
.contact-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin: 1.6rem 0;
  box-shadow: var(--shadow);
}
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 0.35rem; color: var(--ink); }
.form-row .optional { font-weight: 400; color: var(--text-soft); }
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-text);
  font-size: 1rem;
  background: #fff;
  color: var(--text);
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--ink-soft);
  outline-offset: 1px;
  border-color: var(--ink-soft);
}
.contact-form .btn { border: none; cursor: pointer; font-family: var(--font-text); }
.form-note { color: var(--teal); font-weight: 600; margin-top: 1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink-deep); color: #c6c0b0; margin-top: 0; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.4rem;
  padding: 3rem 1.4rem 2.2rem;
  max-width: 1120px;
  margin: 0 auto;
}
.site-footer h4 {
  color: #fff;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--font-text);
  font-weight: 700;
  margin-bottom: 0.9rem;
}
.site-footer p { font-size: 0.92rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.site-footer a { color: #e0d9c5; text-decoration: none; font-size: 0.92rem; }
.site-footer a:hover { color: var(--gold-soft); text-decoration: underline; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
  font-size: 0.84rem;
  padding: 1.1rem 1.4rem;
  color: #9a9482;
}

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 5rem 1.4rem; }
.notfound .code {
  font-family: var(--font-display);
  font-size: 6rem;
  font-weight: 700;
  color: var(--maroon);
  line-height: 1;
  margin-bottom: 0.3rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .masthead { flex-wrap: wrap; }
  .nav-toggle { display: block; }
  .site-nav { display: none; width: 100%; }
  .site-nav.open { display: block; }
  .site-nav ul { flex-direction: column; padding: 0.4rem 0 0.6rem; }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero-inner { padding: 4rem 1.4rem 3.6rem; }
  .ref-details { grid-template-columns: 1fr; gap: 0.15rem; }
  .ref-details dt { margin-top: 0.55rem; }
}
