/* ClearDash home page (index.php): the opening spread, route map and portals
   table. Shared tokens and components are in site.css. */


/* ---------- Opening spread: navy cover + contents ---------- */

.opening {
  position: relative;
  display: grid;
  grid-template-columns: 5fr 7fr;
  align-items: start;
}

.cover {
  position: sticky;
  top: 0;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--navy);
  color: #fff;
  padding: 30px var(--gutter) 56px;
  display: flex;
  flex-direction: column;
}


.cover-body {
  margin-top: auto;
  margin-bottom: auto;
  padding-top: 48px;
  max-width: 34rem;
}

.cover h1 {
  font-size: clamp(44px, 4.7vw, 72px);
  text-wrap: pretty;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.cover-sub {
  margin: 28px 0 0;
  max-width: 30em;
  font-size: 19px;
  line-height: 1.5;
  color: var(--mist);
}


/* Contents column */
.contents { padding: 76px var(--gutter) 88px; }

.site-nav {
  position: absolute;
  top: 22px;
  right: var(--gutter);
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 28px;
}
.site-nav a {
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  padding: 8px 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.site-nav a:hover { text-decoration: underline; }

.contents-title {
  margin-top: clamp(56px, 9vh, 96px);
  padding-bottom: 22px;
  border-bottom: 2px solid var(--rule-strong);
  font-size: clamp(30px, 2.8vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.toc { list-style: none; margin: 0; padding: 0; }
.toc li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 0 16px;
  padding: 18px 0 17px;
  border-bottom: 1px solid var(--rule);
}
.toc-t { font-size: 24px; font-weight: 700; font-stretch: 94%; letter-spacing: -0.01em; line-height: 1.2; }
.toc-t a { text-decoration: none; }
.toc-t a:hover { text-decoration: underline; }
.bullet-sm { margin-left: 10px; vertical-align: 3px; }
.folio {
  margin: 0 0 18px;
  font-size: 44px;
  line-height: 1;
  font-weight: 250;
  font-stretch: 88%;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.toc-t small { display: block; margin-top: 5px; font-size: 15px; font-weight: 400; font-stretch: 100%; letter-spacing: 0; color: var(--ink-soft); }
.toc-d { font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Route map ---------- */

.map-section { padding: 112px var(--gutter) 104px; border-top: 2px solid var(--rule-strong); }
.map-intro { display: grid; grid-template-columns: 5fr 7fr; gap: 20px var(--gutter); align-items: end; }
.map-intro p { margin: 0; max-width: 38em; color: var(--ink-soft); }

.map-key { list-style: none; margin: 44px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.map-key button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 16px 4px 4px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease-out, color 160ms ease-out;
}
.map-key button:hover { background: #eef1f5; }
.map-key button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.map-figure { margin: 28px 0 0; min-width: 0; }
.map-scroll {
  overflow-x: auto;
  scrollbar-color: var(--navy) #e3e8ee;
  scrollbar-width: thin;
}
.map-scroll::-webkit-scrollbar { height: 6px; }
.map-scroll::-webkit-scrollbar-track { background: #e3e8ee; }
.map-scroll::-webkit-scrollbar-thumb { background: var(--navy); border-radius: 3px; }
.map-scroll:focus-visible { outline-offset: 6px; }
.map { display: block; width: 100%; max-width: 1280px; height: auto; min-width: 860px; margin: 0 auto; }
.map-figure figcaption { margin-top: 12px; font-size: 13px; color: var(--ink-soft); }
.scroll-hint { display: none; }

.l-t { stroke: var(--route-t); }
.l-n { stroke: var(--route-n); }
.l-q { stroke: var(--route-q); }
.l-p { stroke: var(--route-p); }
.l-b { stroke: var(--route-b); }
.l-c { stroke: var(--route-c); }

.f-t { fill: var(--route-t); }
.f-n { fill: var(--route-n); }
.f-q { fill: var(--route-q); }
.f-p { fill: var(--route-p); }
.f-b { fill: var(--route-b); }
.f-c { fill: var(--route-c); }
.bl { fill: #fff; font-family: var(--face); font-size: 9.2px; font-weight: 750; }
.bl-lg { font-size: 17px; }
.bl-dark { fill: #111; }

.stop { fill: #111; }
.transfer-bar { fill: none; stroke: #111; stroke-width: 5; }
.transfer { fill: #fff; stroke: #111; stroke-width: 2.5; }
.labels > text { fill: #111; font-family: var(--face); font-size: 16px; font-weight: 600; }
.labels > .major { font-size: 21px; font-weight: 750; }

.map [data-line] { transition: opacity 220ms ease-out; }
.map.map[data-focus="t"] [data-line]:not([data-line="t"]),
.map.map[data-focus="n"] [data-line]:not([data-line="n"]),
.map.map[data-focus="q"] [data-line]:not([data-line="q"]),
.map.map[data-focus="p"] [data-line]:not([data-line="p"]),
.map.map[data-focus="b"] [data-line]:not([data-line="b"]),
.map.map[data-focus="c"] [data-line]:not([data-line="c"]) { opacity: 0.14; }

/* Draw-in, once, only when the script has opted in: each line runs out from
   its terminus bullet, then the stations and names arrive. */
.map.will-draw .line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.map.will-draw .stations, .map.will-draw .labels { opacity: 0; }
.map.will-draw.drawn .line { stroke-dashoffset: 0; transition: stroke-dashoffset 1100ms cubic-bezier(0.16, 1, 0.3, 1), opacity 220ms ease-out; }
.map.will-draw.drawn .stations, .map.will-draw.drawn .labels { opacity: 1; transition: opacity 400ms ease-out 700ms; }
.map.will-draw.drawn .l-n { transition-delay: 80ms; }
.map.will-draw.drawn .l-q { transition-delay: 160ms; }
.map.will-draw.drawn .l-p { transition-delay: 240ms; }
.map.will-draw.drawn .l-b { transition-delay: 320ms; }
.map.will-draw.drawn .l-c { transition-delay: 400ms; }
.map.drawn[data-focus] .line { transition: opacity 220ms ease-out 0ms; }


.map-intro h2, .portals h2 {
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.03em;
}


/* ---------- Portals table ---------- */

.portals { padding: 112px var(--gutter); border-top: 2px solid var(--rule-strong); }
.portals-sub { margin: 18px 0 0; max-width: 34em; color: var(--ink-soft); }
.table-wrap { margin-top: 48px; overflow-x: auto; }
.portals table { width: 100%; min-width: 620px; border-collapse: collapse; }
.portals thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 24px 14px 0;
  border-bottom: 2px solid var(--rule-strong);
}
.portals tbody th, .portals td {
  text-align: left;
  vertical-align: top;
  padding: 20px 24px 20px 0;
  border-bottom: 1px solid #cfd6df;
}
.portals tbody th { width: 22%; font-size: 21px; font-weight: 700; font-stretch: 94%; line-height: 1.25; }
.portals td { color: #2d3a4c; }


/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .map-section { padding-top: 96px; padding-bottom: 96px; }
}

@media (max-width: 960px) {
  .map-intro { grid-template-columns: 1fr; }
  .opening { grid-template-columns: 1fr; }
  .cover { position: static; min-height: 0; padding-bottom: 64px; }
  .contents { padding-top: 8px; padding-bottom: 72px; }
  .site-nav { left: var(--gutter); right: auto; top: 70px; color: #fff; gap: 0 26px; }
  .site-nav a { color: var(--mist); }
  .site-nav a:hover { color: #fff; }
  .site-nav a:focus-visible { outline-color: #fff; }
  .cover-body { padding-top: 112px; }
  .contents-title { margin-top: 48px; }
}

@media (max-width: 600px) {
  .cover { padding-top: 22px; }
  .cover-body { padding-top: 104px; }
  .cover-sub { font-size: 17px; }
  .site-nav { gap: 0 22px; }
  .toc li { grid-template-columns: 1fr; padding: 16px 0 15px; }
  .toc-t { font-size: 20px; }
  .toc-d { display: none; }
  .map-section { padding: 72px var(--gutter); }
  .map-key { display: grid; grid-template-columns: 1fr 1fr; margin-top: 32px; }
  .scroll-hint { display: inline; }
  .map-scroll { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%); padding-bottom: 10px; }
  .portals { padding: 72px var(--gutter); }
  .portals table { min-width: 0; }
  .portals thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .portals tbody, .portals tr, .portals tbody th, .portals td { display: block; width: auto; }
  .portals tr { padding: 20px 0; border-bottom: 1px solid #cfd6df; }
  .portals tbody th, .portals td { border: 0; padding: 0; }
  .portals tbody th { margin-bottom: 10px; }
  .portals td + td { margin-top: 8px; }
  .portals td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft); }
  .table-wrap { margin-top: 28px; border-top: 2px solid var(--rule-strong); }
}
