/* places-map.css
 *
 * components/cities/places-map.php: every city page on a map of the border,
 * beside the list of places by province. Used on the home page and on
 * /tankstations, so it carries its own tokens instead of either page's.
 */

.pm {
    --pm-card: #ffffff;
    --pm-ink: #14110d;
    --pm-muted: #6b645b;
    --pm-line: rgba(20, 17, 13, 0.09);
    --pm-land: #f1ebe2;
    --pm-accent: var(--color-primary, #f38651);
    --pm-accent-rgb: var(--rgb-primary, 243, 134, 81);
    /* How near the border, as a dot: on the map, in the legend and before each place. */
    --pm-tier-border: #e0662e;
    --pm-tier-nearby: #f2b089;
    --pm-tier-inland: #b9b1a6;

    display: grid;
    gap: 28px;
    align-items: start;
}

@media (min-width: 860px) {
    .pm { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; }
    .pm--nomap { grid-template-columns: minmax(0, 1fr); }
}

.pm-sr {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- The map ------------------------------------------------------------------ */
.pm-map {
    margin: 0;
    padding: 18px 18px 14px;
    border: 1px solid var(--pm-line);
    border-radius: 20px;
    background: var(--pm-card);
}

@media (min-width: 860px) {
    .pm-map { position: sticky; top: 96px; }
}

.pm-svg { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto; overflow: visible; }
@media (max-width: 859px) {
    .pm-svg { max-width: 260px; }
}

.pm-land { fill: var(--pm-land); stroke: rgba(20, 17, 13, 0.28); stroke-width: 0.7; stroke-linejoin: round; }

.pm-country {
    font-family: var(--font-family-body, system-ui, sans-serif);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-anchor: middle;
    fill: var(--pm-muted);
    opacity: 0.7;
}

.pm-dot {
    fill: var(--pm-tier-border);
    stroke: var(--pm-card);
    stroke-width: 1.2;
    transition: r 0.2s ease;
}
.pm-city--nearby .pm-dot { fill: var(--pm-tier-nearby); }
.pm-city--inland .pm-dot { fill: var(--pm-tier-inland); }

.pm-name {
    font-family: var(--font-family-body, system-ui, sans-serif);
    font-size: 11px;
    font-weight: 800;
    fill: var(--pm-ink);
    paint-order: stroke;
    stroke: var(--pm-card);
    stroke-width: 3.5px;
    stroke-linejoin: round;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.pm-city.is-lit .pm-dot { r: 5.5px; stroke-width: 2; }
.pm-city.is-lit .pm-name { opacity: 1; }

.pm-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--pm-muted);
}

/* The tier dot, shared by the legend, the place pills and other lists. */
.pm-tier { display: inline-flex; align-items: center; gap: 7px; }
.pm-tier::before {
    content: '';
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pm-tier-border, #e0662e);
}
.pm-tier--nearby::before { background: var(--pm-tier-nearby, #f2b089); }
.pm-tier--inland::before { background: var(--pm-tier-inland, #b9b1a6); }

/* --- The list ----------------------------------------------------------------- */
.pm-provinces { display: grid; gap: 22px; }

.pm .pm-province-name {
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--pm-line);
    font-family: var(--font-family-body, system-ui, sans-serif);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pm-muted);
}

.pm-places {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pm .pm-place {
    padding: 8px 14px 8px 12px;
    border: 1px solid var(--pm-line);
    border-radius: 999px;
    background: var(--pm-card);
    color: var(--pm-ink);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.3;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.pm .pm-place:hover {
    border-color: rgba(var(--pm-accent-rgb), 0.6);
    background: #fff7f1;
    color: var(--pm-ink);
    text-decoration: none;
}
.pm .pm-place:focus-visible { outline: 3px solid rgba(var(--pm-accent-rgb), 0.5); outline-offset: 2px; }

@media (max-width: 600px) {
    .pm-provinces { gap: 18px; }
    .pm-places { gap: 6px; }
    .pm .pm-place { padding: 6px 12px 6px 10px; font-size: 0.9rem; }
}

@media (prefers-reduced-motion: reduce) {
    .pm-dot, .pm-name, .pm .pm-place { transition: none; }
}
