/* The year map: one painted island, with the same weeks as a plain list beside it. See assets/js/yearmap.js. */
.yw { --yw-ink: #1d2a31; position: relative; margin: 0; }
.yw-lists { padding: 18px clamp(14px, 3vw, 28px) 30px; }
.yw-list[hidden] { display: none; }
.yw-set-h { margin: 22px 0 6px; font: 800 26px/1.2 var(--font-title); }
.yw-unit { margin-top: 22px; }
.yw-unit h3 { margin: 0 0 10px; font: 700 21px/1.25 var(--font-kid); }
.yw-unit h3 small { display: block; font: 800 12.5px/1.3 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; color: var(--unit-ink); }
.yw-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.yw-row { display: flex; align-items: flex-start; gap: 12px; }
.yw-n { flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-top: 4px; border-radius: 50%; background: var(--unit-l); color: var(--unit-ink); font: 800 16px/1 var(--font-ui); }
.yw-row.is-done .yw-n { background: var(--good); color: #fff; }
.yw-row.is-now .yw-n { background: var(--unit-ink); color: #fff; box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--unit-ink); }
.yw-links { flex: 1 1 auto; min-width: 0; display: grid; gap: 6px; }
@media (min-width: 760px) { .yw-links { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } }
.yw-link { display: grid; align-content: center; gap: 1px; min-height: 52px; padding: 7px 14px; border-radius: 12px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink); text-decoration: none; }
.yw-link:hover { border-color: var(--unit); }
.yw-link small { font: 700 12.5px/1.3 var(--font-ui); color: var(--ink-2); }
.yw-link b { font: 600 16px/1.3 var(--font-kid); }
.yw-link.is-done b::after { content: " ✓"; color: var(--good); }

/* ---------- the map ---------- */
.yw-stage { position: relative; }
.yw-view { position: relative; overflow: hidden; overflow: clip; background: #557f8c; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; outline-offset: -3px; }
.yw-view.is-drag { cursor: grabbing; }
.yw-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.yw-base, .yw-tiles img { position: absolute; left: 0; top: 0; display: block; max-width: none; pointer-events: none; image-rendering: pixelated; }
/* The base picture stops a little past the island; its edges fade into the map's sea colour. */
.yw-base {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(to right, transparent, #000 5%, #000 95%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
.yw-hit { position: absolute; left: 0; top: 0; overflow: visible; }
.yw-place { fill: transparent; pointer-events: all; cursor: pointer; }
/* A rest week: moss over the painted stone, no number and no link. */
.yw-rest { position: absolute; width: 70px; height: 36px; margin: -18px 0 0 -35px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(96, 120, 70, .92) 62%, rgba(96, 120, 70, .55) 82%, transparent); }
.yw-pins { position: absolute; inset: 0; pointer-events: none; }
.yw-stone, .yw-tag, .yw-here { position: absolute; left: 0; top: 0; }
.yw-stone {
  width: 44px; height: 44px; margin: -22px 0 0 -22px; display: grid; place-items: center; border-radius: 50%; text-decoration: none; color: var(--ink);
  pointer-events: auto; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.yw-stone span {
  min-width: 26px; height: 21px; padding: 0 5px; border-radius: 999px; display: flex; align-items: center; justify-content: center; white-space: nowrap;
  background: rgba(255, 253, 248, .92); box-shadow: 0 0 0 1.5px rgba(29, 42, 49, .6), 0 1px 3px rgba(29, 42, 49, .3); font: 800 13px/1 var(--font-ui);
}
.yw-stone.is-half span { background: #f6e3ae; }
.yw-stone.is-done span { background: #e9b949; box-shadow: 0 0 0 1.5px #7a5410, 0 1px 3px rgba(29, 42, 49, .3); color: #3a2a07; }
.yw-stone.is-now span { background: #fff; box-shadow: 0 0 0 3px var(--yw-ink); font-size: 15px; height: 25px; min-width: 32px; }
.yw-stone.is-now::before {
  content: ""; position: absolute; inset: 2px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255, 255, 255, .9); animation: yw-pulse 2.4s ease-out infinite;
}
.yw-stone.is-unit span { box-shadow: 0 0 0 3px #fffdf8, 0 0 0 5px var(--yw-ink); }
@keyframes yw-pulse { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .yw-stone.is-now::before { animation: none; opacity: 0; } }
.yw.is-calm .yw-stone.is-now::before, .yw.is-away .yw-stone.is-now::before { animation: none; opacity: 0; }
@media (hover: hover) { .yw-stone:hover span { box-shadow: 0 0 0 3px #fffdf8, 0 0 0 5px var(--yw-ink); } }
.yw-stone:focus-visible { outline: none; }
.yw-stone:focus-visible span { box-shadow: 0 0 0 3px #fffdf8, 0 0 0 6px var(--focus); }
.yw-here { z-index: 3; margin-top: -30px; transform-origin: 0 0; padding: 4px 9px; border-radius: 999px; background: var(--yw-ink); color: #fff; font: 700 12.5px/1.2 var(--font-ui); white-space: nowrap; pointer-events: none; translate: -50% -100%; }
.yw-here.is-below { margin-top: 28px; translate: -50% 0; }
/* Zoomed out past the point where stones are 46 px apart: they become dots, and a tap on the map zooms in. */
.yw.is-small .yw-stone { pointer-events: none; }
.yw.is-small .yw-stone span { min-width: 12px; width: 12px; height: 12px; padding: 0; font-size: 0; }
.yw.is-small .yw-stone.is-now span { width: 18px; height: 18px; }
.yw-tag { z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; pointer-events: auto; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.yw-tag span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fffdf8; background: var(--unit-ink); color: #fff; box-shadow: 0 2px 0 rgba(29, 42, 49, .45), 0 3px 8px rgba(29, 42, 49, .25); }
.yw-tag .ico { width: 20px; height: 20px; }
.yw-tag:hover span, .yw-tag[aria-expanded="true"] span { box-shadow: 0 0 0 3px #fffdf8, 0 3px 8px rgba(29, 42, 49, .3); }
.yw-tag:focus-visible { outline: none; }
.yw-tag:focus-visible span { box-shadow: 0 0 0 3px var(--yw-ink); }
.yw-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; padding: 8px 14px; border-radius: 999px; background: rgba(255, 253, 248, .95); box-shadow: 0 1px 0 rgba(29, 42, 49, .3), 0 4px 12px rgba(29, 42, 49, .18); font: 600 14px/1.2 var(--font-ui); white-space: nowrap; pointer-events: none; }
.yw-hint[hidden] { display: none; }

/* ---------- This week ---------- */
.yw-now { display: grid; gap: 8px; padding: 12px 14px 14px; background: var(--paper); }
.yw-now[hidden] { display: none; }
.yw-now-eye { margin: 0; font: 800 12.5px/1.2 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; color: var(--unit-ink); }
.yw-now-t { margin: 0; font: 700 21px/1.2 var(--font-kid); }
.yw-now-go { display: grid; gap: 8px; }
.yw-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 7px 14px; border-radius: 14px; background: var(--unit-ink); color: #fff; text-decoration: none; font: 700 15.5px/1.2 var(--font-kid); }
.yw-go:hover { filter: brightness(1.12); }
.yw-go small { display: block; font: 600 12.5px/1.3 var(--font-ui); opacity: .88; }
.yw-go .ico { flex: none; width: 22px; height: 22px; }
.yw-go.is-done { background: var(--good-l); color: var(--good); }
.yw-go.is-done small { opacity: 1; }
.yw-who button { flex: 1 1 auto; min-width: 44px; min-height: 44px; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; border-radius: 12px; border: 2px solid var(--rule); background: var(--paper); color: var(--ink); font: 700 14.5px/1 var(--font-ui); cursor: pointer; }
.yw-who button[aria-pressed="true"] { border-color: var(--unit-ink); background: var(--unit-ink); color: #fff; }

/* ---------- the few controls: whose year, zoom, island or list ---------- */
.yw-bar { position: absolute; z-index: 5; right: 14px; bottom: 14px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; pointer-events: none; }
.yw-bar > * { pointer-events: auto; }
.yw-pill { display: inline-flex; align-items: center; border-radius: 14px; background: rgba(255, 253, 248, .95); box-shadow: 0 1px 0 rgba(29, 42, 49, .3), 0 4px 12px rgba(29, 42, 49, .18); font: 700 14px/1 var(--font-ui); color: var(--ink); }
.yw-pill button, .yw-pill a { min-width: 44px; min-height: 44px; padding: 0 12px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 14px; text-decoration: none; }
.yw-pill button[aria-pressed="true"] { background: var(--yw-ink); color: #fff; }
.yw-zoom button { padding: 0; }
.yw-zoom .ico { width: 20px; height: 20px; }
.yw-who { position: absolute; z-index: 5; right: 14px; top: 14px; }
.yw-who[hidden] { display: none; }
.yw-who button { max-width: 120px; display: block; line-height: 44px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* The week card is a strip above the map, or floats beside the island on wide screens (is-side). */
@media (min-width: 760px) {
  .yw-now:not([hidden]) { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 18px; }
  .yw-now-eye, .yw-now-t { grid-column: 1; }
  .yw-now-go { grid-column: 2; grid-row: 1 / span 2; grid-auto-flow: column; grid-auto-columns: minmax(0, 340px); }
}
.yw.is-side .yw-now { position: absolute; z-index: 5; left: 16px; top: 16px; width: 300px; display: grid; grid-template-columns: none; border-radius: 18px; box-shadow: 0 2px 0 rgba(29, 42, 49, .25), 0 10px 26px rgba(29, 42, 49, .22); }
.yw.is-side .yw-now-eye, .yw.is-side .yw-now-t, .yw.is-side .yw-now-go { grid-column: auto; grid-row: auto; }
.yw.is-side .yw-now-go { grid-auto-flow: row; }
.yw.is-list .yw-stage > .yw-view, .yw.is-list .yw-zoom { display: none; }
.yw.is-list .yw-stage { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px clamp(14px, 3vw, 28px) 0; }
.yw.is-list .yw-who, .yw.is-list .yw-bar { position: static; }
.yw.is-list .yw-now { position: static; width: auto; margin: 14px clamp(14px, 3vw, 28px) 0; border: 2px solid var(--rule); box-shadow: none; border-radius: 18px; }
.yw.is-list .yw-lists { padding-top: 0; }
.yw.is-list .yw-set-h { margin-top: 0; }
.yw.is-map .yw-lists { display: none; }
/* The island pans when it is wider than the screen, so nothing floats over it. */
.yw-swipe { display: none; margin: 8px 14px 0; font: 600 14px/1.3 var(--font-ui); color: var(--ink-2); text-align: center; }
.yw.is-map.is-pan .yw-stage { display: flex; flex-direction: column; }
.yw.is-map.is-pan .yw-view { flex: none; }
.yw.is-map.is-pan .yw-swipe:not([hidden]) { display: block; order: -1; margin-bottom: 8px; }
.yw.is-map.is-pan .yw-who { position: static; order: -3; align-self: flex-end; margin: 8px 14px 0; }
.yw.is-map.is-pan .yw-bar { position: static; order: -2; padding: 8px 14px; justify-content: space-between; }

/* ---------- a place's weeks ---------- */
.yw-sheet { position: absolute; z-index: 6; top: 16px; right: 16px; max-height: calc(100% - 32px); width: min(360px, calc(100% - 32px)); display: flex; flex-direction: column; border-radius: 18px; background: var(--paper); box-shadow: 0 2px 0 rgba(29, 42, 49, .25), 0 14px 34px rgba(29, 42, 49, .28); overflow: hidden; }
.yw-sheet.on-left { right: auto; left: 16px; }
.yw-sheet[hidden] { display: none; }
.yw-sheet-h { display: flex; align-items: flex-start; gap: 8px; padding: 14px 8px 8px 16px; border-bottom: 2px solid var(--rule); }
.yw-sheet-h div { flex: 1 1 auto; min-width: 0; }
.yw-sheet-h small { display: block; font: 800 12.5px/1.3 var(--font-ui); letter-spacing: .07em; text-transform: uppercase; color: var(--unit-ink); }
.yw-sheet-h h3 { margin: 2px 0 0; font: 700 20px/1.2 var(--font-kid); }
.yw-sheet-x { flex: none; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: 700 22px/1 var(--font-ui); cursor: pointer; }
.yw-sheet-x:hover { background: var(--warm); }
.yw-sheet ol { list-style: none; margin: 0; padding: 8px; display: grid; gap: 4px; overflow-y: auto; }
.yw-sheet li a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 8px; border-radius: 12px; color: var(--ink); text-decoration: none; font: 600 15.5px/1.25 var(--font-kid); }
.yw-sheet li a:hover { background: var(--warm); }
.yw-sheet li a > i { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--unit-l); color: var(--unit-ink); font: 800 14px/1 var(--font-ui); font-style: normal; }
.yw-sheet li.is-done a > i { background: var(--good); color: #fff; }
.yw-sheet li.is-now a > i { background: var(--unit-ink); color: #fff; }
.yw-sheet li small { display: block; font: 600 12.5px/1.3 var(--font-ui); color: var(--ink-2); }
.yw-sheet-more { display: block; padding: 10px 16px 14px; font: 600 14.5px/1.3 var(--font-ui); color: var(--unit-ink); }
/* When the island pans, its controls sit above the map; the panel opens below them so Island/List stays visible. */
@media (min-width: 760px) {
  .yw.is-pan .yw-sheet { top: calc(var(--yw-top, 0px) + 16px); max-height: calc(100% - var(--yw-top, 0px) - 32px); }
}
@media (max-width: 759px) {
  .yw-sheet { position: fixed; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 72dvh; border-radius: 20px 20px 0 0; }
  .yw-sheet.on-left { left: 0; right: 0; }
}

/* ---------- on the hubs: the world is the one picture on the page ---------- */
.yw-head { padding-top: 16px; padding-bottom: 10px; }
.yw-head h2 { margin: 0; }
html[data-grades] .page-home .lb-art, html[data-grades] .page-home .hero-hills { display: none; }
html[data-grades] .page-home .lb { grid-template-columns: minmax(0, 1fr) auto; }
.page-home .yw { display: none; }
html[data-grades] .page-home .yw { display: block; }
html[data-grades] .page-home .yw-whole { display: none; }
.yw-whole { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 600 16px/1.3 var(--font-ui); color: var(--unit-ink); }
.yw-whole .ico { width: 22px; height: 22px; }
.gr-hero.yw-small, .ky-head.yw-small { padding-bottom: 8px; }
.k-main:has(> .ky-head.yw-small) { padding-bottom: 8px; }
.gr-hero.yw-small .hero-grid { display: block; }
.gr-hero.yw-small h1 { margin-bottom: 14px; }
.gr-hero.yw-small .lede { margin: 0; }
