/* Learning maps carousel (maps.js). Scoped under #maps so it overrides the older map rules in site.css. */
#maps.maps-sec{padding-top:clamp(56px,7vw,100px);padding-bottom:clamp(56px,7vw,100px)}
#maps .h2{font-size:clamp(30px,4.2vw,56px);line-height:1.06}
#maps .maps{max-width:1320px}
#maps .maps-title{position:absolute;inset:auto 0 0;justify-content:center;text-align:center;min-height:0;padding:16px 24px 20px;gap:12px}
#maps .maps-title>*{min-width:0;max-width:100%;overflow-wrap:anywhere}
#maps .maps-title .lng{line-height:1.3}
#maps .maps-title .lng .flagpill{flex:none}
#maps .maps-title .t{font:800 clamp(20px,2.4vw,30px)/1.1 var(--display)}
#maps .maps-title .cnt{font:900 13px/1 var(--ui);color:var(--slate);border:2px dashed rgba(27,42,74,.3);border-radius:99px;padding:5px 10px}

#maps .maps-stage{height:calc(clamp(330px,50vw,640px) + var(--tools-space,0px) + var(--caption-space,0px) - 2 * var(--caption-trim,0px));touch-action:pan-y;background-color:var(--cream);background-image:linear-gradient(rgba(27,42,74,.065) 1px,transparent 1px),linear-gradient(90deg,rgba(27,42,74,.065) 1px,transparent 1px);background-size:28px 28px}
#maps .maps-nav{top:calc(50% + var(--tools-space,0px)/2 - var(--caption-space,0px)/2);bottom:auto;transform:translateY(-50%)}
#maps .maps-stage:focus-visible{outline-offset:-4px}
#maps .mcard{transform:translate(-50%,-50%) translate(var(--x,0),var(--y,0)) scale(var(--s,1));opacity:var(--opacity,1);transition:opacity .16s linear;will-change:auto;filter:grayscale(1)}
#maps .mcard.active{filter:none}
#maps .mcard.far{visibility:hidden;pointer-events:none}
#maps.maps-changing .mcard{opacity:0!important;pointer-events:none}
#maps .mcard.side{cursor:pointer;opacity:.48}
#maps .mcard.side .mstop,#maps .mcard.side .mlabel{pointer-events:none}
#maps .mcard.side .mlabel{opacity:.0}
#maps .mcard-title{display:none}
#maps .world{filter:drop-shadow(0 6px 6px rgba(27,42,74,.14))}
#maps .mcard.center .world{filter:drop-shadow(0 10px 10px rgba(27,42,74,.18))}

/* stops */
#maps .mstop{touch-action:manipulation}
/* One proportional treatment for actual stops and picker artwork. Only stops
   carry sequence badges; the slightly uneven ink outline is static in both. */
#maps .mstop{--module-size:max(30px,7.4cqw)}
#maps .mstop,#maps .mt-node{width:var(--module-size);height:var(--module-size);border:calc(var(--module-size)*.0743) solid #fff;border-radius:49% 51% 47% 53%;background:var(--gold);color:var(--navy);box-shadow:0 calc(var(--module-size)*.0946) 0 #C98F00,0 calc(var(--module-size)*.1622) calc(var(--module-size)*.2703) rgba(27,42,74,.4);display:grid;place-items:center}
#maps .mstop::after,#maps.is-editing .mcard.center .mstop::after,#maps .mt-node::after{content:"";position:absolute;inset:calc(var(--module-size)*-.0743);border:1.5px solid var(--navy);border-radius:49% 51% 47% 53%;opacity:1;pointer-events:none;animation:none}
#maps .mstop svg,#maps .mt-node svg{width:48%;height:48%}
#maps .mstop.dragging{box-shadow:0 1.4cqw 0 #C98F00,0 3cqw 3cqw rgba(27,42,74,.45)}
#maps .mstop .n{left:auto;right:-.9cqw}
#maps .mcard.active .mstop.busy::before{content:"";position:absolute;inset:-.9cqw;border-radius:50%;border:.4cqw solid var(--gold);opacity:0;animation:mbusy 2.4s ease-out infinite}
@keyframes mbusy{0%{opacity:.9;transform:scale(.85)}100%{opacity:0;transform:scale(1.5)}}
#maps .mstop:focus-visible{outline:3px solid #4C8FD6;outline-offset:3px}
#maps .mcard.active.populate .mstop{animation:mpop .5s cubic-bezier(.2,1.6,.4,1) both;animation-delay:calc(var(--i) * 80ms)}
#maps .mcard.active.populate .mlabel{animation:mfade .4s ease both;animation-delay:calc(var(--i) * 80ms + 120ms)}
@keyframes mpop{from{scale:0;opacity:0}to{scale:1;opacity:1}}
@keyframes mfade{from{opacity:0}to{opacity:1}}
#maps .mlabel{margin-top:4.4cqw;font-size:max(10px,1.7cqw);max-width:22cqw;overflow:hidden;text-overflow:ellipsis}
#maps .mlabel span{overflow:hidden;text-overflow:ellipsis}
#maps .maps-narrow .mcard.center .mlabel{transform:translate(var(--label-x,0px),var(--label-y,0px));margin-top:0}

/* students */
#maps .mstudent{position:absolute;z-index:5;width:4.4cqw;height:4.4cqw;min-width:20px;min-height:20px;transform:translate(calc(-50% + var(--ox,0px)),-135%);pointer-events:none;transition:opacity .3s}
#maps .mstudent img{display:block;width:100%;height:100%;border-radius:50%;border:max(2px,.4cqw) solid #fff;object-fit:cover;background:#cfd6e4;box-shadow:0 .5cqw .8cqw rgba(27,42,74,.4)}
#maps .mcard.active .mstudent[data-state=working] img{animation:mbob 1.6s ease-in-out infinite}
@keyframes mbob{50%{transform:translateY(-12%)}}
#maps .mstudent .ok{position:absolute;right:-22%;top:-22%;width:52%;height:52%;min-width:11px;min-height:11px;border-radius:50%;background:var(--green);color:#fff;border:2px solid #fff;display:grid;place-items:center;opacity:0;transform:scale(.4);transition:opacity .25s,transform .3s cubic-bezier(.2,1.6,.4,1)}
#maps .mstudent .ok svg{width:70%;height:70%}
#maps .mstudent.ok-now .ok{opacity:1;transform:none}
#maps .mstudent.fin img{border-color:var(--green)}
#maps .mcard.side .mstudent{opacity:.85}
#maps.maps-still .mstudent img,#maps.maps-still .mstop.busy::before{animation-play-state:paused}
#maps.maps-still .mstop.busy::before{opacity:.7;transform:scale(1.1)}
#maps .mcard:not(.active) *,#maps .mcard:not(.active) .mstop::before{animation-play-state:paused!important;transition:none!important}
#maps.maps-still .mcard.populate .mstop,#maps.maps-still .mcard.populate .mlabel{animation-play-state:paused}

/* tooltip */
#maps .mtip{position:absolute;z-index:40;width:min(290px,calc(100% - 16px));background:#fff;border:2.5px solid var(--navy);border-radius:16px 18px 15px 17px;box-shadow:4px 4px 0 var(--navy);padding:11px 14px 12px;display:grid;gap:4px;color:var(--navy);pointer-events:auto;animation:gpop .22s cubic-bezier(.2,1.4,.4,1)}
#maps .mtip[hidden]{display:none}
#maps .mtip a{color:inherit;text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1.5px;direction:ltr;unicode-bidi:isolate}
#maps .mtip a:focus-visible{outline:3px solid #4C8FD6;outline-offset:3px;border-radius:2px}
#maps .mtip::after{content:"";position:absolute;left:var(--ax,50%);bottom:-9px;width:14px;height:14px;background:#fff;border-right:2.5px solid var(--navy);border-bottom:2.5px solid var(--navy);transform:translateX(-50%) rotate(45deg)}
#maps .mtip.below::after{bottom:auto;top:-9px;transform:translateX(-50%) rotate(225deg)}
#maps .mtip-k{font:900 16px/1.2 var(--display)}
#maps .mtip-k::before{content:"";display:inline-block;width:10px;height:10px;margin-inline-end:7px;border-radius:50%;background:var(--gold);border:2px solid var(--navy);vertical-align:1px}
#maps .mtip-d{font:700 14.5px/1.4 var(--ui);color:rgba(27,42,74,.85)}

/* editing */
#maps.is-editing .mcard.center .mstop{cursor:grab;touch-action:none}
#maps.is-editing .mcard.center .mstop::after{animation:none}
#maps .mstop{background:var(--gold);color:var(--navy)}
#maps.is-editing .mcard.center .mstop.sel{outline:3px solid var(--navy);outline-offset:3px}
#maps.is-editing .mcard.center .mstop:focus-visible{outline:3px solid #4C8FD6;outline-offset:6px}
#maps .mcard.is-drag .mstudent{opacity:.35}
#maps .maps-tools{position:absolute;z-index:45;top:14px;bottom:auto;left:16px;right:16px;transform:none;width:auto;display:grid;justify-content:stretch;gap:8px;margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;touch-action:pan-y}
#maps .maps-tools[hidden]{display:none}
#maps .mt-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:8px}
/* Only the picker reserves the physical corner control. Footer rows use the
   full frame center, while their wrapped height remains measured by layout(). */
#maps .mt-footer{display:grid;justify-items:center;gap:4px;text-align:center;min-width:0;container-type:inline-size}
#maps .mt-guidance{display:grid;grid-template-columns:40px minmax(0,auto) 40px;align-items:start;gap:8px;padding-top:20px;max-width:100%;min-width:0;direction:ltr}
#maps .mt-instruction{grid-column:2;margin:0;min-width:0;max-width:100%;font:800 clamp(1rem,1.5vw,1.25rem)/1.35 var(--ui);overflow-wrap:anywhere}
/* Fixed square artwork points up to the choices as a group, never to a specific
   node. Keep both dimensions equal, including when translated text wraps. */
#maps .mt-guide-arrow{display:block;width:40px;height:40px;align-self:start;margin-top:-20px;overflow:hidden;fill:none;stroke:var(--navy);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
#maps .mt-guide-arrow:first-child{grid-column:1}
#maps .mt-guide-arrow:last-child{grid-column:3}
/* Omit decoration, including its gutters, instead of squeezing it to fit. */
@container (max-width:260px){
  #maps .mt-guidance{grid-template-columns:minmax(0,auto);gap:0;padding-top:0}
  #maps .mt-instruction{grid-column:1}
  #maps .mt-guide-arrow{display:none}
}
#maps .maps-tools .chip{min-height:40px;max-width:100%;white-space:normal;text-align:start;box-shadow:none;font-size:.84375rem;overflow-wrap:anywhere}
#maps .maps-tools .chip span{min-width:0}
#maps .mt-row[role=group]{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));align-items:start;gap:12px 8px;margin-right:60px}
#maps .mt-module{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:12px;min-width:0;min-height:44px;width:100%;padding:5px 3px;border:0;border-radius:8px;background:none;color:var(--navy);font:800 .84375rem/1.25 var(--ui);text-align:center;touch-action:manipulation}
#maps .mt-node{--module-size:48px;position:relative;flex:none}
#maps .mt-module:enabled .mt-node::before{content:"";position:absolute;inset:calc(var(--module-size)*-.12);border:calc(var(--module-size)*.054) solid var(--gold);border-radius:50%;opacity:0;pointer-events:none;animation:mbusy 2.4s ease-out infinite}
#maps.maps-still .mt-module:enabled .mt-node::before{animation-play-state:paused}
#maps .mt-name{display:block;max-width:100%;min-width:0;overflow-wrap:anywhere}
#maps .mt-module:enabled:hover .mt-name{text-decoration:underline;text-underline-offset:3px}
#maps .mt-module:focus-visible{outline:3px solid #4C8FD6;outline-offset:2px}
#maps .mt-module:disabled{opacity:.5;cursor:not-allowed}
#maps .chip:disabled{opacity:.5;cursor:not-allowed}

/* Physical right in every language; only the glyph moves, never the touch target. */
#maps .maps-edit{position:absolute;z-index:46;top:12px;right:14px;left:auto;width:48px;height:48px;display:grid;place-items:center;padding:11px;border:2.5px solid var(--navy);border-radius:49% 51% 47% 53%;background:var(--cream);color:var(--navy);box-shadow:1px 2px 0 var(--navy);touch-action:pan-y}
#maps .maps-edit>svg{width:23px;height:23px}
#maps .maps-edit:hover{background:#FFF1CC}
#maps .maps-edit:focus-visible{outline:3px solid #4C8FD6;outline-offset:3px}
#maps .maps-edit[aria-pressed=true]{background:var(--navy);color:#fff;box-shadow:1px 2px 0 var(--gold)}
#maps .maps-edit-tip{position:absolute;right:calc(100% + 8px);top:0;width:max-content;max-width:min(180px,calc(100vw - 140px));padding:8px 10px;border:2px solid var(--navy);border-radius:9px 11px 8px 10px;background:var(--cream);color:var(--navy);font:800 .875rem/1.3 var(--ui);overflow-wrap:anywhere;visibility:hidden}
#maps .maps-edit:not(.tip-dismissed):is(:hover,:focus-visible) .maps-edit-tip{visibility:visible}
#maps .maps-edit.is-inviting>svg{animation:medit-invite 8s ease-in-out infinite;transform-origin:50% 75%}
@keyframes medit-invite{0%,83%,100%{transform:rotate(0)}87%,95%{transform:rotate(-9deg)}91%{transform:rotate(7deg)}}

@media (max-width:900px){
  #maps .mt-row[role=group]{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media (max-width:640px){
  #maps .maps-stage{height:calc(clamp(280px,80vw,400px) + var(--tools-space,0px) + var(--caption-space,0px) - 2 * var(--caption-trim,0px))}
  #maps .maps-nav{width:44px;height:44px;top:auto;bottom:calc(10px + var(--caption-space,0px));transform:none}
  #maps .maps-title{padding:12px 16px 18px;gap:10px}
  #maps .maps-title .t{flex-basis:100%}
  #maps .mlabel{font-size:11px;padding:1px 5px 1px 2px;max-width:30cqw}
  #maps .mstop{min-width:30px;min-height:30px}
  #maps .mtip{width:calc(100% - 16px)}
  #maps .maps-tools{left:12px;right:12px;gap:6px}
  #maps .maps-edit{right:12px}
  #maps .mt-row[role=group]{grid-template-columns:repeat(auto-fit,minmax(min(100%,max(64px,3.25rem)),1fr));gap:10px 6px}
  #maps .mt-module{font-size:.75rem}
  #maps .maps-tools .chip{padding:6px 8px;font-size:.75rem;min-height:40px}
}
@media (prefers-reduced-motion:reduce){
  #maps .mt-module:enabled .mt-node::before{animation:none}
  #maps .mcard,#maps .mcard.far{transition:none}
  #maps .mcard.populate .mstop,#maps .mcard.populate .mlabel,#maps .mstudent img,#maps .mstop.busy::before,#maps .mtip,#maps .maps-edit.is-inviting>svg{animation:none}
}
