/* map.css — /map page styles */

:root {
    --bg: #f6f2e8;
    --text: #1c1c1c;
    --muted: #5a5050;
    --os-red: #c0332b;
    --os-blue: #1a5c8a;
    --os-yellow: #f0c060;
    --rule: rgba(28,28,28,.15);
    --max-width: 1080px;
    --nav-height: 56px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; -webkit-font-smoothing: antialiased; }
body.map-page { background: var(--bg); font-family: 'Barlow Condensed', sans-serif; }

/* Nav — matches index.html */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 1000; background: var(--text); border-bottom: 3px solid var(--os-red); }
.nav-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 32px; height: var(--nav-height); display: flex; align-items: center; justify-content: space-between; }
.nav-brand { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 18px; letter-spacing: 2px; text-transform: uppercase; color: #fff; text-decoration: none; }
.nav-brand em { font-style: normal; color: var(--os-yellow); }
.nav-links { display: flex; gap: 32px; align-items: center; }
.nav-links a { font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(255,255,255,.6); text-decoration: none; }
.nav-links a:hover { color: #fff; }
.nav-link-active { color: var(--os-yellow) !important; }
.nav-cta { color: var(--os-yellow) !important; border: 1px solid rgba(240,192,96,.35); padding: 5px 16px; }
.nav-cta:hover { background: rgba(240,192,96,.1); }

/* Map viewport */
#wc-map {
    position: fixed;
    top: var(--nav-height);
    left: 0; right: 0; bottom: 0;
    background: var(--bg);
    background-image:
        linear-gradient(rgba(26,92,138,.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(26,92,138,.07) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: 0;
}

/* ── Corner panel ── */
#wc-panel {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    left: 12px;
    z-index: 500;
    background: var(--bg);
    border: 1px solid var(--rule);
    box-shadow: 0 2px 16px rgba(0,0,0,.12);
    width: 180px;
}
#wc-panel-toggle { display: none; }
#wc-panel-inner { padding: 12px; }

.wc-panel-logo {
    font-weight: 800; font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
    color: var(--text); border-bottom: 1px solid var(--rule); padding-bottom: 8px;
    margin-bottom: 10px; line-height: 1.3;
}
.wc-panel-logo em { font-style: normal; color: var(--os-red); }

.wc-panel-toggle-row { display: flex; margin-bottom: 10px; }
.wc-panel-tab {
    flex: 1; padding: 5px 4px; font-family: 'Barlow Condensed', sans-serif;
    font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
    cursor: pointer; border: 1px solid var(--rule); background: transparent;
    color: var(--muted); transition: background .15s, color .15s;
}
.wc-panel-tab:first-child { border-right: none; }
.wc-panel-tab.active { background: var(--text); color: #fff; border-color: var(--text); }

.wc-panel-divider { height: 1px; background: var(--rule); margin-bottom: 8px; }
.wc-panel-regions-label {
    font-size: 9px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
    color: var(--muted); margin-bottom: 6px;
}

.wc-region-row {
    display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 4px;
    background: transparent; border: none; cursor: pointer;
    font-family: 'Barlow Condensed', sans-serif; text-align: left;
    transition: background .1s;
}
.wc-region-row:hover { background: rgba(28,28,28,.04); }
.wc-region-row.active { background: rgba(28,28,28,.07); }
.wc-region-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.wc-region-name {
    font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
    color: var(--text); flex: 1; line-height: 1.2;
}
.wc-region-count {
    font-family: 'Space Mono', monospace; font-size: 9px; color: var(--muted); flex-shrink: 0;
}

/* ── App Store CTA ── */
#wc-map-cta {
    position: fixed; bottom: 20px; right: 20px; z-index: 500;
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px;
    background: var(--os-red); color: #fff; font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700; font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase;
    text-decoration: none; box-shadow: 0 2px 12px rgba(192,51,43,.35);
    transition: background .2s;
}
#wc-map-cta:hover { background: #a02020; }

/* ── Popup ── */
.wc-popup .leaflet-popup-content-wrapper {
    background: var(--bg); border: 1px solid rgba(28,28,28,.18);
    box-shadow: 0 4px 20px rgba(0,0,0,.18); border-radius: 0; padding: 0;
}
.wc-popup .leaflet-popup-tip-container { margin-top: -1px; }
.wc-popup .leaflet-popup-tip { background: var(--bg); box-shadow: none; }
.wc-popup .leaflet-popup-content { margin: 0; width: auto !important; }
.wc-popup .leaflet-popup-close-button { font-size: 16px; color: var(--muted); padding: 6px 8px; }

.wcp-accent { height: 4px; }
.wcp-body { padding: 12px 14px 14px; font-family: 'Barlow Condensed', sans-serif; }
.wcp-name { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--text); line-height: 1; margin-bottom: 6px; }
.wcp-region { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.wcp-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.wcp-region-name { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.wcp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-bottom: 10px; }
.wcp-stat { background: rgba(28,28,28,.04); border: 1px solid rgba(28,28,28,.1); padding: 6px 8px; }
.wcp-val { font-size: 16px; font-weight: 700; color: var(--text); line-height: 1; }
.wcp-lbl { font-size: 8px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.wcp-rank { font-size: 10px; font-weight: 600; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; border-top: 1px solid var(--rule); padding-top: 8px; }
.wcp-grid { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--os-blue); background: rgba(26,92,138,.07); border: 1px solid rgba(26,92,138,.15); padding: 4px 9px; display: inline-block; letter-spacing: .5px; }

/* Attribution — sits at bottom of corner panel */
.leaflet-control-attribution { display: none; }
.wc-map-attr { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--rule); font-size: 8px; color: var(--muted); line-height: 1.4; }
.wc-map-attr a { color: var(--os-blue); text-decoration: none; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .nav-links a:not(.nav-cta) { display: none; }

    #wc-panel {
        width: 100%; left: 0; top: auto; bottom: 0;
        max-height: 56px; overflow: hidden; transition: max-height .3s ease;
        border-top: 2px solid var(--os-red); border-left: none; border-right: none; border-bottom: none;
    }
    #wc-panel.expanded { max-height: 70vh; overflow-y: auto; }

    #wc-panel-toggle {
        display: flex; align-items: center; justify-content: space-between;
        width: 100%; padding: 0 16px; height: 56px; background: var(--bg);
        border: none; font-family: 'Barlow Condensed', sans-serif; font-size: 13px;
        font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
        color: var(--text); cursor: pointer;
    }
    #wc-panel-toggle::after { content: '▾'; font-size: 16px; color: var(--muted); }
    #wc-panel.expanded #wc-panel-toggle::after { content: '▴'; }
    #wc-panel-inner { padding: 12px 16px 24px; }

    #wc-map-cta { bottom: 68px; right: 12px; font-size: 12px; padding: 10px 16px; }
}
