/* ==========================================================================
   ask.css: the "Ask a question" button and popup (partials/ask.njk, /js/ask.js).
   Loaded on every page except those with hideAsk: true (the audit page).
   - From 601px wide: a labeled button in the bottom-right corner; the panel opens
     above it, its right edge in line with the button's.
   - Up to 600px: a square icon button; the panel is a sheet from the bottom of the
     screen over a dimmed page, with its own close button.
   The button is quiet on purpose (white, thin border, soft shadow, like the partner
   badges) and only appears once the visitor has scrolled past the first screen.
   The inputs and messages copy the audit form.
   ========================================================================== */
.ask { --ask-r: max(24px, env(safe-area-inset-right, 0px)); --ask-b: max(24px, env(safe-area-inset-bottom, 0px)); }

/* The button. Kept quiet so it doesn't compete with the page's own calls to action:
   white, a thin border and a soft shadow, the blue only in the icon. Hidden until ask.js
   adds .is-shown (scrolled past the first screen), then it fades up. While the panel is
   open it is tinted, with a navy border, an X and "Close". */
.ask__btn { position: fixed; right: var(--ask-r); bottom: var(--ask-b); z-index: 45; display: inline-flex; align-items: center; gap: 8px; height: 44px; margin: 0; padding: 0 16px 0 13px; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--ink); font-family: inherit; font-size: 16px; font-weight: 500; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(17, 27, 61, 0.10); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s, border-color 0.12s; }
.ask.is-shown .ask__btn { opacity: 1; visibility: visible; transform: none; transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s, border-color 0.12s; }
@media (hover: hover) { .ask__btn:hover { border-color: var(--ink); } }
.ask.is-open .ask__btn { border-color: var(--ink); background: var(--pen-tint); }
.ask__icon { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ask__icon--chat { color: var(--pen); }
.ask__icon--x, .ask.is-open .ask__icon--chat { display: none; }
.ask.is-open .ask__icon--x { display: block; }

/* The panel. Never taller than the window less the header (69px) and the button,
   so on short laptop screens the form scrolls inside it. */
.ask__panel { position: fixed; right: var(--ask-r); bottom: calc(var(--ask-b) + 56px); z-index: 46; display: flex; flex-direction: column; width: min(384px, calc(100vw - 48px)); max-height: calc(100vh - var(--ask-b) - 56px - 85px); max-height: calc(100dvh - var(--ask-b) - 56px - 85px); background: var(--white); color: var(--ink); border: 1.5px solid var(--ink); border-radius: 4px; box-shadow: 8px 8px 0 var(--pen-soft); }
.ask.is-open .ask__panel { animation: ask-in 0.16s var(--ease); }
@keyframes ask-in { from { opacity: 0; transform: translateY(8px); } }
.ask__head { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px 14px; border-bottom: 1.5px solid var(--ink); }
.ask__titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ask__title { margin: 0; font-family: var(--cond); font-weight: 800; font-size: 26px; line-height: 1.05; }
.ask__title:focus { outline: none; }
.ask__sub { font-size: 15px; line-height: 1.4; color: var(--ink-2); }
.ask__x { display: none; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--ink); cursor: pointer; }
.ask__x svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (hover: hover) { .ask__x:hover { background: var(--pen-tint); } }

/* The form */
.ask__form, .ask__done { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.ask__form { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 18px 20px; }
.ask__field { display: flex; flex-direction: column; gap: 6px; }
.ask__field label { font-size: 15px; font-weight: 700; }
.ask__field input, .ask__field textarea { width: 100%; min-height: 46px; margin: 0; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 3px; background: var(--white); color: var(--ink); font-family: inherit; font-size: 16px; }
.ask__field textarea { height: 96px; line-height: 1.45; resize: vertical; }
.ask__field input:focus-visible, .ask__field textarea:focus-visible { outline: none; border-color: var(--ink); box-shadow: 3px 3px 0 var(--line-tint); }
.ask__field [aria-invalid="true"], .ask__field [aria-invalid="true"]:focus-visible { border-color: var(--rep); box-shadow: 3px 3px 0 rgba(230, 92, 10, 0.22); }
.ask__err { display: flex; align-items: baseline; gap: 10px; font-size: 15px; font-weight: 700; line-height: 1.4; color: var(--rep-text); }
.ask__err::before { content: ""; flex: none; width: 9px; height: 9px; background: var(--rep); }
.ask__send { width: 100%; min-height: 50px; margin-top: 4px; padding: 0 24px; border: 1.5px solid var(--ink); font-size: 17px; box-shadow: 3px 3px 0 var(--ink); transition: transform 0.12s var(--ease), box-shadow 0.12s var(--ease); }
@media (hover: hover) { .ask__send:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); } }
.ask__send:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.ask__send:disabled { cursor: progress; opacity: 0.75; transform: none; }
.ask__note { font-size: 14px; line-height: 1.45; color: var(--ink-2); }

/* After sending */
.ask__done { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 22px 20px 20px; }
.ask__done:focus { outline: none; }
.ask__thanks { font-family: var(--cond); font-weight: 800; font-size: 30px; line-height: 1.05; }
.ask__done b { overflow-wrap: anywhere; }
.ask__hand { margin-bottom: 4px; font-family: var(--hand); font-size: 20px; line-height: 1.3; color: var(--pen); }
.ask__status { padding: 12px 14px; border: 1.5px dashed var(--ink-2); border-radius: 3px; font-size: 15px; line-height: 1.45; }

.ask__scrim { display: none; }
/* Out of the way while the phone menu is open, and not printed */
.site-head.is-open ~ .ask { display: none; }
@media print { .ask { display: none; } }

/* Phones (600px and narrower) */
@media (max-width: 600px) {
  .ask { --ask-r: max(16px, env(safe-area-inset-right, 0px)); --ask-b: max(16px, env(safe-area-inset-bottom, 0px)); }
  .ask__btn { width: 44px; height: 44px; padding: 0; justify-content: center; box-shadow: 0 4px 14px rgba(17, 27, 61, 0.12); }
  .ask__icon { width: 22px; height: 22px; }
  .ask__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ask.is-open .ask__btn { visibility: hidden; }
  .ask__scrim { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(17, 27, 61, 0.45); }
  .ask__panel { left: 0; right: 0; bottom: 0; width: auto; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); padding-bottom: env(safe-area-inset-bottom, 0px); border-width: 1.5px 0 0; border-radius: 4px 4px 0 0; box-shadow: none; }
  .ask__head { padding: 14px 12px 12px 20px; }
  .ask__title { font-size: 25px; }
  .ask__x { display: inline-flex; }
  .ask__form { padding: 16px 20px 24px; }
  .ask__done { padding: 22px 20px 28px; }
  .ask__done .textbtn { min-height: 44px; }
}
/* The page behind the sheet stops scrolling (class set by ask.js on phones only) */
html.ask-lock, html.ask-lock body { overflow: hidden; }
