/* The template gallery (/templates) and its pages, written by tools/build-templates.py. */

/* A template's sheet, in the light colours of Ratio's "sum" theme, the way website/s.html draws a shared sheet. */
.rsheet { --s-bg: #fcfcf9; --s-text: #13343b; --s-dim: #8a9799; --s-faint: #c9d0d0; --s-label: #5c7377; --s-accent: #1f8a96; --s-result: #167f8b;
  margin: 8px 0 0; background: var(--s-bg); color: var(--s-text); border: 1px solid var(--line); border-radius: 22px; padding: 24px 26px;
  font-family: var(--mono); font-size: 15px; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .03); }
.rsheet table { width: 100%; border-collapse: collapse; }
.rsheet td { padding: 0; height: 1.9em; vertical-align: baseline; border: 0; background: none; }
.rsheet td.in { white-space: pre-wrap; overflow-wrap: anywhere; padding-right: 24px; }
.rsheet td.end { text-align: right; white-space: nowrap; }
.rsheet .out { color: var(--s-result); font-weight: 500; }
.vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rsheet .out[title] { cursor: help; text-decoration: underline dotted color-mix(in srgb, var(--s-result) 45%, transparent); text-underline-offset: 3px; }
.rsheet .row.sum .out { color: var(--s-text); font-weight: 600; }
.rsheet .row.head .in { font-family: var(--sans); font-weight: 600; font-size: 1.12em; }
.rsheet .s-op, .rsheet .s-unit { color: var(--s-dim); }
.rsheet .s-keyword, .rsheet .s-variable { color: var(--s-accent); }
.rsheet .s-label { color: var(--s-label); }
.rsheet .s-comment { color: var(--s-faint); }
.rsheet .s-header { font-family: var(--sans); font-weight: 600; color: var(--s-text); }
.rsheet .tag { line-height: 1.3; color: var(--s-label); background: color-mix(in srgb, var(--s-text) 5.5%, transparent);
  box-shadow: inset 0 0 0 .75px color-mix(in srgb, var(--s-text) 9%, transparent); border-radius: 6px; padding: 0 3px; margin: 0 -3px; }

/* Use / open / copy */
.t-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.legal .t-actions a.pill { text-decoration: none; }
.legal .t-actions a.pill-light { color: #000; }
.t-actions button { font-family: inherit; }
.t-hint { margin: 14px 0 0; padding: 14px 18px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); font-size: 15px; color: var(--dim); }
.t-hint[hidden] { display: none; }

/* The gallery */
.legal .t-grid { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.legal .t-grid li { margin: 0; }
.legal a.t-card { display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 22px 22px 18px; border-radius: 22px; background: var(--card);
  border: 1px solid var(--line); box-shadow: 0 1px 2px rgba(0, 0, 0, .03); text-decoration: none; color: var(--text); transition: transform .2s, box-shadow .2s; }
.legal a.t-card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 0, 0, .07); }
.legal a.t-card:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.t-card-title { font-size: 19px; font-weight: 500; letter-spacing: -0.03em; }
.t-card-text { font-size: 15px; color: var(--dim); line-height: 1.45; }
.t-card-text code { font-size: .9em; }
.t-card-lines { display: grid; gap: 2px; margin-top: auto; padding-top: 12px; font-family: var(--mono); font-size: 12.5px; color: #5c7377; }
.t-card-lines span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-by { font-size: 13px; color: var(--faint); }

/* Share your template */
.t-form-wrap { margin-top: 56px; padding: 28px; border-radius: 26px; background: var(--card); border: 1px solid var(--line); }
.legal .t-form-wrap h2 { margin-top: 0; }
.t-submit-cta { margin-top: 40px; padding: 18px 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); }
.legal .t-submit-cta p { margin: 0; }
.contact { display: grid; gap: 18px; margin-top: 8px; }
.contact label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text); }
.contact input, .contact textarea { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: 16px/1.4 var(--sans); }
.contact textarea[name="sheet"] { font: 14.5px/1.6 var(--mono); }
.contact input:focus, .contact textarea:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.contact button { font-family: inherit; }
.contact button:disabled { opacity: .6; cursor: default; }
.contact-status { font-size: 14px; color: var(--dim); }
.contact-status.bad { color: #c0392b; }
.t-done { margin: 0; font-size: 17px; color: var(--text); }

@media (max-width: 600px) {
  .rsheet { padding: 16px 14px; font-size: 13.5px; border-radius: 18px; }
  .rsheet td.in { padding-right: 12px; min-width: 7ch; }
  .rsheet td.end { white-space: normal; }
  .t-actions .pill { width: 100%; }
  .t-form-wrap { padding: 20px 16px; }
}
