/* The free invoice templates and their hub (pages/invoice-templates*.html, fragments/invoice-templates.html; mocks
   docs/mocks/site/invoice-maker/template.html, templates.html). Their sample sheets are images of the real PDF's first
   page (scripts/template-sheets.mjs), so these pages carry no paper CSS. */

/* ---------- the head: what it is, the way in, and the sheet ---------- */
.tp-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: clamp(40px, 6vw, 80px) clamp(32px, 4vw, 56px); }
.tp-head .kicker { margin-top: 14px; }
.tp-head h1 { margin-top: 12px; font-size: clamp(36px, 4.6vw, 62px); line-height: 1; letter-spacing: -.035em; }
.tp-head .lead { margin-top: 16px; max-width: 34em; }
.tp-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tp-cta .btn { gap: var(--icon-gap-sm); }
@media (max-width: 900px) {
  .tp-head { grid-template-columns: minmax(0, 1fr); }
  .tp-head .sheet-peek { --peek-h: 360px; }
}

/* ---------- the body: facts, the lines, the trade's own sections, wording, questions ---------- */
.tp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; align-items: start; }
.tp-section { margin-top: 48px; }
.tp-section > h2 { font-size: var(--fs-xl); line-height: 1.2; letter-spacing: -.02em; }
.tp-section > h2 + * { margin-top: 18px; }
.tp-section.prose > h2 { margin-top: 0; }
.tp-toc { position: sticky; top: 90px; display: grid; gap: 4px; padding: 16px; border-radius: 14px; background: var(--paper); font-size: var(--fs-sm); }
.tp-toc b { margin-bottom: 4px; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep); }
.tp-toc a { padding: 3px 0; color: var(--text-muted); text-decoration: none; }
.tp-toc a:hover { color: var(--ink); }
@media (max-width: 900px) {
  .tp-layout { grid-template-columns: minmax(0, 1fr); }
  .tp-toc { display: none; }
}

.tp-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; }
.tp-facts div { padding: 14px 16px; border-radius: 12px; background: var(--paper); }
.tp-facts dt { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.tp-facts dd { margin: 0; font-size: var(--fs-sm); color: var(--text-muted); }
@media (max-width: 640px) { .tp-facts { grid-template-columns: minmax(0, 1fr); } }

.tp-lines { width: 100%; border-collapse: collapse; font-size: var(--fs-body); }
.tp-lines th, .tp-lines td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tp-lines thead th { font-size: var(--fs-sm); font-weight: 600; color: var(--caption); }
.tp-lines tbody th { width: 34%; font-weight: 600; color: var(--ink); }
.tp-lines td { color: var(--text-muted); }
.tp-lines a { color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tp-lines--hub { max-width: 880px; }

.tp-copy { position: relative; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.tp-copy + .tp-copy { margin-top: 10px; }
.tp-copy small { display: block; margin-bottom: 4px; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--caption); }
.tp-copy__text { font-family: var(--font-serif); font-size: var(--fs-md); line-height: 1.55; color: var(--ink); }
/* Shown only where the script can copy (invoice-templates.js adds .tp-can-copy); without it the text stays selectable. */
.tp-copy button { display: none; position: absolute; top: 10px; right: 10px; align-items: center; gap: var(--icon-gap-xs); padding: 5px 9px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; font-size: var(--fs-xs); font-weight: 600; color: var(--ink); cursor: pointer; }
.tp-can-copy .tp-copy { padding-right: 96px; }
.tp-can-copy .tp-copy button { display: inline-flex; }
.tp-copy button:hover { border-color: var(--sand-400); }

.tp-sources { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--caption); }
.tp-sources a { color: var(--text-muted); text-underline-offset: 3px; }
.tp-checked { margin-top: 8px; }

/* ---------- the close: one sentence about BillGrid, then three more templates ---------- */
.tp-close { padding-bottom: 64px; }
.tp-next { max-width: 780px; }
.tp-next p { color: var(--text-muted); }
.tp-next a { color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tp-more { padding-block: clamp(48px, 6vw, 72px); background: var(--paper); border-top: 1px solid var(--line); }
.tp-more .tp-cards { margin-top: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .tp-more .tp-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tp-more .tp-cards { grid-template-columns: minmax(0, 1fr); } }
