/* ═══════════════════════════════════════════════════════════════════════
   free-tools.css — downloadable invoice templates (/invoice-templates/*)
   and the calculators (/calculators/*). 2026-11-12.
   Rides on tokens.css + main.css + guides.css. Every colour is a token, so
   the Sandstone (default) and Obsidian themes both work with nothing extra.
   ═══════════════════════════════════════════════════════════════════════ */

.ft-narrow { max-width: 860px; }

/* ── Breadcrumb ── */
.ft-crumbs ol { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0;
  font: 600 var(--text-xs)/1.6 var(--font-body); color: var(--ink-muted); }
.ft-crumbs li + li::before { content: "/"; margin: 0 8px; opacity: .6; }
.ft-crumbs a { color: var(--ink-muted); text-decoration: underline; text-underline-offset: 2px; }
.ft-crumbs a:hover { color: var(--ink); }

/* ── Template page hero: copy + downloads left, preview right ── */
.ft-hero { padding-bottom: clamp(32px, 5vw, 64px); }
.ft-hero__grid { display: grid; gap: clamp(28px, 4vw, 56px); align-items: start; margin-top: 10px; }
.ft-hero__grid > * { min-width: 0; }
@media (min-width: 940px) { .ft-hero__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); } }
.ft-hero__copy { text-align: left; }
.ft-hero__copy .dim-hero__eyebrow { justify-content: flex-start; }
.ft-h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.2rem); margin: 14px 0 16px; }
.ft-lead { font-size: var(--text-lg); color: var(--ink-body); line-height: 1.65; margin: 0 0 24px; max-width: 640px; }
.ft-note { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.65; margin: 14px 0 0; }
.ft-note a, .ft-also a, .ft-prose a, .ft-promo a:not(.dim-btn), .ft-calc__src a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.ft-dl__h { font: 700 var(--text-md)/1.4 var(--font-display); margin: 0 0 12px; letter-spacing: -.01em; }
.ft-dl { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ft-dl__btn {
  display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 10px 16px 10px 10px;
  border: 1px solid var(--line-hi); border-radius: var(--r-md); background: var(--bg-card-hi);
  color: var(--ink); text-decoration: none; transition: border-color var(--dur-fast), transform var(--dur-fast);
}
.ft-dl__btn:hover { border-color: var(--brand); transform: translateY(-1px); }
.ft-dl__btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ft-dl__fmt {
  flex: none; width: 54px; height: 40px; border-radius: var(--r-sm); display: grid; place-items: center;
  font: 800 12px/1 var(--font-body); letter-spacing: .04em; color: #fff;
}
.ft-dl__btn--pdf  .ft-dl__fmt { background: #A3261B; }
.ft-dl__btn--docx .ft-dl__fmt { background: #1F4E99; }
.ft-dl__btn--xlsx .ft-dl__fmt { background: #146C3A; }
.ft-dl__txt { display: grid; gap: 2px; min-width: 0; }
.ft-dl__txt strong { font: 700 var(--text-md)/1.3 var(--font-body); }
.ft-dl__txt span { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.4; }

.ft-preview { margin: 0; }
.ft-preview a { display: block; border-radius: var(--r-sm); }
.ft-preview img {
  display: block; width: 100%; height: auto; max-width: 560px; margin: 0 auto; background: #fff;
  border: 1px solid var(--line-hi); border-radius: var(--r-sm); box-shadow: var(--shadow-pane);
}
.ft-preview figcaption { text-align: center; margin-top: 10px; font-size: var(--text-sm); color: var(--ink-muted); }

/* ── Additions to the fill-in template pages (_invoice-template-page.php) ── */
.ft-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ft-herodl { display: flex; flex-wrap: wrap; gap: 8px 10px; justify-content: center; align-items: center; margin: -6px auto 0;
  font: 600 var(--text-sm)/1.4 var(--font-body); color: var(--ink-muted); }
.ft-herodl > span { flex-basis: 100%; }
@media (min-width: 640px) { .ft-herodl > span { flex-basis: auto; } }
.ft-howto { margin: 18px 0 0; padding-left: 1.2em; font-size: var(--text-sm); color: var(--ink-body); line-height: 1.65; }
.ft-howto li { margin-bottom: .5em; }
.ft-howto strong { color: var(--ink); }
.ft-ticks { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 16px auto 0; padding: 0;
  font: 600 var(--text-sm)/1.5 var(--font-body); color: var(--ink); }
.ft-ticks li::before { content: "\2713"; color: var(--teal); margin-right: 6px; font-weight: 800; }

/* ── Content sections ── */
.ft-sec { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(28px, 4vw, 48px); }
.ft-sec .dim-h2 { margin-bottom: 18px; }
.ft-cards { align-items: stretch; }
.ft-card { padding: 18px 20px; }
.ft-card h3 { font-size: 1rem; margin: 0 0 6px; }
.ft-card p { margin: 0; font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.65; }
.ft-prose { font-size: 1.0625rem; line-height: 1.75; color: var(--ink-body); }
.ft-prose h2 { margin-top: clamp(28px, 4vw, 44px); }
.ft-prose h2:first-child { margin-top: 0; }
.ft-prose ul { padding-left: 1.3em; margin: 0 0 1em; }
.ft-prose li { margin: 0 0 .55em; }
.ft-prose p { margin: 0 0 1em; }
.ft-prose strong { color: var(--ink); }

.ft-promo { padding: clamp(24px, 4vw, 40px); text-align: center; }
.ft-promo .dim-h2 { margin-top: 0; }
.ft-promo__body p { color: var(--ink-body); max-width: 640px; margin: 10px auto 0; line-height: 1.7; }
.ft-promo__fine { font-size: var(--text-xs); color: var(--ink-muted); max-width: 600px; margin: 16px auto 0; line-height: 1.6; }

.ft-chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ft-chips a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-hi); background: var(--bg-card); color: var(--ink); text-decoration: none;
  font: 600 var(--text-sm)/1 var(--font-body);
}
.ft-chips a:hover { border-color: var(--brand); color: var(--brand); }
.ft-also { margin: 20px 0 0; font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.9; }

/* ── Hub cards (template thumbnails, calculator cards) ── */
.ft-hubcard { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-decoration: none; color: var(--ink); }
.ft-hubcard:hover { border-color: var(--line-hi); }
.ft-hubcard:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.ft-hubcard__img { display: block; background: var(--bg-raise); padding: 18px 18px 0; height: 210px; overflow: hidden; }
.ft-hubcard__img img { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto;
  border: 1px solid var(--line); border-bottom: 0; border-radius: 4px 4px 0 0; box-shadow: 0 6px 24px rgba(60,40,20,.12); }
.ft-hubcard__body { display: grid; gap: 4px; padding: 16px 18px 20px; }
.ft-hubcard__h { font: 700 1rem/1.35 var(--font-display); margin: 0; letter-spacing: -.01em; }
.ft-hubcard__h a { color: var(--ink); text-decoration: none; }
.ft-hubcard__h a:hover { color: var(--brand); text-decoration: underline; }
/* whole card clickable through the title link */
.ft-hubcard { position: relative; }
.ft-hubcard__h a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.ft-hubcard__app { position: relative; z-index: 2; justify-self: start; margin-top: 6px; font-size: var(--text-xs); color: var(--ink-muted); text-decoration: underline; text-underline-offset: 2px; min-height: 24px; display: inline-flex; align-items: center; }
.ft-hubcard__app:hover { color: var(--brand); }
.ft-hubcard__p { margin: 0; font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.55; }
.ft-hubcard__fmt { margin: 6px 0 0; font: 700 var(--text-xs)/1.4 var(--font-body); color: var(--teal); letter-spacing: .03em; }

/* ── Calculator hub cards ── */
.ft-calccard { display: flex; flex-direction: column; gap: 8px; padding: 22px; text-decoration: none; color: var(--ink); }
.ft-calccard:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.ft-calccard__i { width: 48px; height: 48px; border-radius: var(--r-md); display: grid; place-items: center; color: var(--teal); background: var(--bg-raise); border: 1px solid var(--line); }
.ft-calccard__h { font: 700 1.0625rem/1.3 var(--font-display); margin: 6px 0 0; letter-spacing: -.01em; }
.ft-calccard__p { margin: 0; font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.6; flex: 1; }
.ft-calccard__go { font: 700 var(--text-sm)/1.4 var(--font-body); color: var(--brand); }

/* ── Calculators ── */
.ft-calc { display: grid; gap: clamp(18px, 3vw, 28px); margin-top: 10px; }
.ft-calc > * { min-width: 0; }
@media (min-width: 900px) { .ft-calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.ft-calc__form, .ft-calc__out { padding: clamp(18px, 3vw, 28px); }
.ft-calc__form h2, .ft-calc__out h2 { font: 700 1.125rem/1.3 var(--font-display); margin: 0 0 14px; }
.ft-field { display: grid; gap: 6px; margin-bottom: 16px; }
.ft-field label, .ft-field legend { font: 700 var(--text-sm)/1.4 var(--font-body); color: var(--ink); }
.ft-field .ft-hint { font-size: var(--text-xs); color: var(--ink-muted); line-height: 1.5; }
.ft-input, .ft-select {
  width: 100%; min-height: 48px; padding: 10px 14px; font: 600 16px/1.3 var(--font-body);  /* 16px: no iOS zoom */
  color: var(--ink); background: var(--bg-card-hi); border: 1px solid var(--line-hi); border-radius: var(--r-md);
  font-variant-numeric: tabular-nums;
}
.ft-input:focus, .ft-select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.ft-money { position: relative; }
.ft-money::before { content: "$"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-muted); font-weight: 700; pointer-events: none; }
.ft-money .ft-input { padding-left: 28px; }
.ft-check { display: flex; gap: 10px; align-items: flex-start; font-size: var(--text-sm); color: var(--ink-body); line-height: 1.5; margin-bottom: 16px; }
.ft-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--brand); }
.ft-row2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 520px) { .ft-row2 { grid-template-columns: 1fr 1fr; } }
fieldset.ft-field { border: 0; padding: 0; margin: 0 0 16px; }

.ft-big { margin: 0 0 4px; font: 800 clamp(2rem, 1.4rem + 2.6vw, 2.8rem)/1.1 var(--font-display); color: var(--teal); font-variant-numeric: tabular-nums; letter-spacing: -.02em; overflow-wrap: anywhere; }
.ft-big__lbl { margin: 0 0 18px; font-size: var(--text-sm); color: var(--ink-muted); }
.ft-res { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.ft-res th, .ft-res td { padding: 9px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; color: var(--ink-body); }
.ft-res th { font-weight: 600; padding-right: 12px; }
.ft-res td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink); font-weight: 700; }
.ft-res tr.ft-res__total th, .ft-res tr.ft-res__total td { border-top: 2px solid var(--ink); border-bottom: 0; color: var(--ink); font-weight: 800; font-size: var(--text-md); }
.ft-res .ft-res__sub th { font-weight: 500; color: var(--ink-muted); padding-left: 12px; }
.ft-res .ft-res__sub td { font-weight: 600; color: var(--ink-muted); }
.ft-msg { margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-raise); border: 1px solid var(--line); font-size: var(--text-sm); line-height: 1.6; color: var(--ink-body); }
.ft-msg[hidden] { display: none; }
.ft-due { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.ft-due li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-card-hi); font-size: var(--text-sm); }
.ft-due li strong { color: var(--ink); }
.ft-due li span { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.ft-due li.is-past { opacity: 1; background: transparent; }
.ft-due li.is-past strong::after { content: " (date passed)"; font-weight: 500; color: var(--ink-muted); }
.ft-disclaimer { margin: 16px 0 0; padding: 12px 14px; border-left: 3px solid var(--amber); background: var(--bg-raise); border-radius: 0 var(--r-sm) var(--r-sm) 0; font-size: var(--text-sm); line-height: 1.6; color: var(--ink-body); }
.ft-calc__src { font-size: var(--text-xs); color: var(--ink-muted); line-height: 1.7; margin: 14px 0 0; }
