/* The irrigation storyline ("Every answer revealed another question"): six chapters in three lanes, one per question
   (Where, When, How much), with elbow arrows from each chapter to the next and a dashed "combined" bracket that feeds the
   last chapter. Hovering, focusing or tapping a chapter opens its study card. Drawn by renderJourney() in index.html. */
.journey{--bleed:clamp(0px,calc((100vw - 1072px) / 2 - 20px),170px);position:relative;display:grid;grid-template-columns:104px repeat(6,minmax(0,1fr));column-gap:28px;row-gap:6px;margin:52px calc(-1 * var(--bleed)) 4px;padding-bottom:30px}
.journey .j-steps{display:contents;list-style:none;margin:0;padding:0}
.j-lane{grid-column:1/-1;display:flex;align-items:center;gap:9px;min-height:84px;margin:0 -12px;padding:0 12px;border-radius:8px;background:var(--tint);font:650 1.06rem/1.2 var(--sans);color:var(--ink)}
.j-lane::before{content:"";flex:none;width:12px;height:12px;border-radius:2px;background:var(--g)}
.j-lane.g-where{--tint:rgba(49,130,189,.07)}.j-lane.g-when{--tint:rgba(253,141,60,.09)}.j-lane.g-how_much{--tint:rgba(116,196,118,.11)}
.j-step{position:relative;z-index:2;align-self:center;margin:34px 0 10px}
.j-node{position:relative;display:block;width:100%;height:100%;padding:9px 11px 11px;border:1px solid var(--line);border-top:3px solid var(--g);border-radius:6px;background:var(--paper);color:var(--ink);font:inherit;text-align:left;cursor:pointer;transition:transform .15s,box-shadow .15s,border-color .15s}
.j-node:hover,.j-node[aria-expanded="true"]{border-color:var(--g);transform:translateY(-2px);box-shadow:0 8px 22px rgba(15,26,31,.14)}
.j-step.is-next .j-node{border-style:dashed;border-top-style:solid}
/* The top of the chapter is left to its icon; the chapter name and year share one line just above the title
   ("Chapter one · 2019"). On narrow screens the question tag (Where, When, How much) follows on the same line. */
.j-top{display:block;min-height:22px;margin-bottom:3px}
.j-ch{display:flex;flex-wrap:wrap;align-items:center;gap:2px 0;margin:0 0 2px;font:600 .8rem/1.3 var(--sans);color:var(--ink-2);}
.j-year::before{content:"\00b7";margin:0 .45em}
.j-q{display:none}
/* Chapter icon: a picture over the top-right corner of the chapter, breaking out of its border. A card-coloured
   backing in the icon's own outline (assets/chapters/<icon>-back.png) hides the border and arrows behind it,
   while the area around the icon stays transparent. */
.j-ico{position:absolute;top:-46px;right:-10px;width:80px;height:80px;pointer-events:none}
/* The backing is cut to the card itself (from the outer edge of its 3px top border, and its right edge), so it only hides the
   border under the icon; above and beside the card the icon stays transparent. Insets follow the icon's offsets (top -46px,
   right -10px) and the card's borders (3px top, 1px right). */
.j-ico::before{content:"";position:absolute;inset:0;background:var(--paper);-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;clip-path:inset(43px 9px 0 0)}
.j-ico img{position:relative;display:block;width:100%;height:100%;filter:drop-shadow(0 2px 3px rgba(15,26,31,.16))}
.j-ico-voyage::before{-webkit-mask-image:url(chapters/voyage-back.png?v=2026-10-26f);mask-image:url(chapters/voyage-back.png?v=2026-10-26f)}
.j-ico-details::before{-webkit-mask-image:url(chapters/details-back.png?v=2026-10-26f);mask-image:url(chapters/details-back.png?v=2026-10-26f)}
.j-ico-shift::before{-webkit-mask-image:url(chapters/shift-back.png?v=2026-10-26f);mask-image:url(chapters/shift-back.png?v=2026-10-26f)}
.j-ico-patterns::before{-webkit-mask-image:url(chapters/patterns-back.png?v=2026-10-26f);mask-image:url(chapters/patterns-back.png?v=2026-10-26f)}
.j-ico-map::before{-webkit-mask-image:url(chapters/map-back.png?v=2026-10-26f);mask-image:url(chapters/map-back.png?v=2026-10-26f)}
.j-ico-circle::before{-webkit-mask-image:url(chapters/circle-back.png?v=2026-10-26f);mask-image:url(chapters/circle-back.png?v=2026-10-26f)}
/* The full-circle and paradigm-shift icons are mostly dark line art; in dark mode a thin light halo keeps their dashes visible. */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) :is(.j-ico-circle,.j-ico-shift) img{filter:drop-shadow(0 0 1px #DDE6E3) drop-shadow(0 0 .6px #DDE6E3)}}
:root[data-theme="dark"] :is(.j-ico-circle,.j-ico-shift) img{filter:drop-shadow(0 0 1px #DDE6E3) drop-shadow(0 0 .6px #DDE6E3)}
.j-title{display:block;font:italic 600 1rem/1.25 Georgia,"Times New Roman",serif;color:var(--ink);text-wrap:balance}
.j-what{display:block;margin-top:4px;font-size:.8rem;line-height:1.35;color:var(--ink)}
.j-why{display:block;margin-top:6px;font-size:.75rem;line-height:1.4;color:var(--ink-2)}
.j-links{position:absolute;inset:0;z-index:1;width:100%;height:100%;overflow:visible;pointer-events:none;color:var(--ink-2)}
.j-links .j-arrow,.j-links .j-feed{fill:none;stroke:currentColor;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.j-links .j-feed{stroke-width:2.2;stroke-dasharray:1 7;opacity:.9}
.j-links .j-head{fill:currentColor;stroke:none}
.j-links .j-dots circle{fill:currentColor;stroke:var(--paper);stroke-width:2}
.j-together{position:absolute;z-index:2;transform:translate(-50%,-50%);padding:0 6px;background:var(--paper);font:500 .8rem/1.4 var(--sans);color:var(--ink-2);}

/* Study card: one card, placed beside the chapter on wide screens and under it when the chapters stack. */
.j-card{position:absolute;z-index:30;width:360px;max-width:calc(100vw - 32px);background:var(--paper);border:1px solid var(--line);border-radius:10px;box-shadow:0 18px 50px rgba(15,26,31,.22);overflow:hidden;opacity:0;visibility:hidden;transform:translateY(6px);transition:opacity .16s,transform .16s,visibility 0s .16s}
.j-card.on{opacity:1;visibility:visible;transform:none;transition:opacity .16s,transform .16s}
.j-card.inline{position:relative;width:auto;max-width:none;margin-top:10px;box-shadow:0 8px 24px rgba(15,26,31,.12)}
.jc-head{display:flex;gap:10px;align-items:flex-start;padding:12px 14px}
.jc-kick{margin:0;font:600 .8rem/1.3 var(--sans);color:var(--ink-2);}
.jc-title{margin:2px 0 0;font:italic 600 1.08rem/1.25 Georgia,"Times New Roman",serif;color:var(--ink)}
.jc-sub{margin:3px 0 0;font-size:.8rem;line-height:1.4;color:var(--ink-2)}
/* Study figures at the top of the card: one, or several side by side (chapter option figs), each sized by its own shape. */
.jc-figs{display:flex;gap:1px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--line)}
.jc-fig{display:block;flex:1 1 auto;min-width:0;background:#fff}
.jc-fig img{display:block;width:100%;height:130px;object-fit:contain;padding:6px}
.jc-figs .jc-fig:has(+ .jc-fig){flex:0 1 auto}
.jc-figs .jc-fig:has(+ .jc-fig) img{width:auto;max-width:100%}
.jc-fig:hover img{opacity:.85}
.j-card .paper-card{border:0;border-radius:0}
.jc-also,.jc-left{margin:0;padding:10px 14px;font-size:.8rem;line-height:1.45;color:var(--ink-2);border-top:1px dashed var(--line)}
.jc-left{padding-bottom:14px}
.jc-left b{color:var(--ink);font-weight:600}
.jc-body{padding:0 14px 14px}
.jc-body p{margin:0 0 10px;font-size:.85rem;line-height:1.5;color:var(--ink-2)}
.jc-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px;padding:0;list-style:none}
.jc-chips li{font-size:.72rem;padding:2px 7px;border:1px solid var(--line);border-radius:3px;color:var(--ink)}
.jc-more{font-size:.82rem}

@media(max-width:1100px){
  .journey{display:block;margin:52px 0 4px;padding-bottom:0}
  .j-lane,.j-links,.j-together{display:none}
  .journey .j-steps{display:block}
  .j-step{margin:0 0 56px}
  .j-step:not(:last-child)::after{content:"\2193";position:absolute;left:16px;bottom:-44px;font:700 1.35rem/1 var(--sans);color:var(--ink-2)}
  .j-q{display:inline-block;margin-left:9px;padding:2px 7px;border-radius:3px;background:var(--g);color:var(--gt);font-size:.8rem;font-weight:650;letter-spacing:normal;text-transform:none}
  .j-node:hover,.j-node[aria-expanded="true"]{transform:none}
  .j-ico{top:-44px;right:-2px}
  .j-top{min-height:0;margin:0}
  .j-ch{min-height:24px;margin-bottom:4px;padding-right:78px}
  .j-ico::before{clip-path:inset(41px 1px 0 0)}
}
@media(prefers-reduced-motion:reduce){.j-node,.j-card,.j-card.on{transition:none}.j-node:hover,.j-node[aria-expanded="true"]{transform:none}}

/* Enlarged study figure */
.study-figure-dialog{border:1px solid var(--line);border-radius:8px;padding:24px;width:min(1100px,calc(100% - 32px));max-width:1100px;max-height:94dvh;overflow:auto;background:var(--surface);color:var(--ink);box-shadow:0 24px 90px #0005}
.study-figure-dialog::backdrop{background:#10232bd9}
.figure-dialog-head{display:flex;align-items:flex-start;justify-content:space-between;gap:24px;padding:0 0 18px}
.figure-dialog-head h2{font-size:1.15rem;line-height:1.4;margin:0;max-width:80ch}
#figure-close{flex-shrink:0;width:36px;height:36px;border:1px solid var(--line);border-radius:50%;background:var(--surface);color:var(--ink);font-size:1.6rem;cursor:pointer;line-height:1}
.study-figure-dialog figure{margin:0}
#figure-image{display:block;width:100%;height:auto;max-height:66dvh;object-fit:contain;background:#fff;border-radius:3px}
#figure-caption{font-size:.84rem;color:var(--ink-2);margin-top:12px}
.figure-links{display:flex;flex-wrap:wrap;justify-content:space-between;gap:10px 24px;padding-top:16px;font-size:.82rem}
@media(max-width:680px){.study-figure-dialog{padding:16px}.figure-dialog-head h2{font-size:1rem}}

/* "Read the full chapter" at the foot of each study card */
.jc-read{display:block;padding:11px 14px 13px;border-top:1px solid var(--line);font:600 .84rem/1.3 var(--sans);text-decoration:none;color:var(--link)}
.jc-read:hover,.jc-read:focus-visible{background:var(--hover);text-decoration:underline}

/* The chapter reader: the whole chapter in a dialog, with its story, figures, findings, paper, links and posts.
   Built by chapterHTML() in irrigation.html; each chapter has the address #chapter-1 to #chapter-6. */
.chapter-reader{width:min(920px,calc(100% - 32px));max-width:920px;max-height:min(94dvh,1100px);padding:0;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);box-shadow:0 28px 90px #0006;overflow:auto;overscroll-behavior:contain}
.chapter-reader::backdrop{background:#10232bd0}
.cr-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:16px;padding:20px 24px 16px;border-top:5px solid var(--g);border-bottom:1px solid var(--line);background:var(--paper)}
.cr-head-text{flex:1;min-width:0}
.cr-kick{margin:0;font:650 .86rem/1.3 var(--sans);color:var(--ink-2);}
.cr-kick::before{content:"";display:inline-block;width:10px;height:10px;margin-right:7px;border-radius:2px;background:var(--g);vertical-align:-1px}
.cr-head h2{margin:4px 0 0;font:italic 600 clamp(1.35rem,3.2vw,1.85rem)/1.15 Georgia,"Times New Roman",serif;color:var(--ink);text-wrap:balance}
.cr-sub{margin:5px 0 0;font-size:.95rem;line-height:1.4;color:var(--ink-2)}
.cr-ico{flex:none;width:72px;height:72px;filter:drop-shadow(0 2px 3px rgba(15,26,31,.16))}
.cr-close{flex:none;align-self:flex-start;width:38px;height:38px;border:1px solid var(--line);border-radius:50%;background:var(--paper);color:var(--ink);font-size:1.6rem;line-height:1;cursor:pointer}
.cr-close:hover{background:var(--hover)}
.cr-body{padding:22px 24px 8px}
.cr-story{max-width:68ch}
.cr-story p{margin:0 0 14px;font-size:1.02rem;line-height:1.62;color:var(--ink)}
.cr-story p:first-child::first-letter{font:600 2.9em/0.9 Georgia,"Times New Roman",serif;float:left;margin:4px 8px 0 0;color:var(--g)}
.cr-body h3{margin:0 0 10px;font:650 .86rem/1.3 var(--sans);color:var(--ink-2);}
/* Figures: white mats so the paper figures read in both themes; a click enlarges one. */
.cr-fig{margin:0;display:flex;flex-direction:column;min-width:0}
.cr-fig > a{display:block;padding:8px;border:1px solid var(--line);border-radius:6px;background:#fff}
.cr-fig > a:hover{border-color:var(--ink-2)}
.cr-fig img{display:block;width:100%;height:auto;max-height:420px;object-fit:contain}
.cr-fig figcaption{margin-top:7px;font-size:.8rem;line-height:1.45;color:var(--ink-2)}
.cr-credit{font-style:italic}
.cr-wide{margin:8px 0 18px}
.cr-figs{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:18px;margin:8px 0 22px;align-items:start}
/* 2021 ↔ 2022 slider: the first year is drawn on top and clipped at the slider. */
.cmp{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:6px;background:#fff;touch-action:pan-y}
.cmp img{display:block;width:100%;height:auto;max-height:none}
.cmp .cmp-top{position:absolute;inset:0;height:100%;clip-path:inset(0 calc(100% - var(--pos)) 0 0)}
.cmp-bar{position:absolute;top:0;bottom:0;left:var(--pos);width:3px;margin-left:-1.5px;background:var(--ink);pointer-events:none}
.cmp-bar::after{content:"\2039\00a0\203A";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--ink);color:var(--paper);font:700 1rem/1 var(--sans)}
.cmp-tag{position:absolute;top:8px;padding:2px 8px;border-radius:3px;background:#172026d9;color:#fff;font:600 .78rem/1.5 var(--sans);pointer-events:none}
.cmp-a{left:8px}.cmp-b{right:8px}
.cmp input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:ew-resize}
.cmp:has(input:focus-visible){outline:3px solid var(--link);outline-offset:2px}
.cr-found{margin:0 0 20px;padding:16px 18px;border-left:4px solid var(--g);border-radius:0 8px 8px 0;background:var(--hover)}
.cr-found ul{margin:0;padding-left:1.15em}
.cr-found li{margin:0 0 6px;font-size:.92rem;line-height:1.5}
.cr-found li:last-child{margin-bottom:0}
.cr-paper{margin:0 0 18px}
.cr-also{display:grid;grid-template-columns:minmax(0,220px) 1fr;gap:6px 18px;align-items:start;margin:0 0 18px;padding-top:16px;border-top:1px dashed var(--line)}
.cr-also h3{grid-column:1/-1;margin:0}
.cr-also p{margin:0;font-size:.9rem;line-height:1.5;color:var(--ink-2)}
.cr-side figcaption{display:none}
.cr-chips{margin-top:4px}
.cr-left{margin:0 0 16px;padding:12px 0 0;border-top:1px dashed var(--line);font-size:.95rem;line-height:1.5;color:var(--ink-2)}
.cr-left b{color:var(--ink)}
.cr-links{display:flex;flex-wrap:wrap;gap:8px 20px;margin:0 0 18px;font-size:.9rem}
.cr-posts-box{margin:4px 0 18px}
.cr-posts{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:12px;margin:0;padding:0;list-style:none}
.cr-post{display:flex;flex-direction:column;gap:6px;height:100%;padding:12px 14px;border:1px solid var(--line);border-radius:8px;color:var(--ink);text-decoration:none}
.cr-post:hover{border-color:var(--ink-2);background:var(--hover)}
.cr-post-who{font-size:.85rem}
.cr-post-who span{color:var(--ink-2)}
.cr-post-text{font-size:.88rem;line-height:1.45}
.cr-post-go{margin-top:auto;font-size:.8rem;color:var(--link)}
.cr-nav{position:sticky;bottom:0;display:flex;justify-content:space-between;gap:12px;padding:12px 24px;border-top:1px solid var(--line);background:var(--paper)}
.cr-go{display:flex;flex-direction:column;gap:2px;max-width:48%;padding:8px 12px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font:inherit;text-align:left;cursor:pointer}
.cr-go:hover{border-color:var(--ink-2);background:var(--hover)}
.cr-next{margin-left:auto;text-align:right}
.cr-go-k{font:650 .86rem/1.3 var(--sans);color:var(--ink-2);}
.cr-go-t{font:italic 600 .95rem/1.25 Georgia,"Times New Roman",serif}
@media (max-width:680px){
  .chapter-reader{width:100%;max-width:none;height:100dvh;max-height:none;margin:0;border:0;border-radius:0}
  .cr-head{padding:14px 16px 12px;gap:12px}
  .cr-ico{width:52px;height:52px}
  .cr-body{padding:16px 16px 4px}
  .cr-story p{font-size:.98rem}
  .cr-also{grid-template-columns:1fr}
  .cr-nav{padding:10px 16px}
  .cr-go-t{font-size:.85rem}
}
/* The page's sections are spaced with padding-top; the reader's own sections are not. */
.chapter-reader section{padding-top:0}
.chapter-reader .cr-found{padding:16px 18px}
.chapter-reader .cr-also{padding-top:16px}
.cr-inner{display:flex;flex-direction:column;min-height:100%}
.cr-body{flex:1 0 auto}
