/* ── Metric tile + metric dialog ─────────────────────
   The two-step metrics pattern: simple preview card (tile)
   opening a dark Level 3 dialog. Extracted from metrics.html
   so topic pages reuse it. Requires tokens.css, site.css,
   exhibit-tags.css and level3.css, plus the l3-icon sprite
   inlined in the page body. */

/* ─ Metric tile — the simple preview card ─
   A button, because it opens the metric dialog. Figure + topic
   chips + title + one-liner and nothing else; everything deeper
   lives in the dialog. */
.metric-tile {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.metric-tile:hover,
.metric-tile:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}
.metric-tile:focus-visible {
  outline: 3px solid var(--color-teal);
  outline-offset: 2px;
}
.metric-tile__media {
  position: relative;
  height: 260px;
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
}
.metric-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  box-sizing: border-box;
  display: block;
}
/* Expand affordance — mirrors the exhibit poster's corner marker
   position; fills teal on hover. */
.metric-tile__expand {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--color-border);
  color: var(--color-teal-ada);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.metric-tile__expand svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}
.metric-tile:hover .metric-tile__expand {
  background: var(--color-teal);
  border-color: var(--color-teal);
  color: var(--color-white);
}
.metric-tile__caption {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding: var(--space-16);
}
.metric-tile__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-950);
}
.metric-tile__subtitle {
  font-size: 15px;
  line-height: 1.45;
  color: var(--gray-500);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-32);
  margin-top: var(--space-32);
  padding-bottom: var(--space-64);
}
@media (max-width: 860px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }
}

/* ─ Metric dialog — the exhibit-DNA layer ─
   Dark end-card surface from level3.css tokens. Figure enlarged on
   a white panel; identity + fine print beside it; the Data/Tools/
   Science hub below, verbatim exhibit classes. */
.metric-dialog {
  width: min(1100px, 94vw);
  border: 1px solid var(--l3-border);
  border-radius: 14px;
  padding: 0;
  background: var(--l3-bg);
  color: var(--l3-text);
}
.metric-dialog::backdrop {
  background: rgba(6, 20, 28, 0.72);
  backdrop-filter: blur(3px);
}
.metric-dialog__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 30px 30px;
}
.metric-dialog__close {
  all: unset;
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--l3-bg-raised);
  color: var(--l3-text-subtle);
  cursor: pointer;
}
.metric-dialog__close:hover {
  background: var(--l3-bg-hover);
  color: #fff;
}
.metric-dialog__close:focus-visible {
  background: var(--l3-bg-hover);
  color: #fff;
  outline: 2px solid var(--l3-accent);
  outline-offset: 2px;
}
.metric-dialog__close svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}
.metric-dialog__lead {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 800px) {
  .metric-dialog__lead {
    grid-template-columns: 1fr;
  }
}
.metric-dialog__figure {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 18px;
}
.metric-dialog__figure img {
  width: 100%;
  max-height: 56vh;
  object-fit: contain;
  display: block;
}
.metric-dialog__info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 40px; /* clear the close chip */
}
.metric-dialog__title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  margin: 0;
}
.metric-dialog__desc {
  font-size: 16px;
  line-height: 1.55;
  color: var(--l3-text-subtle);
  margin: 0;
}
/* Fine print — source + vintage + figure downloads stay readily
   visible, per the decision to keep the data source on the card. */
.metric-dialog__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--l3-border);
  font-size: 13px;
  color: var(--l3-text-subtle);
}
.metric-dialog__meta a {
  color: var(--l3-accent);
  text-underline-offset: 2px;
}
.metric-dialog .l3-hub {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: stretch;
}
.metric-dialog .l3-hub-panel {
  max-width: none;
  min-width: 0;
}
/* A category with nothing linked keeps its column: dashed outline,
   no tinted wash, one muted line. */
.metric-dialog .l3-hub-panel--empty {
  background: none;
  border-style: dashed;
  border-color: var(--l3-border);
}
.metric-dialog .l3-hub-empty {
  font-size: 14px;
  color: var(--l3-text-subtle);
  margin: 12px 0 0;
}
/* Topic chips on the dark dialog surface — the frosted on-cover
   treatment from exhibit-tags.css. */
.metric-dialog__info .exhibit-topic {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--gray-12);
}
body.is-dialog-open {
  overflow: hidden;
}
