/* public/css/entity-cards.css  (Phase 3 + 4) */

/* ── Entity card grid (Characters page) ─────────────────────── */
.entity-page h2 {
  font-family: inherit;
  border-bottom: 2px solid #c8a96e;
  padding-bottom: .4rem;
  margin-bottom: 1.2rem;
}

.entity-card {
  cursor: pointer;
  border: 1px solid #e8d9bb;
  border-radius: 6px;
  transition: box-shadow .2s, transform .15s;
}
.entity-card:hover {
  box-shadow: 0 4px 18px rgba(180,120,30,.18);
  transform: translateY(-2px);
}

.entity-iast {
  font-size: 1.1rem;
  color: #3a2a0a;
  font-style: italic;
}
.entity-devanagari {
  font-size: 1rem;
  line-height: 1.4;
}
.entity-summary {
  font-size: .88rem;
  color: #555;
}

/* Tier badges */
.badge-tier1 { background: #8b4513; color: #fff; }
.badge-tier2 { background: #c8781a; color: #fff; }
.badge-tier3 { background: #888;    color: #fff; }

/* ── Entity modal (Characters + parva annotation) ────────────── */
#entityModal .modal-dialog,
#entityAnnotationModal .modal-dialog {
  max-width: 720px;
}

.entity-modal-summary {
  font-size: 1rem;
  color: #222;
}

.entity-relations li {
  margin-bottom: .3rem;
  font-size: .92rem;
}
.rel-type {
  display: inline-block;
  background: #f0e6d2;
  color: #5a3a0a;
  border-radius: 3px;
  padding: 0 5px;
  font-size: .78rem;
  margin-right: 4px;
  text-transform: lowercase;
}

.entity-appearances li a {
  color: #7b4f00;
  text-decoration: underline dotted;
}

.death-ref {
  background: #fff3e0;
  border-left: 3px solid #c8781a;
  font-size: .9rem;
}

/* ── Inline annotation highlights (parva text pages) ─────────── */
.entity-link {
  border-bottom: 1px dotted #b8860b;
  color: inherit;
  cursor: pointer;
  transition: background .15s;
}
.entity-link:hover {
  background: #fff3cd;
  border-radius: 2px;
}

/* ── Entity sidebar (parva text pages) ──────────────────────── */
#entity-sidebar {
  position: fixed;
  right: 0;
  top: 120px;
  width: 220px;
  max-height: 60vh;
  overflow-y: auto;
  background: #fffdf6;
  border: 1px solid #e8d9bb;
  border-right: none;
  border-radius: 6px 0 0 6px;
  box-shadow: -2px 2px 10px rgba(0,0,0,.08);
  z-index: 900;
  font-size: .85rem;
  transition: transform .25s;
}
#entity-sidebar.collapsed {
  transform: translateX(190px);
}

.entity-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f5ead0;
  border-bottom: 1px solid #e8d9bb;
  font-size: .8rem;
}

.entity-sidebar-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .85rem;
  color: #666;
}

.entity-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.entity-sidebar-item {
  padding: 5px 10px;
  cursor: pointer;
  border-bottom: 1px solid #f0e8d4;
  line-height: 1.3;
}
.entity-sidebar-item:hover {
  background: #fff3cd;
}

.entity-sidebar-iast {
  display: block;
  font-style: italic;
  color: #3a2a0a;
}
.entity-sidebar-dev {
  display: block;
  color: #888;
  font-size: .8rem;
}

/* ── Responsive: hide sidebar on mobile ──────────────────────── */
@media (max-width: 768px) {
  #entity-sidebar { display: none; }
}