/* =========================================================================
   Email templates tool. Reuses the global tokens from global.css
   (--paper, --surface, --ink, --accent, --radius, --line, ...). Loaded
   only on the /tools/email-templates pages.
   ========================================================================= */

/* Category cards (hub + "more templates") -------------------------------- */
.tpl-cat-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .tpl-cat-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 920px) { .tpl-cat-grid { grid-template-columns: repeat(3, 1fr); } }
.tpl-cat-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 22px 22px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.tpl-cat-card:hover {
  background: var(--raise);
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px -22px rgba(26, 22, 17, 0.45);
}
.tpl-cat-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.tpl-cat-card h3 {
  font-family: var(--display); font-weight: 600; font-size: 19px;
  margin: 2px 0 0;
}
.tpl-cat-card p { color: var(--muted); font-size: 14px; line-height: 1.5; }
.tpl-cat-go { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--accent-deep); }

/* Tips block ------------------------------------------------------------- */
.tpl-tips {
  margin-top: 26px;
  padding: 20px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.tpl-tips h2 {
  font-family: var(--display); font-weight: 600; font-size: 17px;
  margin: 0 0 10px;
}
.tpl-tips ul { margin: 0; padding-left: 20px; display: grid; gap: 7px; }
.tpl-tips li { color: var(--muted); font-size: 14.5px; line-height: 1.55; }

/* Template cards --------------------------------------------------------- */
.tpl-list { margin-top: 26px; display: grid; gap: 22px; }
.tpl-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
}
.tpl-head h2 {
  font-family: var(--display); font-weight: 600; font-size: 20px;
  margin: 0;
}
.tpl-when { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 6px 0 0; }
.tpl-label {
  font-size: 10.5px; font-weight: 800;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted);
}
.tpl-subject {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px;
  padding: 10px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14.5px;
}
.tpl-subject-text { font-weight: 600; flex: 1; min-width: 200px; }
.tpl-body {
  margin: 12px 0 0;
  padding: 16px 18px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-wrap;
  word-wrap: break-word;
}
.tpl-actions { margin-top: 14px; display: flex; gap: 10px; }

/* Copy buttons ----------------------------------------------------------- */
.tpl-copy { transition: background 0.15s var(--ease), border-color 0.15s var(--ease); }
.tpl-copy-small {
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}
.tpl-copy-small:hover { background: var(--raise); }
.tpl-copy.copied,
.tpl-copy-small.copied { border-color: var(--accent-deep); }
