/*!
 * hover-popup.css — Discovery Zone / Sankhya Calc hover-definition cards
 * ----------------------------------------------------------------------
 * Wikipedia-style definition card styling for js/hover-popup.js.
 * INW brand palette:
 *   Ocean Blue   #0D3B6E   (card border, headings)
 *   Forest Green #2D6A4F   (symbol id accent)
 *   Sand Gold    #C8963E   (links / "More" affordance)
 * All text is dark on a white background for WCAG AA contrast.
 */

/* ---- Sankhya Calc intro block ---------------------------------------- */
.discovery-zone .sankhya-intro {
  margin: 8px 0 24px;
  padding: 20px 22px;
  background: #f6f8fb;
  border: 1px solid #d9e1ec;
  border-left: 4px solid #0D3B6E;          /* Ocean Blue accent */
  border-radius: 8px;
}
.discovery-zone .sankhya-intro-title {
  margin: 0 0 10px;
  color: #0D3B6E;
  font-family: "Playfair Display", Georgia, serif;
}
.discovery-zone .sankhya-intro-lede {
  margin: 0;
  color: #1a1a1a;
  line-height: 1.7;
}
.discovery-zone .sankhya-intro-hint {
  margin: 12px 0 0;
  font-size: 13px;
  color: #2D6A4F;                          /* Forest Green */
  font-style: italic;
}

/* ---- inline symbol trigger ------------------------------------------- */
.sankhya-sym {
  cursor: help;
  border-bottom: 1px dotted #2D6A4F;      /* Forest Green underline cue */
  color: #0D3B6E;                          /* Ocean Blue — AA on white */
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
  border-radius: 2px;
}
.sankhya-sym:hover,
.sankhya-sym:focus {
  background-color: rgba(45, 106, 79, 0.10);
  outline: none;
}
.sankhya-sym:focus-visible {
  outline: 2px solid #C8963E;             /* Sand Gold focus ring */
  outline-offset: 2px;
}

/* ---- live-region host ------------------------------------------------- */
.sym-popup-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  /* Container itself is invisible; cards are absolutely positioned. */
}

/* ---- the definition card --------------------------------------------- */
.sym-popup {
  position: absolute;
  z-index: 9999;
  max-width: 320px;
  width: max-content;
  box-sizing: border-box;
  padding: 14px 16px;
  background: #ffffff;
  border: 2px solid #0D3B6E;              /* Ocean Blue */
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  color: #1a1a1a;                          /* near-black body text (AA) */
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;

  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}
.sym-popup.is-visible {
  opacity: 1;
  transform: translateY(0);
}
/* When the card flips below the trigger, animate downward from above. */
.sym-popup.sym-popup--below {
  transform: translateY(-4px);
}
.sym-popup.sym-popup--below.is-visible {
  transform: translateY(0);
}

/* ---- card content ----------------------------------------------------- */
.sym-popup-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.sym-popup-id {
  font-size: 20px;
  font-weight: 700;
  color: #2D6A4F;                          /* Forest Green accent */
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.1;
}
.sym-popup-name {
  font-weight: 700;
  color: #0D3B6E;                          /* Ocean Blue */
  font-size: 15px;
}
.sym-popup-physics {
  margin: 0 0 6px;
  color: #444;
  font-size: 13px;
}
.sym-popup-def {
  margin: 0 0 8px;
  color: #1a1a1a;
}
.sym-popup-value,
.sym-popup-source {
  margin: 2px 0;
  font-size: 13px;
  color: #333;
}
.sym-popup-label {
  display: inline-block;
  min-width: 52px;
  font-weight: 700;
  color: #0D3B6E;
}
.sym-popup-value {
  font-variant-numeric: tabular-nums;
}
.sym-popup-more {
  display: inline-block;
  margin-top: 10px;
  font-weight: 700;
  color: #A97B2C;                          /* Gold-dk — AA on white */
  text-decoration: none;
}
.sym-popup-more:hover,
.sym-popup-more:focus {
  text-decoration: underline;
  color: #8a6321;
}

/* ---- mobile bottom sheet (<=480px) ----------------------------------- */
@media (max-width: 480px) {
  .sym-popup,
  .sym-popup.sym-popup--sheet {
    position: fixed;
    left: 5vw !important;
    right: 5vw;
    top: auto !important;
    bottom: 16px;
    width: 90vw;
    max-width: none;
    transform: translateY(12px);
  }
  .sym-popup.is-visible {
    transform: translateY(0);
  }
}

/* ---- reduced motion --------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .sym-popup,
  .sankhya-sym {
    transition: none !important;
  }
  .sym-popup,
  .sym-popup.sym-popup--below,
  .sym-popup.sym-popup--sheet {
    transform: none !important;
  }
}
