/* Festidy free tools (/tools). Builds on site.css (tokens, .btn, .prose, .cta, .crumbs, .out).
   One widget pattern for every tool: .tool holds the form (.t-form), the answer (.t-out), actions (.t-actions) and the
   plan link (.t-cta). Printables put what prints inside .t-print; everything else is hidden when printing. */

.t-page { max-width: 820px; }
.t-page h1 { margin-bottom: .3rem; }
.t-page > .lead { margin-top: 0; }

/* ---------- the widget ---------- */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: clamp(16px, 3.5vw, 26px); box-shadow: var(--shadow); margin: 1.4rem 0 2rem; display: grid; gap: 18px; }
.t-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px 16px; align-items: end; margin: 0; }
.t-form .wide { grid-column: 1 / -1; }
.t-field { display: grid; gap: 6px; min-width: 0; }
.t-field > label, .t-seg legend, .t-lab { font: 600 .8rem/1.2 var(--sans); letter-spacing: .02em; color: var(--ink-2); }
.t-field input[type="number"], .t-field input[type="text"], .t-field input[type="date"], .t-field input[type="time"], .t-field select, .t-field textarea {
  width: 100%; font: 500 1rem/1.3 var(--sans); color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 12px; min-height: 46px; }
.t-field textarea { min-height: 84px; resize: vertical; }
.t-field input:focus, .t-field select:focus, .t-field textarea:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-soft); }
.t-hint { font-size: .8rem; color: var(--ink-3); margin: 0; }

/* number with - and + */
.t-step { display: grid; grid-template-columns: 46px 1fr 46px; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--paper); }
.t-step:focus-within { border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-soft); }
.t-step button { border: 0; background: transparent; color: var(--ink); font: 500 1.35rem/1 var(--sans); cursor: pointer; min-height: 46px; }
.t-step button:hover { background: var(--paper-2); }
.t-step input { border: 0 !important; box-shadow: none !important; text-align: center; border-radius: 0 !important; background: transparent !important; min-width: 0; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.t-step input::-webkit-outer-spin-button, .t-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* chips: a radio or checkbox group that looks like pills */
.t-seg { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0; }
.t-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.t-chips label { position: relative; cursor: pointer; }
.t-chips input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.t-chips span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 999px; font: 500 .92rem/1.2 var(--sans); background: var(--paper); color: var(--ink); transition: background .15s, border-color .15s; }
.t-chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.t-chips input:focus-visible + span { outline: 3px solid var(--clay); outline-offset: 2px; }
.t-chips span:hover { border-color: var(--ink-3); }

/* the theme picked, shown as a banner */
.t-theme { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; background: var(--paper-2); }
.t-theme img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.t-theme b { font: 600 1rem/1.2 var(--serif); display: block; }
.t-theme span { font-size: .85rem; color: var(--ink-3); }

/* answers: big numbers in tiles (the same look as the site's .out) */
.t-out { min-width: 0; }
.t-out:empty { display: none; }
.t-res { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.t-res > div { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 2px; align-content: start; }
.t-res b { font: 600 clamp(1.6rem, 4vw, 2.1rem)/1.05 var(--serif); font-variant-numeric: tabular-nums; }
.t-res span { font-weight: 600; font-size: .95rem; }
.t-res small { color: var(--ink-3); font-size: .8rem; line-height: 1.35; }
.t-res > div.big { grid-column: 1 / -1; background: var(--clay-soft); border-color: transparent; }
.t-res > div.big b { font-size: clamp(2.2rem, 7vw, 3rem); }
.t-res > div.txt b { font: 600 1.12rem/1.3 var(--serif); }
.t-res > div.wide { grid-column: 1 / -1; }
.t-err { color: #b42318; font-size: .9rem; margin: 0; }
.t-note { background: var(--sage-bg); color: var(--ink); border-radius: 12px; padding: 10px 14px; font-size: .92rem; margin: 0; }

/* lists the tools produce (checklists, games, songs, schedules) */
.t-list, .prose .t-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.prose .t-list > li { margin: 0; }
.prose .t-list > li::marker { content: none; }
.t-list > li { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; }
.t-list > li h3 { font: 600 1.08rem/1.25 var(--serif); margin: 0; }
.t-list > li p { margin: 0; font-size: .95rem; }
.t-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--ink-3); }
.t-meta span { background: var(--paper-2); border-radius: 999px; padding: 2px 9px; }
.t-group { display: grid; gap: 10px; }
.t-group + .t-group { margin-top: 18px; }
.t-group > h3 { font: 600 .82rem/1.2 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0; }
.t-check { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.t-check input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--clay); }

/* actions and the plan link */
.t-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.t-actions:empty { display: none; }
.t-actions button, .t-actions a { font: 600 .9rem/1 var(--sans); padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.t-actions button:hover, .t-actions a:hover { border-color: var(--ink); }
.t-actions svg { width: 16px; height: 16px; }
.t-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.t-cta p { margin: 0; font-size: .92rem; color: var(--ink-2); max-width: 46ch; }

/* sections below the tool */
.t-how { background: var(--paper-2); border-radius: var(--r-card); padding: 18px 20px; margin: 1.5rem 0; }
.t-how h2 { margin-top: 0; }
.t-updated { font-size: .82rem; color: var(--ink-3); margin: .6rem 0 0; }
.t-planlink { margin: .8rem 0 0; } .t-planlink a { color: var(--ink); text-decoration-color: var(--clay); }  /* v130 */
.t-faq { display: grid; gap: 8px; margin: .6rem 0 1.6rem; }
details.faq { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 0 16px; }
details.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font: 400 1.3rem/1 var(--sans); color: var(--ink-3); }
details.faq[open] summary::after { content: "\2212"; }
details.faq > p, details.faq > ul { margin: 0 0 14px; }
.t-draft { border: 1.5px dashed var(--clay); background: var(--clay-soft); color: var(--ink); border-radius: 12px; padding: 8px 12px; font-size: .85rem; margin: 0; }

/* cards: the hub and "More free tools" */
.t-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.t-card { display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto 1fr; column-gap: 12px; row-gap: 2px; padding: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: var(--ink); transition: border-color .15s, transform .15s; min-width: 0; }
.t-card:hover { border-color: var(--ink-3); transform: translateY(-1px); text-decoration: none; }
.t-card .t-ic { grid-row: 1 / span 3; }
.t-card b { font: 600 1.05rem/1.25 var(--serif); }
.t-card span:not(.t-ic) { font-size: .9rem; color: var(--ink-2); line-height: 1.4; }
.t-card small { font: 600 .7rem/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 8px; align-self: end; }
.t-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--clay-soft); color: var(--ink); display: grid; place-items: center; }
.t-ic svg { width: 22px; height: 22px; }
.t-ic.big { width: 48px; height: 48px; }
.t-ic.big svg { width: 26px; height: 26px; }
.t-related { margin: 2.2rem 0 1rem; }
.t-related h2 { margin-bottom: .8rem; }

.t-hub { max-width: 1080px; }
.t-hub-head { margin: 1rem 0 1.4rem; }
.t-hub-head h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); margin: .2rem 0 .4rem; }
.t-hub-head .lead { max-width: 62ch; }
.t-jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1rem; }
.t-jump a { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font: 600 .9rem/1 var(--sans); background: var(--card); }
.t-jump a:hover { border-color: var(--ink-3); }
.t-jump svg { width: 18px; height: 18px; }
.t-cat { margin: 2.2rem 0; scroll-margin-top: 80px; }
.t-cat-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.t-cat-head h2 { margin: 0; font-size: 1.5rem; }
.t-cat-head p { margin: 2px 0 0; color: var(--ink-3); font-size: .95rem; }

/* printables: what prints sits in .t-print */
.t-print { display: grid; gap: 12px; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000 !important; }
  .nav, .foot, .crumbs, .skip, .t-form, .t-actions, .t-cta, .t-how, .t-faq, .t-related, .t-updated, .t-planlink, h2, .lead, .t-draft, .no-print, main > *:not(.tool), .tool > *:not(.t-out) { display: none !important; }
  main, .t-page { max-width: none !important; padding: 0 !important; margin: 0 !important; }
  .tool { box-shadow: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; background: none !important; }
  .t-print .card-break { break-inside: avoid; }
}

@media (max-width: 520px) {
  .t-form { grid-template-columns: 1fr 1fr; }
  .t-form .t-seg, .t-form .t-field.full { grid-column: 1 / -1; }
  .t-res { grid-template-columns: 1fr 1fr; }
  .t-cta .btn { width: 100%; text-align: center; justify-content: center; }
}
