/* EA Vocabulary page — reuses style.css's tokens/reset, adds its own layout */

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

.voc-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  position: relative;
  /* the Library gets its own room in the house: forest green instead of
     the indigo/rose used everywhere else — one hue family, not a second
     accent color, so --accent-2 is a lighter sage rather than a
     different color entirely. Just re-pointing the two shared tokens —
     every existing --accent/--accent-2 usage on this page (links,
     headers, badges, borders) retints for free. Paired with a warm
     paper neutral (not derived from the accent) for the page and its
     drawers — cream page, green binding, like an actual book. */
  --accent: #3d7259;
  --accent-2: #7fa88f;
  --voc-paper: #faf6ec;
  --voc-paper-2: #f3ecd9;
  /* --fire/--earth/--air/--water (used by the Personal Room's per-group
     "kind" tinting — data-kind="water" on Transit journal, Your notes,
     etc.) are each declared exactly ONCE in style.css's :root as a
     color-mix() of --accent/--accent-2, so a descendant page that
     re-points those two base tokens does NOT get them re-derived for
     free — the element/fire/earth/air/water tokens inherit their
     already-computed indigo/rose value straight from :root regardless.
     Re-declaring the same formula here, now referencing THIS block's
     own green --accent/--accent-2, is what actually retints them. */
  --fire: var(--accent-2);
  --earth: color-mix(in srgb, var(--accent-2) 40%, var(--accent) 60%);
  --air: var(--accent);
  --water: color-mix(in srgb, var(--accent) 40%, var(--accent-2) 60%);
}
/* the Library at night: swap the warm cream "paper" for a deep
   green-black one and brighten the accent for dark-bg contrast — same
   mechanism, tokens only, so every existing --voc-paper/--accent usage
   (the drawers, links, headers) follows without touching them directly */
body.theme-night .voc-page {
  --accent: #6fcf9e;
  --accent-2: #a3d9bc;
  --voc-paper: #0f2119;
  --voc-paper-2: #163429;
  --fire: var(--accent-2);
  --earth: color-mix(in srgb, var(--accent-2) 40%, var(--accent) 60%);
  --air: var(--accent);
  --water: color-mix(in srgb, var(--accent) 40%, var(--accent-2) 60%);
}

.voc-page::before {
  content: ""; position: absolute; z-index: -1;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 100vw; height: 100%;
  background:
    radial-gradient(ellipse 900px 500px at 50% -8%, color-mix(in srgb, var(--voc-paper-2) 70%, transparent), transparent 65%),
    linear-gradient(180deg, var(--voc-paper) 0%, var(--bg) 60%);
}

.voc-head { margin-bottom: 34px; }
.voc-back {
  display: inline-block; color: var(--ink-faint); font-size: 12px;
  text-decoration: none; margin-bottom: 18px; transition: color .15s;
}
.voc-back:hover { color: var(--accent); }

.voc-coverage {
  margin: 10px 0 0; font-size: 11px; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .08em;
}

/* the "Gemini mode" ask box folds everywhere via ask.js now — Library-
   specific paper-token sizing lives in the shared .ask-fold rule in
   style.css; this file only needs the Library's own paper tone on top */
.ask-fold > summary, .ask-fold #ask-input { background: var(--voc-paper); }

/* a filing system: drawers (groups) laid out as blocks, rows that slide open */
.voc-groups {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px; align-items: start;
}
@media (max-width: 720px) { .voc-groups { grid-template-columns: minmax(0, 1fr); } }

/* each category is a block, folded in by default, click to fold out */
.voc-group {
  background: color-mix(in srgb, var(--voc-paper-2) 55%, var(--bg-2));
  border: 1px solid color-mix(in srgb, var(--accent) 12%, var(--line));
  border-radius: 14px; padding: 4px 16px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 3%, transparent);
}
.voc-group--full { grid-column: 1 / -1; }
.voc-group--core {
  border-color: color-mix(in srgb, var(--accent-2) 30%, var(--line));
  background:
    radial-gradient(ellipse 500px 200px at 0% -30%, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 70%),
    color-mix(in srgb, var(--voc-paper-2) 55%, var(--bg-2));
}
/* the esoteric/historical wing carries the same violet identity as the
   rest of Scorpio mode — a hint that it's part of that family, without
   the standalone dark panel treatment that didn't sit well elsewhere */
.voc-group--scorpio {
  border-color: color-mix(in srgb, var(--scorpio) 25%, var(--line));
}
.voc-group--scorpio summary.voc-group-title { color: var(--scorpio); }
summary.voc-group-title {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--accent); margin: 0;
  padding: 12px 0;
}
summary.voc-group-title::-webkit-details-marker { display: none; }
summary.voc-group-title::after {
  content: "▸"; margin-left: auto; font-size: 10px; color: var(--ink-faint);
  transition: transform .2s var(--ease);
}
.voc-group[open] > summary.voc-group-title {
  border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.voc-group[open] > summary.voc-group-title::after { transform: rotate(90deg); }
.voc-group--core summary.voc-group-title { color: var(--accent-2); }
.voc-group-count {
  font-weight: 700; font-size: 9.5px; line-height: 15px;
  min-width: 15px; text-align: center; padding: 0 4px; border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.voc-group-body { padding-bottom: 4px; }

/* one entry = one row; hairline-separated, no chunky card */
.voc-term {
  border-bottom: 1px solid var(--line-soft);
  scroll-margin-top: 20px;
}
.voc-group-body > .voc-term:last-child { border-bottom: none; }
.voc-term[open] {
  background: color-mix(in srgb, var(--accent) 3.5%, transparent);
  border-bottom-color: var(--line);
  margin: 0 -16px; padding-left: 16px; padding-right: 16px;
  border-radius: 8px;
}

/* the glossary row */
.voc-sum {
  list-style: none; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; align-items: baseline;
  gap: 2px 14px; padding: 12px 4px 12px 2px;
}
.voc-sum::-webkit-details-marker { display: none; }
.voc-sum:hover .voc-term-title { color: var(--accent); }
.voc-term-title {
  font-family: var(--serif); font-weight: 600; font-size: 15.5px;
  color: var(--ink); margin: 0; transition: color .12s;
}
.voc-mantra {
  grid-column: 1 / -1;
  font-family: var(--serif); font-style: italic; font-size: 12.5px; color: var(--accent-2);
}
.voc-gloss {
  grid-column: 1 / -1;
  font-size: 13.5px; line-height: 1.6; color: var(--ink-dim);
}
.voc-term[open] .voc-gloss { display: none; }
.voc-more {
  align-self: start; white-space: nowrap;
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; color: var(--accent);
}
.voc-chev { display: inline-block; margin-left: 4px; transition: transform .2s var(--ease); }
.voc-term[open] .voc-chev { transform: rotate(180deg); }
.voc-term[open] .voc-more { color: var(--ink-faint); }

.voc-full { padding: 0 4px 16px 2px; animation: voc-unfold .22s var(--ease); }

.voc-fig { margin: 4px 0 14px; }

/* a photographic backdrop behind the whole entry — visible as a hint even
   folded, fuller behind the title when open, always faded enough that the
   reading stays the thing actually being read */
.voc-term.has-backdrop {
  position: relative; isolation: isolate; overflow: hidden;
}
.voc-term.has-backdrop::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--voc-backdrop) center 25% / cover no-repeat;
  opacity: .16;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
          mask-image: linear-gradient(180deg, #000 0%, transparent 75%);
  transition: opacity .3s var(--ease-soft);
}
.voc-term.has-backdrop[open]::before { opacity: .24; }
.voc-photo-credit {
  margin: -6px 0 12px; font-family: var(--serif); font-style: italic;
  font-size: 11px; color: var(--ink-faint);
}
.voc-diagram {
  display: block; width: 100%; max-width: 380px; height: auto; margin: 0 auto;
}
.voc-diagram .vd-role {
  font-family: var(--sans); font-size: 8.5px; font-weight: 700;
  letter-spacing: .08em;
}
.voc-diagram .vd-gloss { font-family: var(--sans); font-size: 9px; fill: var(--ink-dim); }
.voc-diagram .vd-center { font-family: var(--serif); font-size: 11px; fill: var(--ink); }
.voc-diagram .vd-note { font-family: var(--sans); font-size: 8px; fill: var(--ink-faint); font-style: italic; }
@keyframes voc-unfold { from { opacity: 0; transform: translateY(-4px); } }

/* flat one-line entries (no deeper text to reveal) */
.voc-term-flat { padding: 12px 4px 12px 2px; }
.voc-term-flat .voc-term-title { margin-bottom: 4px; }

.voc-deeper {
  margin-top: 14px; padding-top: 10px;
  border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
/* a paid-tier feel that reads as its own thing wherever it lands, but
   sitting on the page's own paper rather than a standalone dark panel —
   same treatment as .voc-personal-toggle above. Clicking any of them
   opens the Library's own personal section (vocabulary.js). */
.voc-deeper-badge {
  display: inline-flex; align-items: center; gap: 5px; cursor: pointer;
  padding: 3px 11px 3px 8px; border-radius: var(--r-pill);
  background: var(--voc-paper-2);
  border: 1px solid color-mix(in srgb, var(--scorpio) 28%, var(--line));
  transition: border-color .2s var(--ease-soft), color .2s var(--ease-soft);
}
.voc-deeper-badge:hover {
  border-color: color-mix(in srgb, var(--scorpio) 45%, var(--line));
}
.voc-deeper-label {
  font-family: var(--sans); font-weight: 700; font-size: 10.5px;
  text-transform: uppercase; letter-spacing: .06em;
  color: color-mix(in srgb, var(--scorpio) 65%, var(--ink-dim));
}
.voc-deeper-key {
  font-family: var(--serif); font-size: 13px; font-weight: 400;
  color: var(--scorpio);
}
.voc-deeper-note { font-size: 12px; color: var(--ink-faint); font-style: italic; }
.voc-deeper-locked {
  font-family: var(--sans); font-weight: 600; font-size: 9px;
  text-transform: uppercase; letter-spacing: .06em;
  color: color-mix(in srgb, var(--scorpio) 40%, var(--ink-faint));
  padding-left: 6px; margin-left: 2px;
  border-left: 1px solid color-mix(in srgb, var(--scorpio) 25%, var(--line));
}
/* the Pluto/Scorpio/8th-house entries get the same badge with a slow
   pulse — reserved for the true underworld rung rather than every entry */
.voc-deeper.is-scorpio .voc-deeper-badge {
  border-color: color-mix(in srgb, var(--scorpio) 50%, transparent);
  animation: voc-scorpio-pulse 3.6s ease-in-out infinite;
}
.voc-deeper.is-scorpio .voc-deeper-label { color: var(--scorpio); }
@keyframes voc-scorpio-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--scorpio) 30%, transparent); }
  50% { box-shadow: 0 0 8px 1px color-mix(in srgb, var(--scorpio) 30%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .voc-deeper.is-scorpio .voc-deeper-badge { animation: none; }
}

/* margin notes — your own reading, written right where you're reading it */
.voc-note-wrap { margin-top: 10px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.voc-note-toggle, .voc-save-toggle {
  font: inherit; font-size: 11.5px; color: var(--ink-faint); cursor: pointer;
  background: none; border: none; padding: 0; text-decoration: underline;
  text-decoration-style: dotted; text-underline-offset: 2px;
}
.voc-note-toggle:hover, .voc-save-toggle:hover { color: var(--ink-dim); }
.voc-note-toggle.has-note { color: var(--accent); font-weight: 600; text-decoration-style: solid; }
.voc-save-toggle.is-saved { color: #b8860b; font-weight: 600; text-decoration-style: solid; }
.voc-note-area {
  display: block; width: 100%; flex: 1 1 100%; margin-top: 8px;
  font: inherit; font-size: 13px; line-height: 1.6; color: var(--ink);
  padding: 10px 12px; border-radius: var(--r-sm); resize: vertical; min-height: 64px;
  background: var(--bg); border: 1px solid var(--line);
}
.voc-note-area[hidden] { display: none; }
.voc-note-area:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}
.voc-term.is-draft { padding: 11px 4px; opacity: .6; }
.voc-term.is-draft .voc-term-title { font-size: 14px; margin: 0; }
.voc-term p {
  margin: 0 0 9px; font-size: 14px; line-height: 1.68; color: var(--ink-dim);
}
.voc-term p:last-child { margin-bottom: 0; }
.voc-term h4 {
  font-family: var(--sans); font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--accent-2); margin: 16px 0 5px;
}
.voc-term ul {
  margin: 0 0 10px; padding-left: 18px;
  font-size: 14.5px; line-height: 1.7; color: var(--ink-dim);
}
.voc-term ul li { margin: 2px 0; }
.voc-term strong { color: var(--ink); font-weight: 600; }
.voc-xref {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--accent) 45%, transparent);
}
.voc-xref:hover { border-bottom-style: solid; }
.voc-ext-link {
  color: var(--ink); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--ink-dim) 45%, transparent);
}
.voc-ext-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.voc-ext-link::after { content: " ↗"; font-size: .85em; opacity: .6; }
.voc-table {
  width: 100%; border-collapse: collapse; margin: 4px 0 14px;
  font-size: 13px; line-height: 1.45;
}
.voc-table th, .voc-table td {
  text-align: left; padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-dim); vertical-align: top;
}
.voc-table th {
  font-family: var(--sans); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint);
}
.voc-table td:first-child { color: var(--ink); font-weight: 600; white-space: nowrap; }
.voc-todo {
  font-family: var(--mono); font-size: 11.5px !important;
  color: var(--ink-faint) !important;
}

@media (max-width: 560px) {
  .voc-page { padding: 28px 16px 60px; }
}
