/* Article pages: answer-first header with a "jump to a section or question"
   search and the common questions, a wide article card, and a contents rail
   on the right (a Sections sheet below 1080px). Loaded by templates/article.html. */


/* ---- Header ---- */
.guide-hero { background: var(--navy); color: var(--white); border-bottom: 5px solid var(--band, var(--red)); }
.guide-hero-inner { max-width: 1280px; margin: 0 auto; padding: 30px 24px 34px; }
.guide-hero h1 { font-size: clamp(26px, 3.6vw, 38px); font-weight: 700; line-height: 1.15; max-width: 22em; }
.guide-hero-summary { color: #C7D0D4; font-size: 17px; margin-top: 8px; max-width: 60ch; }
.guide-hero-meta { color: rgba(255, 255, 255, 0.6); font-size: 13px; margin-top: 18px; }

/* Jump to a section or question */
.jump { position: relative; max-width: 680px; margin-top: 22px; }
.jump-box { display: flex; align-items: center; gap: 10px; background: var(--white); color: var(--ink-soft); border-radius: var(--radius); padding: 0 16px; height: 54px; }
.jump-box input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; height: 100%; min-width: 0; }
.jump-box:focus-within { box-shadow: 0 0 0 3px rgba(231, 55, 70, 0.55); }
.jump-results {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); list-style: none; background: var(--white);
  color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(8, 25, 31, 0.18);
  max-height: 60vh; overflow-y: auto; padding: 6px;
}
.jump-results a { display: flex; gap: 10px; align-items: baseline; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-size: 14.5px; }
.jump-results a.on, .jump-results a:hover { background: var(--grey); }
.jump-results .kind { flex: 0 0 auto; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); width: 62px; }
.jump-results .kind-q { color: var(--red); }
.jump-results mark { background: #FFF1B8; color: inherit; border-radius: 3px; }
.ask-nina-guide {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 12px; border: 0; background: none; cursor: pointer;
  color: var(--white); font-family: inherit; font-size: 14px; font-weight: 600; padding: 4px 4px 4px 0;
}
.ask-nina-guide[hidden] { display: none; }
.ask-nina-guide img { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--red); }
.ask-nina-guide:hover { text-decoration: underline; }
.jump-results .none { padding: 10px 12px; color: var(--ink-soft); font-size: 14px; }

/* Common questions */
.hero-qs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; max-width: 1000px; }
.hero-qs-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); margin-right: 4px; }
.hero-q {
  font-size: 13.5px; text-decoration: none; color: var(--white); background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 999px; padding: 6px 13px;
}
.hero-q:hover { background: rgba(255, 255, 255, 0.16); }
.hero-q-more { border-color: var(--red); }

/* ---- Body: article card + contents rail ---- */
.guide { max-width: 1280px; margin: 0 auto; padding: 28px 24px 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; align-items: start; }
.prose.prose-wide { max-width: none; margin: 0 0 64px; padding: clamp(24px, 4vw, 52px); }
.prose-wide h2 { font-size: 23px; padding-top: 22px; margin-top: 1.6em; border-top: 1px solid var(--border); }
.prose-wide > h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.prose-wide h2, .prose-wide .faq { scroll-margin-top: 24px; }

/* Questions people ask: each Q/A as its own card */
.prose-wide .faq {
  background: #F7F8F9; border: 1px solid var(--border); border-left: 3px solid var(--red);
  border-radius: 10px; padding: 14px 18px; margin-bottom: 12px;
}
.prose-wide .faq strong { display: block; margin-bottom: 4px; }
.is-target { animation: target-flash 1.6s ease-out; }
@keyframes target-flash { 0% { box-shadow: 0 0 0 4px rgba(231, 55, 70, 0.35); } 100% { box-shadow: 0 0 0 4px rgba(231, 55, 70, 0); } }

.rail { position: sticky; top: 16px; display: grid; gap: 14px; }
.rail-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 10px 12px 14px; }
.rail-card .toc-list { max-height: calc(100vh - 260px); overflow-y: auto; margin-top: 8px; padding-right: 4px; }
.rail-help { padding: 16px 18px; font-size: 14px; }
.rail-help p { color: var(--ink-soft); margin: 4px 0 12px; }
.btn-small { display: inline-block; background: var(--red); color: var(--white); text-decoration: none; font-weight: 600; font-size: 14px; border-radius: 10px; padding: 8px 14px; }
.btn-small:hover { background: var(--red-dark); }

.toc-label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); }
.toc-list { list-style: none; }
.toc-list a {
  display: block; text-decoration: none; color: var(--ink-soft); font-size: 14px; line-height: 1.35;
  padding: 7px 10px 7px 12px; border-left: 2px solid transparent; border-radius: 0 8px 8px 0;
}
.toc-compact a { font-size: 13.5px; padding: 5px 10px 5px 12px; }
.toc-list a:hover { color: var(--ink); background: var(--grey); }
.toc-list a.is-active { color: var(--ink); font-weight: 600; border-left-color: var(--red); background: #FDEEEF; }

.sections-fab, .sheet { display: none; }

/* ---- Tablet and phone: the rail becomes a Sections sheet ---- */
@media (max-width: 1080px) {
  .guide { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .sections-fab {
    display: block; position: fixed; left: 16px; bottom: 16px; z-index: 25; /* the chat button is bottom-right */ border: 0; cursor: pointer;
    background: var(--navy); color: var(--white); font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1;
    border-radius: 999px; padding: 13px 18px; box-shadow: 0 8px 22px rgba(8, 25, 31, 0.3);
  }
  .sheet[open] {
    display: block; margin: auto 0 0; width: 100%; max-width: 100%; max-height: 75vh; border: 0;
    border-radius: 18px 18px 0 0; padding: 0 12px 16px;
  }
  .sheet::backdrop { background: rgba(8, 25, 31, 0.5); }
  .sheet-head { position: sticky; top: 0; background: var(--white); display: flex; align-items: center; justify-content: space-between; padding: 16px 6px 10px; }
  .sheet-close { border: 0; background: var(--grey); width: 36px; height: 36px; border-radius: 50%; font-size: 22px; cursor: pointer; }
}
@media (max-width: 640px) {
  .guide { padding: 0 16px; gap: 0; }
  .guide-hero-inner { padding: 24px 16px 26px; }
  .guide-hero-summary { font-size: 15.5px; }
  .hero-q { font-size: 13px; }
  .hero-q:nth-of-type(n+3):not(.hero-q-more) { display: none; } /* two common questions on phones, plus "All …" */
  .prose.prose-wide { padding: 22px 18px; margin: 16px 0 40px; }
  .prose-wide h2 { font-size: 20px; }
}
@media print {
  .jump, .hero-qs, .rail, .sections-fab, .sheet { display: none !important; }
  .guide { display: block; }
}
