/*
 * Free tool pages.
 *
 * Plain CSS rather than Tailwind utilities, because several of these class
 * names are produced by assets/js/tolinku-tools.js and the scanner cannot see
 * a class that only exists inside a JavaScript string.
 *
 * The page reuses .tolinku-blog-band for its hero, so the sand ground, the
 * curved bottom corners and the fixed-header clearance are the same ones the
 * blog and the marketing pages use rather than a second implementation.
 */

/* ── Hero ───────────────────────────────────────────────────────────────── */
.tolinku-tool-hero {
  max-width: 44rem;
  margin: 0 auto;
  padding: 0 1rem 1.5rem;
  text-align: center;
}
@media (min-width: 1024px) { .tolinku-tool-hero { padding-left: 2rem; padding-right: 2rem; } }

.tolinku-tool-eyebrow { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; }
.tolinku-tool-eyebrow a { color: var(--color-orange-ink); }
.tolinku-tool-eyebrow a:hover { color: var(--color-orange); }

.tolinku-tool-title {
  font-family: var(--font-display, inherit);
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 500;
  color: #000;
  margin-bottom: 1rem;
}
.tolinku-tool-lede {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--color-muted);
  margin: 0 auto 2rem;
  max-width: 36rem;
}

/* ── Form ───────────────────────────────────────────────────────────────── */
.tolinku-tool-form { display: grid; gap: 0.5rem; }
.tolinku-tool-form.is-hero {
  display: flex;
  gap: 0.625rem;
  max-width: 34rem;
  margin: 0 auto;
  /* Without this the button stretches to the height of whatever sits beside
     it, which a pill radius then renders as an oval blob. */
  align-items: center;
}
@media (max-width: 575px) { .tolinku-tool-form.is-hero { flex-direction: column; } }

.tolinku-tool-label { font-size: 0.875rem; font-weight: 600; color: #000; margin-top: 0.75rem; }
.tolinku-tool-input {
  width: 100%; padding: 0.75rem 1rem; border: 2px solid #000;
  border-radius: 0.75rem; font-size: 0.9375rem; background: #fff; color: #111827;
  font-family: inherit;
}
.tolinku-tool-input.is-hero {
  flex: 1; padding: 0.9375rem 1.25rem; border-radius: 9999px; font-size: 1rem;
}
.tolinku-tool-input:focus { outline: none; box-shadow: 3px 3px 0 #000; }
.tolinku-tool-hint { font-size: 0.8125rem; color: var(--color-muted); margin-top: -0.125rem; }
.tolinku-tool-hint.is-hero { margin: 1rem auto 0; max-width: 32rem; text-align: center; }

.tolinku-tool-button {
  justify-self: start; margin-top: 1rem; padding: 0.9375rem 1.75rem; border-radius: 9999px;
  background: var(--color-ink); color: #fff; font-weight: 600; font-size: 0.9375rem;
  white-space: nowrap; transition: transform .14s ease, box-shadow .14s ease;
}
.tolinku-tool-form.is-hero .tolinku-tool-button { margin-top: 0; }
.tolinku-tool-button:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--color-orange); }
.tolinku-tool-button:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

/* ── Body ───────────────────────────────────────────────────────────────── */
/*
 * Block padding only. The width and the side gutter come from .tolinku-shell
 * in tolinku-nav.css, which is the one ladder the header, the footer and every
 * page on the site share. This used to be its own 68rem box, which is why the
 * header never lined up with it.
 */
.tolinku-tool-body { padding-top: 2.5rem; padding-bottom: 0; }

.tolinku-tool-panel {
  border: 2px solid #000; border-radius: 1rem; padding: 1.5rem;
  background: #fff; max-width: 44rem; margin: 0 auto;
}
.tolinku-tool-output { margin: 1.75rem auto 0; max-width: 44rem; }

.tolinku-tool-cols { display: grid; gap: 2.5rem; margin-top: 3.5rem; }
@media (min-width: 900px) { .tolinku-tool-cols { grid-template-columns: minmax(0, 1fr) 19rem; gap: 3.5rem; } }

/*
 * A reading measure, not a column width.
 *
 * The prose column is `1fr` in a grid whose other track is the 19rem aside, so
 * before the page moved onto .tolinku-shell it was whatever 68rem left over:
 * about 664px, roughly 83 characters. On the shell the same 1fr grew to
 * 1152px, about 144 characters, which is twice a comfortable line and was a
 * readability regression, not a design change anyone asked for.
 *
 * Capped here rather than on the grid track, so the aside stays pinned to the
 * right edge of the shell and only the text stops early.
 */
.tolinku-tool-prose { max-width: 42rem; }

.tolinku-tool-prose h2 {
  font-family: var(--font-display, inherit);
  font-size: 1.5rem; font-weight: 500; color: #000;
  letter-spacing: -0.02em; margin: 2.25rem 0 0.875rem;
}
.tolinku-tool-prose h2:first-child { margin-top: 0; }
.tolinku-tool-prose p { font-size: 1rem; line-height: 1.7; color: var(--color-muted); margin-bottom: 1rem; }
.tolinku-tool-prose code {
  font-family: var(--font-mono, monospace); font-size: 0.875em;
  background: var(--color-sand); padding: 0.1em 0.35em; border-radius: 0.25rem; color: #000;
}

.tolinku-tool-aside {
  border: 2px solid #000; border-radius: 1rem; padding: 1.5rem;
  background: var(--color-cream); align-self: start;
}
.tolinku-tool-aside-head { font-size: 1rem; font-weight: 600; color: #000; margin-bottom: 0.875rem; }
.tolinku-check-list { display: grid; gap: 0.5rem; padding-left: 1.125rem; margin: 0; list-style: disc; }
.tolinku-check-list li { font-size: 0.875rem; color: var(--color-muted); line-height: 1.55; }
.tolinku-check-list li::marker { color: var(--color-orange); }
.tolinku-tool-note {
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--color-line);
  font-size: 0.8125rem; color: var(--color-muted); line-height: 1.5;
}

/* ── Further reading and other tools ────────────────────────────────────── */
.tolinku-tool-section-head {
  font-family: var(--font-display, inherit);
  font-size: 1.5rem; font-weight: 500; color: #000;
  letter-spacing: -0.02em; margin-bottom: 1.5rem;
}
.tolinku-tool-related { margin-top: 4.5rem; }
.tolinku-tool-cards { display: grid; gap: 1.75rem; }
@media (min-width: 700px) { .tolinku-tool-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tolinku-tool-card-art {
  aspect-ratio: 16 / 10; border-radius: 0.875rem; overflow: hidden;
  margin-bottom: 0.875rem; background: var(--color-sand);
}

.tolinku-tool-other { margin-top: 4.5rem; }
.tolinku-tool-otherlist { display: grid; gap: 0.75rem; }
@media (min-width: 700px) { .tolinku-tool-otherlist { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tolinku-tool-otheritem {
  display: block; padding: 1.125rem 1.25rem; border: 2px solid var(--color-line);
  border-radius: 0.875rem; transition: border-color .14s ease, transform .14s ease;
}
.tolinku-tool-otheritem:hover { border-color: #000; transform: translate(-1px, -1px); }
.tolinku-tool-othername { display: block; font-size: 0.9375rem; font-weight: 600; color: #000; }
.tolinku-tool-otherdesc { display: block; font-size: 0.8125rem; color: var(--color-muted); margin-top: 0.1875rem; }

.tolinku-verdict {
  display: flex; align-items: baseline; gap: 0.75rem; flex-wrap: wrap;
  padding: 1rem 1.25rem; border-radius: 0.75rem; border: 1px solid var(--color-line);
}
.tolinku-verdict strong { font-size: 1.0625rem; }
.tolinku-verdict span { font-size: 0.8125rem; color: var(--color-muted); }
.tolinku-verdict.is-ok { border-color: #15803d; }
.tolinku-verdict.is-warning { border-color: #b45309; }
.tolinku-verdict.is-error { border-color: var(--color-orange); }
.tolinku-checked { font-size: 0.8125rem; color: var(--color-muted); margin-top: 0.75rem; }
.tolinku-checked code, .tolinku-summary code {
  font-family: var(--font-mono, monospace); font-size: 0.8125rem; word-break: break-all;
}

.tolinku-findings { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.75rem; }
.tolinku-finding {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.875rem 1rem; border: 1px solid var(--color-line); border-radius: 0.75rem;
}
.tolinku-finding-msg { font-size: 0.9375rem; color: #000; }
.tolinku-finding-fix { font-size: 0.8125rem; color: var(--color-muted); margin-top: 0.375rem; line-height: 1.5; }
.tolinku-pill {
  flex-shrink: 0; font-size: 0.6875rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; padding: 0.25rem 0.5rem; border-radius: 0.375rem; color: #fff;
}
.tolinku-pill.is-error { background: var(--color-orange); }
.tolinku-pill.is-warning { background: #b45309; }
.tolinku-pill.is-info { background: #15803d; }

.tolinku-hops { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.5rem; }
.tolinku-hops li {
  display: flex; gap: 0.75rem; align-items: center;
  padding: 0.625rem 0.875rem; border: 1px solid var(--color-line); border-radius: 0.625rem;
  font-size: 0.8125rem;
}
.tolinku-hops code { font-family: var(--font-mono, monospace); word-break: break-all; flex: 1; }
.tolinku-status { font-weight: 700; min-width: 2.5rem; }
.tolinku-ms { color: var(--color-muted); }

.tolinku-summary { margin-top: 1rem; font-size: 0.8125rem; color: var(--color-muted); line-height: 1.8; }
.tolinku-file { margin-top: 1.5rem; }
.tolinku-file-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.tolinku-file-head code { font-family: var(--font-mono, monospace); font-size: 0.875rem; font-weight: 600; }
.tolinku-download { font-size: 0.8125rem; font-weight: 600; color: var(--color-orange-ink); }
.tolinku-pre {
  background: var(--color-sand); border: 1px solid var(--color-line); border-radius: 0.75rem;
  padding: 1rem; font-family: var(--font-mono, monospace); font-size: 0.8125rem;
  overflow-x: auto; color: #111827;
  /* pre-wrap, not pre: a 95 character fingerprint is one long line and
     scrolling sideways to read it is worse than wrapping. JSON output is
     unaffected, since its lines are short and indentation is preserved. */
  white-space: pre-wrap; word-break: break-all;
}
.tolinku-check-list { display: grid; gap: 0.5rem; padding-left: 1.125rem; list-style: disc; }
.tolinku-check-list li::marker { color: var(--color-line); }
.tolinku-check-list li { font-size: 0.9375rem; color: var(--color-muted); line-height: 1.6; }

/* ── Tools index ────────────────────────────────────────────────────────── */
.tolinku-tool-index { display: grid; gap: 1rem; }
@media (min-width: 700px) { .tolinku-tool-index { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tolinku-tool-indexcard {
  display: block; padding: 1.5rem; border: 2px solid var(--color-line);
  border-radius: 1rem; transition: border-color .14s ease, transform .14s ease, box-shadow .14s ease;
}
.tolinku-tool-indexcard:hover {
  border-color: #000; transform: translate(-2px, -2px); box-shadow: 5px 5px 0 #000;
}
.tolinku-tool-indextag {
  display: inline-block; font-size: 0.6875rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--color-muted); margin-bottom: 0.625rem;
}
.tolinku-tool-indexname { font-size: 1.125rem; font-weight: 600; color: #000; margin-bottom: 0.375rem; }
.tolinku-tool-indexcard:hover .tolinku-tool-indexname { color: var(--color-orange); }
.tolinku-tool-indexdesc { font-size: 0.9375rem; color: var(--color-muted); line-height: 1.55; }

/* ── QR generator ───────────────────────────────────────────────────────── */
/*
 * Its own block, because this tool is a control panel beside a live preview
 * rather than the single form the other tools share. Class names are written
 * here and in the markup, not produced in JavaScript, but they live in this
 * file so the whole tool set is styled in one place.
 */
.tolinku-qr-layout {
  display: grid;
  gap: 2rem;
  align-items: start;
  margin-bottom: 3rem;
}
@media (min-width: 900px) {
  .tolinku-qr-layout { grid-template-columns: minmax(0, 1fr) 20rem; gap: 2.5rem; }
}

.tolinku-qr-kinds { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.25rem; }
.tolinku-qr-kinds button {
  border: 1px solid var(--color-line);
  background: #fff;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.875rem;
  cursor: pointer;
}
.tolinku-qr-kinds button.is-active {
  background: var(--color-ink, #000);
  border-color: var(--color-ink, #000);
  color: #fff;
}

.tolinku-qr-group {
  border: 1px solid var(--color-line);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin-top: 1rem;
  background: #fff;
}
.tolinku-qr-group > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9375rem;
  list-style: none;
}
.tolinku-qr-group > summary::-webkit-details-marker { display: none; }
.tolinku-qr-group > summary::after { content: " +"; color: var(--color-muted); }
.tolinku-qr-group[open] > summary::after { content: " \2212"; }

.tolinku-qr-grid { display: grid; gap: 0.75rem 1rem; margin-top: 0.85rem; }
@media (min-width: 560px) { .tolinku-qr-grid { grid-template-columns: 1fr 1fr; } }
.tolinku-qr-grid label { display: block; font-size: 0.8125rem; font-weight: 600; }
.tolinku-qr-grid label .tolinku-tool-input,
.tolinku-qr-grid label select { margin-top: 0.3rem; font-weight: 400; }

.tolinku-qr-colour {
  display: block;
  width: 100%;
  height: 2.4rem;
  margin-top: 0.3rem;
  padding: 0.15rem;
  border: 1px solid var(--color-line);
  border-radius: 0.5rem;
  background: #fff;
  cursor: pointer;
}

.tolinku-qr-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  margin-top: 0.7rem;
}
.tolinku-qr-check input { width: auto; margin: 0; }

.tolinku-qr-clear {
  margin-top: 0.75rem;
  background: none;
  border: 1px solid var(--color-line);
  border-radius: 0.5rem;
  padding: 0.35rem 0.8rem;
  font-size: 0.8125rem;
  cursor: pointer;
}

.tolinku-qr-side { position: sticky; top: 6rem; }
.tolinku-qr-preview {
  border: 1px solid var(--color-line);
  border-radius: 0.75rem;
  background:
    linear-gradient(45deg, #f3f3f3 25%, transparent 25%, transparent 75%, #f3f3f3 75%) 0 0 / 16px 16px,
    linear-gradient(45deg, #f3f3f3 25%, transparent 25%, transparent 75%, #f3f3f3 75%) 8px 8px / 16px 16px,
    #fff;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 15rem;
}
.tolinku-qr-preview svg {
  width: 100%;
  height: auto;
  /* Wider than it looks like it needs to be: at 16rem a version 3 code gets
     about 6.6px per module, which is where sub-pixel gaps between dots start
     to disappear. */
  max-width: 20rem;
}
.tolinku-qr-empty { color: var(--color-muted); font-size: 0.875rem; text-align: center; margin: 0; }

.tolinku-qr-actions { display: flex; gap: 0.5rem; margin-top: 0.85rem; }
.tolinku-qr-actions .tolinku-tool-button { flex: 1; }
.tolinku-qr-actions .is-ghost { background: #fff; color: var(--color-ink, #000); border: 1px solid var(--color-line); }

.tolinku-qr-notes { list-style: none; margin: 1rem 0 0; padding: 0; font-size: 0.8125rem; line-height: 1.5; }
.tolinku-qr-notes li { padding-left: 1.1rem; position: relative; margin-bottom: 0.45rem; color: var(--color-muted); }
.tolinku-qr-notes li::before { content: "\2022"; position: absolute; left: 0; color: var(--color-line); }
.tolinku-qr-notes li.is-warn { color: var(--color-orange-ink); }
.tolinku-qr-notes li.is-warn::before { content: "\26A0"; font-size: 0.75rem; }
