/* Painted route · Luxe (core/events/010) — INV-05 v2.2 · Luxe (A1754, D-113): ev005 with its watercolour paint drawn by
   section.js on a small 2D canvas over each picture (.ev010__wc), so it starts the moment the heart arrives, however fast
   the guest scrolls (the engine's WebGL layer waited for the scroll to stop). Text wraps with text-wrap: pretty.
   Below: ev005's header. Painted route (core/events/005) — INV-05 v2 "Signature" (A1338, D-034); a fork of core/events/004 "Painted day".
   The zigzag (picture | fine rule | text, sides alternating) now lies on a pale sage watercolour sheet with torn top
   and bottom edges (the sheet slides over the held countdown). A dashed ink route joins the pictures one by one: pure
   CSS geometry (three pieces per gap) wiped by transform with --ev010-p, so no-JS, reduced motion and lite show the
   whole route. A small ink heart rides the tip, and each picture appears (or is painted in, live) when it arrives.
   Painted watercolour never moves (ruling A). A tied sprig lies across the sheet's bottom torn edge. */
.ev010 {
  --ev010-gy: 72px; --ev010-r: 18px; --ev010-bw: 1.6px; --ev010-eh: 34px; --ev010-tie-w: 240px; --ev010-pad: 6px;
  --ev010-tie-h: calc(var(--ev010-tie-w) * .8119); --ev010-tail: calc(var(--ev010-tie-h) / 2 + 24px);
  position: relative; z-index: 2; padding: var(--k-section-pad) var(--k-gutter);
  /* room above the torn edge for the tie's upper half too, so the sprig never covers the last event, even in the
     scrub's start pose (A1338, theme_contract §100: ≥ 24 px from the last buttons and text at rest and at the start) */
  padding-bottom: calc(max(var(--k-section-pad), var(--ev010-tie-h) / 2 + 40px) + var(--ev010-tail));
  background: var(--k-light-ground); color: var(--k-ink); touch-action: pan-y;
}
.ev010__head { position: relative; z-index: 1; text-align: center; }
.ev010__kicker { margin-bottom: var(--k-s-3); }
.ev010__track { position: relative; z-index: 1; max-width: 100%; margin: 48px auto 0; }
.ev010__list { position: relative; display: grid; gap: var(--ev010-gy); }

/* the sheet: static paper (the shadow follows the torn shape: the filter sits on this unmasked parent only) */
.ev010__paper { position: absolute; top: -24px; bottom: var(--ev010-tail); left: 0; right: 0; z-index: 0; pointer-events: none; filter: drop-shadow(0 6px 10px rgb(74 63 53 / .16)) drop-shadow(0 -5px 12px rgb(74 63 53 / .10)); } /* the second shadow falls UP onto the countdown the sheet slides over (A1338: replaces cd002's flat dimming overlay) */
.ev010__sheet {
  position: absolute; inset: 0;
  background: var(--k-grain), url("assets/wash.webp") center / 100% 100% no-repeat, var(--k-card);
  background-blend-mode: normal, multiply, normal;
  -webkit-mask: url("assets/edge-top.webp") left top / auto var(--ev010-eh) repeat-x, linear-gradient(#000, #000) center / 100% calc(100% - 2 * var(--ev010-eh) + 2px) no-repeat, url("assets/edge-bot.webp") left bottom / auto var(--ev010-eh) repeat-x;
  -webkit-mask-composite: source-over;
  mask: url("assets/edge-top.webp") left top / auto var(--ev010-eh) repeat-x, linear-gradient(#000, #000) center / 100% calc(100% - 2 * var(--ev010-eh) + 2px) no-repeat, url("assets/edge-bot.webp") left bottom / auto var(--ev010-eh) repeat-x;
  mask-composite: add;
}

/* one event: odd = picture | rule | text, even = text | rule | picture (right-aligned) */
.ev010-item {
  --ev010-icon: clamp(112px, 36vw, 150px); --ev010-gap: 36px;
  position: relative; display: grid; align-items: center; column-gap: 8px;
  grid-template-columns: var(--ev010-icon) var(--ev010-gap) minmax(0, 1fr); grid-template-areas: "icon rule text";
}
.ev010-item:nth-child(even) { grid-template-columns: minmax(0, 1fr) var(--ev010-gap) var(--ev010-icon); grid-template-areas: "text rule icon"; text-align: right; }
.ev010__icon { position: relative; z-index: 1; grid-area: icon; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; }
.ev010__rule { grid-area: rule; display: block; height: 1px; background: var(--k-line); transform-origin: 0 50%; }
.ev010-item:nth-child(even) .ev010__rule { transform-origin: 100% 50%; }
.ev010__text { grid-area: text; justify-self: start; position: relative; min-width: 0; max-width: 100%; overflow-wrap: break-word; }
.ev010-item:nth-child(even) .ev010__text { justify-self: end; }

/* the route: per gap, a1 (down from the picture) + a2 (elbow, then the run across) in the upper item, b (elbow, then
   down to the next picture's top) in the lower one. Odd items are drawn here; even items mirror them below. */
.ev010-item:first-child .ev010__seg--b, .ev010-item:last-child .ev010__seg--a1, .ev010-item:last-child .ev010__seg--a2 { display: none; }
.ev010__seg { position: absolute; z-index: 0; overflow: hidden; pointer-events: none; --ev010-p: 1; opacity: .85; }
.ev010__seg > i { position: absolute; inset: 0; display: block; box-sizing: border-box; border: 0 dashed var(--c-secondary-dark); }
.ev010__seg--a1 { left: calc(var(--ev010-icon) / 2 - var(--ev010-bw) / 2); top: calc(50% + var(--ev010-icon) / 2 + var(--ev010-pad)); width: var(--ev010-bw); height: calc(50% - var(--ev010-icon) / 2 - var(--ev010-pad) + var(--ev010-gy) / 2 - var(--ev010-r)); }
.ev010__seg--a1 > i { border-left-width: var(--ev010-bw); }
.ev010__seg--a2 { left: calc(var(--ev010-icon) / 2 - var(--ev010-bw) / 2); top: calc(100% + var(--ev010-gy) / 2 - var(--ev010-r)); width: calc(100% - var(--ev010-icon) - var(--ev010-r) + var(--ev010-bw)); height: calc(var(--ev010-r) + var(--ev010-bw) / 2); }
.ev010__seg--a2 > i { border-left-width: var(--ev010-bw); border-bottom-width: var(--ev010-bw); border-bottom-left-radius: var(--ev010-r); }
.ev010__seg--b { left: calc(var(--ev010-icon) / 2 - var(--ev010-bw) / 2); top: calc(var(--ev010-gy) / -2 - var(--ev010-bw) / 2); width: var(--ev010-r); height: calc(var(--ev010-gy) / 2 + var(--ev010-bw) / 2 + 50% - var(--ev010-icon) / 2 - var(--ev010-pad)); }
.ev010__seg--b > i { border-top-width: var(--ev010-bw); border-left-width: var(--ev010-bw); border-top-left-radius: var(--ev010-r); }
.ev010-item:nth-child(even) .ev010__seg--a1, .ev010-item:nth-child(even) .ev010__seg--a2, .ev010-item:nth-child(even) .ev010__seg--b { left: auto; right: calc(var(--ev010-icon) / 2 - var(--ev010-bw) / 2); }
.ev010-item:nth-child(even) .ev010__seg--a1 > i { border-left-width: 0; border-right-width: var(--ev010-bw); }
.ev010-item:nth-child(even) .ev010__seg--a2 > i { border-left-width: 0; border-bottom-left-radius: 0; border-right-width: var(--ev010-bw); border-bottom-right-radius: var(--ev010-r); }
.ev010-item:nth-child(even) .ev010__seg--b > i { border-left-width: 0; border-top-left-radius: 0; border-right-width: var(--ev010-bw); border-top-right-radius: var(--ev010-r); }
/* the wipe (transform only): the box slides off its own line while the line inside holds still; p = 1 is the rest.
   The extra 3px puts an undrawn line clear of the clip edge, so no dash tip survives pixel snapping (A1338). */
.ev010__seg--a1, .ev010__seg--b { transform: translateY(calc((var(--ev010-p) - 1) * (100% + 3px))); }
.ev010__seg--a1 > i, .ev010__seg--b > i { transform: translateY(calc((1 - var(--ev010-p)) * (100% + 3px))); }
.ev010__seg--a2 { transform: translateX(calc((var(--ev010-p) - 1) * (100% + 3px))); }
.ev010__seg--a2 > i { transform: translateX(calc((1 - var(--ev010-p)) * (100% + 3px))); }
.ev010-item:nth-child(even) .ev010__seg--a2 { transform: translateX(calc((1 - var(--ev010-p)) * (100% + 3px))); }
.ev010-item:nth-child(even) .ev010__seg--a2 > i { transform: translateX(calc((var(--ev010-p) - 1) * (100% + 3px))); }

/* the small ink heart riding the route's tip: only while section.js drives the route */
.ev010__traveller { position: absolute; left: 0; top: 0; z-index: 2; width: 16px; height: 16px; margin: -8px 0 0 -8px; fill: var(--c-primary); stroke: none; opacity: 0; pointer-events: none; display: none; }
.ev010.has-route .ev010__traveller { display: block; }

.ev010__name { font: 400 1.32rem/1.2 var(--k-font-display); color: var(--k-ink); }
.ev010__name { text-wrap: balance; }
.ev010__venue, .ev010__fact, .ev010__day { text-wrap: pretty; }
.ev010__time { margin-top: 6px; font: 500 .72rem/1.4 var(--k-font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--c-primary); }
.ev010__day { margin-top: 2px; font: 500 .8rem/1.45 var(--k-font-body); color: var(--k-ink-soft); }
.ev010__venue { margin-top: 6px; font: 500 .84rem/1.45 var(--k-font-body); color: var(--k-ink-soft); }
.ev010__fact { margin-top: 4px; font: 400 .8rem/1.45 var(--k-font-body); color: var(--k-ink-soft); }

/* compact buttons: 44 px tall, wrapping cleanly in the narrow column */
.ev010__links { display: flex; flex-wrap: wrap; gap: 6px; max-width: 320px; margin-top: 12px; }
.ev010-item:nth-child(even) .ev010__links { justify-content: flex-end; margin-left: auto; }
.ev010__btn, .ev010 .kjy-cal { flex: 1 1 auto; }
.ev010__btn, .ev010 .kjy-cal__toggle { min-height: 44px; padding: 0 10px; font-size: .68rem; letter-spacing: .1em; white-space: nowrap; }
.ev010 .kjy-cal { max-width: 100%; }
.ev010 .kjy-cal__toggle { width: 100%; }
.ev010 .kjy-cal[open] { flex-basis: 100%; }
.ev010 .kjy-cal__toggle { list-style: none; }
.ev010 .kjy-cal__toggle::-webkit-details-marker { display: none; }
.ev010 .kjy-cal__menu { display: grid; margin-top: 8px; text-align: left; background: var(--k-card); box-shadow: 0 0 0 1px rgb(var(--c-secondary-rgb) / .35), 4px 10px 24px rgb(74 63 53 / .12); }
.ev010 .kjy-cal__opt { padding: 12px 14px; font: 500 .9rem/1.3 var(--k-font-body); color: var(--c-primary); text-decoration: none; }
.ev010 .kjy-cal__opt + .kjy-cal__opt { border-top: 1px solid rgb(var(--c-secondary-rgb) / .25); }

/* small hand-drawn hearts at the text's outer top corner; every third one rests */
.ev010__heart { position: absolute; top: -22px; right: 0; width: 16px; height: 16px; fill: none; stroke: var(--c-secondary); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; transform: rotate(-12deg); }
.ev010-item:nth-child(even) .ev010__heart { right: auto; left: 0; transform: rotate(10deg); }
.ev010-item:nth-child(3n) .ev010__heart { display: none; }

/* the separator: a eucalyptus and gypsophila sprig tied with sage ribbon, laid across the sheet's bottom torn edge,
   inside this section's own box (theme_contract §100, D-034). Rest = the scrub's end state. */
.ev010__tie { position: absolute; z-index: 3; left: 50%; width: var(--ev010-tie-w); height: var(--ev010-tie-h); margin-left: calc(var(--ev010-tie-w) / -2); bottom: calc(var(--ev010-tail) - var(--ev010-tie-h) / 2); pointer-events: none; }
.ev010__tie-img, .ev010__tie-shadow { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.ev010__tie-img { transform: rotate(-4deg); }
.ev010__tie-shadow { transform: translate(3px, 5px) rotate(-4deg); opacity: .8; }

/* reveal: opacity only (ruling A). A picture shows once the route's heart reaches it (.is-reached, never removed);
   hidden only once section.js has added .is-anim. The text and the fine rule still arrive with .is-in, as v1. */
.ev010.is-anim .ev010__icon { transition: opacity 1.1s ease; }
html.kjy-fx .ev010.is-anim .ev010-item:not(.is-reached) .ev010__icon { opacity: 0; }
/* the painter (section.js, .is-wc): a picture stays hidden until its paint has dried (.is-painted), then the DOM picture
   shows in the same frame the canvas goes. Scoped to .is-wc, which section.js adds only once the painter is armed, so
   no-JS, reduced motion and a failed painter still show every reached picture through the fade above (AG-T038). */
html .ev010.is-wc .ev010-item:not(.is-painted) .ev010__icon { opacity: 0; transform: none; transition: none; }
html .ev010.is-wc .ev010-item.is-painted .ev010__icon { opacity: 1; transform: none; transition: none; }
/* the canvas sits in the picture's own grid cell, the same square, above it; it never takes a click */
/* the painter gave up on one picture (it was not ready 0.8 s after the heart arrived): that picture fades in as before */
html .ev010.is-wc .ev010-item.is-plain .ev010__icon { opacity: 1; transition: opacity 1.1s ease; }
.ev010__wc { position: relative; z-index: 2; grid-area: icon; display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; pointer-events: none; }

@media (min-width: 768px) {
  .ev010 { --ev010-gy: 80px; --ev010-r: 24px; --ev010-bw: 2px; --ev010-tie-w: 360px; }
  .ev010__paper { left: max(var(--k-gutter), calc((100% - 1040px) / 2)); right: max(var(--k-gutter), calc((100% - 1040px) / 2)); }
  .ev010__track { max-width: 720px; margin-top: 64px; }
  .ev010-item { --ev010-icon: 180px; --ev010-gap: 56px; column-gap: 12px; }
  .ev010__name { font-size: 1.5rem; }
  .ev010__heart { top: -24px; }
}
@media (min-width: 1200px) {
  .ev010 { --ev010-gy: 104px; --ev010-tie-w: 440px; }
  .ev010__track { max-width: 880px; }
  .ev010-item { --ev010-icon: 200px; --ev010-gap: 72px; }
}
