/* ===========================================================================
 * admin.css — Phase A admin overlay styling.
 *
 * Scoping rule: every selector is rooted at `body.admin-mode` so this file
 * can never affect the public reader. The reader's index.html doesn't load
 * this stylesheet at all, but the scoping is defense-in-depth.
 *
 * Reuses theme variables from styles.css (--accent, --muted, --rule, etc.).
 * Adds no new top-level variables; everything below is admin-only.
 * =========================================================================== */

body.admin-mode .admin-brand-sub {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 12px;
  margin-top: 2px;
}

/* Cross-mode navigation pills (Reader / Source / Admin).
   Same visual treatment in admin and in index.html (where it's inline). */
body.admin-mode .modes {
  display: flex;
  gap: 4px;
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
body.admin-mode .modes-link {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  transition: background 100ms ease, color 100ms ease;
}
body.admin-mode .modes-link:hover { background: var(--accent-soft); color: var(--accent); }
body.admin-mode .modes-link.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  cursor: default;
}

/* ---------- .name span: hover-only ✎ affordance ----------
 * The reader's existing click-to-popover behavior is preserved. We layer a
 * pointer-events:none pseudo-element so the glyph is purely decorative.
 */

body.admin-mode .name {
  cursor: cell;
}
body.admin-mode .name::after {
  content: "✎";
  display: inline-block;
  margin-left: 4px;
  font-size: 0.7em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 100ms ease;
  pointer-events: none;
  vertical-align: super;
  line-height: 0;
}
body.admin-mode .name:hover::after,
body.admin-mode .name:focus::after {
  opacity: 0.85;
}

/* ---------- .vnum span: clickable verse-number affordance ----------
 * No separate icon. The number itself communicates interactivity through
 * cursor + hover styling. Selected state when the verse panel is open.
 */

body.admin-mode .vnum {
  cursor: pointer;
  border-radius: 3px;
  padding: 0 2px;
  transition: color 100ms ease, text-decoration-color 100ms ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  outline: none;
}
body.admin-mode .vnum:hover,
body.admin-mode .vnum:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent-soft);
}
body.admin-mode .vnum.admin-selected {
  color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
  text-decoration-color: var(--accent);
}

/* ---------- h2.chapter affordance ----------
 * Subtle hover state on chapter headings; styled like a clickable target.
 * No icon — the heading text itself is the click target.
 */

body.admin-mode h2.chapter {
  cursor: pointer;
  transition: color 100ms ease, text-decoration-color 100ms ease;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  outline: none;
  border-radius: 3px;
}
body.admin-mode h2.chapter:hover,
body.admin-mode h2.chapter:focus-visible {
  color: var(--accent);
  text-decoration-color: var(--accent-soft);
}
body.admin-mode h2.chapter.admin-selected {
  color: var(--accent);
  text-decoration-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}

/* ---------- Inert scope panels (verse + chapter share styling) ----------
 * Visually distinct from the reader's translation-note popover (#panel) so
 * users can tell admin content from reader content at a glance. Slides in
 * from the right with a warm-umber accent stripe at the left edge.
 *
 * Verse and chapter panels share the same shell — only the title and the
 * body content differ. They share the scrim and behave mutually-exclusively
 * (opening one closes the other) for a clean focus model.
 */

body.admin-mode .admin-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 40;
}
body.admin-mode .admin-scrim.show {
  opacity: 1;
  pointer-events: auto;
}

body.admin-mode .admin-scope-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(440px, 92vw);
  height: 100%;
  background: var(--panel-bg);
  box-shadow: var(--panel-shadow);
  border-left: 4px solid var(--accent);
  transform: translateX(100%);
  transition: transform 220ms ease;
  z-index: 50;
  overflow-y: auto;
  padding: 28px 28px 60px;
  font-family: var(--sans);
}
body.admin-mode .admin-scope-panel.open {
  transform: translateX(0);
}
/* Chapter panel uses a slightly cooler accent stripe so the two scopes
   are tellable apart at a glance even when only one is visible. */
body.admin-mode .admin-chapter-panel {
  border-left-color: var(--divergent, var(--accent));
}
body.admin-mode .admin-scope-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule);
}
body.admin-mode .admin-scope-panel-head h3 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.005em;
}
body.admin-mode .admin-scope-panel-close {
  background: transparent;
  border: 0;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
body.admin-mode .admin-scope-panel-close:hover { color: var(--accent); }
body.admin-mode .admin-scope-panel-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink);
}
body.admin-mode .admin-scope-panel-body p { margin: 0 0 12px; }
body.admin-mode .admin-placeholder-tag {
  display: inline-block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}
body.admin-mode .admin-scope-list {
  margin: 8px 0 16px 0;
  padding-left: 20px;
  color: var(--muted);
}
body.admin-mode .admin-scope-list li { margin: 2px 0; font-size: 13px; }
body.admin-mode .admin-foot-note {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}
body.admin-mode .admin-foot-note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: rgba(127, 127, 127, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  font-style: normal;
}
