/* ==========================================================
   Church History Timeline — Side Panel — the slide-in quick-view panel for events, people, works, movements & Bible books
   Part of the split stylesheet (see css/ for the rest): base.css,
   top-bar.css, datasource-filters.css, map-view.css, side-panel.css,
   article-view.css, mobile-view.css. Loaded as separate <link>
   tags in index.html; order barely matters for CSS (later same-
   specificity rules win, and there are no same-selector conflicts
   across these files) — base.css is simply listed first as a
   convention, since it holds the shared :root variables and button
   primitives (.btn, .jump-btn, .read-article-btn, .google-search-btn)
   the other files build on.
   ========================================================== */

/* ---------------- Side panel ---------------- */

#side-panel {
  position: fixed;
  top: 0;
  right: -440px;
  width: 420px;
  max-width: 92vw;
  height: 100%;
  background: var(--parchment);
  color: var(--ink);
  box-shadow: -12px 0 32px rgba(0,0,0,0.5);
  z-index: 100;
  transition: right 0.28s cubic-bezier(.2,.8,.3,1);
  display: flex;
  flex-direction: column;
}
#side-panel.open { right: 0; }

#side-panel-header {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 22px 14px;
  border-bottom: 2px solid rgba(0,0,0,0.08);
}

#side-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ink-soft);
  line-height: 1;
  padding: 4px;
}
#side-panel-close:hover { color: var(--ink); }

#side-panel-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 18px 22px 32px;
}

.panel-back-link {
  font-size: 12px;
  color: #8a6d1f;
  cursor: pointer;
  margin-bottom: 8px;
  display: inline-block;
}
.panel-back-link:hover { text-decoration: underline; }

.panel-category-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.panel-title {
  font-family: var(--font-serif);
  font-size: 24px;
  margin: 10px 0 4px;
  line-height: 1.2;
}

.panel-dates {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.panel-summary {
  font-size: 14.5px;
  font-style: italic;
  color: #4a4030;
  border-left: 3px solid var(--gold);
  padding-left: 12px;
  margin-bottom: 16px;
}

.consensus-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  margin: 4px 0 16px;
  border: 1px solid rgba(0,0,0,0.12);
}
.consensus-Undisputed { background: rgba(46,158,79,0.14); color: #1f7a3d; border-color: rgba(46,158,79,0.4); }
.consensus-Majority-Traditional { background: rgba(46,111,224,0.12); color: #2451a3; border-color: rgba(46,111,224,0.35); }
.consensus-Debated { background: rgba(201,154,30,0.16); color: #8a6d1f; border-color: rgba(201,154,30,0.4); }
.consensus-Majority-Critical { background: rgba(214,57,47,0.12); color: #b5352c; border-color: rgba(214,57,47,0.35); }
.consensus-Anonymous { background: rgba(100,116,139,0.14); color: #4a5568; border-color: rgba(100,116,139,0.35); }

.panel-section { margin-bottom: 20px; }
.panel-section h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a6d1f;
  margin: 0 0 8px;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  padding-bottom: 5px;
}
.panel-section p {
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 8px;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-pill {
  background: rgba(0,0,0,0.06);
  border-radius: 12px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--ink-soft);
}

.person-chip, .link-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 16px;
  padding: 5px 12px 5px 8px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink);
  margin: 0 6px 6px 0;
  transition: background 0.15s, border-color 0.15s;
}
.person-chip:hover, .link-chip:hover { background: #f5e8c4; border-color: var(--gold); }
.person-chip .avatar {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex: 0 0 auto;
}

.list-plain { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.65; }
.list-plain li { margin-bottom: 4px; }

.source-item {
  font-size: 12.5px;
  color: var(--ink-soft);
  padding: 4px 0;
  border-bottom: 1px dotted rgba(0,0,0,0.12);
}

.lifespan-badge {
  display: inline-block;
  background: rgba(201,154,30,0.15);
  border: 1px solid rgba(201,154,30,0.4);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.panel-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.external-text-btn {
  background: #eaf6ee;
  color: #1f7a3d;
  border-color: rgba(46,158,79,0.4);
}
.external-text-btn:hover { background: #d8f0df; }
