/* ==========================================================================
   Dubai Interactive Map - English Road & Street Names (since 1.3.2)
   Dark rounded labels drawn over the satellite imagery by public/js/map-labels.js.
   Quieter than the property badges (which stay the primary content), and
   using the map's own surface, text and gold colours (--dm-* settings).
   ========================================================================== */

.leaflet-dubaiMapLabels-pane {
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.leaflet-dubaiMapLabels-pane.dm-road-labels--zooming {
  opacity: 0;
  transition: none;
}

.dm-road-label {
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(20, 23, 31, 0.8);
  background: color-mix(in srgb, var(--dm-card, #141720) 82%, transparent);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.45), 0 4px 12px rgba(0, 0, 0, 0.28);
  color: var(--dm-text, #f5f6fa);
  font-family: var(--font-main, 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transform-origin: 50% 50%;
  will-change: transform;
  animation: dmRoadLabelIn 0.2s ease-out both;
}

/* Highways and main roads: a touch larger, with a fine gold edge. */
.dm-road-label--major {
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.015em;
  border-color: rgba(226, 202, 141, 0.55);
  border-color: color-mix(in srgb, var(--primary-gold, #e2ca8d) 55%, transparent);
  background: rgba(20, 23, 31, 0.86);
  background: color-mix(in srgb, var(--dm-card, #141720) 88%, transparent);
}

.dm-road-label--major:has(.dm-road-label__ref) {
  padding-left: 4px;
}

/* Local streets: smallest and lightest, so they never compete with the badges. */
.dm-road-label--minor {
  padding: 2px 8px;
  font-size: 10.5px;
  color: rgba(245, 246, 250, 0.92);
  background: rgba(20, 23, 31, 0.72);
  background: color-mix(in srgb, var(--dm-card, #141720) 74%, transparent);
  border-color: rgba(255, 255, 255, 0.1);
}

/* Route number (E11, E311, D71 ...) */
.dm-road-label__ref {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary-gold, #e2ca8d);
  color: var(--dm-card, #141720);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.dm-road-label--ref-only {
  padding: 2px;
}

.dm-road-labels-measure {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}

.dm-road-labels-measure .dm-road-label {
  animation: none;
}

@keyframes dmRoadLabelIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Data credit required by OpenFreeMap / OpenStreetMap; shown only with the names. */
.dm-road-labels-credit {
  display: none !important;
  position: absolute;
  left: 10px;
  bottom: 8px;
  z-index: 800;
  max-width: calc(100% - 20px);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(20, 23, 31, 0.62);
  color: rgba(245, 246, 250, 0.78);
  font-family: var(--font-main, 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 10px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: auto;
}

.dm-road-labels-credit a {
  color: inherit;
  text-decoration: none;
}

.dm-road-labels-credit a:hover,
.dm-road-labels-credit a:focus-visible {
  color: var(--primary-gold, #e2ca8d);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .dm-road-label {
    font-size: 10.5px;
  }

  .dm-road-label--major {
    font-size: 11px;
  }

  .dm-road-label--minor {
    font-size: 10px;
  }

  /* Sit above the bottom filter dock on phones and tablets. */
  .dm-road-labels-credit {
    left: 8px;
    bottom: 58px;
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dm-road-label {
    animation: none;
  }

  .leaflet-dubaiMapLabels-pane {
    transition: none;
  }
}
