/*
 * Catalogue pages: industry pages, the template gallery and single templates.
 * Everything shared lives in site.css; this file only adds what those three
 * pages need. The live calculator is the loud thing on each page, so the
 * rest stays plain.
 */

/* ---- industry hero: copy beside a working calculator */
.cat-hero { padding-top: clamp(36px, 5vw, 72px); }
.cat-hero-in { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.cat-hero-copy { position: sticky; top: 96px; }
.cat-hero-copy h1 { font-size: clamp(2.3rem, 4.6vw, 3.9rem); }
@media (max-width: 960px) {
	.cat-hero-in { grid-template-columns: 1fr; }
	.cat-hero-copy { position: static; }
}

.cat-points { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 3.5vw, 48px) clamp(28px, 5vw, 72px); }
@media (max-width: 760px) { .cat-points { grid-template-columns: 1fr; } }

/* ---- template cards */
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.cat-card { align-content: start; grid-template-rows: auto 1fr auto; padding: 24px; border-radius: var(--r-m); }
.cat-card[hidden] { display: none; }
.cat-card p { font-size: 0.97rem; line-height: 1.5; }
.cat-card-link { font-weight: 600; font-size: 0.93rem; text-decoration: underline; text-underline-offset: 3px; margin-top: 6px; }
.cat-card-blank { background: transparent; border-style: dashed; }

/* ---- how it works: a real sequence, so it is numbered */
.cat-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(24px, 4vw, 56px); counter-reset: step; }
.cat-steps li { counter-increment: step; display: grid; gap: 10px; align-content: start; padding-top: 18px; border-top: 2px solid var(--tape); }
.cat-steps li::before { content: counter(step); font: 800 2.6rem/1 var(--display); color: var(--tape); letter-spacing: -0.03em; }
.cat-steps p { color: #c2d3cc; }
@media (max-width: 800px) { .cat-steps { grid-template-columns: 1fr; } }

.cat-cta { padding-bottom: 0; }
.cat-ghost-light { color: var(--white); border-color: #4a6a63; }
.cat-ghost-light:hover { border-color: var(--white); }

/* ---- single template */
.tpl-head { padding: clamp(32px, 4vw, 56px) 0 clamp(28px, 3vw, 40px); }
.tpl-crumbs { display: flex; gap: 8px; color: var(--muted); margin-bottom: 20px; }
.tpl-crumbs a { color: var(--muted); }
.tpl-head-in { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; }
.tpl-head h1 { font-size: clamp(2.2rem, 4.4vw, 3.6rem); }
.tpl-head-side { justify-items: start; }
.tpl-facts { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 860px) { .tpl-head-in { grid-template-columns: 1fr; align-items: start; } }

.tpl-demo-band { padding-bottom: clamp(24px, 4vw, 48px); }
.tpl-demo { max-width: 1040px; }

.tpl-table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-m); }
.tpl-formulas { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.tpl-formulas th, .tpl-formulas td { text-align: left; padding: 13px 18px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.tpl-formulas thead th { font-weight: 600; color: var(--muted); font-size: 0.87rem; border-bottom: 2px solid var(--ink); }
.tpl-formulas tbody tr:last-child th, .tpl-formulas tbody tr:last-child td { border-bottom: 0; }
.tpl-formulas tbody th { font-weight: 600; width: 34%; min-width: 180px; }
.tpl-formulas code, .tpl-code code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.88rem; }
.tpl-formulas code { overflow-wrap: anywhere; color: var(--ink-2); }
.tpl-id { display: block; font: 400 0.8rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--muted); letter-spacing: 0; }
.tpl-lookups { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 20px; }
.tpl-lookup { background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-m); padding: 18px; min-width: 240px; }
.tpl-lookup h3 { font: 600 0.97rem/1.3 var(--body); letter-spacing: 0; margin-bottom: 10px; }
.tpl-lookup table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
.tpl-lookup th { text-align: right; font-weight: 600; color: var(--muted); font-size: 0.84rem; padding: 4px 0; border-bottom: 1px solid var(--rule); }
.tpl-lookup td { text-align: right; padding: 5px 0; border-bottom: 1px dashed var(--rule); }
.tpl-lookup tr:last-child td { border-bottom: 0; }
.tpl-fn-note { margin-top: 20px; max-width: 52em; }

.tpl-code { margin: 0; background: var(--ink); color: #e6efea; border-radius: var(--r-m); padding: 22px; overflow-x: auto; line-height: 1.7; }
.tpl-back { margin-top: 28px; font-weight: 600; }

/* ---- gallery */
.gal-head { padding-bottom: clamp(24px, 3vw, 40px); }
.gal-filter { display: grid; gap: 6px; max-width: 420px; }
.gal-body { padding-bottom: clamp(40px, 6vw, 80px); }
.gal-group { padding: 28px 0 36px; border-top: 2px solid var(--ink); }
.gal-group[hidden] { display: none; }
.gal-group-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; margin-bottom: 20px; }
.gal-group-head h2 { font-size: clamp(1.4rem, 2.2vw, 1.8rem); }
.gal-group-head a { font-size: 0.93rem; color: var(--muted); }
.gal-empty { padding: 28px 0; font-size: 1.05rem; }
@media (max-width: 600px) { .tpl-formulas tbody th { min-width: 0; width: 38%; } .tpl-formulas th, .tpl-formulas td { padding: 11px 12px; } }

/* Tables on public pages: price lists and comparisons. */
.crumbs { font-size: 0.9rem; margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.ptable-wrap { overflow-x: auto; border: 1px solid var(--ledger); border-radius: 12px; background: var(--white); }
.ptable { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.ptable th, .ptable td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--ledger); }
.ptable thead th { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.ptable tbody tr:last-child td, .ptable tbody tr:last-child th { border-bottom: 0; }
.ptable .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ptable-group th { font-weight: 700; background: var(--ledger); }
.ptable tbody th[scope="row"] { font-weight: 600; width: 26%; }
.ptable-ours { background: #fff8e1; }
.dated { font-size: 0.9rem; color: var(--muted); }
.steps-plain { margin: 0; padding-left: 1.3em; display: grid; gap: 12px; }
.steps-plain li { padding-left: 4px; }
.before-after { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: start; }
.before-after > div { display: grid; gap: 14px; }
.before-after .sheet { max-height: 640px; overflow-y: auto; font-size: 0.92rem; }
@media (max-width: 900px) { .before-after { grid-template-columns: 1fr; } }
