/* The India dial on the Modern sources page (templates/sources.html, india-map.js, india-map.svg).
   Without script: a still map in region colours, the list below carries the links. With it: the
   states in dots on a canvas inside a turnable dial. The canvas reads its colours from the custom
   properties below, so it follows the site's theme. No numbers anywhere (owner). */
body.colour-v1 .imap{
  --imap-s1:#ffffff;--imap-s2:#eef3fb;--imap-s3:#dfe7f5;--imap-frame:rgba(23,42,69,.1);
  --imap-ring:#13213a;--imap-band:rgba(19,33,58,.05);--imap-band-hi:rgba(19,33,58,.09);--imap-soft:rgba(19,33,58,.16);
  --imap-face:rgba(36,90,215,.05);--imap-border:rgba(19,33,58,.09);--imap-label:#1b2a45;--imap-label-2:rgba(27,42,69,.55);
  --imap-halo:#f6f8fc;--imap-knob:#ffffff;--imap-dot-s:66;--imap-dot-l:48;--imap-dot-a:.82;--imap-dim-a:.18;--imap-lit-l:40;--imap-lit:0;
  --imap-glass:rgba(255,255,255,.82);--imap-shadow:rgba(19,33,58,.32);--imap-still-l:72%;
  display:grid;grid-template-columns:minmax(0,1fr);gap:16px;margin:0 0 28px}
html[data-theme=dark] body.colour-v1 .imap{
  --imap-s1:#0f1b39;--imap-s2:#070e20;--imap-s3:#03060d;--imap-frame:rgba(223,231,251,.08);
  --imap-ring:#dfe7fb;--imap-band:rgba(223,231,251,.05);--imap-band-hi:rgba(223,231,251,.12);--imap-soft:rgba(223,231,251,.15);
  --imap-face:rgba(130,166,255,.06);--imap-border:rgba(223,231,251,.07);--imap-label:#e5ecfb;--imap-label-2:rgba(229,236,251,.5);
  --imap-halo:#081022;--imap-knob:#0b1427;--imap-dot-s:88;--imap-dot-l:63;--imap-dot-a:.8;--imap-dim-a:.16;--imap-lit-l:68;--imap-lit:1;
  --imap-glass:rgba(12,20,36,.8);--imap-shadow:rgba(0,0,0,.7);--imap-still-l:42%}
@media(prefers-color-scheme:dark){html:not([data-theme=light]) body.colour-v1 .imap{
  --imap-s1:#0f1b39;--imap-s2:#070e20;--imap-s3:#03060d;--imap-frame:rgba(223,231,251,.08);
  --imap-ring:#dfe7fb;--imap-band:rgba(223,231,251,.05);--imap-band-hi:rgba(223,231,251,.12);--imap-soft:rgba(223,231,251,.15);
  --imap-face:rgba(130,166,255,.06);--imap-border:rgba(223,231,251,.07);--imap-label:#e5ecfb;--imap-label-2:rgba(229,236,251,.5);
  --imap-halo:#081022;--imap-knob:#0b1427;--imap-dot-s:88;--imap-dot-l:63;--imap-dot-a:.8;--imap-dim-a:.16;--imap-lit-l:68;--imap-lit:1;
  --imap-glass:rgba(12,20,36,.8);--imap-shadow:rgba(0,0,0,.7);--imap-still-l:42%}}

/* region hues (the script reads them too): indigo north, rose west, amber central, magenta east,
   teal north-east, green south, sky islands */
body.colour-v1 .imap [data-r=north]{--h:226}
body.colour-v1 .imap [data-r=west]{--h:350}
body.colour-v1 .imap [data-r=central]{--h:38}
body.colour-v1 .imap [data-r=east]{--h:300}
body.colour-v1 .imap [data-r=northeast]{--h:174}
body.colour-v1 .imap [data-r=south]{--h:142}
body.colour-v1 .imap [data-r=islands]{--h:198}

/* heading, hint, region chips */
body.colour-v1 .imap-h{font:800 clamp(24px,6.4vw,34px)/1.12 var(--display);letter-spacing:-.03em;margin:0 0 8px;color:var(--ink);text-wrap:balance}
html[lang=hi] body.colour-v1 .imap-h,html[lang=mr] body.colour-v1 .imap-h{letter-spacing:0;line-height:1.3}
body.colour-v1 .imap-hint{margin:0 0 14px;color:var(--ink-2);font-size:15px}
body.colour-v1 .imap-regions{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:2px 2px 6px;margin:0 -2px}
body.colour-v1 .imap-regions::-webkit-scrollbar{display:none}
body.colour-v1 .imap-regions[hidden]{display:none}
body.colour-v1 .imap-rg{flex:none;display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:0 13px 0 9px;border:1px solid var(--rule);border-radius:999px;background:var(--surface);color:var(--ink);font:700 13px/1.2 'DM Sans','AnekHi',sans-serif;cursor:pointer}
body.colour-v1 .imap-rg i{width:16px;height:16px;border-radius:50%;background:conic-gradient(from 210deg,hsl(var(--h) 85% 70%),hsl(var(--h) 80% 45%),hsl(var(--h) 85% 70%));box-shadow:0 0 0 2px var(--surface),0 0 0 3px hsl(var(--h) 70% 55% / .45)}
body.colour-v1 .imap-rg[aria-pressed=true]{border-color:hsl(var(--h) 70% 50%);background:color-mix(in srgb,hsl(var(--h) 80% 55%) 13%,var(--surface))}
body.colour-v1 .imap .lg-central{display:inline-block;flex:none;width:13px;height:13px;border-radius:4px;transform:rotate(45deg);background:linear-gradient(135deg,#ff9933 0 36%,#fff 36% 64%,#138808 64%);box-shadow:0 0 0 1px rgba(23,42,69,.25)}

/* the stage: a square holding the dial */
body.colour-v1 .imap-main{min-width:0}
body.colour-v1 .imap-stage{position:relative;width:100%;aspect-ratio:1/1;border-radius:28px;overflow:hidden;isolation:isolate;
  background:radial-gradient(circle at 50% 46%,var(--imap-s1) 0,var(--imap-s2) 58%,var(--imap-s3) 100%);box-shadow:0 24px 60px -30px var(--imap-shadow),inset 0 0 0 1px var(--imap-frame)}
body.colour-v1 .imap-frame{position:absolute;inset:7%}
body.colour-v1 .imap-svg{display:block;width:100%;height:100%}
body.colour-v1 .imap-st{fill:hsl(var(--h) 60% var(--imap-still-l));stroke:var(--imap-s1);stroke-width:3;stroke-linejoin:round}
body.colour-v1 .imap.is-live .imap-frame{display:none}
body.colour-v1 .imap-cv{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:pan-y;cursor:pointer}
body.colour-v1 .imap-cv[hidden],body.colour-v1 .imap-ring[hidden],body.colour-v1 .imap-hud[hidden],body.colour-v1 .imap-tip[hidden],body.colour-v1 .imap-tuner[hidden],body.colour-v1 .imap-how[hidden],body.colour-v1 .imap-card[hidden]{display:none}
body.colour-v1 .imap-stage.is-zoomed .imap-cv{touch-action:none;cursor:grab}
body.colour-v1 .imap-stage.is-drag .imap-cv{cursor:grabbing}
body.colour-v1 .imap-ring{position:absolute;z-index:2;border-radius:50%;touch-action:none;cursor:grab;left:var(--rl,0);top:var(--rt,0);width:var(--rw,0);height:var(--rw,0);clip-path:var(--rclip,none)}
body.colour-v1 .imap-ring:focus-visible{outline:none}
body.colour-v1 .imap-stage.ring-focus::before{content:"";position:absolute;z-index:1;pointer-events:none;border-radius:50%;left:var(--fl);top:var(--ft);width:var(--fw);height:var(--fw);box-shadow:0 0 0 2px var(--brand),0 0 0 6px color-mix(in srgb,var(--brand) 25%,transparent)}
body.colour-v1 .imap-hud{position:absolute;z-index:3;display:flex;gap:6px}
body.colour-v1 .imap-hud-tl{top:12px;left:12px}
body.colour-v1 .imap-hud-br{right:12px;bottom:12px}
body.colour-v1 .imap-hud button{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:40px;min-width:40px;padding:0 12px;border-radius:13px;border:1px solid var(--rule);background:var(--imap-glass);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);color:var(--ink);font:700 18px/1 'DM Sans','AnekHi',sans-serif;cursor:pointer;box-shadow:0 6px 18px -10px var(--imap-shadow)}
body.colour-v1 .imap-hud button:disabled{opacity:.4;cursor:default}
body.colour-v1 .imap-hud .imap-central,body.colour-v1 .imap-hud .imap-reset{font-size:13px}
body.colour-v1 .imap-central{padding:0 13px 0 11px}
body.colour-v1 .imap-central[aria-pressed=true]{border-color:#ff9933;box-shadow:0 0 0 3px rgba(255,153,51,.25)}
body.colour-v1 .imap-reset[hidden]{display:none}
body.colour-v1 .imap-reset .ico{width:16px;height:16px;transform:scaleX(-1)}
body.colour-v1 .imap-tip{position:absolute;z-index:4;left:0;top:0;pointer-events:none;padding:7px 11px;border-radius:11px;background:var(--imap-glass);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border:1px solid var(--rule);color:var(--ink);font:700 13px/1.25 'DM Sans','AnekHi',sans-serif;white-space:nowrap;transform:translate(var(--x,0),var(--y,0));box-shadow:0 8px 20px -10px var(--imap-shadow)}
body.colour-v1 .imap-tip small{display:block;font-weight:600;font-size:11px;color:var(--ink-2)}

/* the tuner: what the dial points at */
body.colour-v1 .imap-tuner{margin-top:12px;display:flex;align-items:center;gap:12px;padding:10px 10px 10px 14px;border-radius:18px;background:var(--surface);border:1px solid var(--rule);min-height:62px}
body.colour-v1 .imap-sw{flex:none;width:12px;height:36px;border-radius:6px;background:linear-gradient(180deg,hsl(var(--h,226) 80% 62%),hsl(var(--h,226) 75% 42%));box-shadow:0 0 14px -2px hsl(var(--h,226) 80% 55% / .7)}
body.colour-v1 .imap-tx{min-width:0;flex:1}
body.colour-v1 .imap-lb{display:block;font:700 11px/1.3 'DM Sans','AnekHi',sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3)}
html[lang=hi] body.colour-v1 .imap-lb,html[lang=mr] body.colour-v1 .imap-lb{letter-spacing:0;text-transform:none;font-size:12px}
body.colour-v1 .imap-nm{display:block;font:800 17px/1.3 var(--display);color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body.colour-v1 .imap-nm small{font-weight:600;font-size:13px;color:var(--ink-2)}
body.colour-v1 .imap-open{flex:none;height:42px;padding:0 16px;border-radius:13px;border:0;background:var(--brand);color:#fff;font:800 14px/1 'DM Sans','AnekHi',sans-serif;cursor:pointer}
body.colour-v1 .imap-open:disabled{background:var(--surface-2,var(--rule));color:var(--ink-3);cursor:default}
body.colour-v1 .imap-how{margin:10px 2px 0;font-size:13px;color:var(--ink-3)}

/* the card: a sheet on phones and tablets, a panel beside the dial on wide screens */
body.colour-v1 .imap-card{border-radius:24px;background:var(--surface);border:1px solid var(--rule);overflow:hidden;box-shadow:0 24px 60px -28px var(--imap-shadow);color:var(--ink)}
body.colour-v1 .imap-band{position:relative;padding:16px 56px 16px 18px;color:#fff;overflow:hidden;background:linear-gradient(135deg,hsl(var(--h) 74% 30%),hsl(calc(var(--h) + 22) 76% 20%))}
body.colour-v1 .imap-band::before{content:"";position:absolute;right:-40px;top:-60px;width:200px;height:200px;border-radius:50%;background:repeating-radial-gradient(circle,rgba(255,255,255,.16) 0 1px,transparent 1px 12px);opacity:.7}
body.colour-v1 .imap-band::after{content:"";position:absolute;right:-20px;bottom:-70px;width:160px;height:160px;border-radius:50%;background:radial-gradient(circle,hsl(var(--h) 90% 70% / .45),transparent 70%)}
body.colour-v1 .imap-card.is-central .imap-band{background:linear-gradient(135deg,#1b51ba,#2a6af0)}
body.colour-v1 .imap-stripe{position:absolute;left:0;right:0;bottom:0;height:4px;background:linear-gradient(90deg,#ff9933 0 33.3%,#fff 33.3% 66.6%,#138808 66.6%)}
body.colour-v1 .imap-card.is-empty .imap-band{background:linear-gradient(135deg,var(--surface-2,var(--surface)),var(--surface));color:var(--ink)}
body.colour-v1 .imap-card.is-empty .imap-band::after{background:radial-gradient(circle,color-mix(in srgb,var(--brand) 30%,transparent),transparent 70%)}
body.colour-v1 .imap-chip{position:relative;z-index:1;display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:rgba(255,255,255,.17);font:700 11.5px/1.3 'DM Sans','AnekHi',sans-serif;letter-spacing:.04em}
body.colour-v1 .imap-card.is-empty .imap-chip{background:var(--surface);border:1px solid var(--rule);color:var(--ink-2)}
body.colour-v1 .imap-chip i{width:7px;height:7px;border-radius:50%;background:hsl(var(--h) 90% 75%)}
body.colour-v1 .imap-card h3{position:relative;z-index:1;margin:8px 0 0;font:800 26px/1.15 var(--display);letter-spacing:-.03em;color:inherit}
html[lang=hi] body.colour-v1 .imap-card h3,html[lang=mr] body.colour-v1 .imap-card h3{letter-spacing:0;line-height:1.3}
body.colour-v1 .imap-alt{position:relative;z-index:1;margin:2px 0 0;font:600 14px/1.4 'DM Sans','AnekHi',sans-serif;opacity:.85}
body.colour-v1 .imap-x{position:absolute;z-index:2;top:12px;right:12px;width:36px;height:36px;border-radius:11px;border:0;background:rgba(255,255,255,.16);color:#fff;cursor:pointer;display:grid;place-items:center}
body.colour-v1 .imap-x .ico{width:18px;height:18px}
body.colour-v1 .imap-card.is-empty .imap-x{display:none}
body.colour-v1 .imap-body{padding:16px 18px 18px}
body.colour-v1 .imap-body p{margin:0 0 14px;color:var(--ink-2);font-size:14px}
body.colour-v1 .imap-go{display:inline-flex;align-items:center;gap:8px;height:46px;padding:0 20px;border-radius:14px;background:hsl(var(--h) 74% 30%);color:#fff;font:800 15px/1 'DM Sans','AnekHi',sans-serif;text-decoration:none;box-shadow:0 12px 24px -14px hsl(var(--h) 74% 30%)}
body.colour-v1 .imap-card.is-central .imap-go{background:#1d55c9}
body.colour-v1 .imap-go:hover{filter:brightness(1.08);color:#fff}
body.colour-v1 .imap-go .ico{width:18px;height:18px}
body.colour-v1 .imap-body .imap-more-h{margin:18px 0 8px;font:700 11.5px/1.3 'DM Sans','AnekHi',sans-serif;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3)}
html[lang=hi] body.colour-v1 .imap-body .imap-more-h,html[lang=mr] body.colour-v1 .imap-body .imap-more-h{letter-spacing:0;text-transform:none;font-size:13px}
body.colour-v1 .imap-more{display:flex;flex-wrap:wrap;gap:6px}
body.colour-v1 .imap-more button{min-height:34px;padding:0 12px;border-radius:999px;border:1px solid var(--rule);background:var(--surface-2,var(--surface));font:700 13px/1 'DM Sans','AnekHi',sans-serif;cursor:pointer;color:var(--ink)}
body.colour-v1 .imap-more button:hover{border-color:hsl(var(--h) 60% 55%)}
@media(max-width:899px){
  body.colour-v1 .imap-card{position:fixed;z-index:60;left:12px;right:12px;bottom:var(--sheet-bottom,calc(12px + env(safe-area-inset-bottom)));max-height:var(--sheet-max,46vh);overflow:auto;overscroll-behavior:contain;transform:translateY(calc(100% + 30px));visibility:hidden;transition:transform .42s cubic-bezier(.2,.9,.25,1),visibility 0s .42s}
  body.colour-v1 .imap-card.is-open{transform:none;visibility:visible;transition:transform .42s cubic-bezier(.2,.9,.25,1)}
  body.colour-v1 .imap-card.is-empty{display:none}
  body.colour-v1.imap-sheet .pub-sources{padding-bottom:60vh}
}

/* wide screens: the section breaks out of the reading column; dial left, words and card right */
@media(min-width:900px){
  body.colour-v1 .imap{width:min(1180px,calc(100vw - 64px));margin-left:calc(50% - min(590px,50vw - 32px));grid-template-columns:minmax(0,1fr) 360px;column-gap:36px;align-items:start}
  body.colour-v1 .imap-main{grid-column:1;grid-row:1}
  body.colour-v1 .imap-side{grid-column:2;grid-row:1;position:sticky;top:84px}
  body.colour-v1 .imap-stage,body.colour-v1 .imap-tuner,body.colour-v1 .imap-how{width:min(100%,max(480px,calc(100vh - 190px)));margin-left:auto;margin-right:auto}
  body.colour-v1 .imap-regions{flex-wrap:wrap;overflow:visible;margin-bottom:16px}
}
@media(prefers-reduced-motion:reduce){body.colour-v1 .imap *{transition:none!important;animation:none!important}}
