/* Guides (content/guides.mjs): long reading on a phone. The answer comes first, on a card that
   sits on the edge of the night band; then the article at a reading width, with its contents
   beside it on wide screens. Tokens come from site.css, so dark mode follows on its own. */

.guide .hero-band {
  padding-bottom: 76px;
}

.guide .hero-band h1 {
  max-width: 22em;
}

.guide-body {
  padding-bottom: 24px;
}

.guide-grid {
  display: grid;
  gap: 0 56px;
  align-items: start;
}

.guide-main {
  min-width: 0;
  max-width: 44rem;
}

@media (min-width: 1060px) {
  .guide-grid {
    grid-template-columns: minmax(0, 44rem) minmax(0, 15rem);
    justify-content: space-between;
  }
}

/* The short answer: the first thing under the question. (Not .answer: the FAQ uses that.) */
.short-answer {
  position: relative;
  margin-top: -48px;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--mint);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.short-answer .answer-label {
  margin: 0 0 8px;
  color: var(--action-text);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.3;
  text-transform: uppercase;
}

.answer-text p {
  margin: 0;
  color: var(--text);
  font-size: 1.12rem;
  line-height: 1.6;
}

.answer-text p + p {
  margin-top: 0.7em;
}

/* Contents: inline on phones, beside the article on wide screens. */
.toc {
  font-size: 0.95rem;
}

.toc-title {
  margin: 0 0 6px;
  color: var(--text2);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: grid;
  grid-template-columns: 1.6em 1fr;
  gap: 4px;
  padding: 7px 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.toc a::before {
  content: counter(toc);
  color: var(--action-text);
  font-variant-numeric: tabular-nums;
}

.toc a:hover {
  color: var(--action-text);
  text-decoration: underline;
}

.toc-inline {
  margin: 28px 0 8px;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--surface2);
}

.toc-side {
  display: none;
}

@media (min-width: 1060px) {
  .toc-inline {
    display: none;
  }
  .toc-side {
    display: block;
    position: sticky;
    top: 24px;
    margin-top: 40px;
    padding-left: 18px;
    border-left: 2px solid var(--line);
  }
}

/* The article: one comfortable column. */
.article {
  font-size: 1.0625rem;
  line-height: 1.7;
}

.article > section {
  margin-top: 8px;
}

.article h2 {
  max-width: none;
  margin: 1.9em 0 0.5em;
  font-size: clamp(1.45rem, 4.4vw, 1.95rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  scroll-margin-top: 16px;
}

.article h3 {
  margin: 1.5em 0 0.4em;
  font-size: 1.2rem;
  line-height: 1.25;
}

.article p,
.article li {
  max-width: 40em;
}

.article ul,
.article ol {
  padding-left: 1.3em;
}

.article li {
  margin-bottom: 0.45em;
}

.article li::marker {
  color: var(--action-text);
  font-weight: 800;
}

.article .table-wrap {
  margin: 1.4em 0 1.6em;
}

.article table {
  font-size: 0.97rem;
}

.article .callout {
  margin: 1.4em 0;
}

.article .callout p {
  max-width: none;
}

/* Definition lists for "line by line" walk-throughs. */
.article dl.terms {
  margin: 1.2em 0;
}

.article .terms dt {
  margin-top: 1em;
  font-weight: 800;
}

.article .terms dd {
  margin: 0.2em 0 0;
  color: var(--text2);
}

/* The guest check inside an article: a little less tilt, and printed figures for a pay stub. */
.article .guide-check {
  margin: 30px 0 34px;
  rotate: -0.8deg;
}

.guide-check figcaption.check-foot {
  margin: 10px 22px 0;
}

.guide-check.printed .hand {
  color: var(--paper-text);
  font-family: var(--font);
  font-size: 1.02rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.guide-check.printed .check-total .hand {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 7vw, 2.1rem);
}

@media (max-width: 480px) {
  .article .guide-check {
    rotate: 0deg;
  }
  .guide-check .check-head {
    padding-right: 96px;
  }
}

.guide-main .bridge {
  margin-top: 40px;
}

/* Under the article. */
.guide-related h2,
.guide-index .index-title {
  font-size: clamp(1.6rem, 5vw, 2.3rem);
}

/* ---------- The index of guides ---------- */

.guide-list {
  display: grid;
  gap: 14px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .guide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.guide-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 8px;
  height: 100%;
  padding: 22px;
  border: 1.5px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.guide-card:hover {
  border-color: var(--action-text);
}

.guide-q {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.guide-a {
  color: var(--text2);
}

.guide-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--action-text);
  font-weight: 800;
}

.guide-more .icon {
  width: 18px;
  height: 18px;
}

/* ---------- Template pages: the downloads ---------- */

.downloads {
  display: grid;
  gap: 12px;
  margin: 1.4em 0 1.8em;
  padding: 0;
  list-style: none;
}

@media (min-width: 620px) {
  .downloads {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.downloads a {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 4px 14px;
  align-items: center;
  height: 100%;
  padding: 16px 18px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.downloads a:hover {
  border-color: var(--action-text);
}

.downloads .tile-icon {
  grid-row: span 2;
}

.downloads small {
  color: var(--text2);
  font-size: 0.88rem;
  font-weight: 600;
}

/* A picture of the sheet, drawn in HTML: the header row and one filled line. */
.sheet {
  margin: 1.6em 0;
  padding: 18px 16px 14px;
  border-radius: 6px 6px 14px 14px;
  background: #ffffff;
  color: #10231e;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.12), 0 24px 48px -24px rgba(1, 33, 31, 0.45);
  overflow-x: auto;
}

.sheet table {
  min-width: 560px;
  font-size: 0.86rem;
}

.sheet th,
.sheet td {
  padding: 7px 8px;
  border-bottom: 1px solid #a8d1bd;
  color: #10231e;
}

.sheet thead th {
  border-bottom: 2px solid #0b6b55;
  color: #0b6b55;
  font-size: 0.78rem;
  white-space: normal;
}

.sheet tbody th {
  white-space: nowrap;
}

.sheet td.pen {
  color: #1d3a8f;
  font-family: var(--font-hand);
  font-size: 1.05rem;
}

.sheet caption {
  padding: 0 0 10px;
  color: #3b5d52;
}
