/* ============================================================
   Up the Mississippi: A Journey of the Blues — prototype styles
   ============================================================ */

:root {
  --ink: #1e2430;
  --ink-soft: #4a5265;
  --paper: #f7f3ea;
  --paper-deep: #efe8d9;
  --indigo: #1b2a52;
  --indigo-deep: #131e3c;
  /* MVBS brand blues, from the mvbs.org theme */
  --brand-blue: #1e4497;
  --brand-blue-med: #133377;
  --brand-blue-dark: #120747;
  --gold: #c9972c;
  --gold-soft: #e3c477;
  --red: #a03426;
  --sidebar-w: 300px;
  --content-max: 46rem;
  --serif: "Iowan Old Style", "Palatino", "Book Antiqua", Georgia, serif;
  --sans: "Avenir Next", "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

/* ---------------- Prototype password gate ----------------
   Delete this block with #gate in index.html when the site goes public. */

html.is-gated,
html.is-gated body { overflow: hidden; }

.gate {
  display: none;
}

html.is-gated .gate {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 300;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--indigo) 0%, var(--indigo-deep) 100%);
}

.gate-card {
  width: min(22rem, calc(100vw - 2.5rem));
  text-align: center;
}

.gate .brand-mark {
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .35em;
  color: var(--gold-soft);
  margin-bottom: .6rem;
}

.gate-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: #fff;
  margin: 0 0 .35rem;
}

.gate-note {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(233,228,214,.55);
  margin: 0 0 1.6rem;
}

.gate-label {
  display: block;
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(233,228,214,.7);
  text-align: left;
  margin: 0 0 .4rem;
}

.gate-input {
  width: 100%;
  padding: .7rem .85rem;
  font-family: var(--sans);
  font-size: 1rem;
  color: #fff;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  outline: none;
}

.gate-input:focus { border-color: var(--gold-soft); }

.gate-error {
  margin: .55rem 0 0;
  font-family: var(--sans);
  font-size: .8rem;
  color: #f0b4b0;
}

.gate-submit {
  display: inline-block;
  margin-top: 1.2rem;
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  background: var(--gold);
  padding: .75rem 1.6rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}

.gate-submit:hover { box-shadow: 0 10px 24px rgba(201,151,44,.4); }

/* ---------------- Loading gate ---------------- */

body.is-loading { overflow: hidden; }

.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  opacity: 1;
  transition: opacity .6s ease;
}

body:not(.is-loading) .loader {
  opacity: 0;
  pointer-events: none;
}

.loader-inner { text-align: center; }

.loader .brand-mark {
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .35em;
  color: var(--gold-soft);
  margin-bottom: .6rem;
}

.loader-title {
  font-family: var(--serif);
  font-size: 1.6rem;
  color: #fff;
  margin: 0 0 1.6rem;
}

.loader-eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 26px;
}

.loader-eq i {
  width: 5px;
  background: var(--gold);
  animation: eq-bounce 1s ease-in-out infinite;
}

.loader-eq i:nth-child(1) { height: 55%; animation-delay: -.45s; }
.loader-eq i:nth-child(2) { height: 85%; animation-delay: -.2s; }
.loader-eq i:nth-child(3) { height: 100%; }
.loader-eq i:nth-child(4) { height: 75%; animation-delay: -.6s; }
.loader-eq i:nth-child(5) { height: 50%; animation-delay: -.3s; }

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--serif);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
}

/* ---------------- Sidebar ---------------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  color: #e9e4d6;
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.sidebar-head {
  padding: 1.6rem 1.4rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-mark {
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .35em;
  color: var(--gold-soft);
  margin-bottom: .5rem;
}

.brand-title {
  font-size: 1.5rem;
  line-height: 1.15;
  margin: 0 0 .4rem;
  font-weight: 700;
  color: #fff;
}

.brand-sub {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(233,228,214,.65);
  margin: 0;
}

/* Search */

.search-box {
  position: relative;
  padding: .9rem 1.4rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

#searchInput {
  width: 100%;
  padding: .55rem .8rem;
  font-family: var(--sans);
  font-size: .85rem;
  color: #fff;
  background: rgba(255,255,255,.09);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  outline: none;
}

#searchInput::placeholder { color: rgba(233,228,214,.5); }
#searchInput:focus { border-color: var(--gold-soft); background: rgba(255,255,255,.14); }

.search-results {
  position: absolute;
  top: calc(100% - .3rem);
  left: 1.4rem;
  right: 1.4rem;
  max-height: 21rem;
  overflow-y: auto;
  background: #fffdf7;
  color: var(--ink);
  border-radius: 8px;
  box-shadow: 0 14px 40px rgba(10,15,35,.45);
  z-index: 60;
}

.search-results .sr-meta {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: .55rem .85rem .1rem;
}

.search-results a {
  display: block;
  padding: .55rem .85rem;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--ink);
  text-decoration: none;
  border-top: 1px solid #eee6d4;
}

.search-results a:first-of-type { border-top: 0; }
.search-results a:hover { background: var(--paper-deep); }

.search-results a .sr-sec {
  display: block;
  font-family: var(--sans);
  font-size: .66rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: .15rem;
}

.search-results mark {
  background: var(--gold-soft);
  color: var(--indigo-deep);
  padding: 0 .1em;
  border-radius: 2px;
}

.search-results .sr-empty {
  padding: .8rem .85rem;
  font-size: .8rem;
  color: var(--ink-soft);
  font-style: italic;
}

/* Sidebar CTA buttons */

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: .9rem 1.4rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.sidebar-cta {
  display: flex;
  align-items: center;
  gap: .55rem;
  width: 100%;
  padding: .55rem .8rem;
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gold-soft);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(227,196,119,.35);
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}

.sidebar-cta:hover {
  background: rgba(227,196,119,.12);
  border-color: var(--gold-soft);
  color: #fff;
}

.sidebar-cta svg { flex-shrink: 0; }

/* Table of contents */

.toc {
  flex: 1;
  overflow-y: auto;
  padding: .8rem 0 1rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}

.toc-group {
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold-soft);
  padding: .9rem 1.4rem .3rem;
}

.toc a {
  display: block;
  padding: .42rem 1.4rem .42rem 1.25rem;
  font-family: var(--sans);
  font-size: .8rem;
  line-height: 1.35;
  color: rgba(233,228,214,.82);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .15s, border-color .15s, color .15s;
}

/* Numbered entries: number in a fixed column, title + author aligned beside it */
.toc a.has-num {
  display: grid;
  grid-template-columns: 1.3rem 1fr;
  column-gap: .45rem;
}

.toc a .toc-num {
  grid-row: 1 / span 2;
  padding-top: .12em;
  font-size: .66rem;
  text-align: right;
  color: var(--gold-soft);
  opacity: .85;
  font-variant-numeric: tabular-nums;
}

.toc a .toc-title { grid-column: 2; }

.toc a .toc-author {
  display: block;
  grid-column: 2;
  margin-top: .1rem;
  font-size: .66rem;
  color: rgba(233,228,214,.45);
}

.toc a:hover { background: rgba(255,255,255,.06); color: #fff; }

.toc a.active {
  background: rgba(255,255,255,.09);
  border-left-color: var(--gold);
  color: #fff;
}

.sidebar-foot {
  padding: .9rem 1.4rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,.12);
  font-family: var(--sans);
  font-size: .66rem;
  line-height: 1.5;
  color: rgba(233,228,214,.5);
}

.sidebar-foot p { margin: 0 0 .4rem; }

.draft-note { font-style: italic; }

/* ---------------- Content ---------------- */

.content {
  margin-left: var(--sidebar-w);
}

/* Hero */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5.5rem;
  min-height: 100vh;
  min-height: 100svh;
  padding: 4rem 8vw;
  /* sidebar gradient, inverted — dark-to-light against its light-to-dark */
  background: linear-gradient(180deg, var(--indigo-deep) 0%, var(--indigo) 100%);
  color: #f2ecdd;
  border-bottom: 3px solid var(--gold);
}

/* letterpress-style hairline frame */
.hero::before {
  content: "";
  position: absolute;
  inset: 1.4rem;
  border: 1px solid rgba(227,196,119,.55);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 1.75rem;
  border: 1px solid rgba(227,196,119,.22);
  pointer-events: none;
}

.hero-cover {
  margin: 0;
  flex: 0 0 min(300px, 28vw);
}

.hero-cover a {
  display: block;
  cursor: zoom-in;
}

.hero-cover img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
  outline: 1px solid rgba(227,196,119,.35);
  outline-offset: 6px;
}

.hero-text { max-width: 30rem; }

.hero-kicker {
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin: 0 0 1rem;
}

.hero-title {
  font-size: clamp(2.6rem, 5vw, 4rem);
  line-height: 1.05;
  margin: 0;
  color: #fff;
}

/* short gold rule between title and byline */
.hero-title::after {
  content: "";
  display: block;
  width: 3.2rem;
  height: 2px;
  background: var(--gold);
  margin: 1.5rem 0;
}

.hero-byline {
  font-size: 1.02rem;
  line-height: 1.7;
  color: rgba(242,236,221,.72);
  margin: 0 0 2.2rem;
}

.hero-cta {
  display: inline-block;
  font-family: var(--sans);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--indigo-deep);
  background: var(--gold);
  padding: .8rem 1.6rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(201,151,44,.4);
}

/* scroll cue at the frame's bottom edge */
.hero-scroll {
  position: absolute;
  bottom: 3rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: rgba(242,236,221,.55);
  text-decoration: none;
  transition: color .15s;
}

.hero-scroll::after {
  content: "";
  display: block;
  width: 1px;
  height: 1.5rem;
  margin: .55rem auto 0;
  background: linear-gradient(180deg, var(--gold-soft), transparent);
}

.hero-scroll:hover { color: var(--gold-soft); }

/* Sections */

.book-section {
  padding: 4.5rem 6vw 2rem;
  scroll-margin-top: 1.5rem;
}

.book-section + .book-section {
  border-top: 1px solid #e2d9c4;
}

.section-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.section-eyebrow {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  color: var(--red);
  margin: 0 0 .7rem;
}

.section-title {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.15;
  margin: 0 0 .4rem;
  color: var(--indigo-deep);
}

.section-author {
  font-family: var(--sans);
  font-size: .85rem;
  letter-spacing: .04em;
  color: var(--ink-soft);
  margin: 0 0 2.2rem;
}

.section-author::before {
  content: "";
  display: inline-block;
  width: 2.2rem;
  height: 2px;
  background: var(--gold);
  vertical-align: middle;
  margin-right: .7rem;
}

.section-body p {
  margin: 0 0 1.15rem;
  font-size: 1.04rem;
  text-align: justify;
  hyphens: auto;
}

.section-body h3 {
  font-family: var(--sans);
  font-size: 1.02rem;
  letter-spacing: .03em;
  color: var(--indigo);
  margin: 2.3rem 0 .9rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--gold-soft);
  display: inline-block;
}

/* First paragraph drop cap */

.section-body > p.opener::first-letter {
  float: left;
  font-size: 3.6em;
  line-height: .82;
  padding: .07em .12em 0 0;
  color: var(--red);
  font-weight: 700;
}

/* Poems */

.poem .section-body { max-width: 32rem; }

.stanza {
  margin: 0 0 1.6rem;
  padding-left: 1.4rem;
  border-left: 3px solid var(--gold-soft);
  font-size: 1.02rem;
  line-height: 1.75;
  font-style: italic;
  color: #2c3347;
  white-space: normal;
}

.stanza span { display: block; }

/* Lists (readings / listening) */

.ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ref-list li {
  padding: .55rem 0 .55rem 1.1rem;
  border-left: 3px solid var(--paper-deep);
  margin-bottom: .35rem;
  font-size: .92rem;
  line-height: 1.55;
}

.ref-list li:hover { border-left-color: var(--gold); }

/* Full-width illustration inserts */

.illustration {
  margin: 4rem calc(50% - 50vw + var(--sidebar-w) / 2);
  padding: 0 6vw;
}

.illustration figure {
  max-width: 56rem;
  margin: 0 auto;
}

.illustration a {
  display: block;
  cursor: zoom-in;
}

.illustration img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 3px;
  background: #fff;
  padding: 10px;
  border: 1px solid #e2d9c4;
  box-shadow: 0 18px 44px rgba(30,36,48,.14);
}

.illustration figcaption {
  max-width: 38rem;
  margin: 1.3rem auto 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: .92rem;
  font-style: italic;
  line-height: 1.6;
}

.illustration figcaption::before {
  content: "";
  display: block;
  width: 2.4rem;
  height: 2px;
  background: var(--gold);
  margin: 0 auto .8rem;
}

/* ---------------- Companion audio player ---------------- */

.player {
  /* break out of the reading column, stay centered over the content area */
  width: min(64rem, calc(100vw - var(--sidebar-w) - 10vw));
  margin: 3rem 50% 3.5rem;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--indigo) 0%, var(--indigo-deep) 100%);
  border-radius: 14px;
  color: #e9e4d6;
  box-shadow: 0 26px 60px rgba(19,30,60,.35);
  overflow: hidden;
}

.player-now {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 2rem 2.4rem 1.4rem;
}

.player-toggle {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: none;
  background: var(--gold);
  color: var(--indigo-deep);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, box-shadow .15s;
}

.player-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 26px rgba(201,151,44,.45);
}

.player-toggle svg { width: 32px; height: 32px; }

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}

.player-eyebrow {
  font-family: var(--sans);
  font-size: .66rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.player-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-artist {
  font-family: var(--sans);
  font-size: .82rem;
  color: rgba(233,228,214,.6);
}

.player-time {
  font-family: var(--sans);
  font-size: .78rem;
  color: rgba(233,228,214,.6);
  font-variant-numeric: tabular-nums;
}

.player-seek {
  height: 16px;
  margin: 0 2.4rem;
  padding: 6px 0;
  cursor: pointer;
  background: linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,.14)) center / 100% 4px no-repeat;
}

.player-seek-fill {
  height: 4px;
  width: 0;
  background: var(--gold);
  border-radius: 2px;
}

.player-list {
  list-style: none;
  margin: 1.6rem 0 0;
  padding: 1.2rem 1.6rem 1.6rem;
  border-top: 1px solid rgba(255,255,255,.09);
}

.player-list button {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: baseline;
  column-gap: .9rem;
  width: 100%;
  padding: .68rem 1rem;
  font-family: var(--sans);
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  color: rgba(233,228,214,.85);
  cursor: pointer;
  transition: background .15s;
}

.player-list button:hover { background: rgba(255,255,255,.07); }

.player-list button.active {
  background: rgba(227,196,119,.14);
  color: #fff;
}

.player-list .pl-num {
  font-size: .74rem;
  color: var(--gold-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.player-list .pl-title { font-size: .95rem; }

.player-list .pl-artist {
  font-size: .78rem;
  color: rgba(233,228,214,.5);
}

/* tiny equalizer replaces the number while playing */
.player-list .pl-eq {
  display: none;
  grid-column: 1;
  align-self: center;
  height: 12px;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 2px;
}

.player-list button.playing .pl-eq { display: flex; }
.player-list button.playing .pl-num { display: none; }

.player-list .pl-eq i {
  width: 3px;
  background: var(--gold);
  animation: eq-bounce 1s ease-in-out infinite;
}

.player-list .pl-eq i:nth-child(1) { height: 60%; animation-delay: -.3s; }
.player-list .pl-eq i:nth-child(2) { height: 100%; }
.player-list .pl-eq i:nth-child(3) { height: 75%; animation-delay: -.6s; }

@keyframes eq-bounce {
  0%, 100% { transform: scaleY(.45); }
  50% { transform: scaleY(1); }
}

/* Search highlight flash */

.flash-target {
  animation: flash 2.4s ease-out;
}

@keyframes flash {
  0%, 35% { background: rgba(227,196,119,.55); }
  100% { background: transparent; }
}

mark.inline-hit {
  background: var(--gold-soft);
  color: var(--indigo-deep);
  padding: 0 .08em;
  border-radius: 2px;
}

/* Footer */

.site-foot {
  padding: 3rem 6vw 4rem;
  text-align: center;
  font-family: var(--sans);
  font-size: .75rem;
  color: var(--ink-soft);
  border-top: 1px solid #e2d9c4;
}

.site-foot p { margin: .3rem 0; }

/* Mobile toggle */

.menu-toggle {
  display: none;
  position: fixed;
  top: .9rem;
  left: .9rem;
  z-index: 60;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  background: var(--indigo);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  cursor: pointer;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--gold-soft);
}

.scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,14,30,.5);
  z-index: 35;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 960px) {
  .menu-toggle { display: flex; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: min(320px, 86vw);
  }

  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; }

  .content { margin-left: 0; }

  .hero {
    flex-direction: column;
    text-align: center;
    gap: 2.2rem;
    padding-top: 5.5rem;
  }

  .hero-cover { flex-basis: auto; width: min(240px, 58vw); }

  .hero-title::after { margin: 1.5rem auto; }

  .illustration { margin: 4rem calc(50% - 50vw); }

  .player { width: calc(100vw - 10vw); }

  .player-now { padding: 1.4rem 1.4rem 1rem; gap: 1rem; }
  .player-toggle { width: 54px; height: 54px; }
  .player-title { font-size: 1.05rem; white-space: normal; }
  .player-seek { margin: 0 1.4rem; }
  .player-list { padding: .9rem .7rem 1rem; }
  .player-list .pl-artist { display: none; }

  .section-body p { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
