/* D&R Canal Watch: canal journey map. Colors fall back if the theme variables are missing. */
.cw-journey{
  --j-ink:var(--ink,#0A2433);--j-deep:var(--deep,#103A52);--j-sky:var(--sky,#9CCBEA);--j-gold:var(--house,#D48620);--j-mist:var(--mist,#E9F0F2);
  --j-display:var(--display,"Big Shoulders Display",Impact,"Arial Narrow",sans-serif);
  --j-pad:var(--pad,clamp(20px,5vw,72px));
  position:relative;background:var(--j-ink);color:var(--j-mist);
}
.cw-journey .vh{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.cw-journey__data{display:none}
.cw-journey__sticky{display:grid;gap:18px;padding:72px var(--j-pad) 32px}
.cw-journey__head h2{font-size:clamp(40px,5.2vw,80px);margin:0}
.cw-journey__head h1{font-size:clamp(34px,4.2vw,64px);margin:0}
.cw-journey__intro{margin:10px 0 0;font-size:17px;color:#b9d0dc;max-width:28em}

/* readout */
.cw-readout{display:none;flex-wrap:wrap;align-items:baseline;gap:6px 18px;margin-top:14px;font-family:var(--j-display);font-weight:800;text-transform:uppercase;letter-spacing:.05em;font-size:18px}
.cw-readout__mile{display:inline-flex;align-items:baseline;gap:8px;color:#fff}
.cw-readout__mile small{font-size:18px;color:var(--j-gold)}
.cw-readout__mile b{font-weight:900;font-size:44px;line-height:.9;font-variant-numeric:tabular-nums;min-width:2.3em}
.cw-readout__leg{color:var(--j-sky)}
.cw-readout__speed{color:var(--j-gold)}

/* map */
.cw-map{position:relative;min-width:0}
.cw-map svg{display:block;width:100%;height:auto;max-height:78vh;overflow:hidden}
.cw-river{stroke:var(--j-deep);stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.cw-river--delaware{stroke-width:12px}
.cw-river--raritan{stroke-width:8px}
.cw-river--millstone{stroke-width:4px}
.cw-route-bg{stroke:#3d6f8c;stroke-width:3px;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.cw-journey.is-live .cw-route-bg{stroke:#2b5670;stroke-dasharray:2 8}
.cw-route{stroke:var(--j-sky);stroke-width:5px;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.cw-stub{stroke:#2b5670;stroke-width:2px;stroke-dasharray:2 7;stroke-linecap:round;vector-effect:non-scaling-stroke}
.cw-map text{font-family:var(--text,Georgia,serif);font-size:17px;fill:#8fb0c2}
.cw-map .cw-state{font-family:var(--j-display);font-weight:800;font-size:22px;letter-spacing:.3em;text-transform:uppercase;fill:#1d4a63}
.cw-map .cw-rv{font-style:italic;font-size:16px;fill:#4f7d98}
.cw-map .cw-ctx{font-size:15px;fill:#6f97ad}
.cw-map .cw-ctx--note{font-style:italic;font-size:13px;fill:#4f7d98}
.cw-scale path{stroke:#6f97ad;stroke-width:2px;vector-effect:non-scaling-stroke}
.cw-scale text,.cw-north text{font-size:14px;fill:#6f97ad}
.cw-scale{transition:opacity .3s}
.cw-north path{fill:#6f97ad}
.cw-journey.is-live .cw-north{display:none}
.cw-pin{cursor:pointer}
.cw-pin__hit{fill:transparent}
.cw-pin__dot{fill:var(--j-ink);stroke:#5c8aa5;stroke-width:3px;transition:fill .3s,stroke .3s}
.cw-pin.passed .cw-pin__dot{fill:var(--j-sky);stroke:var(--j-sky)}
.cw-pin.on .cw-pin__dot{fill:var(--j-gold);stroke:var(--j-gold)}
.cw-pin text{paint-order:stroke;stroke:var(--j-ink);stroke-width:5px;stroke-linejoin:round}
.cw-pin.on text{fill:#fff;font-weight:500}
.cw-journey.is-live .cw-pin:not(.is-major):not(.on) text{opacity:0;transition:opacity .3s}
.cw-journey.is-live svg.is-close .cw-pin text{opacity:1}
.cw-pin:hover text{opacity:1 !important;fill:#fff}
.cw-boat{display:none}
.cw-journey.is-live .cw-boat{display:block}
.cw-boat__hull{fill:var(--j-gold);stroke:var(--j-ink);stroke-width:1.5}
.cw-boat__cabin{fill:var(--j-ink)}
.cw-boat__rope{stroke:var(--j-gold);stroke-width:1;opacity:.7}
.cw-boat__mule{fill:var(--j-mist)}
.cw-map__note{margin:6px 0 0;font-size:13px;font-style:italic;color:#6f97ad}
.cw-map__note a{color:inherit}

/* stops: without JavaScript they are a plain readable list */
.cw-stops{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:36px 28px}
.cw-stop__fig{margin:0 0 16px;aspect-ratio:16/10;overflow:hidden;border-radius:3px;background:var(--j-deep)}
.cw-stop__fig img{width:100%;height:100%;object-fit:cover;display:block}
.cw-stop__fig.is-archive img{filter:sepia(.35) contrast(1.05)}
.cw-stop__big{font-family:var(--j-display);font-weight:900;font-size:clamp(96px,15vw,220px);line-height:.8;color:var(--j-sky);margin:0 0 16px}
.cw-stop__big small{font-size:.24em;letter-spacing:.04em;color:var(--j-mist);margin-left:.2em;text-transform:uppercase}
.cw-stop__kicker{display:flex;flex-wrap:wrap;gap:4px 16px;font-family:var(--j-display);font-weight:800;font-size:19px;letter-spacing:.06em;text-transform:uppercase;color:var(--j-gold)}
.cw-stop__kicker span{color:var(--j-sky)}
.cw-stop h3{font-size:clamp(34px,4.2vw,64px);margin:2px 0 10px}
.cw-stop p{margin:0;max-width:30em;color:#d5e3ea}
.cw-stop__links{display:flex;flex-wrap:wrap;gap:6px 22px;margin-top:14px !important;font-size:17px}
.cw-stop__links a{color:#fff;text-decoration-color:var(--j-gold);text-underline-offset:4px}
.cw-stop__links a:hover{color:var(--j-gold)}
.cw-ruler{display:none}

/* ---------- live (JavaScript running) ---------- */
.cw-journey.is-live .cw-readout{display:flex}
.cw-journey.is-live .cw-journey__sticky{
  grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);
  grid-template-rows:auto minmax(0,1fr) auto;
  grid-template-areas:"head stops" "map stops" "ruler ruler";
  column-gap:clamp(16px,4vw,64px);row-gap:10px;
}
.cw-journey.is-live .cw-journey__head{grid-area:head}
.cw-journey.is-live .cw-map{grid-area:map;display:flex;flex-direction:column;justify-content:flex-end;min-height:0}
.cw-journey.is-live .cw-map svg{flex:1 1 auto;min-height:0;height:100%;max-height:none}
.cw-journey.is-live .cw-stops{grid-area:stops;display:block;position:relative;min-height:0}
.cw-journey.is-live .cw-stop{position:absolute;inset:0;display:flex;flex-direction:column;justify-content:center;opacity:0;visibility:hidden;transform:translateY(18px);transition:opacity .45s,transform .45s,visibility 0s .45s}
.cw-journey.is-live .cw-stop.on{opacity:1;visibility:visible;transform:none;transition:opacity .45s,transform .45s}
.cw-journey.is-live .cw-stop__fig{aspect-ratio:auto;height:min(40vh,380px);flex:0 1 auto}

.cw-journey--scroll.is-live{height:calc((var(--cw-stops) + .5) * 72vh + 100vh)}
.cw-journey--scroll.is-live .cw-journey__sticky{position:sticky;top:0;height:100vh;height:100svh;padding-top:84px;padding-bottom:22px;overflow:hidden}
.cw-journey--explore.is-live .cw-journey__sticky{min-height:min(900px,100svh);padding-top:clamp(96px,12vh,140px)}
.cw-journey--explore.is-live .cw-stops{min-height:520px}

/* ruler */
.cw-journey.is-live .cw-ruler{grid-area:ruler;display:flex;align-items:center;gap:14px;padding-top:8px}
.cw-ruler__track{position:relative;flex:1;height:44px}
.cw-ruler__track::before{content:"";position:absolute;left:0;right:0;top:21px;height:2px;background:#2b5670}
.cw-ruler__fill{position:absolute;left:0;top:20px;height:4px;width:0;background:var(--j-sky);border-radius:2px}
.cw-ruler__junction{position:absolute;top:8px;height:28px;width:2px;background:#2b5670}
.cw-ruler__junction i{position:absolute;top:28px;left:8px;white-space:nowrap;font-size:12px;color:#6f97ad}
.cw-ruler__stop{position:absolute;top:0;width:28px;height:44px;margin-left:-14px;padding:0;border:0;background:none;cursor:pointer;color:inherit}
.cw-ruler__stop::before{content:"";position:absolute;left:8px;top:16px;width:12px;height:12px;border-radius:50%;background:var(--j-ink);border:2px solid #5c8aa5;box-sizing:border-box;transition:background .3s,border-color .3s,transform .2s}
.cw-ruler__stop.passed::before{background:var(--j-sky);border-color:var(--j-sky)}
.cw-ruler__stop.on::before{background:var(--j-gold);border-color:var(--j-gold);transform:scale(1.35)}
.cw-ruler__stop span b,.cw-ruler__stop span i{font:inherit}
.cw-ruler__count{display:none}
.cw-ruler__btn:disabled{opacity:.35;cursor:default;pointer-events:none}
.cw-ruler__stop span{position:absolute;bottom:40px;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:13px;background:var(--j-mist);color:var(--j-ink);padding:3px 9px;border-radius:2px;opacity:0;pointer-events:none;transition:opacity .15s;z-index:2}
.cw-ruler__stop:hover span,.cw-ruler__stop:focus-visible span{opacity:1}
.cw-ruler__stop:first-of-type span{left:0;transform:none}
.cw-ruler__stop:last-of-type span{left:auto;right:0;transform:none}
.cw-ruler__boat{position:absolute;top:13px;width:0;height:0;margin-left:-7px;border:7px solid transparent;border-top:10px solid var(--j-gold);border-bottom:0;transform:translateY(-9px);pointer-events:none}
.cw-ruler__btn,.cw-ruler__cruise,.cw-ruler__more{flex:none;display:inline-flex;align-items:center;justify-content:center;min-width:44px;height:44px;padding:0 14px;border:2px solid rgba(156,203,234,.55);border-radius:3px;background:none;color:var(--j-mist);font-family:var(--j-display);font-weight:800;font-size:19px;letter-spacing:.05em;text-transform:uppercase;text-decoration:none;cursor:pointer;transition:background .15s,color .15s,border-color .15s}
.cw-ruler__btn:hover,.cw-ruler__cruise:hover,.cw-ruler__more:hover{background:var(--j-mist);color:var(--j-ink);border-color:var(--j-mist)}
.cw-ruler__cruise[aria-pressed=true]{background:var(--j-gold);border-color:var(--j-gold);color:var(--j-ink)}
.cw-journey--scroll .cw-ruler__cruise,.cw-journey--scroll .cw-ruler__btn{display:none}
.cw-journey :focus-visible{outline:3px solid var(--j-gold);outline-offset:3px}

@media(max-width:860px){
  .cw-journey.is-live .cw-journey__sticky{grid-template-columns:minmax(0,1fr);grid-template-rows:auto 32svh minmax(0,1fr) auto;grid-template-areas:"head" "map" "stops" "ruler";row-gap:8px}
  .cw-journey--scroll.is-live .cw-journey__sticky{padding-top:72px;padding-bottom:12px}
  .cw-journey.is-live .cw-journey__head h1{font-size:28px}.cw-journey.is-live .cw-journey__head h2{font-size:32px}
  .cw-journey.is-live .cw-journey__intro,.cw-journey.is-live .cw-map__note,.cw-journey.is-live .cw-readout__speed{display:none}
  .cw-journey.is-live .cw-readout{margin-top:2px;font-size:15px}
  .cw-readout__mile b{font-size:30px}
  .cw-journey.is-live .cw-stop{justify-content:flex-start}
  .cw-journey.is-live .cw-stop__fig{height:15svh;margin-bottom:8px}
  .cw-journey.is-live .cw-stop__big{font-size:76px;margin-bottom:6px}
  .cw-journey.is-live .cw-stop h3{font-size:32px;margin-bottom:4px}
  .cw-journey.is-live .cw-stop p{font-size:16px;line-height:1.42}
  .cw-stop__kicker{font-size:16px}
  .cw-stop__links{margin-top:8px !important;font-size:15px}
  .cw-map .cw-state{display:none}
  .cw-journey--explore.is-live .cw-journey__sticky{min-height:100svh}
  .cw-journey--explore.is-live .cw-stops{min-height:300px}
  .cw-journey--scroll .cw-ruler__btn{display:inline-flex}
  .cw-ruler__junction i,.cw-ruler__more{display:none}
  .cw-ruler{gap:8px}
}
@media(prefers-reduced-motion:reduce){
  .cw-journey .cw-stop,.cw-pin__dot,.cw-ruler__stop::before{transition:none !important}
}

/* room for the fixed site header (and the WordPress toolbar when logged in) */
.cw-journey--scroll.is-live .cw-journey__sticky{padding-top:96px}
.admin-bar .cw-journey--scroll.is-live .cw-journey__sticky{padding-top:128px}
@media(max-width:860px){.cw-journey--scroll.is-live .cw-journey__sticky{padding-top:76px}.admin-bar .cw-journey--scroll.is-live .cw-journey__sticky{padding-top:122px}}

/* explore mode fits one screen so the stop ruler is always in view */
.cw-journey--explore.is-live .cw-journey__sticky{height:100svh;min-height:660px;max-height:1040px;padding-top:100px;padding-bottom:20px}
.admin-bar .cw-journey--explore.is-live .cw-journey__sticky{height:calc(100svh - 32px)}
.cw-journey--explore.is-live .cw-stops{min-height:0}
@media(max-width:860px){.cw-journey--explore.is-live .cw-journey__sticky{padding-top:80px;min-height:600px}}


/* ---------- phones: explore and homepage journey ---------- */
@media(max-width:860px){
  /* one screen, nothing clipped: the photo flexes to take up the slack */
  .cw-journey.is-live .cw-journey__sticky{grid-template-rows:auto 30svh minmax(0,1fr) auto;row-gap:10px}
  .cw-journey--explore.is-live .cw-journey__sticky{height:100svh;min-height:560px;padding-top:78px;padding-bottom:12px}
  .cw-journey.is-live .cw-journey__head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 14px}
  .cw-journey.is-live .cw-journey__head h1,.cw-journey.is-live .cw-journey__head h2{font-size:26px}
  .cw-journey.is-live .cw-readout{margin:0;gap:4px 12px;font-size:14px}
  .cw-readout__mile small{font-size:14px}
  .cw-readout__mile b{font-size:26px;min-width:2.1em}
  .cw-journey.is-live .cw-map{border-radius:4px;overflow:hidden;background:linear-gradient(180deg,rgba(16,58,82,.35),rgba(16,58,82,.12));box-shadow:inset 0 0 0 1px rgba(156,203,234,.14)}
  .cw-journey.is-live .cw-stop{justify-content:flex-start;gap:0}
  .cw-journey.is-live .cw-stop__fig{flex:1 1 0;height:auto;min-height:64px;max-height:26svh;margin-bottom:10px}
  .cw-journey.is-live .cw-stop__big{font-size:clamp(56px,11svh,92px);margin-bottom:6px}
  .cw-journey.is-live .cw-stop h3{font-size:30px;margin:0 0 4px}
  .cw-journey.is-live .cw-stop p{font-size:16px;line-height:1.4}
  .cw-journey.is-live .cw-stop__links{margin-top:8px !important}
  .cw-journey.is-live .cw-stop__links a{display:inline-flex;align-items:center;min-height:40px;padding:0 14px;border:1px solid rgba(156,203,234,.45);border-radius:3px;text-decoration:none;font-size:15px}

  /* the ruler becomes a row of tappable chips over a slim progress line, with the arrows under it */
  .cw-journey.is-live .cw-ruler{position:relative;display:grid;grid-template-columns:48px minmax(0,1fr) auto 48px;grid-template-areas:"prev count cruise next" "track track track track";gap:8px;padding-top:12px}
  .cw-journey.is-live .cw-ruler::before{content:"";position:absolute;left:0;right:0;top:0;height:3px;border-radius:2px;background:linear-gradient(90deg,var(--j-sky) var(--cw-p,0%),#23485f var(--cw-p,0%))}
  .cw-ruler__track{grid-area:track;display:flex;gap:6px;height:auto;overflow-x:auto;scroll-snap-type:x proximity;scrollbar-width:none;-webkit-overflow-scrolling:touch;margin:0 calc(var(--j-pad) * -1);padding:2px var(--j-pad)}
  .cw-ruler__track::-webkit-scrollbar{display:none}
  .cw-ruler__track::before,.cw-ruler__fill,.cw-ruler__junction,.cw-ruler__boat{display:none}
  .cw-ruler__stop{position:static;flex:none;width:auto;height:40px;margin:0;padding:0 14px;border:1px solid rgba(156,203,234,.4);border-radius:20px;scroll-snap-align:center;transition:background .2s,border-color .2s,color .2s}
  .cw-ruler__stop::before{display:none}
  .cw-ruler__stop span{position:static;transform:none !important;opacity:1;background:none;color:inherit;padding:0;font-size:15px;pointer-events:none;white-space:nowrap}
  .cw-ruler__stop span b{font-weight:500}
  .cw-ruler__stop span i{display:none}
  .cw-ruler__stop.passed{border-color:rgba(156,203,234,.75);color:var(--j-sky)}
  .cw-ruler__stop.on{background:var(--j-gold);border-color:var(--j-gold);color:var(--j-ink)}
  .cw-ruler__stop:focus-visible{outline-offset:1px}
  .cw-ruler [data-cw-prev]{grid-area:prev}
  .cw-ruler [data-cw-next]{grid-area:next}
  .cw-ruler__btn{display:inline-flex !important;height:48px;min-width:48px;padding:0;font-size:22px}
  .cw-ruler__count{grid-area:count;display:flex;align-items:center;gap:6px;font-family:var(--j-display);font-weight:800;font-size:17px;letter-spacing:.06em;text-transform:uppercase;color:#8fb0c2}
  .cw-ruler__count b{color:#fff;font-weight:900;font-size:22px}
  .cw-ruler__count::before{content:"Stop"}
  .cw-ruler__cruise{grid-area:cruise;height:48px}
  .cw-journey--scroll .cw-ruler__cruise{display:none}
  .cw-ruler__more{display:none}
  /* zoomed out on a phone there is only room to name the stop you are on */
  .cw-journey.is-live svg:not(.is-close) .cw-pin:not(.on) text{opacity:0}
  .cw-map .cw-ctx,.cw-map .cw-rv{opacity:.75}
}

/* short phones (iPhone SE and similar): drop the photo so the text and controls never collide */
@media(max-width:860px) and (max-height:700px){
  .cw-journey.is-live .cw-journey__sticky{grid-template-rows:auto 27svh minmax(0,1fr) auto}
  .cw-journey.is-live .cw-stop__fig{display:none}
  .cw-journey.is-live .cw-stop__big{font-size:52px}
  .cw-journey.is-live .cw-stop{overflow:hidden}
}
