/* Oh Canada (25 Oct 2026): a map of Canada and its provinces on maple red, a pin at each Canadian brand's home town and a star
   on the store; choosing a pin shows its maker. Mobile first; tokens, .rail, .h2, .lede and data-reveal from main.css. */

.mapca { position: relative; overflow: hidden; isolation: isolate; color: #fff; padding: var(--pad) 0; background: radial-gradient(circle at 88% 0%, rgba(255, 255, 255, .18), transparent 38%), radial-gradient(circle at 0% 100%, rgba(0, 0, 0, .28), transparent 50%), linear-gradient(135deg, #cf3624 0%, #a51f15 52%, #77130c 100%); }
.mapca__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.mapca__head { display: grid; justify-items: center; text-align: center; }
.mapca .h2 { text-shadow: 0 4px 24px rgba(0, 0, 0, .2); }
.mapca .lede { color: #fff; }

/* The map runs edge to edge on a phone. The canvas is the container: pins, labels and lines scale with it. */
.mapca__map { margin: 0 calc(var(--gut) * -1); padding-bottom: 34px; }
.mapca__canvas { position: relative; container: mapca / inline-size; }
.mapca__svg, .mapca__leads { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.mapca__grat { stroke-width: 1; vector-effect: non-scaling-stroke; }
.mapca__near { fill-opacity: .1; }
.mapca__land { filter: drop-shadow(0 10px 14px rgba(60, 0, 0, .42)); }
.mapca__prov { stroke: #b02a1c; stroke-width: .8; vector-effect: non-scaling-stroke; transition: fill var(--base); }
.mapca__prov--t0 { fill: #fffaf0; }
.mapca__prov--t1 { fill: #f8f0de; }
.mapca__prov--t2 { fill: #f2e7cd; }
.mapca__prov--t3 { fill: #ebdec0; }
.mapca__canvas::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 40% 38% at 40% 40%, rgba(255, 255, 255, .13), transparent); } /* a sheen, as on a printed wall map, fading out inside the frame */

/* Pins: a teardrop standing on its point at the town; the chosen one turns gold */
.mapca__pins { position: absolute; inset: 0; z-index: 2; list-style: none; margin: 0; padding: 0; }
.mapca__spot { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; --pin: 15px; }
.mapca__spot:has(.is-on) { z-index: 3; }
.mapca__pin { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.mapca__pin:focus-visible { outline: none; }
.mapca__drop { position: absolute; left: 0; top: calc(var(--pin) * -1); width: var(--pin); height: var(--pin); border-radius: 50% 50% 50% 0; background: linear-gradient(135deg, #3b6c52, #1f3a2b); box-shadow: inset 0 0 0 calc(var(--pin) * .2) #fffaf0, 0 5px 10px -3px rgba(40, 0, 0, .6); transform-origin: 0 100%; transform: rotate(-45deg); transition: transform var(--base) var(--ease); }
.mapca__drop::before { content: ""; position: absolute; inset: -9px; } /* a larger target than the drawing */
.mapca__pin:hover .mapca__drop { transform: rotate(-45deg) scale(1.15); }
.mapca__pin.is-on .mapca__drop { background: linear-gradient(135deg, #ffe08a, #ffb020); transform: rotate(-45deg) scale(1.4); }
.mapca__pin.is-on .mapca__drop::after { content: ""; position: absolute; left: 50%; top: 50%; width: 260%; height: 260%; margin: -130% 0 0 -130%; border-radius: 50%; border: 2px solid rgba(255, 224, 138, .85); animation: mapca-ring 3.2s ease-out infinite; }
@keyframes mapca-ring { 0% { transform: scale(.35); opacity: 1; } 70%, 100% { transform: scale(1.2); opacity: 0; } }
.mapca__pin:focus-visible .mapca__drop, .mapca__pin:focus-visible .mapca__tag { outline: 3px solid var(--glo-focus); outline-offset: 2px; }

/* Labels: on a narrow map only the chosen pin's, just above its head (clear of a neighbour at the same height); on a wide map
   every pin's, placed by map.php */
.mapca__tag { position: absolute; z-index: 2; bottom: calc(var(--pin) * 1.5); display: none; justify-items: center; align-content: center; white-space: nowrap; padding: 5px 9px 6px; border-radius: 3px; background: #fffdf6; color: var(--muted); font: 500 11px/1.2 var(--f-body); text-align: center; box-shadow: 0 6px 14px -6px rgba(40, 0, 0, .55); transition: background-color var(--base), color var(--base); }
.mapca__tag b { display: block; font: 700 13px/1.05 var(--f-head); text-transform: uppercase; letter-spacing: .02em; color: var(--navy); }
.mapca__spot--r .mapca__tag { left: calc(var(--pin) * .5); }
.mapca__spot--l .mapca__tag { right: calc(var(--pin) * .5); }
.mapca__pin.is-on .mapca__tag { display: grid; background: var(--navy); color: var(--muted-light); }
.mapca__pin.is-on .mapca__tag b { color: #fff; }
.mapca__pin:hover .mapca__tag b { color: var(--sale); }
.mapca__pin.is-on:hover .mapca__tag b { color: #ffe08a; }
.mapca__leads { display: none; z-index: 1; }
.mapca__leads path { fill: none; stroke: var(--navy); stroke-width: 2; stroke-linecap: round; }

/* The store: a gold star under the Sault's pin, explained in the key */
.mapca__star { position: absolute; z-index: 1; left: var(--x); top: var(--y); --st: 20px; width: var(--st); height: var(--st); margin: calc(var(--st) / -2) 0 0 calc(var(--st) / -2); }
.mapca__star svg, .mapca__key svg { display: block; width: 100%; height: 100%; fill: #ffd34d; stroke: var(--navy); stroke-width: 1.5; stroke-linejoin: round; overflow: visible; }
.mapca__star svg { filter: drop-shadow(0 3px 4px rgba(40, 0, 0, .5)); }
.mapca__key { position: absolute; left: var(--gut); top: calc(100% + 10px); display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; line-height: 1.2; }
.mapca__key svg { width: 18px; height: 18px; flex: none; }

/* Makers: a rail of their lines on a phone, the chosen one ringed in gold */
.mapca__cards { grid-auto-columns: 86%; gap: 12px; list-style: none; margin: 0; padding: 2px 2px 6px; }
.mapca__card { display: flex; flex-direction: column; gap: 10px; padding: 20px 18px 18px; border-radius: var(--r-2); background: linear-gradient(170deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .03) 62%), rgba(80, 6, 2, .26); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 18px 30px -18px rgba(40, 0, 0, .6); transition: box-shadow var(--base); }
.mapca__card.is-on { box-shadow: inset 0 0 0 2px #ffe08a, 0 18px 30px -18px rgba(40, 0, 0, .6); }
.mapca__brand { font: 800 26px/1 var(--f-head); text-transform: uppercase; letter-spacing: .01em; text-wrap: balance; }
/* The maker's logo in place of its name (3 Nov 2026), on a white tile so its own colours read on the red */
.mapca__brand--logo { --logo-w: 136px; --logo-h: 52px; --logo-a: 50px; align-self: flex-start; display: grid; place-items: center; width: 168px; height: 72px; padding: 10px 16px; background: #fff; border-radius: var(--r-1); }
.mapca__brand--logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.mapca__town { display: flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 600; line-height: 1.3; color: #ffe2c2; }
.mapca__town .ico { width: 18px; height: 18px; color: #ffe08a; }
.mapca__line { font-size: 15.5px; line-height: 1.5; }
.mapca__acts { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-top: 6px; }
.mapca__src { font-size: 13px; color: rgba(255, 255, 255, .85); text-decoration: underline; text-underline-offset: 3px; }
.mapca__src:hover { color: #fff; }
.mapca .btn--light { color: #a51f15; }
.mapca .rail__arrow { top: calc(50% - 40px); }
.mapca .rail__bar { background: rgba(255, 255, 255, .3); }
.mapca .rail__bar span { background: #fff; }

/* Coming in: the provinces west to east, then the pins drop in, the labels and lines follow, the star last */
.js .mapca__map .mapca__prov { opacity: 0; transition: opacity .8s var(--ease), fill var(--base); transition-delay: calc(.15s + var(--i) * .07s); }
.js .mapca__map.is-in .mapca__prov { opacity: 1; }
.js .mapca__map .mapca__spot { opacity: 0; transform: translateY(-34px); transition: opacity .4s var(--ease), transform .8s cubic-bezier(.34, 1.56, .64, 1); transition-delay: calc(1s + var(--i) * .11s); }
.js .mapca__map.is-in .mapca__spot { opacity: 1; transform: none; }
.js .mapca__map .mapca__leads path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset .7s var(--ease); transition-delay: calc(1.6s + var(--i) * .08s); }
.js .mapca__map.is-in .mapca__leads path { stroke-dashoffset: 0; }
.js .mapca__map .mapca__star { opacity: 0; transform: scale(0) rotate(-90deg); transition: opacity .3s, transform .9s cubic-bezier(.34, 1.56, .64, 1); transition-delay: 2.2s; }
.js .mapca__map.is-in .mapca__star { opacity: 1; transform: none; }

@media (min-width: 600px) {
	.mapca__cards { grid-auto-columns: calc((100% - 14px) / 2); gap: 14px; }
}
@media (min-width: 900px) {
	.mapca__head { max-width: 860px; margin-inline: auto; }
	.mapca__map { width: 100%; max-width: 860px; margin: 0 auto; }
	.mapca__key { left: 0; }
	.mapca__cards { grid-auto-columns: calc((100% - 16px * 2) / 3); gap: 16px; }
}
/* Desktop: the heading centred over both, then the chosen maker on the left and the map beside it */
@media (min-width: 1200px) {
	.mapca__grid { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 48px; row-gap: 28px; }
	.mapca__head { grid-column: 1 / -1; grid-row: 1; }
	.mapca__map { grid-column: 2; grid-row: 2; max-width: none; padding-bottom: 0; }
	.mapca__rail { grid-column: 1; grid-row: 2; align-self: end; }
	.mapca__cards { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow: visible; padding: 0; }
	.mapca__card { grid-area: 1 / 1; align-self: end; display: none; padding: 26px 24px 24px; }
	.mapca__card.is-on { display: flex; animation: mapca-card .5s var(--ease); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 18px 30px -18px rgba(40, 0, 0, .6); }
	.mapca__brand { font-size: 34px; }
	.mapca__line { font-size: 16.5px; }
	.mapca__rail .rail__arrow, .mapca__rail .rail__bar { display: none; }
}

@keyframes mapca-card { from { opacity: 0; transform: translateY(14px); } }

/* A wide map: every label shows where map.php placed it (1 viewBox unit is .1cqw), with its leader line; the key sits inside */
@container mapca (min-width: 700px) {
	.mapca__spot { --pin: 2cqw; }
	.mapca__tag { display: grid; left: calc(var(--dx) * .1cqw); right: auto; top: calc(var(--dy) * .1cqw); bottom: auto; width: calc(var(--bw) * .1cqw); height: calc(var(--bh) * .1cqw); padding: 0; font-size: 1.4cqw; }
	.mapca__spot--l .mapca__tag { right: auto; }
	.mapca__tag b { font-size: 1.75cqw; margin-bottom: .2cqw; }
	.js .mapca__map .mapca__tag { opacity: 0; transition: opacity .6s var(--ease), background-color var(--base), color var(--base); transition-delay: calc(1.5s + var(--i) * .08s), 0s, 0s; }
	.js .mapca__map.is-in .mapca__tag { opacity: 1; }
	.mapca__leads { display: block; }
	.mapca__star { --st: 2.5cqw; }
	.mapca__key { top: auto; left: 1.6cqw; bottom: 1.6cqw; gap: .8cqw; font-size: 1.45cqw; }
	.mapca__key svg { width: 2.1cqw; height: 2.1cqw; }
}

@media (prefers-reduced-motion: reduce) {
	.mapca__pin.is-on .mapca__drop::after { animation: none; opacity: 0; }
	.js .mapca__map .mapca__prov, .js .mapca__map .mapca__spot, .js .mapca__map .mapca__tag, .js .mapca__map .mapca__star { opacity: 1; transform: none; transition: none; }
	.js .mapca__map .mapca__leads path { stroke-dashoffset: 0; transition: none; }
	.mapca__card, .mapca__card.is-on { transition: none; animation: none; }
}
