/* Spectrum: editorial two-column ranking layout */

.spectrum-section { background: transparent; }

#spectrum-viz.spectrum-viz { min-height: 0; }

.spectrum-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1100px;
  margin: 0 auto;
}

.spectrum-column h3 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 16px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.spectrum-column.loud h3 { color: var(--scale-5); }

.spectrum-column .col-eyebrow {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}

.spectrum-list {
  display: block;
  list-style: none;
  margin: 0;
  padding: 0;
}

.spectrum-row {
  position: relative;
  border-top: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 12px;
  background: transparent;
  font-family: var(--font-body);
  color: var(--ink);
  transition: background-color var(--dur-base) var(--ease-stately),
              border-color var(--dur-base) var(--ease-stately),
              transform var(--dur-base) var(--ease-stately),
              opacity var(--dur-base) var(--ease-stately);
  will-change: transform, background-color;
}

.spectrum-row:first-child { border-top: none; }

.spectrum-row:hover {
  background: rgba(46, 123, 232, 0.05);
  transform: translateX(2px);
}

/* The clickable selection target. Spans the visible row content. The CTA
   sits OUTSIDE this button (in the .spectrum-row wrapper) so its own anchor
   click does not bubble through the row selection handler. */
.spectrum-row .row-select {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 16px;
  row-gap: 4px;
  align-items: center;
  width: 100%;
  padding: 14px 14px 14px 14px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.spectrum-row .rank {
  width: 56px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--ink);
  line-height: 1;
  text-align: left;
}

.spectrum-column.loud .rank { color: var(--scale-5); }

/* Right cell: stacked name on top, country + metric strip below. */
.spectrum-row .row-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

/* Top line: city name. Reserves space for the CTA on the right via padding. */
.spectrum-row .row-top {
  display: flex;
  align-items: baseline;
  min-width: 0;
  padding-right: 156px;
}

/* Bottom line: country on the left, metric strip on the right. */
.spectrum-row .row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.spectrum-row .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.32rem;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.015em;
  display: inline-block;
  max-width: 100%;
}

.spectrum-row .country {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.86rem;
  color: var(--ink-soft);
  flex: 0 1 auto;
  min-width: 0;
}

/* Metric strip: six labeled vertical bars, one per metric.
   Taller bar = better for quiet. Replaces the legacy fingerprint squares. */
.metric-strip-legend {
  font-family: var(--font-body);
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 16px;
  max-width: 64ch;
  line-height: 1.5;
}
.metric-strip-legend strong {
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
}

.metric-strip {
  display: inline-grid;
  grid-template-columns: repeat(6, 20px);
  gap: 6px;
  align-items: end;
}
.metric-strip .ms-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: end;
  cursor: help;
  gap: 4px;
}
.metric-strip .ms-bar-wrap {
  display: flex;
  align-items: end;
  justify-content: center;
  width: 100%;
  height: 26px;
}
.metric-strip .ms-bar {
  width: 8px;
  min-height: 3px;
  height: var(--bar-h, 50%);
  max-height: 26px;
  background: var(--scale-3);
  border-radius: 1px;
  transition: background var(--dur-fast) var(--ease-responsive),
              height var(--dur-base) var(--ease-stately);
}
.metric-strip .ms-cell[data-tier="quiet"] .ms-bar { background: var(--scale-1); }
.metric-strip .ms-cell[data-tier="loud"]  .ms-bar { background: var(--scale-5); }
.metric-strip .ms-cell[data-tier="mid"]   .ms-bar { background: var(--scale-3); }
.metric-strip .ms-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  opacity: 1;
}
.metric-strip .ms-icon svg { width: 15px; height: 15px; display: block; }
.metric-strip .ms-cell[data-tier="loud"]  .ms-icon { color: var(--scale-5); }
.metric-strip .ms-cell[data-tier="quiet"] .ms-icon { color: var(--brand-navy); }
.metric-strip .ms-label {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.spectrum-row.is-selected {
  border-left-color: var(--brand-sky);
  background: rgba(46, 123, 232, 0.07);
  transform: translateX(2px);
}

.spectrum-section.has-selection .spectrum-row:not(.is-selected) {
  opacity: 0.55;
}
.spectrum-section.has-selection .spectrum-row:not(.is-selected):hover {
  opacity: 0.85;
}

/* Store your bags CTA. Anchored to the top-right of the row so the button-area
   grid below stays free for full city name + country + metric strip. The
   row-top reserves 156px padding-right to keep the name out of the CTA zone. */
.spectrum-row .cta-stash {
  position: absolute;
  top: 12px;
  right: 14px;
  color: var(--brand-sky);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
  padding: 4px 2px;
  z-index: 1;
  transition: color var(--dur-fast) var(--ease-responsive);
}

.spectrum-row .cta-stash:hover,
.spectrum-row .cta-stash:focus-visible {
  text-decoration: underline;
  color: var(--brand-navy);
}

.spectrum-row .row-select:focus-visible {
  outline: 2px solid var(--brand-sky);
  outline-offset: 2px;
  border-radius: 8px;
}

@media (max-width: 720px) {
  .spectrum-grid { grid-template-columns: 1fr; gap: 32px; }
  .spectrum-row .row-select {
    padding: 12px 14px 6px;
    column-gap: 12px;
  }
  .spectrum-row .rank { width: 44px; font-size: 1.7rem; }
  .spectrum-row .name { font-size: 1.05rem; }
  /* Drop the desktop CTA reservation; CTA now flows below the button. */
  .spectrum-row .row-top { padding-right: 0; }
  .spectrum-row .metric-strip { display: none; }
  /* Mobile: CTA sits below the row content as its own line at the left. */
  .spectrum-row .cta-stash {
    position: static;
    display: inline-block;
    margin: 0 14px 12px calc(44px + 12px + 14px);
    padding: 4px 0;
    font-size: 0.84rem;
  }
}
