/* ============================================================
   Map marker + corridor styling (Leaflet layer)
   ============================================================ */

/* ---------------------------------------------------- estate marker */
.est-marker-wrap { background: none !important; border: 0 !important; }
.est-marker {
  position: relative; width: 26px; height: 26px;
  display: grid; place-items: center; cursor: pointer;
}
.est-core {
  position: relative; z-index: 3;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(150deg, #D8BE87 0%, #B89A60 46%, #97793F 100%);
  color: #1B2A22; border: 1.5px solid #FFF8E4;
  box-shadow: 0 0 0 3px rgba(184,154,96,.26), 0 3px 10px rgba(21,61,50,.34),
              inset 0 1px 1px rgba(255,255,255,.5);
  transition: transform .22s cubic-bezier(.2,.7,.3,1.1);
}
.est-core svg { width: 15px; height: 15px; stroke-width: 2; }
.est-marker:hover .est-core { transform: scale(1.08); }
.est-marker.is-selected .est-core {
  box-shadow: 0 0 0 4px rgba(184,154,96,.34), 0 0 0 9px rgba(184,154,96,.13),
              0 4px 14px rgba(21,61,50,.4), inset 0 1px 1px rgba(255,255,255,.55);
}
.est-glow {
  position: absolute; inset: -10px; border-radius: 50%; z-index: 1;
  background: radial-gradient(circle, rgba(184,154,96,.34) 0%, rgba(184,154,96,.13) 46%, transparent 70%);
  animation: estGlow 4.2s ease-in-out infinite;
}
@keyframes estGlow {
  0%, 100% { transform: scale(.9); opacity: .55; }
  50% { transform: scale(1.12); opacity: .95; }
}
.est-ripple {
  position: absolute; z-index: 0;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1.4px solid rgba(184,154,96,.75);
  animation: estRipple 4.6s cubic-bezier(.2,.6,.3,1) infinite;
}
.est-ripple.two { animation-delay: 2.3s; }
@keyframes estRipple {
  0% { transform: scale(.85); opacity: .8; }
  70% { opacity: .12; }
  100% { transform: scale(3.1); opacity: 0; }
}
.est-marker.no-motion .est-ripple,
.est-marker.no-motion .est-glow { animation: none; opacity: .3; }

.est-label {
  position: absolute; left: 34px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  white-space: nowrap; pointer-events: none;
  background: rgba(21,61,50,.94);
  padding: 5px 10px 6px; border-radius: 2px;
  border-top: 1.5px solid var(--brass, #B89A60);
  box-shadow: 0 3px 12px rgba(14,44,36,.28);
  opacity: 0; transition: opacity .2s;
}
.est-marker.is-selected .est-label,
.est-marker:hover .est-label { opacity: 1; }
.est-label strong { font-size: 9px; letter-spacing: .13em; font-weight: 700; color: #FBF8EF; }
.est-label em { font-style: normal; font-size: 8.5px; color: #B9C9BE; }

/* ---------------------------------------------------- place markers */
.pl-marker-wrap { background: none !important; border: 0 !important; z-index: 1; }
.pl-marker {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer; transform: translate(-11px, -11px); width: max-content;
}
.pl-dot {
  width: 21px; height: 21px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: #FFFEFA; color: #2C4C3E;
  border: 1.5px solid #C4CEBE;
  box-shadow: 0 1px 4px rgba(21,61,50,.18);
  transition: transform .16s, border-color .16s, background .16s;
}
.pl-dot svg { width: 12px; height: 12px; stroke-width: 2; }
.pl-marker:hover .pl-dot { border-color: var(--brass, #B89A60); transform: scale(1.1); }
.pl-marker-wrap.is-active .pl-dot {
  background: var(--forest, #153D32); color: #F6F3EA; border-color: var(--brass, #B89A60);
  box-shadow: 0 0 0 4px rgba(184,154,96,.26), 0 2px 8px rgba(21,61,50,.3);
}
.pl-name {
  font-size: 10px; font-weight: 600; letter-spacing: .015em;
  color: #2E4238; white-space: nowrap;
  background: rgba(255,254,250,.9);
  padding: 1.5px 5px 2px; border-radius: 2px;
  box-shadow: 0 1px 2px rgba(21,61,50,.08);
  transition: background .16s, color .16s, opacity .18s, transform .18s;
}
.pl-marker-wrap.is-active .pl-name { background: var(--forest, #153D32); color: #FBF8EF; }
.pl-marker.is-regional .pl-dot { border-color: #BCC9D2; }
.pl-marker[data-kind="airport"] .pl-dot { border-color: #9FBFA8; }
.pl-marker[data-kind="rail"] .pl-dot { border-color: #C0B49C; }
.pl-marker-wrap:hover { z-index: 500 !important; }

/* zoom-aware label density — the seven primary towns keep their labels always */
#map.z-far .pl-marker:not(.is-primary) .pl-name { opacity: 0; transform: scale(.9); }
#map.z-far .pl-marker:not(.is-primary) .pl-dot { width: 15px; height: 15px; }
#map.z-far .pl-marker:not(.is-primary) .pl-dot svg { width: 9px; height: 9px; }
#map.z-far .fk-tip { display: none; }
#map.z-far .ctx-label { opacity: .55; }
#map.z-mid .pl-marker:not(.is-primary) .pl-name { opacity: .92; font-size: 9.5px; }

/* ---------------------------------------------------- infra markers */
.fk-marker-wrap { background: none !important; border: 0 !important; }
.fk-marker { position: relative; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; }
.fk-pin {
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--stbg, #fff); color: var(--st, #28734A);
  border: 1.6px solid var(--st, #28734A);
  box-shadow: 0 0 0 2.5px rgba(255,254,250,.9), 0 2px 7px rgba(21,61,50,.24);
  transition: transform .16s, box-shadow .16s;
}
.fk-pin svg { width: 13px; height: 13px; stroke-width: 2; }
.fk-marker:hover .fk-pin { transform: scale(1.12); }
.fk-marker-wrap.is-active .fk-pin {
  box-shadow: 0 0 0 3px #FFFEFA, 0 0 0 7px rgba(184,154,96,.34), 0 3px 10px rgba(21,61,50,.3);
  transform: scale(1.1);
}
.fk-tip {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(3px);
  white-space: nowrap; background: var(--forest, #153D32); color: #FBF8EF;
  font-size: 9.5px; font-weight: 600; padding: 4px 8px; border-radius: 2px;
  pointer-events: none; opacity: 0; transition: opacity .16s, transform .16s;
  box-shadow: 0 3px 10px rgba(14,44,36,.3);
}
.fk-marker:hover .fk-tip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------- arrival markers */
.arr-marker-wrap { background: none !important; border: 0 !important; }
.arr-marker { position: relative; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; }
.arr-core {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: #FFFEFA; color: #28734A; border: 2px solid #28734A;
  box-shadow: 0 0 0 3px rgba(255,254,250,.95), 0 3px 10px rgba(21,61,50,.24);
  transition: transform .16s, box-shadow .16s;
}
.arr-core svg { width: 15px; height: 15px; stroke-width: 2; }
.arr-marker:hover .arr-core { transform: scale(1.08); }
.arr-marker.on .arr-core {
  background: #28734A; color: #FFFEFA;
  box-shadow: 0 0 0 3px #FFFEFA, 0 0 0 8px rgba(40,115,74,.22), 0 4px 12px rgba(21,61,50,.3);
}
.arr-badge {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  background: var(--forest, #153D32); color: #F3EEDF;
  font-size: 8.5px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 8px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(14,44,36,.3);
}
.arr-name {
  position: absolute; top: 32px; left: 50%; transform: translateX(-50%);
  white-space: nowrap; font-size: 10px; font-weight: 600; color: #2E4238;
  background: rgba(255,254,250,.92); padding: 2px 6px 2.5px; border-radius: 2px;
  box-shadow: 0 1px 3px rgba(21,61,50,.1);
}
.arr-marker.on .arr-name { background: var(--forest, #153D32); color: #FBF8EF; }

/* ---------------------------------------------------- context labels */
.ctx-label-wrap { background: none !important; border: 0 !important; pointer-events: none !important; }
.ctx-label {
  position: absolute; transform: translate(-50%, -50%);
  font-size: 9.5px; font-weight: 500; letter-spacing: .07em;
  color: #8C9A8E; text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,254,250,.9), 0 0 4px rgba(255,254,250,.9);
  pointer-events: none;
}
.ctx-label.is-city { font-size: 11px; font-weight: 600; color: #7E8E82; letter-spacing: .1em; }
.ctx-label.is-major { font-size: 12.5px; font-weight: 600; color: #56685C; letter-spacing: .13em; }
.ctx-label.is-mid { font-size: 10px; color: #93A096; }
.ctx-label.is-sea {
  font-family: var(--serif, Georgia, serif);
  font-size: 12px; font-style: italic; letter-spacing: .28em;
  color: #A8BABE; text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255,255,255,.6);
}

/* ---------------------------------------------------- selection + route animation */
.leaflet-marker-icon.is-active { z-index: 1500 !important; }
.leaflet-marker-icon:has(.est-marker) { z-index: 1600 !important; }
.leaflet-marker-icon:has(.arr-marker) { z-index: 1400 !important; }

.route-flow {
  stroke-dasharray: 14 12;
  animation: routeFlow 1.15s linear infinite;
}
@keyframes routeFlow { to { stroke-dashoffset: -26; } }
.route-static { animation: none; }

.corridor-selected { animation: corridorGlow 2.4s ease-in-out infinite; }
@keyframes corridorGlow {
  0%, 100% { stroke-opacity: 1; }
  50% { stroke-opacity: .78; }
}

.leaflet-pane { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .route-flow, .est-ripple, .est-glow, .corridor-selected { animation: none !important; }
}

/* mobile tuning */
@media (max-width: 767.98px) {
  .pl-dot { width: 18px; height: 18px; }
  .pl-dot svg { width: 10px; height: 10px; }
  .pl-marker.is-primary .pl-name {
    font-size: 9.5px; padding: 1px 4px 1.5px;
    background: rgba(255,254,250,.93);
  }
  #map.z-far .pl-marker .pl-name,
  #map.z-mid .pl-marker:not(.is-primary) .pl-name { opacity: 0; }
  #map.z-near .pl-marker:not(.is-primary) .pl-name { opacity: 1; }
  /* the gold pin is self-evident on a phone; the label returns when zoomed in */
  .est-label { display: none !important; }
  #map.z-near .est-marker.is-selected .est-label { display: flex !important; }
  .arr-name { font-size: 9px; }
  .arr-badge { font-size: 8px; }
  .ctx-label { font-size: 9px; }
  .ctx-label.is-major { font-size: 11px; }
}
