/* ============================================================
   TELL — styles-v2.css
   Visual upgrade layer — load after styles.css
   Adds DM Sans, updated tokens, and refreshed component styles.
   Does not touch annotation logic, map, or mobile shell CSS.
   ============================================================ */

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

/* ── Updated tokens ── */
:root {
  --sans:          'DM Sans', sans-serif;
  --gold:          #C4820E;
  --gold-deep:     #9E6808;
  --gold-bg:       #FDF4DA;
  --teal:          #1E6B52;
  --teal-deep:     #165440;
  --teal-bg:       #E2F0EB;
  --cream:         #EDE5CF;
  --surface:       #F8F2E3;
  --r:             12px;
  --sh-sm:         0 2px 8px  rgba(29,21,8,.07);
  --sh-md:         0 4px 20px rgba(29,21,8,.12);
  /* Tier color overrides — used by script.js inline styles */
  --patina:        #677245;   /* Attested — user spec */
  --ane-blue:      #8B6A20;   /* Contextual Parallel — warm amber gold */
  --terracotta:    #a7432a;   /* Debated — user spec */
}

/* ============================================================
   HEADER — solid olive green
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 62px;
  padding: 0 clamp(20px, 4vw, 56px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #677245;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid rgba(0,0,0,.2);
}
.site-brand .mark   { color: rgba(242,232,208,.7); border-color: rgba(242,232,208,.25); }
.site-brand .tagline { color: rgba(242,232,208,.85); border-left-color: rgba(242,232,208,.2); }
.brand-wordmark, .site-brand { color: #F2E8D0; }
.site-nav a { color: rgba(242,232,208,.78); border-bottom-color: transparent; }
.site-nav a:hover { color: #fff; border-bottom-color: rgba(242,232,208,.4); }
.site-nav a[aria-current="page"] { color: #F2E8D0; border-bottom-color: rgba(242,232,208,.7); }

/* ============================================================
   CHAPTER HEAD — dark full-bleed, summary only
   ============================================================ */
html { overflow-x: hidden; }

.chapter-head {
  background: #181412;
  margin-left:  calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding: 80px calc(50vw - 50%) 0;
  position: relative;
  border-bottom: none;
}
/* ── Translation toggle — explicit override for --patina conflict ── */
.translation-toggle button[aria-pressed="true"] {
  background: linear-gradient(135deg, #ab4825, #c07912);
  color: #fff;
  border-color: #c07912;
}

/* Gradient divider — left-to-right amber stripe, full viewport width */
.chapter-head::after {
  content: '';
  display: block;
  height: 9px;
  background: linear-gradient(90deg, #ab4825 0%, #c07912 100%);
  margin-top: 80px;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
}

.back-link {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink);
  border-color: var(--line);
  background: #f8f2e3;
  border-radius: 20px;
  padding: 7px 16px;
  box-shadow: none;
  transition: color .14s, border-color .14s, transform .14s;
  margin-bottom: 22px;
}
.back-link:hover {
  color: var(--gold-deep);
  border-color: var(--gold);
  transform: translateX(-2px);
}
.chapter-head .kicker {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .18em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.chapter-head .kicker::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 1px;
  background: var(--gold);
}
.chapter-head h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  letter-spacing: -.025em;
  margin: 0 0 12px;
  color: #F2E8D0;
}
.chapter-head .summary {
  font-family: var(--sans);
  font-size: 1.06rem;
  line-height: 1.68;
  color: rgba(242,232,208,.72);
  margin-bottom: 0;
}

/* Give main a cream background so controls inherit correctly */
main { background: var(--limestone); }

/* ── Chapter controls — cream section below gradient divider ── */
.chapter-controls {
  position: relative;
  z-index: 2;
  background: var(--limestone) !important;
  padding: 80px 0 80px; /* bottom matches top — space under layer bar equals space above nav row */
  border-bottom: 1px solid var(--line);
}

/* Chapter nav in light context */
.chapter-controls .chapter-nav {
  font-family: var(--sans);
  font-size: .84rem;
  font-weight: 500;
}
.chapter-controls .chapter-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .14s;
}
.chapter-controls .chapter-nav a:hover { color: var(--gold-deep); }

/* Translation toggle in light context */
.chapter-controls .translation-toggle {
  border-radius: 30px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  gap: 0;
}
.chapter-controls .translation-toggle button {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 7px 16px;
  color: var(--ink-soft);
  transition: background .14s, color .14s;
  background: transparent;
}
.chapter-controls .translation-toggle button[aria-pressed="true"] {
  background: linear-gradient(135deg, #ab4825, #c07912);
  color: #fff;
}
.chapter-controls .translation-toggle button:hover:not([aria-pressed="true"]) {
  background: var(--gold-bg);
  color: var(--gold-deep);
}

/* Layer bar in light context */
.chapter-controls .layer-bar {
  margin-top: 12px;
  gap: 6px;
  padding-bottom: 2px;
}
.chapter-controls .lb-btn {
  font-family: var(--sans);
  font-size: .74rem;
  font-weight: 500;
  border-radius: 20px;
  padding: 6px 13px;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  letter-spacing: 0;
  transition: all .14s;
  background: var(--cream);
}
.chapter-controls .lb-btn[aria-pressed="false"] { opacity: .55; }

/* Layer button gradients — stronger, clearly visible */
.lb-btn.lb-places[aria-pressed="true"]  { background: linear-gradient(135deg,#1E3D2E,#4A8A6A); border-color:#3E6657; color:#fff; }
.lb-btn.lb-words[aria-pressed="true"]   { background: linear-gradient(135deg,#3A3870,#7070B8); border-color:#6E6A9C; color:#fff; }
.lb-btn.lb-xrefs[aria-pressed="true"]   { background: linear-gradient(135deg,#2C2880,#5858C0); border-color:#4B47A0; color:#fff; }
.lb-btn.lb-objects[aria-pressed="true"] { background: linear-gradient(135deg,#5A3A08,#B07820); border-color:#9A6A1A; color:#fff; }
.lb-btn.lb-numbers[aria-pressed="true"] { background: linear-gradient(135deg,#6A2810,#C05838); border-color:#C05A2E; color:#fff; }
.lb-btn.lb-scrolls[aria-pressed="true"] { background: linear-gradient(135deg,#2E2050,#6858A0); border-color:#4F4B79; color:#fff; }
.lb-btn.lb-quran[aria-pressed="true"]   { background: linear-gradient(135deg,#4A3008,#A07820); border-color:#7E5A20; color:#fff; }
.lb-btn.lb-ane[aria-pressed="true"]     { background: linear-gradient(135deg,#163858,#2A6496); border-color:#2A6496; color:#fff; }
.lb-btn.lb-women[aria-pressed="true"]   { background: linear-gradient(135deg,#5A1030,#B05070); border-color:#B05070; color:#fff; }

/* ============================================================
   VERSE TEXT
   ============================================================ */
.verses {
  font-size: 1.1rem;
  line-height: 1.72;
}
.verse { margin: 0 0 1.1em; }
.vnum {
  font-family: var(--mono);
  font-size: .64rem;
  color: var(--ink-faint);
  vertical-align: super;
  margin-right: 4px;
}
.verses h2.subhead {
  font-family: var(--display);
  font-size: .92rem;
  font-weight: 600;
  font-style: italic;
  text-transform: none;
  letter-spacing: -.01em;
  color: var(--ink-soft);
  margin: 36px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.verses h2.subhead:first-child { margin-top: 0; }

/* ============================================================
   MAP RAIL
   ============================================================ */
.map-rail .map-frame {
  border-radius: var(--r);
  border-color: var(--line-soft);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.map-caption {
  font-size: .66rem;
  line-height: 1.55;
  margin-top: 9px;
}

/* ============================================================
   CROSS-CALLOUTS (DSS & Quran)
   ============================================================ */
.cross-box {
  border-radius: var(--r);
  border-left-width: 4px;
}
.cross-box summary {
  font-family: var(--sans);
  font-size: .78rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  padding: 14px 18px;
  border-radius: var(--r) var(--r) 0 0;
}
.cross-box[open] summary { border-radius: 0; }
.cross-box p {
  font-family: var(--sans);
  font-size: .92rem;
  line-height: 1.65;
}

/* ============================================================
   ANE PANEL
   ============================================================ */
.ane-item-title {
  font-family: var(--display);
  font-style: italic;
  font-size: .94rem;
}
.ane-item-body {
  font-family: var(--sans);
  font-size: .84rem;
  line-height: 1.62;
}

/* ============================================================
   FIELD CARDS (annotation popups)
   ============================================================ */
.fc-title {
  letter-spacing: -.02em;
}
.fc-meta {
  font-size: .72rem;
}
.fc-summary {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.68;
}
.fc-case .case {
  border-radius: 8px;
}

/* ============================================================
   NOTES PANEL
   ============================================================ */
.notes-toggle {
  background: var(--ink);
  box-shadow: var(--sh-md);
  border-radius: 50%;
  transition: background .14s, transform .14s;
}
.notes-toggle:hover {
  background: var(--gold-deep);
  transform: scale(1.06);
}
.notes-panel {
  border-radius: var(--r);
  box-shadow: var(--sh-md);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  font-family: var(--sans);
  font-size: .8rem;
  background: var(--ink);
  color: rgba(244, 236, 216, .7);
  border-top: none;
  padding: 28px clamp(20px, 5vw, 56px);
  margin-top: 0;
  border-top: none;
}
.site-footer a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   ANE SECTION HEADER
   ============================================================ */
.ane-section {
  border-top: 2px solid var(--gold);
  margin-top: 48px;
  padding-top: 32px;
}
.ane-section-head { margin-bottom: 24px; }
.ane-section-icon { color: var(--gold); }
.ane-section-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -.02em;
  color: var(--ink);
}
.ane-acronym {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--gold);
  font-weight: 600;
}
.ane-section-note {
  font-family: var(--sans);
  font-size: .8rem;
  color: var(--ink-faint);
  border-left: 2px solid var(--gold-bg);
  padding-left: 14px;
}

/* ============================================================
   ANE ACCORDION CARDS — two-tone: dark header, light body
   ============================================================ */
.ane-panel-item {
  border: 1px solid rgba(0,0,0,.15);
  border-left: none;
  border-radius: 14px;
  overflow: hidden;
  background: #f8f2e4;
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  transition: box-shadow .18s;
  position: relative;
  padding: 0;
  margin: 0;
}
.ane-panel-item:hover { box-shadow: 0 4px 20px rgba(0,0,0,.16); }
/* Collapsed cards must not stretch to the row height of an open neighbor
   (.ane-section-body is a grid; default align-items:stretch left an empty
   cream box below the dark header). Closed = header height only. */
.ane-panel-item:not([open]) { align-self: start; }
/* No ::before — stripe baked into summary background */
.ane-tier-badge {
  border-radius: 20px;
  padding: 3px 11px;
  font-size: .58rem;
  letter-spacing: .1em;
  font-weight: 700;
  font-family: var(--mono);
}
.ane-panel-summary {
  display: flex;
  width: 100%;
  box-sizing: border-box;
  list-style: none;
  /* Dark header with 4px gradient stripe at the BOTTOM — separator to cream body */
  background: linear-gradient(to top, #ab4825 0px, #c07912 4px, #161009 4px);
  padding: 14px 18px 18px;
  color: #F2E8D0;
  gap: 10px;
  align-items: center;
  margin: 0;
  cursor: pointer;
}
.ane-panel-summary::-webkit-details-marker { display: none; }
.ane-panel-summary:hover {
  background: linear-gradient(to top, #ab4825 0px, #c07912 4px, #1c1208 4px);
}
.ane-panel-summary::after {
  font-family: var(--mono);
  font-size: .62rem;
  color: rgba(242,232,208,.4);
  letter-spacing: .04em;
}
.ane-panel-item[open] .ane-panel-summary {
  background: linear-gradient(to top, #ab4825 0px, #c07912 4px, #161009 4px);
  border-bottom: none;
}
.ane-panel-title {
  font-family: var(--display);
  font-style: italic;
  font-weight: 500;
  font-size: .92rem;
  color: #F2E8D0;
  letter-spacing: -.01em;
}
.ane-panel-content {
  background: #f8f2e4;
  font-family: var(--sans);
  font-size: .88rem;
  line-height: 1.68;
  color: var(--ink-soft);
  padding: 16px 18px;
}
.ane-panel-content strong { color: var(--ink); font-weight: 600; }
.ane-sources {
  background: #f8f2e4;
  padding: 8px 18px 16px;
  border-top: 1px solid var(--line-soft);
}
.ane-sources a {
  color: var(--gold-deep);
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color .14s;
}
.ane-sources a:hover { color: var(--gold); }

/* ============================================================
   DSS & QURAN RAIL PANELS — exact spec
   ============================================================ */
.rail-panel {
  border: 1px solid rgba(255,255,255,.08);
  border-left: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  margin-bottom: 16px;
}
.rail-panel-head {
  font-family: var(--sans);
  font-size: .84rem;
  font-weight: 600;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #181412;
  /* Gradient separator line at bottom */
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, #c07912, #ab4825) 1;
}
.rail-dss  .rail-panel-head { color: #c07912; }
.rail-quran .rail-panel-head { color: #c07912; }

/* DSS body — amber gradient */
.rail-dss { background: linear-gradient(135deg, #ab823b, #634b1f); }
/* Quran body — deep red gradient */
.rail-quran { background: linear-gradient(135deg, #632715, #2a160a); }

.rail-panel p {
  font-family: var(--sans);
  font-size: .9rem;
  line-height: 1.7;
  color: #ece6d7;
  margin: 16px 20px;
}
.rail-panel .cross-links {
  padding: 0 20px 18px;
  gap: 8px 16px;
}
.rail-panel .cross-links a { color: #c07912; text-decoration: underline; text-underline-offset: 3px; }
.rail-panel .cross-links a:hover { color: #e0a030; }

/* ============================================================
   FIELD CARD ANNOTATION PANEL
   ============================================================ */
.field-card {
  background: var(--surface);
  border-left: none;
  box-shadow: -6px 0 40px rgba(29,21,8,.18);
  top: 62px;
  height: calc(100% - 62px);
}

.fc-tab {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .12em;
  padding: 5px 14px;
  border-radius: 0 0 8px 0;
  font-weight: 700;
}
.fc-tab.attested { background: linear-gradient(135deg, var(--teal-deep), var(--teal)); }
.fc-tab.parallel { background: linear-gradient(135deg, var(--gold-deep), var(--gold)); }
.fc-tab.debated  { background: linear-gradient(135deg, #A63D2A, #C14828); }
.fc-tab.word     { background: linear-gradient(135deg, #4F4B79, #6E6A9C); }
.fc-tab.xref     { background: linear-gradient(135deg, #3A3880, #5854A8); }
.fc-tab.number   { background: linear-gradient(135deg, #8A3820, #C05A2E); }
.fc-tab.woman    { background: linear-gradient(135deg, #802048, #B05070); }

.fc-close {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--cream);
  color: var(--ink-soft);
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .14s, color .14s;
}
.fc-close:hover { border-color: var(--gold); color: var(--gold-deep); }

.fc-body { padding: 44px 28px 36px; }
.fc-title {
  font-size: 1.7rem;
  letter-spacing: -.025em;
  line-height: 1.1;
}
.fc-meta {
  font-size: .7rem;
  color: var(--ink-faint);
  line-height: 1.75;
  margin-bottom: 16px;
  padding-bottom: 14px;
}
.fc-meta .k { color: var(--ink-faint); }
.fc-summary {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink-soft);
}
.fc-case .case {
  border-radius: 10px;
  background: var(--cream);
}
.fc-case .for   h4 { color: var(--teal-deep); }
.fc-case .against h4 { color: var(--terra); }
.fc-sources a {
  color: var(--gold-deep);
  text-decoration-color: var(--gold-bg);
}
.fc-sources a:hover { color: var(--gold); }

/* Hebrew text in word studies */
.fc-hebrew {
  font-size: 2rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.fc-translit {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--gold-deep);
  border-bottom-color: var(--line-soft);
}
.fc-greek-note {
  background: var(--gold-bg);
  border-radius: 8px;
  padding: 10px 14px;
}
.fc-greek-note .greek { color: var(--gold-deep); }

/* ============================================================
   ENTRY TOOLTIP (hover preview)
   ============================================================ */
.entry-tooltip {
  background: var(--ink);
  color: var(--cream);
  font-family: var(--mono);
  border-radius: 8px;
  font-size: .7rem;
  padding: 8px 12px;
  box-shadow: var(--sh-md);
}
/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */
@media (max-width: 780px) {
  .site-nav { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

