/* ── Meet the Sages CSS ──
   Philosopher profiles page.
   Clean, card-based layout matching the hub aesthetic.
   Loads after shared.css.
*/

/* ── Page layout ── */
.sages-shell {
  max-width: 1060px;
  margin: 0 auto;
  padding: 36px 24px 48px;
}

.sages-header {
  margin-bottom: 28px;
}

.sages-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.sages-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--color-text-secondary, #5e6470);
  text-decoration: none;
  transition: background 0.15s;
  flex-shrink: 0;
}
.sages-back:hover {
  background: var(--color-accent-soft, rgba(102, 126, 234, 0.08));
}

.sages-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text-primary, #1a1d23);
  letter-spacing: -0.3px;
  margin: 0;
}

.sages-subtitle {
  font-size: 14px;
  color: var(--color-text-secondary, #5e6470);
  line-height: 1.5;
  margin: 0;
}

/* ── Constellation hero ── */
.constellation-wrap {
  margin-bottom: 32px;
  text-align: center;
}

.constellation {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 520px;
  margin: 0 auto;
  background: transparent;
  border-radius: 16px;
  overflow: hidden;
}

.constellation svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.constellation-node {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: transform 0.25s ease, filter 0.25s ease;
  z-index: 2;
}

.constellation-node:hover {
  transform: translate(-50%, -50%) scale(1.15);
  z-index: 10;
}

.constellation-node img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid rgba(240, 230, 208, 0.7);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.constellation-node:hover img {
  border-color: var(--node-color, #667eea);
  box-shadow: 0 0 16px var(--node-color, rgba(102, 126, 234, 0.4));
}

/* Monogram fallback for constellation */
.constellation-node .const-mono {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  border: 2.5px solid rgba(240, 230, 208, 0.7);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.constellation-node:hover .const-mono {
  border-color: var(--node-color, #667eea);
  box-shadow: 0 0 16px var(--node-color, rgba(102, 126, 234, 0.4));
}

.constellation-node-name {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: #3d3225;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  background: rgba(255, 250, 240, 0.8);
  padding: 1px 6px;
  border-radius: 4px;
}

.constellation-node:hover .constellation-node-name {
  opacity: 1;
}

.constellation-hint {
  font-size: 12px;
  color: var(--color-text-tertiary, #98a0ad);
  margin: 8px 0 0;
}

/* ── Filter bar ── */
.sages-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.sages-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--color-border-tertiary, #e6e8ee);
  border-radius: 20px;
  background: var(--color-background-primary, #ffffff);
  color: var(--color-text-secondary, #5e6470);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

/* Parchment filter buttons */
.hub-body .sages-filter-btn {
  background: transparent;
  border-color: rgba(160, 140, 110, 0.2);
}
.hub-body .sages-filter-btn:hover {
  background: rgba(255, 250, 240, 0.45);
}
.sages-filter-btn:hover {
  border-color: var(--color-border-secondary, #d8dce4);
  color: var(--color-text-primary, #1a1d23);
}
.sages-filter-btn.active {
  background: var(--color-text-primary, #1a1d23);
  color: #fff;
  border-color: var(--color-text-primary, #1a1d23);
}

/* ── Sage cards grid ── */
.sages-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Individual sage card ── */
.sage-card {
  background: var(--color-background-primary, #ffffff);
  border: 1px solid var(--color-border-tertiary, #e6e8ee);
  border-radius: 14px;
  padding: 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.sage-card:hover {
  border-color: var(--color-border-secondary, #d8dce4);
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

/* Parchment sage cards */
.hub-body .sage-card {
  background: transparent;
  border-color: rgba(160, 140, 110, 0.2);
  box-shadow: none;
}
.hub-body .sage-card:hover {
  background: rgba(255, 250, 240, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(160, 140, 110, 0.35);
  box-shadow: none;
}

/* Card header: portrait + name/school/bio */
.sage-card-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.sage-portrait {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #f0e6d0;
  background: #f7f4ef;
  flex-shrink: 0;
}

/* Monogram fallback at portrait size */
.sage-portrait-mono {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: white;
  font-family: Georgia, 'Times New Roman', serif;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.sage-header-text {
  flex: 1;
  min-width: 0;
}

.sage-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary, #1a1d23);
  margin: 0 0 4px;
  line-height: 1.3;
}

.sage-era {
  font-size: 13px;
  color: var(--color-text-secondary, #5e6470);
  margin: 0 0 8px;
  line-height: 1.4;
}

.sage-school-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 4px;
  color: white;
}

/* ── Card body sections ── */
.sage-section {
  margin-bottom: 16px;
}
.sage-section:last-child {
  margin-bottom: 0;
}

.sage-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--color-text-tertiary, #98a0ad);
  margin: 0 0 6px;
}

.sage-section-text {
  font-size: 14px;
  color: var(--color-text-primary, #1a1d23);
  line-height: 1.6;
  margin: 0;
}

/* Signature quote */
.sage-quote {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-size: 15px;
  color: var(--color-text-secondary, #5e6470);
  line-height: 1.6;
  margin: 0;
  padding-left: 16px;
  border-left: 3px solid var(--color-border-tertiary, #e6e8ee);
}

/* Parchment quote border */
.hub-body .sage-quote {
  border-left-color: rgba(160, 140, 110, 0.3);
}

/* Key works */
.sage-works {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.sage-work-tag {
  font-size: 12px;
  padding: 4px 10px;
  background: var(--color-background-secondary, #f7f8fb);
  border-radius: 6px;
  color: var(--color-text-secondary, #5e6470);
  font-weight: 500;
}

/* Parchment work tags */
.hub-body .sage-work-tag {
  background: rgba(255, 250, 240, 0.4);
}

/* Fun fact */
.sage-fact {
  font-size: 13px;
  color: var(--color-text-secondary, #5e6470);
  line-height: 1.6;
  margin: 0;
  padding: 12px 14px;
  background: #fffcf5;
  border: 1px solid #f0e6d0;
  border-radius: 8px;
}

/* Parchment fun fact */
.hub-body .sage-fact {
  background: rgba(255, 250, 240, 0.35);
  border-color: rgba(160, 140, 110, 0.2);
}

/* ── Expand/collapse ── */
.sage-card-body {
  display: none;
}
.sage-card.expanded .sage-card-body {
  display: block;
}

.sage-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-accent, #667eea);
  padding: 8px 0 0;
  font-family: inherit;
  transition: color 0.15s;
}
.sage-toggle:hover {
  color: var(--color-text-primary, #1a1d23);
}
.sage-toggle svg {
  transition: transform 0.2s;
}
.sage-card.expanded .sage-toggle svg {
  transform: rotate(180deg);
}

/* ── Footer ── */
.sages-footer {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(160, 140, 110, 0.15);
  text-align: center;
  font-size: 13px;
  color: var(--color-text-tertiary, #98a0ad);
  line-height: 1.5;
}

/* ── Mobile responsive ── */
@media (max-width: 600px) {
  .sages-shell {
    padding: 24px 16px 36px;
  }

  .sage-card {
    padding: 18px;
  }

  .sage-portrait,
  .sage-portrait-mono {
    width: 56px;
    height: 56px;
    font-size: 18px;
  }

  .sage-name {
    font-size: 16px;
  }

  .sage-card-header {
    gap: 12px;
  }

  .constellation {
    height: 380px;
  }

  .constellation-node {
    transform: translate(-50%, -50%) scale(0.8);
  }
  .constellation-node:hover {
    transform: translate(-50%, -50%) scale(0.92);
  }

  .constellation-node-name {
    font-size: 9px;
    bottom: -14px;
  }
}
