/* explore_v6.css — Cosmology Transit System
 *
 * The cosmology as a Vignelli/Beck diagrammatic transit map. Off-white
 * paper, thick saturated lines, white-circle stations with 1px black
 * borders, station names set at 0° / 45° / 90° only. No drop shadows
 * (the brutalist rule still applies here — this is the rules-following
 * side of the spatial-topology pair).
 */

/* ───────────── reset + ground ───────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body.c6 {
    background: #f6f3eb;          /* off-white "newsprint" paper */
    color: #1a1a1a;
    font-family: "Helvetica Neue", Helvetica, "Arial Narrow", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    overflow: hidden;             /* the map IS the page */
}

/* ───────────── topbar ───────────── */
.c6-top {
    background: #1a1a1a;
    color: #f6f3eb;
}
.c6-top-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 10px 22px;
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap;
}
.c6-brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: #f6f3eb;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 14px; letter-spacing: 0.3px; font-weight: 500;
}
.c6-brand-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
    background: #d62828;          /* NYC-subway red M */
    color: #fff;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-weight: 700; font-size: 14px;
    border-radius: 50%;
}
.c6-brand-text { text-transform: lowercase; letter-spacing: 0.5px; }
.c6-nav {
    display: flex; gap: 16px; flex-wrap: wrap;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px; letter-spacing: 1px; text-transform: uppercase;
}
.c6-nav a {
    color: #c8c2b0; text-decoration: none;
    padding-bottom: 1px; border-bottom: 1px solid transparent;
}
.c6-nav a:hover { color: #fff; border-bottom-color: #fff; }
.c6-nav a[aria-current="page"] { color: #f6c87a; border-bottom-color: #f6c87a; }

/* ───────────── masthead ───────────── */
.c6-mast {
    background: #f6f3eb;
    border-bottom: 2px solid #1a1a1a;
}
.c6-mast-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 18px 22px 14px;
}
.c6-mast-title {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 28px; font-weight: 700; letter-spacing: -0.4px;
    line-height: 1.05;
    margin-bottom: 6px;
}
.c6-mast-sub {
    max-width: 720px;
    font-size: 14px; color: #444;
    line-height: 1.5;
    margin-bottom: 8px;
}
.c6-mast-sub em { font-style: italic; }
.c6-mast-hint {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px;
    color: #6a6a6a;
}
.c6-mast-sep { margin: 0 8px; color: #aaa; }

/* ───────────── map area ───────────── */
.c6-main {
    position: relative;
    width: 100vw;
    /* fill remaining viewport */
    height: calc(100vh - 44px - 88px);
    overflow: hidden;
    background: #f6f3eb;
    background-image:
        linear-gradient(rgba(0,0,0,0.020) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.020) 1px, transparent 1px);
    background-size: 40px 40px;
}
@media (max-width: 640px) {
    .c6-main { height: calc(100vh - 44px - 110px); }
}

.c6-map-wrap {
    position: absolute; inset: 0;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
}
.c6-map-wrap.c6-dragging { cursor: grabbing; }
.c6-map {
    display: block;
    width: 100%; height: 100%;
    user-select: none;
    -webkit-user-select: none;
}

/* ─── inside-the-SVG styling — referenced by JS via class names ─── */
.c6-map .c6-line {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.c6-map .c6-line-hl {
    /* highlight overlay drawn under the lines, transparent */
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0;
    pointer-events: none;
    transition: opacity 120ms ease-out;
}
.c6-map .c6-station {
    cursor: pointer;
}
.c6-map .c6-station circle {
    fill: #ffffff;
    stroke: #1a1a1a;
    stroke-width: 1.5;
    transition: r 90ms ease-out;
}
.c6-map .c6-station:hover circle,
.c6-map .c6-station:focus circle {
    fill: #fffacd;
}
.c6-map .c6-xfer-bg {
    fill: #ffffff;
    stroke: #1a1a1a;
    stroke-width: 1.5;
}
.c6-map .c6-xfer-seg {
    stroke-width: 0;
    opacity: 0.92;
}
.c6-map .c6-station-label {
    fill: #1a1a1a;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 500;
    pointer-events: none;
}
.c6-map .c6-station-label.c6-xfer-label {
    font-weight: 700;
}

/* ───────────── legend, fixed bottom-left ───────────── */
.c6-legend {
    position: absolute;
    bottom: 16px; left: 16px;
    z-index: 30;
    background: #ffffff;
    border: 1.5px solid #1a1a1a;
    padding: 12px 14px;
    width: 240px;
    max-height: calc(100% - 32px);
    overflow-y: auto;
    font-size: 12px;
}
.c6-legend-head {
    display: flex; align-items: center; gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #1a1a1a;
}
.c6-legend-mark {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px;
    background: #1a1a1a; color: #fff;
    border-radius: 50%;
    font-weight: 700; font-size: 11px;
    font-style: italic; font-family: Georgia, serif;
}
.c6-legend-title {
    font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; font-size: 11px;
}
.c6-legend-list {
    list-style: none;
    display: flex; flex-direction: column; gap: 6px;
}
.c6-legend-item {
    display: flex; align-items: flex-start; gap: 9px;
    padding: 4px 6px;
    margin: 0 -6px;
    cursor: pointer;
    border-radius: 2px;
    user-select: none;
}
.c6-legend-item:hover { background: #f3eedd; }
.c6-legend-swatch {
    display: inline-block;
    width: 18px; height: 8px;
    margin-top: 4px;
    flex-shrink: 0;
}
.c6-legend-text { flex: 1; }
.c6-legend-name {
    font-weight: 700; font-size: 12px;
    line-height: 1.25;
}
.c6-legend-blurb {
    font-size: 10.5px; color: #555;
    line-height: 1.3;
    margin-top: 1px;
}
.c6-legend-foot {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #1a1a1a;
    font-size: 10.5px; color: #555;
}
.c6-xfer-mark {
    position: relative;
    display: inline-block;
    width: 18px; height: 18px;
    background: #fff;
    border: 1.5px solid #1a1a1a;
    border-radius: 50%;
    overflow: hidden;
}
.c6-xfer-mark span {
    position: absolute;
    width: 50%; height: 100%;
    top: 0;
}
.c6-xfer-mark span:nth-child(1) { left: 0;   background: #d62828; }
.c6-xfer-mark span:nth-child(2) { left: 33%; background: #1d4ed8; width: 34%; }
.c6-xfer-mark span:nth-child(3) { left: 67%; background: #15803d; width: 33%; }

/* Dim non-selected lines when one is "selected" in the legend */
.c6-map.c6-has-selection .c6-line:not(.c6-line-active) { opacity: 0.18; }
.c6-map.c6-has-selection .c6-station:not(.c6-station-active) { opacity: 0.28; }
.c6-map.c6-has-selection .c6-station-label:not(.c6-label-active) { opacity: 0.28; }

.c6-legend-item.c6-legend-active {
    background: #f3eedd;
    outline: 1.5px solid #1a1a1a;
}

/* ───────────── view controls, fixed bottom-right ───────────── */
.c6-controls {
    position: absolute;
    bottom: 16px; right: 16px;
    z-index: 30;
    display: flex; flex-direction: column; gap: 4px;
}
.c6-btn {
    width: 36px; height: 36px;
    background: #ffffff;
    border: 1.5px solid #1a1a1a;
    color: #1a1a1a;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 18px; font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.c6-btn:hover { background: #fffacd; }

/* ───────────── mobile ───────────── */
@media (max-width: 640px) {
    .c6-top-inner { padding: 8px 14px; }
    .c6-brand-text { font-size: 12.5px; }
    .c6-nav { gap: 10px; font-size: 10.5px; letter-spacing: 0.6px; }
    .c6-nav a:nth-child(n+5) { display: none; }

    .c6-mast-inner { padding: 12px 14px 10px; }
    .c6-mast-title { font-size: 20px; }
    .c6-mast-sub { font-size: 12.5px; }
    .c6-mast-hint { font-size: 10px; }

    .c6-legend {
        bottom: 8px; left: 8px;
        width: 200px;
        padding: 10px 12px;
        font-size: 11px;
        max-height: 220px;
    }
    .c6-controls { bottom: 8px; right: 8px; }
    .c6-btn { width: 32px; height: 32px; font-size: 16px; }
}
