/* ===== INDIA MAP STANDALONE PAGE ===== */
/* Self-contained — loaded ONLY by india-map.html */

/* ----- Design tokens (Apple light / Cupertino, warm cream) -----
   Every colour, font and timing below comes from these. State colours are
   referenced by key from india-map-view.js (STATE_COLORS → --map-c-<key>). */
body.map-entry {
  --map-bg: #F7F3EC;                 /* cream base under the gradient */
  --map-surface: #FFFFFF;
  --map-surface-raised: #F2ECE2;     /* hover / active control */
  --map-neutral: #E6E0D5;            /* districts without vacancies */
  --map-border: rgba(255, 255, 255, 0.95);  /* state borders: white hairlines */
  --map-hairline: rgba(29, 36, 51, 0.08);
  --map-text: #1D2433;
  --map-text-2: #5E6878;
  --map-select: #1D2433;             /* selection / keyboard-focus ring */
  --map-accent: #3A6FD8;             /* links */
  --map-shadow: 0 1px 2px rgba(29, 36, 51, 0.05), 0 8px 24px rgba(29, 36, 51, 0.08);
  /* Warm cream with a soft peach glow top-left and a cool mist glow
     bottom-right — modern, light, never busy */
  --map-backdrop:
    radial-gradient(1100px 760px at 12% 8%, rgba(255, 222, 190, 0.55), transparent 62%),
    radial-gradient(1000px 720px at 88% 92%, rgba(196, 214, 238, 0.5), transparent 62%),
    linear-gradient(160deg, #FCFAF6 0%, #F4EEE4 100%);

  --map-c-powder: #79A9E7;
  --map-c-sage: #77BFAF;
  --map-c-lavender: #A99ADB;
  --map-c-champagne: #D5AA79;
  --map-c-mist: #91B5C7;
  --map-c-rose: #C28FA5;
  --map-c-olive: #A5B69A;
  --map-c-slate: #8E9AB4;

  --map-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --map-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
  --map-dur: 200ms;

  /* colour + multi-layer image must be separate properties: a colour
     before the first of several layers makes the shorthand invalid */
  background-color: var(--map-bg);
  background-image: var(--map-backdrop);
  background-attachment: fixed;
}

/* Neutralize home page layout */
/* The page is exactly one screen: the nav, then the map filling the rest */
body.map-entry { margin: 0; padding: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
/* The nav itself is the shared one (navbar.css, light theme), as on every page */
body.map-entry .top-nav { flex-shrink: 0; }
.map-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
body.map-entry .bg-shapes { display: none !important; }
body.map-entry .app-container { max-width: none; margin: 0; padding: 0; }
body.map-entry .scroll-progress { display: none; }

body.map-active .app-container { overflow: hidden; }
#map-view { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; width: 100%; background: transparent; position: relative; font-family: var(--map-font); color: var(--map-text); }
.map-container { position: relative; flex: 1; display: flex; flex-direction: column; overflow: hidden; background: transparent; }
/* A size container, so the Delhi photo views can size to it (cqw / cqh) */
#mapSvgWrap { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; container-type: size; }
#mapSvgWrap svg { width: 100%; height: 100%; }

/* ----- Header: floats over the map so the map gets the full height -----
   Only its buttons and the counter take clicks; the map shows through */
.map-header { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: flex-start; padding: 14px 20px; gap: 12px; pointer-events: none; }
.map-header > * { pointer-events: auto; }
.map-back-btn { display: flex; align-items: center; gap: 6px; background: var(--map-surface); border: 1px solid var(--map-hairline); color: var(--map-text-2); padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 500; font-family: var(--map-font); transition: background var(--map-dur) var(--map-ease), color var(--map-dur) var(--map-ease); }
/* display:flex above would otherwise override the hidden attribute */
.map-back-btn[hidden] { display: none; }
.map-back-btn:hover { background: var(--map-surface-raised); color: var(--map-text); }
.map-state-list-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; background: var(--map-surface); border: 1px solid var(--map-hairline); color: var(--map-text); padding: 7px 14px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; font-family: var(--map-font); transition: background var(--map-dur) var(--map-ease); }
.map-state-list-btn:hover { background: var(--map-surface-raised); }
.map-state-list-btn[hidden] { display: none; }
.map-state-list-note { font-size: 11px; font-weight: 400; color: var(--map-text-2); }
/* No hover tooltips from states sliding under a still cursor mid-zoom */
#map-svg.ad-zooming { pointer-events: none; }
.map-counter { margin-left: auto; display: flex; flex-direction: column; align-items: center; padding: 8px 16px; border-radius: 12px; background: var(--map-surface); border: 1px solid var(--map-hairline); box-shadow: var(--map-shadow); }
.map-counter-label { font-size: 10px; font-weight: 500; color: var(--map-text-2); text-transform: uppercase; letter-spacing: 0.06em; }
.map-counter-value { font-family: var(--map-font); font-size: 22px; font-weight: 600; color: var(--map-text); font-variant-numeric: tabular-nums; }

/* ----- State title: the open state's name, large, beside it -----
   Placed and sized by showStateTitle / placeStateTitle; decodes in while
   the state loads. Monospace for the small "readout" lines, the site font
   for the name; gold (#8A5A0B, 5:1 on the cream) and ink only. */
.map-state-title { position: absolute; z-index: 2; margin: 0; pointer-events: none; font-family: var(--map-font); font-weight: 400; color: var(--map-text); text-align: left; }
.map-state-title[hidden] { display: none; }
.map-state-title.align-right { text-align: right; }
.map-state-title.compact .mst-stats { display: none; }
.mst-over, .mst-stats { display: block; min-height: 1.4em; font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: 12px; line-height: 1.4; text-transform: uppercase; white-space: nowrap; }
.mst-over { font-weight: 600; letter-spacing: 0.18em; color: #8A5A0B; }
.mst-stats { margin-top: 10px; font-weight: 500; letter-spacing: 0.14em; color: var(--map-text-2); font-variant-numeric: tabular-nums; }
.mst-name { position: relative; display: block; margin-top: 10px; font-weight: 700; line-height: 0.98; letter-spacing: -0.02em; }
.mst-line { display: block; white-space: nowrap; }
.mst-ch { display: inline-block; text-align: center; letter-spacing: 0; }
.mst-ch.scr { color: #B7791F; font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-weight: 600; font-size: 0.82em; }
.mst-scan { position: absolute; top: -8%; bottom: -8%; left: 0; width: 2px; border-radius: 2px; background: #FFC567; box-shadow: 0 0 10px 2px rgba(255, 176, 50, 0.7), 0 0 28px 6px rgba(255, 176, 50, 0.25); opacity: 0; }
.mst-rule { display: block; height: 2px; margin-top: 14px; border-radius: 2px; background: linear-gradient(90deg, #E39B2F, rgba(227, 155, 47, 0)); transform-origin: left center; }
.align-right .mst-rule { background: linear-gradient(270deg, #E39B2F, rgba(227, 155, 47, 0)); transform-origin: right center; }
/* HUD corner brackets around the title while it decodes */
.mst-corner { position: absolute; width: 14px; height: 14px; border: 0 solid #E39B2F; opacity: 0; }
.mst-corner.tl { top: -10px; left: -14px; border-top-width: 1.5px; border-left-width: 1.5px; }
.mst-corner.tr { top: -10px; right: -14px; border-top-width: 1.5px; border-right-width: 1.5px; }
.mst-corner.bl { bottom: -10px; left: -14px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.mst-corner.br { bottom: -10px; right: -14px; border-bottom-width: 1.5px; border-right-width: 1.5px; }

/* ----- Tooltip: minimal floating panel ----- */
.map-tooltip { position: fixed; z-index: 100; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, 0.94); border: 1px solid var(--map-hairline); box-shadow: var(--map-shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity 180ms var(--map-ease), transform 200ms var(--map-ease); max-width: 240px; font-family: var(--map-font); }
.map-tooltip.visible { opacity: 1; transform: translateY(0); }
.map-tooltip-name { font-size: 13px; font-weight: 600; color: var(--map-text); }
.map-tooltip-count { font-size: 12px; font-weight: 500; color: var(--map-text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.map-tooltip-meta { font-size: 11px; color: var(--map-text-2); margin-top: 2px; }
.map-tooltip-meta:empty { display: none; }

/* ----- Controls: segmented filter + zoom, floating at the map's foot ----- */
.map-controls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; justify-content: flex-end; align-items: flex-end; padding: 14px 20px; gap: 12px; pointer-events: none; }
.map-controls > * { pointer-events: auto; }
.map-zoom-controls { display: flex; gap: 4px; }
.map-zoom-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--map-hairline); background: var(--map-surface); color: var(--map-text-2); font-size: 15px; cursor: pointer; transition: background var(--map-dur) var(--map-ease), color var(--map-dur) var(--map-ease); display: flex; align-items: center; justify-content: center; font-family: var(--map-font); }
.map-zoom-btn:hover { background: var(--map-surface-raised); color: var(--map-text); }

/* A very soft lift for the map on the light backdrop; dropped during the
   cinematic zoom so every frame stays cheap */
#map-group { filter: drop-shadow(0 10px 16px rgba(29, 36, 51, 0.14)); }

/* ----- A little 3D (buildRelief): side walls under the outer edge in a
   darker shade of each shape's colour, and a faint top-left sheen. Walls
   are neutral sandstone under the intro's tricolour, and fade with their
   state on hover and with the category filters. */
.ad-walls, .ad-sheen { pointer-events: none; }
.ad-wall {
  --wall-color: color-mix(in srgb, var(--wall-intro, var(--wall-base)) var(--wall-mix), #1D2433);
  fill: var(--wall-color);
  stroke: var(--wall-color);
  stroke-width: 0.6;
  stroke-linejoin: round;
  transition: fill 700ms var(--map-ease), stroke 700ms var(--map-ease), opacity var(--map-dur) var(--map-ease);
}
#map-svg.ad-intro .ad-wall { --wall-intro: #E2D5BD; }
#map-svg.has-spotlight .ad-wall:not(.is-spot) { opacity: 0.38; }
#map-svg.ad-zooming #map-group { filter: none; }

/* ----- States: flat fills, hairline borders -----
   The fill is set inline as var(--map-c-<key>). Strokes don't scale with
   zoom, so borders stay a crisp 1.2px at every zoom level. */
.ad-state {
  stroke: var(--map-border);
  stroke-width: 1.2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: filter var(--map-dur) var(--map-ease), opacity var(--map-dur) var(--map-ease);
}
.ad-state:hover { filter: brightness(0.86) saturate(1.2); }
/* Hover spotlight: every other state, and its labels, fades back */
#map-svg.has-spotlight .ad-state:not(.is-spot) { opacity: 0.38; }
#map-svg :is(.ad-state-label, .ad-state-count, .ad-tag, .ad-tag-leader, .ad-tag-dot) { transition: opacity var(--map-dur) var(--map-ease); }
#map-svg.has-spotlight #map-labels :is(.ad-state-label, .ad-state-count, .ad-tag, .ad-tag-leader, .ad-tag-dot):not(.is-spot) { opacity: 0.35; }
/* The hovered state, redrawn above its neighbours: grows a little about its
   own centre, darkens, and lifts off the map on a soft shadow */
.ad-lift {
  pointer-events: none;
  opacity: 0;
  stroke: var(--map-border);
  stroke-width: 1.5;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(1);
  filter: brightness(0.86) saturate(1.2) drop-shadow(0 6px 10px rgba(29, 36, 51, 0.28));
  transition: transform 220ms var(--map-ease), opacity 160ms var(--map-ease);
}
.ad-lift.on { opacity: 1; transform: scale(var(--lift-scale, 1.05)); }
.ad-lift.empty-state { fill-opacity: 0.75; }
/* No vacancies: same colour, a touch quieter, so states with vacancies lead
   while small UTs (Goa, DNH, Lakshadweep) stay clearly visible */
.ad-state.empty-state { fill-opacity: 0.75; }
/* Mouse focus would draw a bounding-box rectangle; the outline layer below
   draws a shape-following ring for hover, keyboard focus and selection */
.ad-state:focus, .ad-district:focus { outline: none; }

/* Keyboard focus rings use the selection colour; map shapes get theirs from
   the outline layer instead of a bounding-box outline */
#map-view :focus-visible { outline-color: var(--map-select); }
#map-view .ad-state:focus-visible, #map-view .ad-district:focus-visible { outline: none; }

/* Outline layer: one path above all shapes, so a highlight is never hidden
   under a neighbour's border */
.ad-outline { fill: none; stroke: transparent; stroke-width: 1.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; transition: stroke var(--map-dur) var(--map-ease); }
.ad-outline-hover { stroke: rgba(29, 36, 51, 0.4); }
.ad-outline-focus, .ad-outline-selected { stroke: var(--map-select); stroke-width: 2; }

/* ----- First-load intro: faded tricolour India, then states light up -----
   States and labels wait hidden under the flag; the view animates each one
   in (playTricolourIntro) and drops .ad-intro when done. */
#map-svg.ad-intro { pointer-events: none; }
#map-svg.ad-intro :is(.ad-state, .ad-district) { fill-opacity: 0; stroke-opacity: 0; }
#map-svg.ad-intro #map-labels [data-for] { opacity: 0; }
.ad-intro-flag { filter: drop-shadow(0 0 1px rgba(29, 36, 51, 0.3)); }
.ad-intro-flag > path { stroke-width: 1.2; stroke-linejoin: round; }
/* Navy 3D chakra (see buildChakra): the back wheel is the darker edge */
/* Zooms out from its own centre (see playTricolourIntro) */
.ad-chakra { pointer-events: none; transform-box: fill-box; transform-origin: center; }
.ad-chakra-wheel { transform-box: fill-box; transform-origin: center; animation: ad-chakra-spin 16s linear infinite; }
.ad-chakra-wheel circle { fill: none; stroke: #1B2F8A; }
.ad-chakra-wheel .fill { fill: #1B2F8A; stroke: none; }
.ad-chakra-wheel.back circle { stroke: #0A1550; }
.ad-chakra-wheel.back .fill { fill: #0A1550; }
@keyframes ad-chakra-spin { to { transform: rotate(360deg); } }

/* ----- Lit borders -----
   A thin gold line under a soft glow on every border; drawn once per
   border after the draw-in, and still once lit. */
#map-leds { pointer-events: none; transition: opacity var(--map-dur) var(--map-ease); }
#map-svg.has-spotlight #map-leds { opacity: 0.3; }
.ad-led-core { fill: none; stroke: #E39B2F; stroke-width: 1.25; stroke-linejoin: round; }
.ad-net-core { fill: none; stroke: #E39B2F; stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.ad-net-glow { fill: none; stroke: #FFC567; stroke-opacity: 0.4; stroke-width: 3.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#map-leds .ad-net-glow { opacity: 0; transition: opacity 900ms var(--map-ease); }
#map-leds.lit .ad-net-glow { opacity: 1; }

/* The electricity that runs round each border during the intro: a
   flickering golden tail, a crackle of broken sparks, and a white-hot head */
.ad-zap { filter: drop-shadow(0 0 1px #FFF6DA) drop-shadow(0 0 3px rgba(255, 190, 60, 1)) drop-shadow(0 0 7px rgba(255, 145, 20, 0.6)); }
.ad-zap path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ad-zap-tail { stroke: #FFC23D; stroke-width: 2.2; animation: ad-zap-flicker 0.19s steps(1, end) infinite; }
.ad-zap-crackle { stroke: #FFF2C8; stroke-width: 1.9; animation: ad-zap-flicker 0.13s steps(1, end) infinite reverse; }
.ad-zap-head { stroke: #FFFFFF; stroke-width: 3.2; }
/* The black current that runs round a state's outer border while it
   loads, drawing the black line that stays as the state's border */
.ad-current { filter: drop-shadow(0 0 1.5px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 5px rgba(20, 24, 40, 0.45)); }
.ad-current path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ad-current-tail { stroke: #1D2433; stroke-opacity: 0.75; stroke-width: 2.4; animation: ad-zap-flicker 0.17s steps(1, end) infinite; }
.ad-current-crackle { stroke: #0B0F1A; stroke-width: 2; animation: ad-zap-flicker 0.11s steps(1, end) infinite reverse; }
.ad-current-head { stroke: #000000; stroke-width: 3.4; }
.ad-current-line { stroke: #111827; stroke-width: 1.8; }
.ad-state-outline { fill: none; stroke: #111827; stroke-width: 1.6; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
@keyframes ad-zap-flicker {
  0% { stroke-opacity: 1; } 20% { stroke-opacity: 0.45; } 40% { stroke-opacity: 0.9; }
  60% { stroke-opacity: 0.3; } 80% { stroke-opacity: 1; } 100% { stroke-opacity: 0.6; }
}

/* Labels: each state's full name, fitted inside its borders by the view
   (sizes are set inline), with the vacancy count beneath it. Dark ink is
   5.5–7.3:1 on every state colour, so no outline or shadow is needed. */
.ad-state-label { font-family: var(--map-font); font-size: 10px; font-weight: 600; letter-spacing: 0; fill: var(--map-text); fill-opacity: 0.82; pointer-events: none; text-anchor: middle; }
.ad-state-count { font-family: var(--map-font); font-size: 13.5px; font-weight: 700; fill: var(--map-text); pointer-events: none; text-anchor: middle; font-variant-numeric: tabular-nums; }
/* Areas too small for their name: a tag outside, joined by a leader */
.ad-tag { cursor: pointer; }
.ad-tag-pill { fill: rgba(255, 255, 255, 0.92); stroke: rgba(29, 36, 51, 0.14); stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: fill var(--map-dur) var(--map-ease), stroke var(--map-dur) var(--map-ease); }
.ad-tag:hover .ad-tag-pill { fill: #FFFFFF; stroke: rgba(29, 36, 51, 0.32); }
.ad-tag-name { text-anchor: start; }
.ad-tag-count { text-anchor: end; }
.ad-tag-leader { stroke: rgba(29, 36, 51, 0.45); stroke-width: 0.8; vector-effect: non-scaling-stroke; pointer-events: none; }
.ad-tag-dot { fill: var(--map-text); fill-opacity: 0.7; pointer-events: none; }

/* ----- Districts (inside a state): the state's colour ----- */
.ad-district {
  stroke: var(--map-border);
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: filter var(--map-dur) var(--map-ease), fill-opacity var(--map-dur) var(--map-ease);
}
.ad-district:hover { filter: brightness(1.04) saturate(1.12); }
/* Districts without vacancies use the neutral surface (set by the view);
   only districts with vacancies carry the state colour */
/* Count badge sits on the district centroid — let clicks reach the path */
.ad-count-badge { pointer-events: none; font-family: var(--map-font); font-size: 14px; font-weight: 600; fill: var(--map-text); text-anchor: middle; font-variant-numeric: tabular-nums; }
.ad-district-label { font-family: var(--map-font); font-size: 9px; font-weight: 500; fill: var(--map-text); fill-opacity: 0.72; text-anchor: middle; pointer-events: none; opacity: 0; transition: opacity 0.4s ease; }
.ad-district-label.visible { opacity: 1; }

/* Live insert: one quiet ring that grows and fades */
.ad-ripple { fill: none; stroke: var(--map-select); stroke-opacity: 0.8; stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; transform-box: fill-box; transform-origin: center; animation: ad-ripple 1.2s var(--map-ease) both; }
@keyframes ad-ripple { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(5); } }

/* Draw-in animation */
.ad-draw-state {
  stroke-dasharray: var(--ad-draw-len, 1000);
  stroke-dashoffset: var(--ad-draw-len, 1000);
  animation: ad-draw 1.2s ease-out forwards;
}
@keyframes ad-draw {
  to { stroke-dashoffset: 0; }
}

/* NOTE: Do NOT set opacity:0 on .ad-state — stroke-dashoffset alone hides
   the path during draw-in. An extra opacity rule would keep it invisible
   after the animation ends. */
.ad-gpu { will-change: filter; }

/* Standalone map page — no SPA fade-in needed */
body.map-entry #map-view { opacity: 1; transform: none; transition: none; }

/* ----- Listings panel (district / state vacancies) ----- */
.map-modal { position: fixed; inset: 0; margin: auto; height: fit-content; width: min(560px, calc(100vw - 32px)); max-height: min(72vh, 640px); padding: 0; border: 1px solid var(--map-hairline); border-radius: 16px; background: var(--map-surface); color: var(--map-text); box-shadow: 0 24px 60px rgba(29, 36, 51, 0.18); font-family: var(--map-font); overflow: hidden; }
.map-modal[open] { display: flex; flex-direction: column; }
.map-modal::backdrop { background: rgba(29, 36, 51, 0.22); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.map-modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--map-hairline); flex-shrink: 0; }
.map-modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; color: var(--map-text); }
.map-modal-close { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 0; background: rgba(29, 36, 51, 0.06); color: var(--map-text-2); font-size: 18px; line-height: 1; cursor: pointer; transition: background var(--map-dur) var(--map-ease), color var(--map-dur) var(--map-ease); }
.map-modal-close:hover { background: rgba(29, 36, 51, 0.1); color: var(--map-text); }
.map-modal-body { padding: 12px 16px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.ad-listing-card { background: #FBF9F5; border: 1px solid var(--map-hairline); border-radius: 12px; padding: 12px 14px; }
.ad-listing-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ad-listing-title { font-size: 14px; font-weight: 600; color: var(--map-text); line-height: 1.35; }
.ad-listing-badge { flex-shrink: 0; font-size: 11px; font-weight: 500; color: var(--map-text-2); background: rgba(29, 36, 51, 0.06); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ad-listing-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--map-text-2); line-height: 1.4; }
.ad-listing-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: 12px; color: var(--map-text-2); }
.ad-listing-link { color: var(--map-accent); text-decoration: none; font-weight: 500; }
.ad-listing-link:hover { text-decoration: underline; }
/* Whole card opens the vacancy: the title link's ::after covers the card */
.ad-listing-card.is-linked { position: relative; cursor: pointer; transition: border-color var(--map-dur) var(--map-ease), box-shadow var(--map-dur) var(--map-ease), background var(--map-dur) var(--map-ease); }
.ad-listing-card.is-linked:hover { background: #FFFFFF; border-color: rgba(58, 111, 216, 0.35); box-shadow: 0 4px 14px rgba(29, 36, 51, 0.08); }
.ad-listing-open { text-decoration: none; outline: none; }
.ad-listing-open::after { content: ""; position: absolute; inset: 0; border-radius: 12px; }
.ad-listing-card.is-linked:hover .ad-listing-open { color: var(--map-accent); }
.ad-listing-card.is-linked:has(.ad-listing-open:focus-visible) { outline: 2px solid var(--map-accent); outline-offset: 2px; }
.ad-listing-card.is-linked .ad-listing-link { position: relative; z-index: 1; }

/* --- Delhi image-map drill-down --- */
/* Both Delhi views (photos are 1472×1344) are as large as the map area
   allows, leaving 68px clear above and below for the floating header and
   controls and 16px at the sides */
.ad-delhi-map-wrap, .ad-delhi-district-view {
  position: relative;
  height: min(calc(100cqh - 136px), calc((100cqw - 32px) * 1344 / 1472));
  aspect-ratio: 1472 / 1344;
  margin: 0 auto;
}
.ad-delhi-map-wrap {
  user-select: none;
  z-index: 2;
}
.ad-delhi-map-img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  box-shadow: var(--map-shadow);
  pointer-events: none;
  transition: opacity 400ms ease;
}
.ad-delhi-preview-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  border-radius: 14px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 400ms ease;
}
.ad-delhi-preview-img.visible { opacity: 1; }
.ad-delhi-hotspot {
  position: absolute;
  z-index: 3;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.ad-delhi-hotspot[data-zero="true"] { cursor: pointer; }
.ad-delhi-hotspot.active { border-color: var(--map-select); }
.ad-delhi-hotspot:focus { outline: none; }
.ad-delhi-hotspot:focus-visible { outline: 2px solid var(--map-select); outline-offset: 2px; }
/* Count chip: readable on the light photo without a heavy outline */
.ad-delhi-count {
  font-family: var(--map-font);
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  background: rgba(29, 36, 51, 0.82);
  padding: 2px 9px;
  border-radius: 999px;
  pointer-events: none;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.ad-delhi-district-img { display: block; width: 100%; height: 100%; border-radius: 14px; box-shadow: var(--map-shadow); }
.ad-delhi-back-btn {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--map-text);
  box-shadow: var(--map-shadow);
  border: 1px solid var(--map-hairline);
  border-radius: 10px;
  padding: 6px 12px;
  font-family: var(--map-font);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--map-dur) var(--map-ease);
}
.ad-delhi-back-btn:hover { background: var(--map-surface-raised); }

/* Ladakh / northeastern states often get clipped by the standard projection —
   ensure the SVG container doesn't clip them */
#map-svg, #mapSvgWrap svg { overflow: visible; }

/* Map viewport fill */
.map-container { position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; }
.map-svg-wrap { flex: 1; position: relative; overflow: hidden; }

/* ===== Phones (<768px) ===== */
@media (max-width: 767px) {
  .map-header { padding: 10px 16px; gap: 10px; flex-wrap: wrap; }
  .map-controls { padding: 14px 16px; }
  .map-controls .map-zoom-controls { min-height: 44px; align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ad-state, .ad-district, .ad-outline, .ad-lift, .map-tooltip,
  #map-svg .ad-state-label, #map-svg .ad-state-count { transition: none; }
  .ad-chakra-wheel, .ad-zap-tail, .ad-zap-crackle, .ad-current-tail, .ad-current-crackle { animation: none; }
}

/* ----- Shared site widgets (site-widgets.js) on a one-screen map ----- */
@media (max-width: 768px) {
  /* The like / dislike pill floats just under the nav: start the map's overlays below it */
  body.map-entry .map-header { padding-top: 52px; }
}
@media (max-width: 640px) {
  /* On phones the visitor count and footer sit in the page flow; keep the map's screen for the map */
  body.map-entry .sw-counter { display: none !important; }
  body.map-entry .sw-footer { margin: 4px auto 6px; font-size: .68rem; gap: 0 8px; line-height: 1.4; }
}

/* ----- Filter panel (india-map-filters.js): the home page's filters ----- */
/* Placed by india-map-view.js: a column on the left (India), under the
   state's name on the right (a state), or a sheet behind a button. */
.map-filter-panel {
  position: absolute; z-index: 4; display: flex; flex-direction: column;
  background: var(--map-surface); border: 1px solid var(--map-hairline); border-radius: 14px;
  box-shadow: var(--map-shadow); font-family: var(--map-font); color: var(--map-text);
}
.map-filter-panel[hidden] { display: none; }
.mfp-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--map-hairline); }
.mfp-title { margin: 0; flex: 1; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.mfp-clear { font-size: 12px; }
.mfp-close { display: none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--map-hairline); background: var(--map-surface); color: var(--map-text-2); cursor: pointer; }
.mfp-close svg { width: 14px; height: 14px; }
.mfp-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 10px 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.mfp-body .filter-group { margin: 0; }
.mfp-body .filter-hint { display: none; }
.mfp-note { margin: 2px 0 0; font-size: 11px; line-height: 1.4; color: var(--map-text-2); }
/* Inside the scrolling panel a dropdown always opens downwards */
.map-filter-panel .ms-panel.ms-open-up { top: calc(100% + 6px); bottom: auto; }

/* Narrow / portrait screens: a sheet from the bottom, behind a button */
.map-filter-panel.is-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto;
  max-height: 78vh; border-radius: 16px 16px 0 0; z-index: 3100;
}
.map-filter-panel.is-sheet .mfp-close { display: inline-flex; }
/* The sheet holds a row of tabs and one filter at a time, so it stays short
   and the map (and its counts) stay in view above it */
.mfp-tabs { display: none; }
.map-filter-panel.is-sheet .mfp-tabs {
  display: flex; gap: 6px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--map-hairline);
}
.map-filter-panel.is-sheet .mfp-tabs::-webkit-scrollbar { display: none; }
.mfp-tab {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px;
  border-radius: 17px; border: 1px solid var(--map-hairline); background: var(--map-surface);
  color: var(--map-text-2); font: 600 12.5px var(--map-font); white-space: nowrap; cursor: pointer;
}
/* A filter that is set: tinted like the home page's active dropdowns */
.mfp-tab.is-set { color: #0891b2; border-color: rgba(8, 145, 178, 0.45); background: rgba(8, 145, 178, 0.08); }
.mfp-tab.is-set::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.mfp-tab[aria-selected="true"] { color: #fff; background: var(--map-text); border-color: var(--map-text); }
.mfp-tab:focus-visible { outline: 2px solid var(--map-select); outline-offset: 2px; }
.map-filter-panel.is-sheet .mfp-body { overflow: visible; padding: 10px 14px 14px; }
.map-filter-panel.is-sheet[data-tab=""] .mfp-body,
.map-filter-panel.is-sheet .mfp-body .filter-group:not(.is-current),
.map-filter-panel.is-sheet .mfp-note { display: none; }
.map-filter-panel.is-sheet[data-tab="me"] .mfp-body {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 10px;
}
/* Below the sheet is the screen's edge: an open list goes up, over the map */
.map-filter-panel.is-sheet .ms-panel,
.map-filter-panel.is-sheet .ms-panel.ms-open-up { top: auto; bottom: calc(100% + 6px); max-height: min(55vh, 420px); }
.map-filters-btn {
  position: absolute; left: 16px; bottom: 14px; z-index: 4;
  display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--map-hairline); background: var(--map-surface);
  color: var(--map-text); font: 600 13px var(--map-font); box-shadow: var(--map-shadow); cursor: pointer;
}
.map-filters-btn[hidden] { display: none; }
.map-filters-btn .icon { width: 18px; height: 18px; }
.mfp-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 9px; background: var(--map-text); color: #fff; font-size: 11px; font-weight: 700;
}
.mfp-badge[hidden] { display: none; }
