/* =============================================
   dynamics.css — system dynamics page
   ============================================= */

/* --- page title --- */
.dynamics-title-section {
  text-align: center;
}

.dynamics-title-section h1 {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}

.dynamics-subtitle {
  font-size: 0.9rem;
  opacity: 0.65;
  margin: 0 0 0.75rem;
}

.dynamics-intro {
  font-size: 0.9rem;
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.85;
}


/* --- legend --- */
.dynamics-legend-section h2 {
  margin-top: 0;
}

.dynamics-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}


/* --- selector section --- */
.dynamics-selector-section h2 {
  margin-top: 0;
  margin-bottom: 0.3rem;
}

.dynamics-selector-hint {
  font-size: 0.82rem;
  opacity: 0.6;
  margin: 0 0 1.25rem;
}

.dynamics-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* individual alter button */
.dyn-alter-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  background: white;
  border: 2px solid var(--border-color, #e8e8e8);
  border-radius: 12px;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  font-family: inherit;
  font-size: 0.78rem;
  color: inherit;
  width: 80px;
}

.dyn-alter-btn img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffd6ea;
}

.dyn-alter-btn:hover {
  border-color: #ffd6ea;
  box-shadow: 0 3px 10px rgba(255,120,190,0.15);
  transform: translateY(-2px);
}

/* first selected alter */
.dyn-alter-btn.selected-a {
  border-color: #f9a8d4;
  background: #fff0f7;
  box-shadow: 0 0 0 3px #f9a8d4;
}

/* second selected alter */
.dyn-alter-btn.selected-b {
  border-color: #a8d8ea;
  background: #f0f9ff;
  box-shadow: 0 0 0 3px #a8d8ea;
}

/* dimmed when two are already selected and this isn't one of them */
.dyn-alter-btn.dimmed {
  opacity: 0.4;
  pointer-events: none;
}


/* --- result section --- */
.dynamics-result-section {
  margin-top: 0;
  animation: fadeSlideIn 0.25s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* header row showing both alters + connector */
.dynamics-result-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.dyn-result-alter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.dyn-result-alter img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #ffd6ea;
}

.dyn-result-alter span {
  font-size: 0.85rem;
  font-weight: bold;
}

.dyn-result-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
}

.dyn-result-type {
  font-size: 0.75rem;
  background: #ffd6ea;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.dyn-result-hearts {
  font-size: 1rem;
  opacity: 0.6;
}

/* co-front note */
.dyn-cofront {
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.6;
  margin-bottom: 1rem;
  font-style: italic;
}

/* fun fact */
.dyn-funfact {
  text-align: center;
  font-size: 0.82rem;
  background: #fff6fb;
  border: 1px solid #ffd6ea;
  border-radius: 10px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.25rem;
}

.dyn-funfact::before {
  content: "✦ ";
  opacity: 0.5;
}

/* blurb cards — stacked */
.dynamics-blurbs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dyn-blurb-card {
  background: var(--card-bg, rgba(255,255,255,0.5));
  border: 1px solid var(--border-color, #ddd);
  border-radius: 12px;
  padding: 1rem 1.25rem;
}

.dyn-blurb-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.dyn-blurb-header img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffd6ea;
}

.dyn-blurb-header span {
  font-size: 0.85rem;
  font-weight: bold;
}

.dyn-blurb-header .dyn-blurb-about {
  font-weight: normal;
  opacity: 0.55;
  font-size: 0.78rem;
}

.dyn-blurb-text {
  font-size: 0.9rem;
  line-height: 1.7;
  margin: 0;
}

/* no entry yet placeholder */
.dyn-blurb-empty {
  font-size: 0.85rem;
  opacity: 0.45;
  font-style: italic;
  margin: 0;
}

/* left border per alter — reuses existing colour palette */
.dyn-blurb-card[data-author="mer"]       { border-left: 4px solid #a8d8ea; }
.dyn-blurb-card[data-author="tinabella"] { border-left: 4px solid #f9c6d0; }
.dyn-blurb-card[data-author="madi"]      { border-left: 4px solid #c3b1e1; }
.dyn-blurb-card[data-author="ravenpaw"]  { border-left: 4px solid #b5c9a1; }
.dyn-blurb-card[data-author="artemi"]    { border-left: 4px solid #f4c896; }
.dyn-blurb-card[data-author="ovie"]      { border-left: 4px solid #a9bcd0; }
.dyn-blurb-card[data-author="vladi"]     { border-left: 4px solid #c9b99a; }
.dyn-blurb-card[data-author="mickey"]    { border-left: 4px solid #f7b2b2; }
.dyn-blurb-card[data-author="harper"]    { border-left: 4px solid #d4b8c7; }
.dyn-blurb-card[data-author="rory"]     { border-left: 4px solid #b8d4c8; }
.dyn-blurb-card[data-author="skylar"]     { border-left: 4px solid #fde89a; }
.dyn-blurb-card[data-author="morgan"]    { border-left: 4px solid #b0b0b0; }


/* --- polycule graph --- */
.dynamics-graph-section h2 {
  margin-top: 0;
}

.dynamics-graph-note {
  font-size: 0.85rem;
  opacity: 0.6;
  margin: 0 0 1rem;
}

.dynamics-graph-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-color, #eee);
}

.dynamics-graph-wrapper iframe {
  display: block;
  max-width: 100%;
  border-radius: 12px;
}


/* --- no entry state --- */
.dynamics-no-entry {
  text-align: center;
  padding: 1.5rem;
  opacity: 0.45;
  font-style: italic;
  font-size: 0.9rem;
}


/* --- spacing between sections handled by page-container gap --- */


/* --- responsive --- */
@media (max-width: 600px) {
  .dynamics-grid {
    gap: 0.5rem;
  }

  .dyn-alter-btn {
    width: 68px;
    font-size: 0.72rem;
    padding: 0.5rem 0.5rem;
  }

  .dyn-alter-btn img {
    width: 40px;
    height: 40px;
  }

  .dynamics-graph-wrapper iframe {
    height: 360px;
  }
}