/*
 * HAR SHALOM CEMETERY — "For Funeral Home Use Only" (/harshalom/funeral).
 *
 * Module   public/harshalom/static/funeral.css  (served at /harshalom/static/funeral.css)
 * Version  0.006 · 2026-11-12 · harshalom/0.019-phone (the count of its changelog entries; no line
 *          before 0.006)
 * Owner    lane M (messages and forms); was lane F; release 0.019, lane phone (0.006)
 *
 * A plain file linked by app/harshalom/funeral/page.tsx after hs.css, so the offline worker
 * can keep it (a bundler import lives under /_next/, which the worker never touches). Every
 * rule is scoped under `.hs` (the page root is `.hs.hs-page.hs-fh`). LIGHT (DESIGN_V2, owner
 * 29 Oct: "extremely dark, depressing"): white panels on the light page, the green as a thin
 * accent, no text on a solid red or green block. The tokens are lane D's (static/hs.css).
 *
 * Three layouts (OWNER_FEEDBACK item 11):
 *   phone    < 700px     one column: the form (the switch's line above its Send), the side card.
 *                        0.006: where scripts run, the title, then "Send a burial permit to the
 *                        office" (.fh-acts) and the side card; the form opens under the button only
 *                        once pressed (:target). With no JavaScript, or an answer that came back
 *                        not sent, the form first, as before
 *   tablet   700-1199px  the form's boxes in two columns; the side card under the form
 *   computer >= 1200px   the form beside the side card; the whole form fits 1440x900
 *
 * CHANGELOG (Rule 45)
 *   2026-10-28 lane F — created.
 *   2026-10-29 feat/harshalom-v2-light, lane M — rewritten light: panels, quiet inputs, the
 *     notice as a slim banner, two columns of boxes, the side card, the phone/computer
 *     fallbacks (a mail link on a phone, the address to copy on a computer).
 *   2026-10-29 feat/harshalom-v2-light, shell fix lane — "Send to the Office" is a normal primary
 *     (.hs-btn's 44px on a phone and a tablet, 40px on a computer; DESIGN_V2), not 46px.
 *   2026-11-02 feat/harshalom-v3-audit, lane L4 — audit V-12: the red "not active yet" block at
 *     the top became one amber line beside Send (.fh-actions; above a full-width Send on a phone);
 *     the held answer calm amber like the line, not red; 44px touch targets (Male/Female, a
 *     file's ×), the 13px text floor, the intro capped at
 *     --hs-prose-max and the boxes at --hs-field-max on a big screen (Rule 40: the page still
 *     fills it).
 *   2026-11-02 feat/harshalom-v3-audit, review fix F3 — from 1800px the side card grows with the
 *     big-screen step (--hs-side-w), so "Call the office" keeps its number on one line (R2-04).
 *   2026-11-12 harshalom/0.019-phone (0.006) — the owner, 11 Nov 2026, on his phone: "Instead of having
 *     like a clean view with like buttons, it's like a whole bunch of empty fields". The page opened on
 *     a phone with the form's empty boxes (4 at 390x844) and no button. Now, on a phone (< 700px) where
 *     scripts run and :has() is understood, the title, "Send a burial permit to the office" (.fh-acts,
 *     48px on a touch screen) and the side card (what the office needs, Call the office); the form
 *     opens under the button once pressed (#fh-write:target), "Close the form" puts it away (what was
 *     typed and attached stays). An answer that came back not sent (.fh-result--error) shows the form
 *     at once. A tablet, a computer, no JavaScript and paper: as before.
 */

/* ── the head: English only ─────────────────────────────────────────────── */

/* HsHead draws an empty Yiddish slot; this page has none (David, 28 Oct). */
.hs.hs-fh .hs-head__yi:empty {
  display: none;
}

/* ── the page ───────────────────────────────────────────────────────────── */

.hs .fh-main {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 12px 12px 24px;
}

.hs .fh-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.hs .fh-col {
  display: grid;
  gap: 12px;
  min-width: 0;
}

/* 0.006: the phone's buttons (.fh-acts): never shown from a tablet up, with no JavaScript, on paper. */
.hs .fh-acts {
  display: none;
}

/* 0.006: ON A PHONE, WHERE YOU ARE AND BIG BUTTONS. Only where the browser can test :has() and says
   scripts run; else the form is open first, as before. Opening (#fh-write:target) keeps the page at
   its top, the title in view (scroll-margin: the browser stops at the top); Close goes to the title. */
@supports selector(:has(*)) {
  @media screen and (max-width: 699px) and (scripting: enabled) {
    .hs .fh-main:not(:has(.fh-result--error)) > .fh-acts {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 8px;
      scroll-margin-top: 100vh;
    }

    .hs .fh-main:not(:has(.fh-result--error)) > .fh-acts:not(:target) ~ .fh-grid .fh-form {
      display: none;
    }

    .hs .fh-act {
      display: flex;
      justify-content: flex-start;
      gap: 10px;
      width: 100%;
      min-height: 48px;
      padding: 10px 14px;
      font-size: 16px;
      font-weight: 600;
      line-height: 1.25;
      text-align: left;
      color: var(--hs-accent-ink);
      background: var(--hs-surface);
    }

    .hs .fh-act__t {
      flex: 1 1 auto;
      min-width: 0;
    }

    .hs .fh-act__go {
      flex: 0 0 auto;
      font-size: 22px;
      line-height: 1;
      color: var(--hs-muted);
    }

    .hs .fh-act.fh-act--close,
    .hs .fh-acts:target .fh-act.fh-act--write {
      display: none;
    }

    .hs .fh-acts:target .fh-act.fh-act--close {
      display: flex;
    }
  }
}

.hs .fh-h2 {
  margin: 0;
  font-family: var(--hs-serif);
  font-size: var(--hs-h2);
  line-height: 1.25;
  color: var(--hs-accent-ink);
}

/* ── notices at the top ─────────────────────────────────────────────────── */

.hs .fh-result--failed,
.hs .fh-result--error {
  border-color: #efc7c3;
  background: var(--hs-red-soft);
}

.hs .fh-result--failed .fh-h2,
.hs .fh-result--error .fh-h2 {
  color: var(--hs-red);
}

/* Saved for the office while email is still being set up: calm amber, not an error (V-12). */
.hs .fh-result--held,
.hs .fh-done--held {
  border-color: #e7d4a6;
  background: #fbf5e6;
}

.hs .fh-result--held .fh-h2,
.hs .fh-done--held .fh-h2 {
  color: #5e4410;
}

.hs .fh-result--sent {
  border-color: #b9d8c6;
  background: var(--hs-green-soft);
}

.hs .fh-result p {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
}

.hs .fh-ref strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}

.hs .fh-call {
  justify-self: start;
  margin-top: 8px;
}

.hs .fh-noscript {
  margin: 0;
  font-size: 14px;
  color: var(--hs-muted);
}

.hs .fh-offline {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #e7d4a6;
  border-radius: var(--hs-r);
  background: #fbf5e6;
  color: #5e4410;
  font-size: 14px;
  font-weight: 600;
}

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

/* ── the form ───────────────────────────────────────────────────────────── */

.hs .fh-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px 16px;
}

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

.hs .fh-intro {
  /* fullbleed-ok: a sentence keeps a readable line length (Rule 40); the page around it fills. */
  max-inline-size: var(--hs-prose-max);
  margin: 0;
  font-size: 14px;
  color: var(--hs-muted);
}

.hs .fh-errsum {
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #efc7c3;
  border-radius: var(--hs-r);
  background: var(--hs-red-soft);
  color: var(--hs-red);
  font-size: 14px;
  font-weight: 600;
}

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

/* The honeypot: off-screen for everyone, not merely invisible. */
.hs .fh-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.hs .fh-f {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.hs .fh-lab {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--hs-ink);
}

.hs .fh-req {
  color: var(--hs-red);
}

.hs .fh-in {
  width: 100%;
  /* fullbleed-ok: a box no wider than what it holds on a big screen (Rule 40: the page fills). */
  max-inline-size: var(--hs-field-max);
}

.hs .fh-in--date {
  max-width: 240px;
}

.hs .fh-hint {
  margin: 0;
  font-size: var(--hs-fs-sm);
  color: var(--hs-muted);
}

.hs .fh-err {
  display: none;
  margin: 0;
  font-size: var(--hs-fs-sm);
  font-weight: 600;
  color: var(--hs-red);
}

.hs .fh-f.bad .fh-err {
  display: block;
}

.hs .fh-f.bad .fh-in {
  border-color: var(--hs-red);
  background: var(--hs-red-soft);
}

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

.hs .fh-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: var(--hs-tap);
  padding: 0 14px 0 12px;
  border: 1px solid var(--hs-line-2);
  border-radius: 999px;
  background: var(--hs-surface);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.hs .fh-opt input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--hs-accent);
}

.hs .fh-opt:has(input:checked) {
  border-color: var(--hs-accent);
  background: var(--hs-accent-soft);
  color: var(--hs-accent-ink);
}

.hs .fh-f.bad .fh-opt {
  border-color: var(--hs-red);
}

/* ── the burial permit ──────────────────────────────────────────────────── */

.hs .fh-attach {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* The real file boxes: out of sight, still focusable; the button labels stand for them. */
.hs .fh-file {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.hs .fh-abtn {
  flex: 1 1 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--hs-line-2);
  border-radius: var(--hs-r);
  background: var(--hs-surface);
  color: var(--hs-accent-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.hs .fh-abtn:hover {
  border-color: var(--hs-accent);
  background: var(--hs-accent-soft);
}

.hs .fh-file:focus-visible + .fh-abtn {
  outline: 2px solid var(--hs-accent);
  outline-offset: 2px;
}

/* Without JavaScript the chosen file is not listed; a tick on the button says one is chosen. */
.hs .fh-file:valid + .fh-abtn:not(.fh-abtn--cam)::after {
  content: '✓';
  margin-inline-start: 4px;
}

.hs.hs-fh[data-js] .fh-file + .fh-abtn::after {
  content: none;
}

.hs .fh-f.bad .fh-abtn {
  border-color: var(--hs-red);
}

.hs .fh-files {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hs .fh-files:empty {
  display: none;
}

.hs .fh-files li {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 4px 4px 6px;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-r);
  background: var(--hs-bg);
}

.hs .fh-thumb {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--hs-line);
}

.hs .fh-pdf {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid #efc7c3;
  border-radius: 6px;
  background: var(--hs-red-soft);
  color: var(--hs-red);
  font-size: var(--hs-fs-min);
  font-weight: 800;
  letter-spacing: 0.3px;
}

.hs .fh-fn {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.hs .fh-fs {
  display: block;
  font-size: var(--hs-fs-min);
  color: var(--hs-muted);
}

.hs .fh-rm {
  flex: none;
  width: var(--hs-tap);
  height: var(--hs-tap);
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--hs-ink);
  font-size: 16px;
  cursor: pointer;
}

.hs .fh-rm:hover {
  background: var(--hs-line);
}

.hs .fh-files .fh-busy {
  color: var(--hs-muted);
  font-size: 13px;
}

/* ── sending ────────────────────────────────────────────────────────────── */

/* The form's one main action: .hs-btn's height (44px phone and tablet, 40px computer). With the
   switch off, its calm amber line sits beside it (above it on a phone): audit V-12. */
.hs .fh-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hs .fh-send {
  width: 100%;
}

.hs .fh-inactive {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #e7d4a6;
  border-radius: var(--hs-r);
  background: #fbf5e6;
  color: #5e4410;
  font-size: var(--hs-fs-sm);
  line-height: 1.4;
}

.hs .fh-inactive__icon {
  flex: none;
  margin-top: 2px;
  color: #8a6116;
}

.hs .fh-inactive__txt {
  min-width: 0;
}

.hs .fh-inactive .fh-inactive__call {
  min-height: var(--hs-tap);
  margin-block: 2px;
  padding: 1px 10px;
  font-size: var(--hs-fs-sm);
  vertical-align: middle;
}

@media (min-width: 1200px) and (pointer: fine) {
  .hs .fh-inactive .fh-inactive__call {
    min-height: 30px;
    margin-block: 0;
  }
}

.hs .fh-status {
  padding: 10px 12px;
  border-radius: var(--hs-r);
  background: var(--hs-accent-soft);
  color: var(--hs-accent-ink);
  font-size: 14px;
  font-weight: 600;
}

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

.hs .fh-status.bad {
  border: 1px solid #efc7c3;
  background: var(--hs-red-soft);
  color: var(--hs-red);
}

.hs .fh-alt {
  display: grid;
  justify-items: start;
  gap: 8px;
  margin-top: 8px;
  font-weight: 500;
  color: var(--hs-ink);
}

.hs .fh-alt a.fh-mail {
  color: var(--hs-accent);
  font-weight: 600;
}

/* a mail link on a phone; the address to copy on a computer (no "xdg-open") */
.hs .fh-maildesk {
  display: none;
}

.hs .fh-maildesk__addr {
  overflow-wrap: anywhere;
}

.hs .fh-spin {
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-inline-end: 8px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: hs-fh-spin 0.8s linear infinite;
}

@keyframes hs-fh-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── the answer ─────────────────────────────────────────────────────────── */

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

.hs .fh-done {
  outline: none;
}

.hs .fh-done--sent {
  border-color: #b9d8c6;
  background: var(--hs-green-soft);
}

.hs .fh-done--failed {
  border-color: #efc7c3;
}

.hs .fh-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 6px;
  border: 1px solid #b9d8c6;
  border-radius: 50%;
  background: var(--hs-green-soft);
  color: var(--hs-green);
  font-size: 18px;
  font-weight: 800;
}

.hs .fh-done--failed .fh-ok {
  border-color: #efc7c3;
  background: var(--hs-red-soft);
  color: var(--hs-red);
}

.hs .fh-done--held .fh-ok {
  border-color: #e7d4a6;
  background: #fff;
  color: #8a6116;
}

.hs .fh-done--failed .fh-h2 {
  color: var(--hs-red);
}

.hs .fh-done p {
  margin: 6px 0 0;
  font-size: 14px;
}

.hs .fh-done dl {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 4px 14px;
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-r);
  background: var(--hs-bg);
  font-size: 14px;
}

.hs .fh-done dt {
  color: var(--hs-muted);
  font-weight: 600;
}

.hs .fh-done dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.hs .fh-again {
  margin-top: 12px;
}

/* ── the side card ──────────────────────────────────────────────────────── */

.hs .fh-side {
  min-width: 0;
}

.hs .fh-sidecard {
  display: grid;
  gap: 10px;
}

.hs .fh-needs {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.hs .fh-needs li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hs .fh-needs svg {
  flex: none;
  color: var(--hs-accent);
}

.hs .fh-sidecard .fh-call {
  margin-top: 0;
}

/* ── tablet ─────────────────────────────────────────────────────────────── */

@media (min-width: 700px) {
  .hs .fh-main {
    gap: 16px;
    padding: 16px 20px 28px;
  }

  .hs .fh-form {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .hs .fh-form > .fh-intro,
  .hs .fh-form > .fh-errsum,
  .hs .fh-form > .fh-f[data-f='permit'],
  .hs .fh-form > .fh-actions,
  .hs .fh-form > .fh-status {
    grid-column: 1 / -1;
  }

  /* the line on the left, Send at the end of the same row; Send alone keeps its place at the start */
  .hs .fh-actions {
    flex-direction: row;
    align-items: center;
  }

  .hs .fh-actions > .fh-inactive {
    flex: 1 1 auto;
  }

  .hs .fh-send {
    flex: none;
    width: auto;
    min-width: 240px;
  }

  .hs .fh-maildesk {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
  }

  .hs .fh-alt a.fh-mail {
    display: none;
  }
}

/* ── computer: the form beside the side card ────────────────────────────── */

@media (min-width: 1200px) {
  .hs .fh-main {
    padding: 20px 32px 28px;
  }

  .hs .fh-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
  }
}

/* v3 review (R2-04): from 1800px the type steps up but the side card stayed 320px, so "Call the
   office" split its number over two lines. The side card now grows with the same step
   (--hs-side-w: 400px from 1800, 460px from 2400; hs.css); the number never wraps (hs.css). */
@media (min-width: 1800px) {
  .hs .fh-grid {
    grid-template-columns: minmax(0, 1fr) var(--hs-side-w);
  }
}

@media (max-width: 420px) {
  .hs .fh-done dl {
    grid-template-columns: 1fr;
  }

  .hs .fh-done dd {
    margin-bottom: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hs .fh-spin {
    animation: none;
  }
}
