/* ── MarkerPopup Component ─────────────────────────
   Styles for WRMP.makeMarkerPopup() DOM elements.
   Load alongside tokens.css — all values use CSS
   custom properties from that file.
   Usage in exhibits:
     <link rel="stylesheet" href="../../shared/css/marker-popup.css"> */

.mp-card {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 320px;
  padding: var(--space-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  box-sizing: border-box;
}

/* ── Image ───────────────────────────────────────── */
.mp-image {
  width: 100%;
  height: 150px;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gray-4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mp-image-label {
  font-family: var(--font-body);
  font-size: var(--step--1);
  color: var(--color-text-subtle);
}

/* ── Body ────────────────────────────────────────── */
.mp-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm);
}

/* ── Header ──────────────────────────────────────── */
.mp-title-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.mp-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.mp-title {
  font-family: var(--font-heading);
  font-size: var(--step-0);
  font-weight: 600;
  line-height: 1.5;
  color: var(--color-text);
  margin: 0;
  white-space: pre-wrap;
}

.mp-title-code {
  font-weight: 700;
}

.mp-category {
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text-subtle);
  margin: 0;
}

/* Leaflet's .leaflet-popup-content p { margin: 18px 0 } has specificity (0,1,1)
   which beats .mp-title / .mp-category at (0,1,0). Scope inside .mp-card to win. */
.mp-card .mp-title,
.mp-card .mp-category {
  margin: 0;
}

/* ── Structure ───────────────────────────────────── */
.mp-divider {
  border: none;
  border-top: 1px solid var(--gray-6);
  margin: 0;
  width: 100%;
}

.mp-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
}

.mp-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  width: 100%;
}

/* ── Attribute label (group/section heading) ─────── */
.mp-group-label {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: var(--color-text);
  white-space: nowrap;
}

/* ── Attribute row ───────────────────────────────── */
.mp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-sm);
  width: 100%;
  font-family: var(--font-body);
}

.mp-row-label {
  flex: 1 1 auto;
  min-width: 0;
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.5;
  color: var(--color-text);
}

.mp-row-value {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: var(--step--1);
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-text-subtle);
  text-align: right;
}

/* ── Tags ────────────────────────────────────────── */
.mp-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  width: 100%;
}

.mp-tag-row--hierarchy {
  align-items: center;
}

.mp-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--gray-6);
  border-radius: var(--radius-sm);
  padding: var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 500;
  line-height: 1.1;
  color: var(--color-text);
  white-space: nowrap;
}

/* ── Chevron ─────────────────────────────────────── */
.mp-chevron {
  color: var(--color-text-subtle);
  flex-shrink: 0;
  user-select: none;
  font-size: var(--step-0);
  line-height: 1;
}
