/* 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-sans); 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; }

/* ---------- a trade's month in BillGrid: an example business, three numbers, then each step's words beside its real
   close-up (spotlight.css), sides alternating; no button, the close stays the one ask (docs/mocks/site/invoice-maker/
   trade-pages-spec.html) ---------- */
.tp-layout + .tp-month { margin-top: clamp(48px, 7vw, 88px); }
.tp-month { padding-block: clamp(56px, 8vw, 104px); background: var(--sand-50); border-block: 1px solid var(--line); }
.tp-month__head { max-width: 760px; }
.tp-month__head h2 { margin-top: 10px; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: var(--fs-d2); line-height: 1.04; text-wrap: balance; }
.tp-month__who { margin-top: 16px; max-width: 60ch; font-size: var(--fs-md); line-height: 1.55; color: var(--text-muted); }
.tp-month__stats { display: flex; flex-wrap: wrap; gap: 12px 44px; margin: 28px 0 0; }
.tp-month__stats dt { font-family: var(--font-display); font-size: clamp(32px, 3.4vw, 44px); line-height: 1; font-variant-numeric: tabular-nums; }
.tp-month__stats dd { margin: 6px 0 0; max-width: 20ch; font-size: var(--fs-sm); color: var(--caption); }
.tp-month__steps { display: grid; gap: clamp(48px, 7vw, 96px); margin: clamp(40px, 6vw, 72px) 0 0; padding: 0; list-style: none; }
/* side by side for a narrow screen (--flip puts the words on the right); a wide screen gets the full width under its
   words (--wide), so it is never shown below about 0.8x; a tall one runs off its stage (--rise) at --tall's height */
.tp-step { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 4vw, 64px); align-items: center; }
.tp-step--flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.tp-step--flip .tp-step__text { order: 2; }
.tp-step--wide { grid-template-columns: minmax(0, 1fr); gap: clamp(20px, 2.4vw, 28px); }
.tp-step--wide .tp-step__text { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: clamp(24px, 4vw, 64px); align-items: end; }
.tp-step--wide .tp-step__n, .tp-step--wide .tp-step__text h3 { grid-column: 1; }
.tp-step--wide .tp-step__text p { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
.tp-step .tp-shot--tall { max-height: 620px; object-fit: cover; object-position: top; }
.tp-step__n { font-family: var(--font-mono); font-size: var(--fs-xs); letter-spacing: .1em; color: var(--gold-deep); }
.tp-step__text h3 { margin-top: 8px; font-family: var(--font-display); font-weight: var(--font-display-weight); font-size: clamp(24px, 2.4vw, 32px); line-height: 1.12; text-wrap: balance; }
.tp-step__text p { margin-top: 10px; max-width: 40ch; font-size: var(--fs-md); line-height: 1.6; color: var(--text-muted); }
.tp-step__text a { display: inline-block; margin-left: 4px; color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.tp-step .spotlight { min-width: 0; }
@media (max-width: 860px) {
  .tp-step, .tp-step--wide .tp-step__text { grid-template-columns: minmax(0, 1fr); }
  .tp-step--flip .tp-step__text { order: 0; }
  .tp-step--wide .tp-step__text p { grid-column: auto; grid-row: auto; margin-top: 10px; }
}
.tp-month + .tp-close { padding-top: clamp(48px, 6vw, 72px); }

/* ---------- 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); } }
