/* =============================================================
   Punjabia — naqsha.css · the Naqsha (/culture/map/)
   Museum register: parchment, ink-indigo, fine rules. No drop
   shadows, no glows, no bounce easing (register kill-list, PRD 12.5).
   ============================================================= */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- intro strip ---------- */
.nq-head .lede { max-width: 66ch; }
.nq-h1-scripts {
  margin: .9rem 0 0; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.5;
  color: var(--gold-300);
}
.nq-h1-scripts .gur { font-family: var(--font-gur); }
.nq-h1-scripts .shah { font-family: var(--font-shah); }
.nq-h1-scripts .nq-dot { opacity: .55; margin: 0 .25em; }
.nq-head h1 { margin-top: .2rem; }
.nq-disclosure {
  margin: 1.1rem 0 0; font-family: var(--font-serif); font-style: italic;
  font-size: .98rem; color: var(--cream-muted);
  border-left: 2px solid var(--gold-400); padding-left: .8rem; max-width: 60ch;
}
.nq-altdoors { margin: .8rem 0 0; font-size: .98rem; color: var(--cream-muted); }
.nq-altdoors a { color: var(--gold-300); }

/* ---------- the word card fold ---------- */
.nq-word { padding-block: 1.4rem 0; }
.nq-word-fold { border: 1px solid var(--line); background: var(--khaddar-50); }
.nq-word-fold summary {
  cursor: pointer; list-style: none; display: flex; flex-wrap: wrap;
  gap: .35rem 1.2rem; align-items: baseline; padding: .85rem 1.1rem;
}
.nq-word-fold summary::-webkit-details-marker { display: none; }
.nq-word-fold summary .eyebrow { margin: 0; }
.nq-word-sum { font-family: var(--font-serif); font-size: 1.02rem; color: var(--text-2); }
.nq-word-sum .gur { font-family: var(--font-gur); }
.nq-word-sum .shah { font-family: var(--font-shah); }
.nq-word-open {
  font-family: var(--font-sans); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent-theme); margin-left: .6rem;
}
.nq-word-fold[open] .nq-word-open { display: none; }
.nq-word-fold > .word-hero, .nq-word-fold > .word-rows { margin: 0 1.1rem 1.1rem; }

/* ---------- the map frame ---------- */
.nq-map-section { padding-block: 1.6rem 2.4rem; }
.nq-frame {
  position: relative; border: 1px solid var(--line);
  background: var(--khaddar-200);
}
.nq-stage { height: max(80vh, 540px); overflow: hidden; }
.nq-stage svg {
  display: block; width: 100%; height: 100%;
  touch-action: none; cursor: grab;
}
.nq-stage.is-panning svg { cursor: grabbing; }
@media (max-width: 700px) {
  .nq-stage { height: min(84vh, 142vw); }
}

/* interactive objects — the drawing lifts 2px on hover/focus, but the
   hit shapes stay put so the pointer can never jitter off the target */
.nq-stage a.obj { cursor: pointer; }
.nq-stage a.obj > g > :not(.hitarea):not(.hitline) { transition: transform .15s ease-out; }
.nq-stage a.obj:hover > g > :not(.hitarea):not(.hitline),
.nq-stage a.obj:focus-visible > g > :not(.hitarea):not(.hitline) { transform: translateY(-2px); }
.nq-stage a.obj:focus-visible { outline: 2.5px solid var(--gold-600); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  .nq-stage a.obj > g > :not(.hitarea):not(.hitline) { transition: none; transform: none !important; }
}

/* controls */
.nq-controls {
  position: absolute; top: .7rem; right: .7rem; z-index: 30;
  display: flex; flex-direction: column; gap: .45rem;
}
.nq-controls button {
  width: 44px; height: 44px; font-size: 1.25rem; line-height: 1;
  font-family: var(--font-sans); color: var(--ink-900);
  background: var(--khaddar-50); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer;
}
.nq-controls button:hover { border-color: var(--gold-600); color: var(--gold-600); }
.nq-controls button:focus-visible { outline: 2.5px solid var(--gold-600); outline-offset: 2px; }

/* the margin-note tooltip */
.nq-tip {
  position: absolute; z-index: 40; max-width: 290px; pointer-events: none;
  background: var(--khaddar-50);
  border: 1px solid color-mix(in srgb, var(--indigo-800) 45%, transparent);
  border-left: 3px solid var(--indigo-600);
  padding: .6rem .85rem .65rem;
  font-family: var(--font-serif); font-size: .96rem; line-height: 1.5;
  color: var(--ink-700);
}
.nq-tip b {
  display: block; font-family: var(--font-display); font-weight: 600;
  font-size: 1rem; color: var(--ink-900); margin-bottom: .15rem;
}
.nq-under {
  margin: .8rem 0 0; text-align: center; font-family: var(--font-serif);
  font-style: italic; font-size: .95rem; color: var(--text-3);
}

/* ---------- the card / bottom sheet ---------- */
.nq-scrim {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 22, 47, .38);
}
.nq-card {
  position: fixed; z-index: 1001; left: 50%; top: 50%;
  transform: translate(-50%, calc(-50% + 8px));
  width: min(430px, calc(100vw - 2rem));
  background: var(--khaddar-50);
  border: 1.5px solid var(--indigo-800);
  opacity: 0;
  transition: opacity .18s ease-out, transform .18s ease-out;
}
.nq-card.is-open { opacity: 1; transform: translate(-50%, -50%); }
.nq-card__inner { padding: 1.3rem 1.5rem 1.4rem; max-height: 76vh; overflow: auto; }
.nq-card h3 {
  font-family: var(--font-display); font-size: 1.3rem; margin: 0 2rem .6rem 0;
  color: var(--ink-900);
}
.nq-card__body { font-family: var(--font-serif); font-size: 1.02rem; line-height: 1.65; color: var(--ink-700); }
.nq-card__body p { margin: 0 0 .8rem; }
.nq-card__body p:last-child { margin-bottom: 0; }
.nq-card__action { margin: 1.1rem 0 0; }
.nq-card__action .nq-forth {
  display: block; font-family: var(--font-serif); font-style: italic;
  font-size: .97rem; color: var(--text-2);
}
.nq-card__action .nq-forth a { color: var(--accent-theme); }
.nq-card__close {
  position: absolute; top: .55rem; right: .55rem; width: 38px; height: 38px;
  font-size: 1rem; background: none; border: 1px solid transparent;
  border-radius: 8px; color: var(--ink-500); cursor: pointer;
}
.nq-card__close:hover { color: var(--ink-900); border-color: var(--line); }
.nq-card__close:focus-visible { outline: 2.5px solid var(--gold-600); }
@media (max-width: 700px) {
  .nq-card {
    left: 0; right: 0; top: auto; bottom: 0; width: auto;
    transform: translateY(10px);
    border-left: 0; border-right: 0; border-bottom: 0;
    border-radius: 14px 14px 0 0;
  }
  .nq-card.is-open { transform: translateY(0); }
  .nq-card__inner { max-height: 62vh; padding-bottom: max(1.4rem, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .nq-card { transition: none; transform: translate(-50%, -50%); }
  @media (max-width: 700px) { .nq-card { transform: none; } }
}

/* ---------- the index ---------- */
.nq-index-note { max-width: 62ch; font-family: var(--font-serif); color: var(--text-2); }
.nq-idx { margin-top: 1.6rem; }
@media (min-width: 900px) { .nq-idx { columns: 2; column-gap: 3.5rem; } }
.nq-idx-group { break-inside: avoid; margin: 0 0 1.9rem; }
.nq-idx-group h3 {
  font-family: var(--font-display); font-size: var(--step-1);
  margin: 0 0 .55rem; padding-bottom: .3rem; border-bottom: 1px solid var(--line);
}
.nq-idx-group ul { list-style: none; margin: 0; padding: 0; }
.nq-idx-group li {
  margin: 0 0 .7rem; font-family: var(--font-serif);
  font-size: 1rem; line-height: 1.55; color: var(--text-2);
}
.nq-idx-group li a { color: var(--accent-theme); font-weight: 600; text-decoration: none; }
.nq-idx-group li a:hover { text-decoration: underline; }
.nq-soon { font-size: .86em; color: var(--text-3); }
