/* ============================================================
   Classicalia — Set-text pages: line- or sense-unit reveal
   classicalia.co.uk

   Companion to classicalia.css / classroom.css. Used by pages
   that present a verse text line by line: Latin line on the
   left, translation on the right, with the teacher's stylistic
   notes anchored to the words they quote.

   Pair with /version2/assets/js/verse-lit.js
   ============================================================ */

body { background: var(--cream); }

/* ── PASSAGE HEADER ── */
.passage-header {
  background: var(--navy);
  position: relative;
  overflow: hidden;
  padding: 80px 0 40px;
}
.passage-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.passage-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #6ba0ff;
  font-weight: 700;
  margin-bottom: 10px;
  opacity: 0.85;
}
.passage-title {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 36px;
  color: white;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.passage-deck {
  font-family: 'Lora', serif;
  font-style: italic;
  color: #8fa8cc;
  font-size: 13.5px;
  line-height: 1.6;
  max-width: 640px;
}

.section-nav { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.section-nav a,
.section-nav .current {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 7px 14px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  transition: all 0.15s;
  white-space: nowrap;
}
.section-nav a { color: rgba(255,255,255,0.5); }
.section-nav a:hover { color: white; border-color: rgba(255,255,255,0.35); }
.section-nav .current {
  color: white;
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.25);
  cursor: default;
}

/* ── CONTROLS BAR ── */
.controls-bar {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 50;
}
.controls-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.controls-left, .controls-right { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ctrl-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 5px 13px;
  border-radius: 4px;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.ctrl-btn:hover { border-color: var(--brand); color: var(--brand); }
.ctrl-btn.active { background: var(--brand); border-color: var(--brand); color: white; }
.ctrl-div { width: 1px; height: 18px; background: var(--rule); margin: 0 4px; }

.key-hint { font-size: 10.5px; color: var(--muted); letter-spacing: 0.02em; opacity: 0.75; }
.key-hint kbd {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 9.5px;
  color: var(--ink);
}

/* category key */
.cat-pills { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.cat-pill {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  opacity: 0.9;
  transition: all 0.12s;
}
.cat-pill:hover { opacity: 1; }
.cat-pill.off { background: var(--cream) !important; color: var(--muted) !important; border-color: var(--rule); }

.cat-order    { background: #d1fae5; color: #065f46; }
.cat-sound    { background: #ede9fe; color: #6d28d9; }
.cat-repeat   { background: #cffafe; color: #155e75; }
.cat-imagery  { background: #ffedd5; color: #9a3412; }
.cat-diction  { background: #fef3c7; color: #92400e; }
.cat-grammar  { background: #dbeafe; color: #1e40af; }
.cat-tone     { background: #fee2e2; color: #991b1b; }
.cat-note     { background: #eceef4; color: #47506b; }

/* ── PASSAGE GRID ── */
.passage-body { max-width: 1200px; margin: 0 auto; padding: 32px 40px 0; }
.passage-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 6px;
  overflow: hidden;
}
.col-head {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 28px 10px;
  border-bottom: 1px solid var(--rule);
  background: var(--cream);
}
.col-head.latin-head { border-right: 1px solid var(--rule); }
.latin-col { border-right: 1px solid var(--rule); padding: 18px 24px 26px; }
.english-col { padding: 18px 24px 26px; }

.line-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 3px 0;
  min-height: 30px;
  border-radius: 4px;
  scroll-margin-top: 70px;
}
.latin-col .line-row { cursor: pointer; }
.latin-col .line-row:hover { background: #f4f7ff; }
.line-row.current { background: #eef3ff; box-shadow: inset 2px 0 0 var(--brand); }

.line-num {
  font-family: 'Lora', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 12px;
  color: var(--brand);
  min-width: 26px;
  text-align: right;
  flex-shrink: 0;
  opacity: 0.75;
}
.words-wrap { display: flex; flex-wrap: wrap; align-items: baseline; }

.wg { border-radius: 3px; padding: 0 1px; }
.lat-w {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 16.5px;
  color: var(--navy);
  padding: 1px 2px;
  border-radius: 3px;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s;
}
.wg + .wg::before { content: ' '; white-space: pre; }

/* english — hidden until revealed */
.eng-w {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  opacity: 0;
  transition: opacity 0.18s;
}
.eng-w.revealed { opacity: 1; }
.eng-w.none { font-style: italic; color: var(--muted); opacity: 0; font-size: 12px; }

/* ── STYLE MARKERS ── */
.wg[data-sf] { cursor: pointer; }
.wg[data-sf] .lat-w { border-bottom: 2px solid transparent; }
body.style-on .wg[data-sf].sf-order   .lat-w { border-bottom-color: #34d399; }
body.style-on .wg[data-sf].sf-sound   .lat-w { border-bottom-color: #a78bfa; }
body.style-on .wg[data-sf].sf-repeat  .lat-w { border-bottom-color: #22d3ee; }
body.style-on .wg[data-sf].sf-imagery .lat-w { border-bottom-color: #fb923c; }
body.style-on .wg[data-sf].sf-diction .lat-w { border-bottom-color: #fbbf24; }
body.style-on .wg[data-sf].sf-grammar .lat-w { border-bottom-color: #60a5fa; }
body.style-on .wg[data-sf].sf-tone    .lat-w { border-bottom-color: #f87171; }
body.style-on .wg[data-sf].sf-note    .lat-w { border-bottom-color: #c2c8d6; }
body.style-on .wg[data-sf]:hover .lat-w { background: #fff0b3; }
.wg.sf-active .lat-w {
  background: var(--brand) !important;
  color: white !important;
  border-bottom-color: transparent !important;
}
/* category filter */
body.style-on .wg[data-sf].cat-hidden .lat-w { border-bottom-color: transparent; }

/* note count marker */
.note-dot {
  font-size: 9px;
  font-weight: 700;
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 0 5px;
  margin-left: 6px;
  align-self: center;
  opacity: 0.75;
}
.line-row:hover .note-dot { border-color: var(--brand); color: var(--brand); }

/* ── PER-LINE NOTE STRIP ── */
.line-notes {
  display: none;
  margin: 2px 0 8px 36px;
  padding: 8px 12px;
  background: #f7f9ff;
  border-left: 2px solid var(--brand);
  border-radius: 0 4px 4px 0;
}
.line-notes.open { display: block; }
.note-item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--ink);
}
.note-badge {
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 2px;
  flex-shrink: 0;
  white-space: nowrap;
}
.note-quote { font-family: 'Lora', serif; font-style: italic; font-weight: 600; color: var(--navy); }
.note-text { color: var(--muted); }

/* ── POPOVER ── */
.style-popover {
  position: fixed;
  z-index: 200;
  width: 330px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(14,30,63,0.18), 0 2px 8px rgba(14,30,63,0.08);
  padding: 14px 16px;
  display: none;
}
.style-popover.visible { display: block; animation: popover-in 0.15s ease; }
@keyframes popover-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.sp-quote { font-family: 'Lora', serif; font-style: italic; font-weight: 600; font-size: 15px; color: var(--navy); }
.sp-badge { font-size: 9px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 2px 7px; border-radius: 2px; margin-left: auto; }
.sp-rule { border: none; border-top: 1px solid var(--rule-faint); margin: 8px 0; }
.sp-body { font-size: 12.5px; color: var(--ink); line-height: 1.6; }
.sp-body em { font-family: 'Lora', serif; font-style: italic; }
.sp-line { font-size: 10.5px; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; margin-top: 8px; }

/* ── SECTION FOOT NAV ── */
.section-foot {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px 48px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.foot-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
}
.foot-link:hover { border-color: var(--brand); }
.foot-link.disabled { visibility: hidden; }

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .passage-header-inner { flex-direction: column; align-items: flex-start; }
  .passage-body { padding: 20px 16px 0; }
  .passage-grid { grid-template-columns: 1fr; }
  .latin-col { border-right: none; border-bottom: 1px solid var(--rule); }
  .col-head.latin-head { border-right: none; }
  .controls-bar-inner { padding: 8px 16px; }
  .style-popover { width: calc(100vw - 32px); }
}

/* set-text flag in the passage eyebrow */
.set-flag { color: #9fc3ff; }

/* ── PROSE SET TEXTS ── */
/* Prose sense-units run longer than a verse line, so the Latin sits as a
   block rather than a single wrapped line, and the reference (chapter and
   line numbers) is narrower. */
.prose .lat-w { font-size: 16px; }
.prose .line-row { align-items: baseline; padding: 5px 0; }
.prose .line-num { min-width: 34px; font-size: 11.5px; }
.prose .eng-w { font-size: 13.5px; }

/* chapter lead-in */
.chapter-intro {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px 0;
}
.chapter-intro-box {
  background: #f7f9ff;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--brand);
  border-radius: 0 6px 6px 0;
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
}
.chapter-intro-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--brand); display: block; margin-bottom: 5px;
}
