/*
 * AskDimitri Authorship Sheet (/tools/authorship/).
 * Colours and fonts come from /css/tokens.css and the shared rules from
 * /css/site.css; only what this tool adds lives here. Mobile first.
 */

.page.tool { max-width: 760px; }
.tool [hidden] { display: none !important; }
/* The skip link focuses <main> by script (the address holds the sheet); no ring around the whole page. */
#main:focus { outline: none; }

h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 6vw, 40px); line-height: 1.2;
  color: var(--ink); margin: 0 0 20px;
}
h1.stroke::after { animation-delay: 0.6s; }
.lede { font-family: var(--serif); font-size: 18px; line-height: 1.75; }
.lede p { margin: 0 0 18px; }

.callout { border-left: 3px solid var(--delta); background: var(--card); padding: 14px 18px; margin: 8px 0 24px; font-size: 15px; }
.callout p { margin: 0; }
.callout b { font-weight: 600; color: var(--ink); }

.start { margin: 0 0 8px; font-size: 15px; }

/* Sections */
.block { border-top: 1px solid var(--hairline); margin-top: 36px; padding-top: 26px; }
.block h2 {
  font-family: var(--serif); font-weight: 500; font-size: 24px; line-height: 1.3;
  color: var(--ink); margin: 0 0 12px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
.block h2 .num {
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--paper); background: var(--ink);
  border-radius: 50%; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; transform: translateY(-3px);
}
.opt { font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--muted); }
.hint { font-size: 15px; color: var(--text); margin: 0 0 16px; }
.fineprint .link-button { color: var(--ink); }

/* Fields this tool adds to the site's input styles */
textarea, input[type="date"] {
  display: block; width: 100%; padding: 10px 14px;
  font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--text);
  background-color: var(--card); border: 1px solid var(--field-border); border-radius: 8px;
}
input[type="date"] { height: 48px; padding: 0 14px; }
textarea { resize: vertical; min-height: 72px; }
textarea:hover, input[type="date"]:hover { border-color: var(--ink); }
textarea:focus-visible, input[type="date"]:focus-visible, input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}
input[readonly] { background: var(--tint); color: var(--text); font-size: 14px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 20px; height: 20px; margin: 0; flex: 0 0 auto; }

.check-field { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 15px; }
.check-field label { cursor: pointer; }

/* Buttons that sit in a row */
.btn.inline { display: inline-flex; align-items: center; justify-content: center; width: auto; height: 44px; padding: 0 18px; margin: 0; font-size: 15px; }
.btn.small { display: inline-flex; align-items: center; justify-content: center; width: auto; height: 40px; padding: 0 14px; margin: 0; font-size: 14px; }
.actions-row, .copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 14px 0 0; }
.btn-link { font-size: 15px; color: var(--ink); }
.copied { font-size: 14px; color: var(--delta); font-weight: 500; }

/* Glossaries */
details.glossary { background: var(--card); border: 1px solid var(--hairline); border-radius: 10px; padding: 0 16px; margin: 0 0 12px; font-size: 15px; }
details.glossary > summary { cursor: pointer; padding: 12px 0; font-weight: 500; color: var(--ink); }
details.glossary[open] > summary { border-bottom: 1px solid var(--hairline); margin-bottom: 10px; }
details.glossary p { margin: 0 0 10px; }
.criteria { margin: 0 0 10px; padding-left: 22px; }
.criteria li { margin: 0 0 6px; }
.criteria b, .roles-list dt { font-weight: 500; }
.roles-list { margin: 0 0 12px; display: grid; gap: 8px; }
.roles-list div { display: grid; gap: 0; }
.roles-list dt { margin: 0; }
.roles-list dd { margin: 0; color: var(--muted); font-size: 14px; }
@media (min-width: 640px) { .roles-list { grid-template-columns: 1fr 1fr; column-gap: 20px; } }

/* Author and paper cards */
.cards { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--hairline); border-radius: 10px; }
.card > details > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; min-height: 52px;
}
.card > details > summary::-webkit-details-marker { display: none; }
/* The word is visual only: the empty alternative text keeps it out of the
   summary's accessible name, which already says expanded or collapsed. */
.card > details > summary::after { content: "Show"; content: "Show" / ""; margin-left: auto; font-size: 13px; color: var(--muted); text-decoration: underline; }
.card > details[open] > summary::after { content: "Hide"; content: "Hide" / ""; }
.card > details[open] > summary { border-bottom: 1px solid var(--hairline); }
.card summary:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 10px; }
.pos {
  font-size: 13px; font-weight: 600; color: var(--ink); border: 1.5px solid var(--ink); border-radius: 50%;
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.who { font-weight: 500; font-size: 16px; }
.who.placeholder { color: var(--muted); font-weight: 400; }
.meta { font-size: 13px; color: var(--muted); }
.card-body { padding: 14px 16px 16px; }
.card-body fieldset { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.card-body legend { font-size: 13.5px; font-weight: 600; margin: 0 0 8px; padding: 0; }
.flags, .ticks { display: grid; gap: 8px; }
.flags label, .ticks label { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.45; cursor: pointer; }
.flags label input, .ticks label input { margin-top: 1px; }
.ticks .sub { color: var(--muted); font-size: 13.5px; display: block; }
.role-grid { display: grid; gap: 6px 18px; }
@media (min-width: 600px) { .role-grid { grid-template-columns: 1fr 1fr; } }
.role-row { display: grid; grid-template-columns: minmax(0, 1fr) 144px; align-items: center; gap: 10px; padding: 3px 6px; border-radius: 6px; }
.role-row label { font-size: 14.5px; line-height: 1.35; }
.role-row select { height: 40px; font-size: 14.5px; padding: 0 28px 0 10px; background-position: right 10px center; }
.role-row.set { background: var(--tint); }
.role-row.set label { font-weight: 500; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.card-actions .danger { color: var(--danger); border-color: var(--danger-line); }
.card-actions .danger:hover:not(:disabled) { background: var(--danger-bg); }
.btn.secondary:disabled { opacity: 0.5; }

.paper-card { padding: 14px 16px 16px; }
.paper-card fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.paper-card legend { font-weight: 500; font-size: 16px; margin: 0 0 8px; padding: 0; display: flex; align-items: center; gap: 10px; }

/* Results */
.results .out { margin: 0 0 28px; }
.results h3 { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 10px; }
.options { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 6px; }
.options fieldset { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.options legend { font-size: 13px; color: var(--muted); padding: 0; margin: 0 0 4px; width: 100%; }
.choice { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; }
.output {
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.65;
  background: var(--card); border: 1px solid var(--hairline); border-radius: 8px; padding: 14px 16px; margin: 10px 0 0;
}
.output.empty { color: var(--muted); }
.label { font-size: 13.5px; font-weight: 600; margin: 16px 0 0; }
.notes { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.note { font-size: 15px; line-height: 1.55; padding: 10px 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--hairline); border-left: 3px solid var(--delta); }
.note .tag { font-weight: 600; margin-right: 6px; }
.note.check { border-left-color: var(--gold); }
.note.flag { border-left-color: var(--danger); background: var(--danger-bg); }
.note.flag .tag { color: var(--danger); }
.note.ok { border-left-color: var(--delta); }
.note.empty { color: var(--muted); border-left-color: var(--hairline); }
.gaps { margin: 8px 0 0; padding-left: 20px; font-size: 15px; }
.gaps li { margin: 0 0 6px; }
details.conventions { margin: 14px 0 0; font-size: 15px; }
details.conventions > summary { cursor: pointer; color: var(--ink); font-weight: 500; }

/* Kickoff agreement */
.agreement { background: var(--card); border: 1px solid var(--hairline); border-radius: 10px; padding: 20px 22px; margin: 18px 0 0; font-size: 15px; }
.agreement h3 { font-family: var(--serif); font-weight: 500; font-size: 22px; color: var(--ink); margin: 0 0 6px; }
.agreement .notice { display: inline-block; font-size: 13px; font-weight: 600; color: var(--danger); border: 1px solid var(--danger-line); background: var(--danger-bg); border-radius: 6px; padding: 2px 8px; margin: 0 0 10px; }
.agreement h4 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; }
.agreement p { margin: 0 0 8px; }
.agreement ul, .agreement ol { margin: 0 0 8px; padding-left: 22px; }
.agreement li { margin: 0 0 4px; }
.agreement .closing { color: var(--muted); font-size: 13px; margin-top: 18px; }

.members { background: var(--card); border: 1px solid var(--hairline); border-radius: 10px; padding: 20px 22px; }
.members h2 { font-size: 20px; }

footer.site .source { margin: 0 0 8px; color: var(--text); }
footer.site .source a { color: var(--ink); }
footer.site .site-links { margin: 0; }

.print-only { display: none; }

@media (max-width: 420px) {
  .role-row { grid-template-columns: minmax(0, 1fr) 140px; }
  .block h2 { font-size: 22px; }
  .agreement, .members { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn.inline, .btn.small { transition: none; }
}

/* Print: the sheet as a one-to-two-page record, or only the agreement */
@media print {
  @page { margin: 16mm; }
  body, body.glow { background: #fff; color: #000; font-size: 11pt; line-height: 1.5; }
  .watermark, .skip, nav.site, .no-print, .callout, .lede, .eyebrow, .tool .hint, details.glossary, #load-error, .copied { display: none !important; }
  .print-only { display: block !important; }
  span.print-only { display: inline !important; }
  .page, .page.tool { max-width: none; padding: 0; margin: 0; }
  h1 { font-size: 22pt; margin: 0 0 8pt; }
  h1.stroke::after { display: none; }
  .block { border-top: 1px solid #999; margin-top: 14pt; padding-top: 10pt; break-inside: auto; }
  .block h2 { font-size: 15pt; }
  .block h2 .num { display: none; }
  .output, .note, .agreement { background: #fff; border-color: #999; break-inside: avoid; }
  .note.flag { background: #fff; }
  details.conventions > summary { list-style: none; }
  a { color: #000; text-decoration: none; }
  a.cite::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  /* Editing controls do not print; the summary table stands in for them. */
  .block.editing { display: none !important; }
  .print-table { width: 100%; border-collapse: collapse; font-size: 10pt; margin: 6pt 0 12pt; }
  .print-table th, .print-table td { border: 1px solid #999; padding: 4pt 6pt; text-align: left; vertical-align: top; }
  .print-table th { background: #eee; }
  footer.site { margin-top: 18pt; color: #000; }
  footer.site .source { font-size: 9pt; }

  body.print-agreement main > *:not(.tool-body), body.print-agreement .tool-body > *:not(.kickoff),
  body.print-agreement h1, body.print-agreement .kickoff > h2, body.print-agreement .kickoff .hint { display: none !important; }
  body.print-agreement .kickoff { border: 0; margin: 0; padding: 0; }
  body.print-agreement .agreement { border: 0; padding: 0; margin: 0; }
}
