/*
 * HAR SHALOM — "Standing at this grave? Save its GPS spot": the button, the panel that listens, the
 * small aerial map (also the office's previews), the exact-spot note.
 *
 * File     public/harshalom/static/gps.css   (linked by app/harshalom/find/page.tsx,
 *          app/harshalom/map/page.tsx, app/harshalom/plot/[code]/page.tsx and the office's Inbox,
 *          burial page and Settings)
 * Version  0.002
 * Owner    lane gps (feat/hs-grave-gps, ticket #1696 item 2)
 * Tokens   public/harshalom/static/hs.css: --hs-surface, --hs-line, --hs-ink, --hs-muted, --hs-accent,
 *          --hs-accent-soft, --hs-dot, --hs-gold, --hs-r, --hs-tap, --hs-fs-min
 *
 * LIGHT and quiet (DESIGN_V2): the button is an outlined one among the grave's next steps; the panel a
 * white card with a thin line; the map a framed, rounded photo with the red spot (the site's dot
 * colour) and a hollow green ring where the plan puts the grave. Three experiences: on a phone the
 * map is the panel's full width; from a tablet it is capped so the grave's other parts stay in view.
 * The button only shows once static/js/gps.js marks the page (<html>) `data-hs-gps-ok` (JavaScript, a
 * position this browser can give, the page's GPS settings): without them there is nothing to press.
 *
 * Static file: no PostCSS, no nesting, no @import; every rule under .hs (BUILD_CONTRACT 5).
 *
 * CHANGELOG (Rule 45)
 *   0.001 · 2026-11-02 · lane gps — created.
 *   0.002 · 2026-11-02 · fix/hs-gps-review (review finding 8) — `.hs .hs-gps__open[hidden]` is hidden
 *           here: on the office's burial page (no find.css) "Record its GPS spot" stayed on screen
 *           above the open panel, and a tap on it did nothing.
 */

.hs .hs-gps {
  display: none;
  margin: 2px 0 0;
}

/* gps.js marks the page (<html>) once a position can be given; still only inside .hs. */
:root[data-hs-gps-ok] .hs .hs-gps {
  display: block;
}

.hs .hs-gps__open {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: var(--hs-tap, 44px);
  height: auto;
  padding: 6px 12px;
  text-align: start;
  white-space: normal;
  line-height: 1.3;
  font-weight: 600;
  color: var(--hs-accent-ink, #1f3a2e);
  background: var(--hs-surface, #fff);
  border: 1px dashed var(--hs-line-2, #d8d2c5);
}

/* gps.js hides the button while its panel is open. The rule above beats the browser's own [hidden],
   and the office's pages do not load find.css (whose [hidden] rule hides it on the public ones). */
.hs .hs-gps__open[hidden] {
  display: none;
}

.hs .hs-gps__open:hover {
  border-color: var(--hs-accent, #2c5140);
  background: var(--hs-accent-soft, #eaf2ed);
}

.hs .hs-gps__yi {
  align-self: stretch;
  font-weight: 500;
  font-size: var(--hs-fs-min, 13px);
  color: var(--hs-muted, #5b645e);
  text-align: right;
}

/* ── the panel that listens ─────────────────────────────────────────────── */

.hs .hs-gps__panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--hs-surface, #fff);
  border: 1px solid var(--hs-line, #e6e2d9);
  border-radius: var(--hs-r, 10px);
  box-shadow: var(--hs-shadow, 0 1px 2px rgba(0, 0, 0, 0.04));
  outline: none;
}

.hs .hs-gps__status {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--hs-ink, #1d2420);
}

.hs .hs-gps__panel[data-hs-gps-done] .hs-gps__status {
  color: var(--hs-accent, #2c5140);
}

.hs .hs-gps__panel[data-hs-gps-error] .hs-gps__status {
  color: var(--hs-red, #b3261e);
}

.hs .hs-gps__time,
.hs .hs-gps__hint {
  margin: 0;
  font-size: var(--hs-fs-min, 13px);
  color: var(--hs-muted, #5b645e);
}

.hs .hs-gps__time:empty {
  display: none;
}

.hs .hs-gps__warn {
  margin: 0;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--hs-ink, #1d2420);
  background: #fdf6e7;
  border: 1px solid #ecd9a8;
  border-radius: var(--hs-r, 10px);
}

.hs .hs-gps__acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hs .hs-gps__acts [hidden] {
  display: none;
}

/* ── the small aerial map ───────────────────────────────────────────────── */

.hs .hs-gps__map {
  position: relative;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  background: #eef0ea;
  border: 1px solid var(--hs-line, #e6e2d9);
  border-radius: var(--hs-r, 10px);
}

.hs .hs-gps__img {
  position: absolute;
  max-width: none;
  height: auto;
  user-select: none;
  pointer-events: none;
}

.hs .hs-gps__plan,
.hs .hs-gps__you,
.hs .hs-gps__ring {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

.hs .hs-gps__plan {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  box-shadow:
    0 0 0 2px var(--hs-accent, #2c5140),
    inset 0 0 0 2px var(--hs-accent, #2c5140);
}

.hs .hs-gps__ring {
  aspect-ratio: 1;
  min-width: 10px;
  background: rgba(217, 43, 43, 0.14);
  border: 1px solid rgba(217, 43, 43, 0.55);
}

.hs .hs-gps__you {
  width: 14px;
  height: 14px;
  background: var(--hs-dot, #d92b2b);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.hs .hs-gps__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  font-size: var(--hs-fs-min, 13px);
  color: var(--hs-muted, #5b645e);
}

.hs .hs-gps__legend[hidden],
.hs .hs-gps__legend [hidden] {
  display: none;
}

.hs .hs-gps__k {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-inline-end: 4px;
  vertical-align: -1px;
  border-radius: 50%;
}

.hs .hs-gps__k--you {
  background: var(--hs-dot, #d92b2b);
}

.hs .hs-gps__k--plan {
  border: 2px solid var(--hs-accent, #2c5140);
}

/* ── the note on a grave with an exact spot ─────────────────────────────── */

.hs .hs-grave__note--gps {
  color: var(--hs-accent-ink, #1f3a2e);
}

.hs .hs-grave__note--gps::before {
  content: '';
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-inline-end: 6px;
  vertical-align: 0;
  background: var(--hs-dot, #d92b2b);
  border-radius: 50%;
}

/* ── the office: a spot's card in the Inbox and on a burial's page ─────── */

.hs .hs-gps-card {
  display: grid;
  gap: 10px;
}

.hs .hs-gps-card__facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
  font-size: 14px;
}

.hs .hs-gps-card__facts dt {
  color: var(--hs-muted, #5b645e);
}

.hs .hs-gps-card__facts dd {
  margin: 0;
  color: var(--hs-ink, #1d2420);
  overflow-wrap: anywhere;
}

@media (min-width: 700px) {
  .hs .hs-gps__panel {
    max-width: 460px;
  }
}

@media print {
  .hs .hs-gps,
  .hs .hs-gps__panel {
    display: none !important;
  }
}
