/* DwellerIQ — "Ask DwellerIQ" answer preview widget (feature #13).
   Mounted by ask-preview.js into <div class="ask-preview">. Uses base.css tokens only.
   Selectors are .aq-scoped (two classes) so .article-prose p/ul/li styles don't leak in. */

.ask-preview:empty { display: none; }

.aq {
  position: relative;
  margin: 36px 0 44px;
  padding: 26px 24px 22px;
  background: var(--white);
  border: 1.5px solid var(--beige-border);
  box-shadow: 0 1px 16px rgba(0,0,0,0.07);
}
.aq .aq-eyebrow {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 8px;
  border-radius: 2px;
  background: rgb(30,30,30);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.4;
}
.aq .aq-title {
  margin: 0 0 6px;
  padding-right: 84px;  /* room for the mascot */
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--dark);
}
.aq .aq-sub {
  margin: 0 0 16px;
  padding-right: 84px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--grey);
}

/* ── Input ─────────────────────────────────────── */
.aq .aq-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.aq .aq-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 84px;
  padding: 12px 14px;
  resize: vertical;
  font-family: var(--font-sans);
  font-size: 16px; /* 16px keeps iOS from zooming on focus */
  line-height: 1.55;
  color: var(--dark);
  background: var(--beige);
  border: 1.5px solid var(--beige-border);
  border-radius: 2px;
}
.aq .aq-input:focus { outline: none; border-color: var(--dark); background: var(--white); }
.aq .aq-input:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.aq .aq-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.aq .aq-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--grey);
  letter-spacing: 0.04em;
}
.aq .aq-count.is-over { color: var(--orange); }
.aq .aq-submit[disabled] { opacity: .55; cursor: default; }
.aq .aq-ts:empty { display: none; }
.aq .aq-ts { margin: 12px 0 0; }
.aq .aq-ts iframe { max-width: 100%; }

/* ── Status line (loading / small notes) ────────── */
.aq .aq-status {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--grey);
}
.aq .aq-bar {
  height: 2px;
  margin-top: 10px;
  background: var(--beige-dark);
  overflow: hidden;
}
.aq .aq-bar::after {
  content: '';
  display: block;
  width: 35%;
  height: 100%;
  background: var(--orange);
  animation: aq-slide 1.1s cubic-bezier(0.16,1,0.3,1) infinite;
}
@keyframes aq-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
@media (prefers-reduced-motion: reduce) { .aq .aq-bar::after { animation: none; width: 100%; opacity: .4; } }

/* ── Preview ───────────────────────────────────── */
.aq .aq-result { margin-top: 22px; padding-top: 20px; border-top: 1.5px solid var(--beige-border); }
.aq .aq-q {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--grey);
  font-style: italic;
}
.aq .aq-h {
  margin: 18px 0 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--orange);
}
.aq .aq-h:first-child { margin-top: 0; }
.aq .aq-bottom {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  color: var(--dark);
}
.aq .aq-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.aq .aq-list li {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0;
  font-size: 15px; line-height: 1.65; color: #3a3a3a;
}
.aq .aq-list li::before {
  content: '↳'; color: var(--orange); font-family: var(--font-mono);
  font-size: 12px; flex-shrink: 0; margin-top: 3px;
}
.aq .aq-cites { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.aq .aq-cites li {
  display: block;           /* article.css makes li a flex row; stack instead so every row aligns */
  margin: 0;
  padding: 9px 12px;
  border: 1.5px solid var(--beige-border);
  background: var(--beige);
  font-size: 13px;
  line-height: 1.4;
  color: var(--dark);
}
.aq .aq-cites li::before { content: none; }
.aq .aq-cite { display: block; font-family: var(--font-mono); font-weight: 700; font-size: 12px; letter-spacing: .02em; }
.aq .aq-cite-covers { display: block; margin-top: 3px; color: var(--grey); }

/* ── Locked section (no gated text is ever in the page; bars are decorative) ── */
.aq .aq-locked {
  position: relative;
  margin-top: 22px;
  padding: 18px 18px 16px;
  border: 1.5px dashed var(--beige-border);
  background: var(--beige);
}
.aq .aq-locked .corners::before, .aq .aq-locked .corners::after,
.aq .aq-locked .corners .c3, .aq .aq-locked .corners .c4 { width: 6px; height: 6px; }
.aq .aq-locked-title {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 12px;
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--dark);
}
.aq .aq-locked-title svg { flex-shrink: 0; }
.aq .aq-locked-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.aq .aq-locked-list li { margin: 0; display: block; font-size: 14px; line-height: 1.5; color: var(--dark); }
.aq .aq-locked-list li::before { content: none; }
.aq .aq-locked-name { font-weight: 700; }
.aq .aq-ghost { display: block; margin-top: 6px; }
.aq .aq-ghost span {
  display: block; height: 8px; margin-top: 5px;
  background: linear-gradient(90deg, var(--beige-border), var(--beige-dark));
  border-radius: 1px;
}
.aq .aq-ghost span:nth-child(2) { width: 82%; }
.aq .aq-ghost span:nth-child(3) { width: 64%; }

/* ── CTA + footnotes ───────────────────────────── */
.aq .aq-cta-row { margin-top: 20px; }
.aq a.aq-cta { white-space: normal; text-align: left; line-height: 1.5; text-decoration: none; color: var(--dark); }
.aq a.aq-cta:hover, .aq a.aq-cta:focus-visible { color: var(--orange); }
.aq .aq-note {
  margin: 14px 0 0;
  font-size: 13px; line-height: 1.6; color: var(--grey);
}
.aq .aq-disclaimer {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 11px; line-height: 1.6; color: var(--grey);
}
.aq .aq-msg { margin: 18px 0 0; font-size: 15px; line-height: 1.7; color: #3a3a3a; }
.aq .aq-msg strong { color: var(--dark); }
.aq .aq-again {
  margin-top: 14px;
  padding: 0;
  background: none; border: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--dark); text-decoration: underline; text-underline-offset: 3px;
}
.aq .aq-again:hover { color: var(--orange); }

@media (max-width: 600px) {
  .aq { padding: 22px 16px 18px; margin: 28px 0 36px; }
  .aq .aq-title { font-size: 19px; }
  .aq .aq-row .aq-submit { width: 100%; text-align: center; }
  .aq a.aq-cta { display: block; width: 100%; box-sizing: border-box; }
}

/* ── Mascot (top right of the box) ────────────── */
.aq .aq-mascot { position: absolute; top: 12px; right: 16px; width: 68px; line-height: 0; pointer-events: none; }
.aq .aq-mascot img { display: block; width: 100%; max-width: none; height: auto; margin: 0; border: 0; box-shadow: none; border-radius: 0; }
@media (max-width: 600px) {
  .aq .aq-mascot { width: 54px; top: 10px; right: 10px; }
  .aq .aq-title, .aq .aq-sub { padding-right: 62px; }
}
