/* ============================================================
   Library — shared styles
   Extends the "Thunder & Lightning" book design to the web.
   Edit colors in :root. Fonts live in ../fonts (referenced below).
   ============================================================ */

@font-face {
  font-family: 'Bask';
  src: url('../fonts/GFSBaskerville.otf');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/Lora-Variable.ttf');
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Lora';
  src: url('../fonts/Lora-Italic-Variable.ttf');
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  --cream:    #f4eddc;
  --ink:      #241e15;
  --ink-soft: #5b5037;
  --gold:     #94701f;
  --gold-lt:  #d8b25a;
  --pale:     #eef3ff;
  --night:    #06080f;
  --measure:  34rem;   /* reading column width */
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Lora', Georgia, serif;
  line-height: 1.65;
  font-size: 1.05rem;
}

/* ---- back link ---- */
.back {
  display: inline-block;
  font-family: 'Bask', serif;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold); text-decoration: none;
  padding: 1.2rem 1.4rem 0;
}
.back:hover { color: var(--ink); }
.back-foot { padding: 2.5rem 0 0; }

/* ============================================================
   HALF-TITLE (top of each work)
   ============================================================ */
.half-title {
  text-align: center;
  padding: 3.2rem 1.5rem 3.4rem;
}
.ht-title {
  font-family: 'Bask', serif;
  font-size: clamp(2rem, 7vw, 2.9rem);
  letter-spacing: 0.1em; color: var(--ink);
  margin: 0; line-height: 1.08; font-weight: 400;
}
.ht-amp { display: block; font-size: 0.5em; color: var(--gold); margin: 0.3em 0; }
.ht-rule { width: 5em; height: 1px; background: var(--gold); border: 0; margin: 1.1em auto; opacity: 0.65; }
.ht-sub {
  font-family: 'Bask', serif; letter-spacing: 0.44em; padding-left: 0.44em;
  font-size: 0.82rem; color: var(--gold); text-transform: uppercase; margin: 0;
}

/* ============================================================
   DIVIDER (section opener) — night band with glow
   ============================================================ */
.divider {
  position: relative;
  background: var(--night);
  color: var(--pale);
  text-align: center;
  padding: 3.6rem 1.5rem 3.8rem;
  overflow: hidden;
}
.divider-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 50% 35%, rgba(120,160,255,0.18), transparent 70%),
    radial-gradient(40% 50% at 70% 60%, rgba(216,178,90,0.10), transparent 70%);
  pointer-events: none;
}
.divider-content { position: relative; }
.div-num {
  font-family: 'Bask', serif; font-size: 0.86rem; letter-spacing: 0.38em;
  color: var(--gold-lt); display: block; margin-bottom: 0.5em;
}
.div-title {
  font-family: 'Bask', serif; font-size: clamp(2rem, 9vw, 3rem);
  letter-spacing: 0.12em; color: var(--pale); display: block; line-height: 1;
  text-shadow: 0 0 22px rgba(150,190,255,0.45), 0 0 8px rgba(180,210,255,0.35);
}
.div-rule { width: 3.5em; height: 1px; background: var(--gold-lt); border: 0; margin: 0.85em auto 0.95em; opacity: 0.7; }
.div-epi {
  font-family: 'Lora', serif; font-style: italic;
  font-size: 1rem; color: var(--gold-lt); line-height: 1.5; margin: 0;
}

/* ============================================================
   VERSE
   ============================================================ */
.verse-page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.6rem 1.4rem 2.8rem;
}
.stanza { margin: 0 0 1.15em 0; }
.stanza:last-child { margin-bottom: 0; }
.line {
  margin: 0;
  padding-left: 1.25em;
  text-indent: -1.25em;
  line-height: 1.62;
}
.line.lead {
  font-family: 'Bask', serif;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--gold); font-size: 0.9rem;
  padding-left: 0; text-indent: 0; margin-bottom: 0.5em;
}

/* ============================================================
   COLOPHON
   ============================================================ */
.colophon {
  max-width: var(--measure);
  margin: 0 auto;
  text-align: center;
  padding: 3rem 1.5rem 4rem;
}
.colo-end { font-family: 'Bask', serif; font-size: 1.05rem; letter-spacing: 0.04em; color: var(--ink); margin-bottom: 1.4rem; }
.colo-rule { width: 4em; height: 1px; background: var(--gold); border: 0; margin: 0 auto 1.5rem; opacity: 0.6; }
.colo-item { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.75; margin: 0 0 0.8rem; }
.colo-item em { font-style: italic; color: var(--ink); }
.colo-seal { font-size: 1.5rem; color: var(--gold); margin-top: 1.6rem; opacity: 0.72; }

/* ============================================================
   INDEX / LIBRARY
   ============================================================ */
.lib-hero {
  position: relative;
  background: var(--night);
  color: var(--pale);
  text-align: center;
  padding: clamp(4rem, 16vw, 7rem) 1.5rem clamp(3.4rem, 12vw, 5.5rem);
  overflow: hidden;
}
.lib-hero-glow {
  position: absolute; inset: 0;
  background:
    radial-gradient(55% 70% at 50% 30%, rgba(120,160,255,0.20), transparent 70%),
    radial-gradient(45% 55% at 30% 70%, rgba(216,178,90,0.12), transparent 70%);
  pointer-events: none;
}
.lib-hero-inner { position: relative; }
.lib-name {
  font-family: 'Bask', serif; font-weight: 400;
  font-size: clamp(2.4rem, 11vw, 4rem); letter-spacing: 0.16em; margin: 0;
  text-shadow: 0 0 26px rgba(150,190,255,0.4), 0 0 9px rgba(180,210,255,0.3);
}
.lib-tagline {
  font-family: 'Bask', serif; letter-spacing: 0.3em; text-transform: uppercase;
  font-size: 0.82rem; color: var(--gold-lt); margin: 1.1rem 0 0;
}

.lib-list {
  max-width: 40rem; margin: 0 auto;
  padding: clamp(1.6rem, 6vw, 3rem) 1.4rem 1rem;
}
.lib-item {
  display: block; position: relative;
  text-decoration: none; color: var(--ink);
  padding: 1.5rem 0 1.6rem;
  border-bottom: 1px solid rgba(148,112,31,0.28);
  transition: padding-left 0.25s ease;
}
.lib-item:first-child { border-top: 1px solid rgba(148,112,31,0.28); }
.lib-item:hover { padding-left: 0.6rem; }
.lib-title {
  display: block; font-family: 'Bask', serif; font-size: 1.5rem;
  letter-spacing: 0.04em; color: var(--ink); line-height: 1.1;
}
.lib-sub {
  display: block; font-family: 'Bask', serif; text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 0.7rem; color: var(--gold); margin-top: 0.45rem;
}
.lib-blurb { display: block; font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.7rem; }
.lib-arrow {
  display: inline-block; font-family: 'Bask', serif; text-transform: uppercase;
  letter-spacing: 0.16em; font-size: 0.72rem; color: var(--gold);
  margin-top: 0.8rem; opacity: 0; transform: translateX(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.lib-item:hover .lib-arrow { opacity: 1; transform: translateX(0); }

.lib-foot { text-align: center; padding: 1.5rem 0 3.5rem; }
.lib-seal { font-size: 1.5rem; color: var(--gold); opacity: 0.7; }

/* ============================================================
   PROSE — for any other text (essays, notes, articles).
   Wrap your content in <article class="prose"> ... </article>.
   ============================================================ */
.prose {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.4rem 1.4rem 4rem;
}
.prose h1 {
  font-family: 'Bask', serif; font-weight: 400; line-height: 1.15;
  font-size: clamp(1.8rem, 6vw, 2.5rem); letter-spacing: 0.03em;
  color: var(--ink); margin: 0.4em 0 0.6em;
}
.prose h2 {
  font-family: 'Bask', serif; font-weight: 400;
  font-size: 1.4rem; letter-spacing: 0.03em; color: var(--ink);
  margin: 2em 0 0.5em;
}
.prose h3 {
  font-family: 'Bask', serif; font-weight: 400; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 0.95rem; color: var(--gold); margin: 1.8em 0 0.4em;
}
.prose p { margin: 0 0 1.1em; }
.prose blockquote {
  margin: 1.4em 0; padding: 0.2em 0 0.2em 1.2em;
  border-left: 2px solid var(--gold); color: var(--ink-soft); font-style: italic;
}
.prose hr { width: 4em; height: 1px; background: var(--gold); border: 0; margin: 2.2em auto; opacity: 0.55; }
.prose a { color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose em { font-style: italic; }
.prose strong { font-weight: 600; }

/* page-load reveal */
@media (prefers-reduced-motion: no-preference) {
  .half-title, .lib-hero-inner { animation: rise 0.9s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.lang-bar {
  position: fixed;
  top: 0; right: 0;
  z-index: 100;
  display: flex;
  gap: 0;
  background: rgba(6,8,15,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom-left-radius: 6px;
  border: 1px solid rgba(216,178,90,0.22);
  border-top: none; border-right: none;
  overflow: hidden;
}
.lang-btn {
  font-family: 'Bask', serif;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-lt);
  background: none;
  border: none;
  padding: 0.48rem 0.78rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease;
  border-right: 1px solid rgba(216,178,90,0.22);
}
.lang-btn:last-child { border-right: none; }
.lang-btn:hover { background: rgba(216,178,90,0.14); color: #fff; }
.lang-btn.lang-active {
  background: rgba(216,178,90,0.22);
  color: #fff;
  pointer-events: none;
}
