/* "Ask anything" row — this site's styling of the infinite-FAQ drop-in.
   Palette is the site's Tailwind theme (tailwind.config.js): ti-dark #2d2d2a,
   ti-cream #eae6dd, ti-orange #da5b37 (borders / large text only — 3.05:1 on cream),
   ti-orange-deep #b44221 (filled surfaces, AA text on cream 4.51:1),
   ti-orange-pale #f59b82 (small orange text on dark, 6.50:1). Fonts: Epilogue for
   copy (the page loads it), Anton is not used here — a question box is not a headline.
   Selectors are scoped under .faq-ask at two-class specificity so Tailwind's preflight
   `button`/`input` resets cannot restyle the box. */

.faq-ask {
  --faq-ink: #2d2d2a;
  --faq-muted: #5c5c57;
  --faq-line: #c9c4b8;
  --faq-accent: #b44221;
  --faq-accent-dark: #2d2d2a;
  --faq-answer-ink: #2d2d2a;
  --faq-answer-link: #b44221;
  --faq-error: #b44221;
  --faq-shimmer-lo: #8a8a84;
  --faq-shimmer-hi: #2d2d2a;
  font-family: Epilogue, ui-sans-serif, system-ui, sans-serif;
  color: var(--faq-ink);
  text-align: left;
}

/* Homepage: on the dark hero. It shares a flex column with the three hero buttons
   (src/pages/Home.tsx), so it stretches to exactly their width — no width of its own. */
.faq-ask--hero {
  --faq-answer-ink: #eae6dd;
  --faq-answer-link: #f59b82;
  --faq-error: #f59b82;
  --faq-shimmer-lo: #8a8a84;
  --faq-shimmer-hi: #eae6dd;
  margin: 0;
  min-width: 0;
}

.faq-ask--hero .faq-ask-form {
  min-height: 3.25rem;
  border: 2px solid #da5b37;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.faq-ask--hero .faq-ask-form:focus-within {
  box-shadow: 0 0 0 3px rgba(245, 155, 130, 0.45);
}

/* Detail pages: on the cream page, under the page's primary control. */
.faq-ask--page {
  margin: 0 0 2.5rem;
}

.faq-ask--page .faq-ask-form {
  min-height: 3.25rem;
  border: 1px solid var(--faq-line);
  background: #fff;
}

.faq-ask--page .faq-ask-form:focus-within {
  border-color: #da5b37;
  box-shadow: 0 0 0 3px rgba(218, 91, 55, 0.25);
}

.faq-ask .faq-ask-form {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem 0 1rem;
  margin: 0;
}

.faq-ask .faq-ask-input,
.faq-ask .faq-ask-input:focus {
  flex: 1;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--faq-ink);
  font: inherit;
  font-size: 16px; /* ≥16px: no iOS auto-zoom on focus */
  font-weight: 500;
  outline: none;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  text-overflow: ellipsis; /* the long placeholder clips with an ellipsis on a phone */
}

.faq-ask .faq-ask-input::placeholder {
  color: var(--faq-muted);
  font-weight: 400;
  opacity: 1;
  text-overflow: ellipsis;
}

.faq-ask .faq-ask-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--faq-muted);
  cursor: pointer;
  touch-action: manipulation;
}

.faq-ask .faq-ask-btn:disabled {
  cursor: default;
}

.faq-ask .faq-ask-btn.is-ready,
.faq-ask .faq-ask-btn.is-stop {
  background: var(--faq-accent);
  color: #fff;
}

.faq-ask .faq-ask-btn.is-ready:hover,
.faq-ask .faq-ask-btn.is-stop:hover {
  background: var(--faq-accent-dark);
}

.faq-ask .faq-ask-btn:focus-visible {
  outline: 3px solid #da5b37;
  outline-offset: 3px;
}

/* Answer typography: 15px, relaxed leading, underlined links. */
.faq-ask .faq-answer {
  padding: 0.875rem 0.25rem 0.25rem;
  color: var(--faq-answer-ink);
  font-size: 15px;
  line-height: 1.625;
  text-align: left;
}

.faq-ask .faq-answer p {
  margin: 0.375rem 0;
}

.faq-ask .faq-answer ul,
.faq-ask .faq-answer ol {
  margin: 0.375rem 0;
  padding-left: 1.25rem;
}

.faq-ask .faq-answer ul {
  list-style: disc;
}

.faq-ask .faq-answer ol {
  list-style: decimal;
}

.faq-ask .faq-answer li {
  margin: 0.125rem 0;
}

.faq-ask .faq-answer a {
  color: var(--faq-answer-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.faq-ask .faq-answer strong {
  font-weight: 700;
}

.faq-ask .faq-answer code {
  font-size: 0.9em;
}

.faq-ask .faq-answer > :first-child {
  margin-top: 0;
}

.faq-ask .faq-answer > :last-child {
  margin-bottom: 0;
}

.faq-ask .faq-error {
  color: var(--faq-error);
  font-weight: 600;
}

/* "Reading the site" shimmer: a light sweep across muted text. */
.faq-ask .faq-shimmer {
  display: inline-block;
  color: transparent;
  background: linear-gradient(
    90deg,
    var(--faq-shimmer-lo) 0%,
    var(--faq-shimmer-hi) 50%,
    var(--faq-shimmer-lo) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: faq-shimmer 1.6s linear infinite;
}

@keyframes faq-shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .faq-ask .faq-shimmer {
    animation: none;
    color: var(--faq-muted);
    background: none;
  }
}

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