/* ============================================================
   Pillar Detail Modal
   ============================================================ */

/* Visual cue on pillar cards — "i" badge + arrow */
.pillar-card {
  position: relative;
  cursor: pointer;
}
.pillar-card::after {
  content: '→';
  position: absolute;
  top: 8px; right: 10px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  background: var(--brand-primary);
  color: white;
  border-radius: 50%;
  font-size: 12px; font-weight: 700;
  opacity: 0;
  transform: translateX(-4px);
  transition: all .2s ease;
}
.pillar-card:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================================
   Modal
   ============================================================ */
.pillar-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(8px);
}
.pillar-modal.open { display: flex; animation: pmFade .25s ease; }
@keyframes pmFade { from { opacity: 0; } to { opacity: 1; } }

.pillar-card-modal {
  background: white;
  border-radius: 24px;
  width: 100%;
  max-width: 780px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, .35);
  animation: pmSlide .3s cubic-bezier(.16, 1, .3, 1);
}
@keyframes pmSlide {
  from { opacity: 0; transform: scale(.94) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Header */
.pm-header {
  padding: 26px 28px;
  background: linear-gradient(135deg, var(--pm-color, var(--brand-primary)) 0%, var(--pm-color-2, var(--brand-secondary)) 100%);
  color: white;
  position: relative;
}
.pm-header-eyebrow {
  font-size: 11.5px; font-weight: 600;
  letter-spacing: 2px;
  opacity: .9;
  text-transform: uppercase;
}
.pm-header-h {
  font-size: 26px;
  font-weight: 800;
  margin: 6px 0 4px;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.pm-header-ico {
  font-size: 32px;
  display: grid; place-items: center;
  width: 52px; height: 52px;
  background: rgba(255, 255, 255, .2);
  border-radius: 14px;
  flex-shrink: 0;
}
.pm-header-sub {
  font-size: 13.5px;
  opacity: .92;
  line-height: 1.45;
}
.pm-close {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(255, 255, 255, .2);
  border: 0;
  color: white;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  transition: all .2s ease;
}
.pm-close:hover {
  background: rgba(239, 68, 68, .85);
  transform: scale(1.08);
}

/* Body — scrollable */
.pm-body {
  padding: 22px 28px;
  overflow-y: auto;
  flex: 1;
}
.pm-section {
  margin-bottom: 22px;
}
.pm-section:last-child { margin-bottom: 0; }
.pm-section-h {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pm-section-h::before {
  content: '';
  width: 4px; height: 18px;
  background: var(--pm-color, var(--brand-primary));
  border-radius: 2px;
}
.pm-section p {
  font-size: 14px;
  color: var(--ink-3);
  line-height: 1.7;
}
.pm-section p b { color: var(--ink); font-weight: 600; }

.pm-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pm-bullets li {
  background: var(--paper-2);
  padding: 10px 14px 10px 32px;
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--ink-3);
  position: relative;
  line-height: 1.55;
}
.pm-bullets li::before {
  content: '✓';
  position: absolute;
  left: 12px; top: 10px;
  color: var(--pm-color, var(--brand-primary));
  font-weight: 800;
  font-size: 13px;
}
.pm-bullets b { color: var(--ink); font-weight: 600; }

/* Stats row inside modal */
.pm-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 4px 0 6px;
}
.pm-stat {
  background: white;
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 10px;
  text-align: center;
}
.pm-stat-n {
  font-size: 22px;
  font-weight: 800;
  color: var(--pm-color, var(--brand-primary));
  letter-spacing: -0.5px;
  line-height: 1.1;
}
.pm-stat-l {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Reference chips */
.pm-refs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pm-ref {
  background: rgba(14, 165, 233, .08);
  color: var(--brand-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}

/* Footer with action */
.pm-footer {
  padding: 16px 28px;
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.pm-foot-info {
  font-size: 12px;
  color: var(--muted);
}
.pm-goto {
  background: var(--ink);
  color: white;
  border: 0;
  padding: 11px 22px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .2s ease;
}
.pm-goto:hover {
  background: var(--pm-color, var(--brand-primary));
  transform: translateY(-2px);
}

@media (max-width: 640px) {
  .pm-header { padding: 20px 22px; }
  .pm-header-h { font-size: 21px; }
  .pm-header-ico { width: 44px; height: 44px; font-size: 26px; }
  .pm-body { padding: 18px 22px; }
  .pm-footer { padding: 14px 22px; flex-direction: column; align-items: stretch; }
  .pm-goto { width: 100%; justify-content: center; }
}
