/* Hub landing for /constituencies/ — map + filterable cards */

body.hub-page {
    background: #fff;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.5;
    margin: 0;
}

.hub-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

.hub-kicker {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 12px;
}

.hub-headline {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 44px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.1;
    margin: 0 0 8px;
}

.hub-subhead {
    font-size: 16px;
    color: #666;
    margin: 0 0 32px;
}

.hub-summary {
    font-size: 14px;
    color: #333;
    margin-bottom: 32px;
    padding: 16px 20px;
    background: #fafafa;
    border-left: 3px solid #1a1a1a;
}

/* ============== Map section ============== */

.hub-map-section {
    margin-bottom: 48px;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
    padding: 24px 0 32px;
}

.hub-map-section-h {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
}

.hub-map-section-note {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px;
}

.hub-map-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.hub-map-search {
    position: relative;
    flex: 1;
    min-width: 240px;
    max-width: 400px;
}
.hub-map-search-input {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: #fff;
}
.hub-map-search-input:focus {
    outline: none;
    border-color: #1a1a1a;
}
.hub-map-search-results {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 2px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    z-index: 10;
}
.hub-map-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}
.hub-map-search-result:last-child { border-bottom: none; }
.hub-map-search-result.active,
.hub-map-search-result:hover { background: #fafafa; }
.hub-map-search-result-name {
    font-weight: 600;
    color: #1a1a1a;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.hub-map-search-result-meta {
    font-size: 12px;
    color: #999;
}
.hub-map-search-empty {
    padding: 12px;
    color: #999;
    font-size: 13px;
    font-style: italic;
}
.hub-map-canvas .pcon-path.search-dim,
.hub-map-canvas .pcon-hex.search-dim {
    opacity: 0.15;
}
.hub-map-canvas .pcon-path.search-hit,
.hub-map-canvas .pcon-hex.search-hit {
    stroke: #1a1a1a;
    stroke-width: 2;
}

.hub-view-toggle {
    display: inline-flex;
    border: 1px solid #ccc;
    border-radius: 2px;
    overflow: hidden;
}

.hub-view-btn {
    background: #fff;
    border: none;
    padding: 8px 14px;
    font-size: 13px;
    font-family: inherit;
    color: #666;
    cursor: pointer;
    border-right: 1px solid #ccc;
}

.hub-view-btn:last-child {
    border-right: none;
}

.hub-view-btn.active {
    background: #1a1a1a;
    color: #fff;
}

.hub-map-canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    max-height: 720px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    overflow: hidden;
}

#hub-map-geo,
#hub-map-hex {
    width: 100%;
    height: 100%;
}

.hub-map-canvas svg {
    width: 100%;
    height: 100%;
    display: block;
}

.hub-map-canvas .pcon-path,
.hub-map-canvas .pcon-hex {
    stroke: #fff;
    stroke-width: 0.5;
    cursor: pointer;
    transition: opacity 0.1s;
}

.hub-map-canvas .pcon-path:hover,
.hub-map-canvas .pcon-hex:hover {
    stroke: #1a1a1a;
    stroke-width: 1.5;
}

.hub-map-canvas .pcon-path.dimmed,
.hub-map-canvas .pcon-hex.dimmed {
    opacity: 0.18;
}

.hub-map-tooltip {
    position: absolute;
    pointer-events: none;
    background: #1a1a1a;
    color: #fff;
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 2px;
    line-height: 1.4;
    max-width: 240px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.08s;
}

.hub-map-tooltip strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
}

.hub-map-tooltip .tt-mp {
    color: #ccc;
}

.hub-map-tooltip .tt-line {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.hub-map-tooltip .tt-swatch {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.hub-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-top: 14px;
    font-size: 12px;
    color: #333;
}

.hub-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hub-legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

/* ============== Cards section ============== */

.hub-cards-section {
    margin-top: 24px;
}

.hub-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.hub-search-input {
    flex: 1;
    min-width: 240px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 2px;
}

.hub-filter {
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid #ccc;
    border-radius: 2px;
    background: white;
    cursor: pointer;
}

.hub-result-count {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.hub-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.hub-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-left: 4px solid var(--card-accent, #999);
    padding: 14px 16px;
    transition: border-color 0.1s, box-shadow 0.1s;
}

.hub-card:hover {
    border-color: #1a1a1a;
    border-left-color: var(--card-accent, #999);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.hub-card-name {
    font-weight: 700;
    color: #1a1a1a;
    font-size: 15px;
    margin: 0 0 4px;
    line-height: 1.25;
}

.hub-card-meta {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px;
    line-height: 1.4;
}

.hub-card-meta .sep {
    color: #ccc;
    margin: 0 4px;
}

.hub-card-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-top: 6px;
    color: #333;
}

.hub-card-row .label {
    color: #999;
    width: 56px;
    flex-shrink: 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hub-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    background: var(--c, #999);
    font-variant-numeric: tabular-nums;
}

.hub-flip-chip {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: 700;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    margin-left: 6px;
    vertical-align: middle;
}

.hub-empty {
    padding: 48px 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

@media (max-width: 768px) {
    .hub-wrap {
        padding: 32px 16px 48px;
    }
    .hub-headline {
        font-size: 32px;
    }
    .hub-map-canvas-wrap {
        aspect-ratio: 3 / 4;
        max-height: 560px;
    }
    .hub-card-grid {
        grid-template-columns: 1fr;
    }
}
