/* Bikepacking journal: only loaded on journal pages. Colours come from site.css. */

.j-totals {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1em;
  margin: 1.8em 0;
  padding: 0.9em 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.journal .j-totals dt {
  margin: 0;
  font-size: 0.7em;
  font-weight: normal;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.journal .j-totals dd { margin: 0; font-size: 1.6em; }
.j-totals small { font-size: 0.55em; color: var(--ink-soft); }

/* Maps */
.j-map { margin: 0 0 1.5em; }
.j-map svg, .j-daymap {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  box-shadow: inset 0 0 0 4px var(--paper);
  background: var(--paper);
}
.journal figcaption { font-size: 0.75em; color: var(--ink-soft); text-align: left; }
/* The base maps take their colours from these. */
.journal {
  --jm-ink: var(--ink-soft);
  --jm-water: #c3d3d0;
  --jm-shore: #5d828a;
  --jm-wood: #7d8a45;
  --jm-tree: #68753a;
}
.night-ride .journal {
  --jm-water: #1b2f36;
  --jm-shore: #5f8791;
  --jm-wood: #6f7d45;
  --jm-tree: #8b9a5c;
}
.jm-town { fill: var(--ink); }
.jm-name {
  fill: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
  paint-order: stroke;
  stroke: var(--paper);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
.jm-lake {
  fill: var(--jm-shore);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  font-style: italic;
  letter-spacing: 0.22em;
  text-anchor: middle;
}
.jm-scale path { fill: none; stroke: var(--ink); stroke-width: 1.3; }
.jm-scale text {
  fill: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-style: italic;
}
.jm-route {
  fill: none;
  stroke: var(--trail);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.j-map a { box-shadow: none; }
.j-map a:hover .jm-route, .j-map a:focus-visible .jm-route { stroke: var(--forest); stroke-width: 5; }
.jm-badge { fill: var(--paper); stroke: var(--trail); stroke-width: 2; }
.jm-number { fill: var(--ink); font-size: 13px; letter-spacing: 0; text-anchor: middle; }
.jm-tent { fill: var(--paper); stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.jm-start { fill: var(--paper); stroke: var(--trail); stroke-width: 2.5; }
.jm-here { fill: var(--forest); stroke: var(--paper); stroke-width: 2; }
.jm-here[hidden] { display: none; } /* SVG ignores the attribute on its own */

.j-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85em;
  font-variant-numeric: tabular-nums;
}
.journal .j-table th, .journal .j-table td {
  padding: 0.35em 0.4em;
  border: 0;
  border-bottom: 1px solid var(--rule);
  text-align: right;
}
.journal .j-table th:first-child { text-align: left; }
.j-table thead th { font-weight: normal; color: var(--ink-soft); }

/* A day */
.j-day.j-only { margin-top: 0; }
.journal .j-credit { margin: 0.4em 0 0; font-size: 0.75em; color: var(--ink-soft); }
.jm-finish { fill: var(--trail); stroke: var(--paper); stroke-width: 2; }
.j-day { margin-top: 4em; }
.journal .j-date {
  margin: 0;
  font-size: 0.8em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.journal .j-day h2 { margin: 0.1em 0; }
.journal .j-facts { margin: 0 0 0.8em; color: var(--ink-soft); font-size: 0.9em; }

.j-profile { margin: 0.6em 0 1.5em; touch-action: pan-y; }
.j-plot { position: relative; border-bottom: 1px solid var(--rule); }
.j-plot svg { display: block; width: 100%; height: 110px; }
.jp-fill { fill: var(--trail); opacity: 0.16; }
.jp-line { fill: none; stroke: var(--trail); stroke-width: 2; vector-effect: non-scaling-stroke; }
.j-cursor { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--ink); }
.journal .j-profile figcaption { display: flex; justify-content: space-between; gap: 1em; min-height: 1.6em; }

/* Front page: every route on one map. Each trip has a colour and a number; pointing
   at either one highlights the route, so colour is never the only clue. */
.jx { position: relative; margin-bottom: 1.2em; }
.jx-map {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.journal .jx-trip { box-shadow: none; cursor: pointer; }
.jx-trip path { fill: none; stroke-linejoin: round; stroke-linecap: round; transition: opacity 0.15s; }
.jx-hit { stroke: transparent; stroke-width: 16; }
.jx-halo { stroke: var(--paper); stroke-width: 6; opacity: 0.85; }
.jx-line { stroke: var(--trip); stroke-width: 2.8; }
.jx-dashed .jx-line { stroke-dasharray: 7 5; stroke-linecap: butt; }
.jx-dashed .jx-halo { opacity: 0; }
.journal .jx-heading { margin: 1.5em 0 0.3em; font-size: 0.85em; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.jx-trip .jx-stem { stroke: var(--trip); stroke-width: 1.4; }
.jx-foot { fill: var(--trip); }
.jx-num { fill: var(--paper); stroke: var(--trip); stroke-width: 2.5; }
.jx-trip text { fill: var(--ink); font-size: 13px; letter-spacing: 0; text-anchor: middle; }
.has-on .jx-trip:not(.is-on) { opacity: 0.22; }
.jx-trip.is-on .jx-line { stroke-width: 4.5; }
.jx-trip.is-on .jx-halo { stroke-width: 10; opacity: 1; }

/* The preview card sits in a corner of the map, out in the lake. */
.jx-card {
  position: absolute;
  top: 0.8em;
  right: 0.8em;
  width: 16em;
  max-width: calc(100% - 1.6em);
  padding: 0.8em 1em;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 5px solid var(--trip);
  box-shadow: 0 6px 18px rgba(43, 41, 37, 0.18);
  font-size: 0.8em;
  line-height: 1.4;
}
.jx-card[hidden] { display: none; }
.journal .jx-card h2 { margin: 0.1em 0 0.3em; font-size: 1.25em; }
.journal .jx-card p { margin: 0 0 0.6em; }
.journal .jx-card .jx-when {
  margin: 0;
  font-size: 0.85em;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.journal .jx-bars { display: flex; align-items: flex-end; gap: 2px; height: 5em; margin: 0 0 0.6em; padding: 0; list-style: none; }
.jx-bars li { flex: 1; max-width: 2.4em; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; margin: 0; text-align: center; }
.jx-bars span { display: block; max-height: calc(100% - 1.5em); background: var(--trip); border-radius: 3px 3px 0 0; }
.jx-bars small { color: var(--ink-soft); font-size: 0.8em; }

.journal .jx-list { list-style: none; padding: 0; }
.journal .jx-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.7em; margin: 0; padding: 0.5em 0.3em; border-bottom: 1px solid var(--rule); }
.jx-list li.is-on { background: var(--paper-deep); }
.jx-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2em;
  height: 2em;
  border: 2px solid var(--trip);
  border-radius: 50%;
  font-size: 0.75em;
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: 0;
  line-height: 1;
}
.jx-list small { color: var(--ink-soft); }
.journal .jx-note { font-size: 0.75em; color: var(--ink-soft); }

@media (max-width: 600px) {
  .j-totals { grid-template-columns: repeat(2, 1fr); }
  .jm-name { font-size: 20px; }
  .jm-minor { display: none; }
  .jm-scale text { font-size: 18px; }
  .jm-number { font-size: 18px; }
  .jm-badge { r: 15px; }
  .j-table { font-size: 0.75em; }
  .jx-map .jm-name { font-size: 20px; }
  .jx-map .jm-town { r: 4px; }
  /* Too small for 21 numbers: only the chosen route shows its own. */
  .jx-trip:not(.is-on) :is(.jx-stem, .jx-foot, .jx-num, text) { display: none; }
  .jx-num { r: 16px; }
  .jx-trip text { font-size: 20px; }
  /* No room on the map: the card goes under it. */
  .jx-card { position: static; width: auto; max-width: none; margin-top: 0.6em; font-size: 0.85em; }
}

.j-place { font-weight: normal; font-style: italic; color: var(--forest); }
