/* Ghost Mechanic — modern, restrained. Triumph red is the single accent; the
   dated citations form a precise red "timeline" (instruments/telemetry, not
   antiques). No gold. Reuses the site's red-on-dark tone (#ff5162) from garage.css. */

.ghost-page {
  --g-tri: #cd192d;              /* red on light surfaces */
  --g-tri-press: #b0121f;
  --g-tri-dark: #ff5162;         /* red on dark surfaces (matches garage.css) */
  --g-ink: #1b1e22;              /* headings */
  --g-body: #2b2f36;             /* answer body */
  --g-muted: #8b9199;            /* secondary meta */
  --g-label: #626973;            /* small-caps labels/stamp — AA on white */
  --g-line: #e7e9ec;
  --g-dark: #16181c;             /* header band / hero */
  --g-hover: #f6f7f9;
  --g-tint: rgba(205, 25, 45, .055);

  max-width: 760px;
  margin: 0 auto;
  padding: 8px 0 64px;
  color: var(--g-ink);
}

/* --- Hero / ask box --------------------------------------------------- */
.ghost-hero {
  background: var(--g-dark);
  color: #fff;
  border-radius: 16px;
  border-left: 3px solid var(--g-tri);
  padding: 32px 30px 26px;
  box-shadow: 0 12px 34px rgba(10, 12, 15, .28);
}
.ghost-hero__eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #aeb4bd;
  font-weight: 600;
  margin-bottom: 14px;
}
.ghost-hero__eyebrow .fas { margin-right: 7px; color: var(--g-tri-dark); }
.ghost-hero__title {
  font-size: 36px;
  line-height: 1.03;
  font-weight: 800;
  letter-spacing: -.02em;
  margin: 0 0 10px;
  color: #fff;
}
.ghost-hero__sub {
  font-size: 15px;
  line-height: 1.55;
  color: #c2c7cf;
  margin: 0 0 22px;
  max-width: 52ch;
}
.ghost-ask {
  display: flex;
  gap: 8px;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
}
.ghost-ask__input {
  flex: 1 1 auto;
  border: 0; outline: none; background: transparent;
  font-size: 16px; color: var(--g-ink);
  padding: 12px; min-width: 0;
}
.ghost-ask__input::placeholder { color: #a7adb5; }
.ghost-ask__btn {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 9px;
  background: var(--g-tri); color: #fff;
  font-weight: 700; font-size: 15px;
  padding: 0 20px; cursor: pointer;
  transition: background .15s ease;
}
.ghost-ask__btn:hover { background: var(--g-tri-press); }
.ghost-ask__btn:disabled { opacity: .6; cursor: default; }

.ghost-examples { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.ghost-eg {
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .05);
  color: #cfd4da;
  border-radius: 999px; padding: 6px 14px;
  font-size: 13px; cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ghost-eg:hover { background: rgba(255, 82, 98, .14); border-color: rgba(255, 82, 98, .5); color: #fff; }

/* --- Loading -------------------------------------------------------- */
/* Self-contained pill so the loading/error text stays legible on the dark hero
   photo (was muted grey on a busy background — nearly invisible). Centered via
   max-content width + auto margins; also styles the ghost.js error messages. */
.ghost-status {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: max-content; max-width: 90%; margin: 26px auto 6px;
  padding: 12px 22px; border-radius: 999px;
  background: rgba(22, 24, 28, .82);
  border: 1px solid rgba(255, 255, 255, .09);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  color: #eef1f4; font-size: 15px; font-weight: 600;
}
.ghost-status .fa-cog { color: var(--g-tri-dark); }

/* --- Result / card -------------------------------------------------- */
.ghost-result { margin-top: 22px; }
.ghost-result--permalink { margin-top: 8px; }

.ghost-card {
  background: #fff;
  border: 1px solid var(--g-line);
  border-left: 3px solid var(--g-tri);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(20, 22, 26, .10);
}
.ghost-card__head { background: var(--g-dark); color: #fff; padding: 20px 24px 22px; }
.ghost-card__eyebrow {
  display: block;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: #aeb4bd; font-weight: 600; margin-bottom: 11px;
}
.ghost-card__eyebrow .fas { margin-right: 7px; color: var(--g-tri-dark); }
.ghost-card__q {
  font-size: 23px; line-height: 1.24; font-weight: 800;
  letter-spacing: -.015em; margin: 0; color: #fff;
}
.ghost-card__body { padding: 22px 24px 6px; }
.ghost-card__answer { font-size: 16px; line-height: 1.62; color: var(--g-body); margin: 0 0 20px; }

/* Sources — the red citation timeline */
.ghost-sources { border-top: 1px solid var(--g-line); padding-top: 16px; }
.ghost-sources__label {
  font-size: 12px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--g-label); font-weight: 700; margin-bottom: 10px;
}
.ghost-sources__label .fas { margin-right: 7px; color: var(--g-tri); }

.ghost-spine { list-style: none; margin: 0; padding: 0; }
.ghost-entry__link {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 12px 12px 4px;
  border-radius: 8px;
  text-decoration: none; color: inherit;
  transition: background .12s ease;
}
.ghost-entry__link:hover { background: var(--g-tint); text-decoration: none; }
.ghost-entry__year {
  font-size: 21px; font-weight: 800; color: var(--g-ink);
  font-variant-numeric: tabular-nums; text-align: right; letter-spacing: -.03em;
}
/* the red index rule — the timeline running down the citations */
.ghost-entry__meta {
  min-width: 0; display: flex; flex-direction: column; gap: 2px;
  border-left: 2px solid var(--g-tri); padding-left: 14px;
}
.ghost-entry__subject {
  font-weight: 600; font-size: 15px; color: var(--g-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ghost-entry__poster { font-size: 12.5px; color: var(--g-muted); }
.ghost-entry__go { color: #c2c7cf; font-size: 12px; transition: color .12s ease, transform .12s ease; }
.ghost-entry__link:hover .ghost-entry__go { color: var(--g-tri); transform: translateX(2px); }

/* Empty / no-answer state */
.ghost-card--empty { border-left-color: var(--g-muted); }
.ghost-card--empty .ghost-card__head { background: #22262b; }
.ghost-card__cta {
  border-top: 1px solid var(--g-line); padding-top: 16px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
}
.ghost-card__cta-label { color: var(--g-muted); font-size: 15px; line-height: 1.5; }
.ghost-btn {
  display: inline-block;
  color: var(--g-tri); font-weight: 700; text-decoration: none; font-size: 14.5px;
  padding: 9px 16px; border: 1px solid var(--g-line); border-radius: 999px;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.ghost-btn:hover { color: #fff; background: var(--g-tri); border-color: var(--g-tri); text-decoration: none; }

/* The stamp — muted but readable (was near-invisible light grey) */
.ghost-card__stamp {
  margin-top: 10px; padding: 14px 24px 18px;
  font-size: 11px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--g-label); font-weight: 700; text-align: center;
  border-top: 1px solid var(--g-line);
}

.ghost-permalink-cta { text-align: center; margin-top: 24px; }
.ghost-permalink-cta .ghost-ask__btn { padding: 12px 22px; border-radius: 999px; }

/* --- Responsive ----------------------------------------------------- */
@media (max-width: 576px) {
  .ghost-hero { padding: 26px 18px 20px; border-radius: 14px; }
  .ghost-hero__title { font-size: 28px; }
  .ghost-ask { flex-wrap: wrap; }
  .ghost-ask__btn { width: 100%; justify-content: center; padding: 12px; }
  .ghost-card__q { font-size: 20px; }
  .ghost-entry__link { grid-template-columns: 44px 1fr auto; gap: 11px; }
  .ghost-entry__year { font-size: 18px; }
}

/* --- A11y ----------------------------------------------------------- */
.ghost-ask__input:focus-visible,
.ghost-ask__btn:focus-visible,
.ghost-eg:focus-visible,
.ghost-entry__link:focus-visible {
  outline: 2px solid var(--g-tri);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  .fa-spin { animation: none; }
  .ghost-ask__btn, .ghost-eg, .ghost-entry__link, .ghost-entry__go { transition: none; }
}
