/* Format, the writing guides (/writing and the pages under it): pictures of
   exported papers, comparison tables, and the two small tools
   (public/tools.js). Loads after site.css and guide.css and draws with their
   tokens. */

/* A real exported page */
.shot-fig { margin: 20px 0 0; }
.shot-fig img {
  display: block; width: 100%; max-width: 420px; height: auto;
  border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-card); background: #fff;
}
.shot-fig figcaption { margin-top: 8px; font-size: 14px; color: var(--text-faint); }

/* Comparison tables */
.table-wrap { margin-top: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.cmp th, .cmp td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cmp thead th { font-weight: 650; border-bottom: 2px solid var(--line-strong); }
.cmp tbody th { font-weight: 600; }
@media (max-width: 640px) {
  .cmp { font-size: 14px; }
  .cmp th, .cmp td { padding: 8px; min-width: 9em; }
}

/* The tools */
.tool {
  margin-top: 16px; padding: var(--card-pad); background: var(--bg-raised);
  border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-card);
}
.tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tool-row + .tool-row { margin-top: 12px; }
.tool-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.tool input, .tool select, .tool textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--bg); color: var(--text); font: 16px/1.4 var(--sans);
}
.tool textarea { resize: vertical; }
.tool input:focus, .tool select:focus, .tool textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tool-out { margin-top: 16px; font-size: 18px; font-weight: 600; line-height: 1.45; color: var(--text); }
.tool-note { margin-top: 12px; font-size: 14px; color: var(--text-faint); }
.tool-cases { list-style: none; margin: 16px 0 0; padding: 0; }
.tool-cases li {
  display: grid; grid-template-columns: 11em 1fr auto; gap: 8px 12px; align-items: center;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.tool-k { font-size: 14px; font-weight: 600; color: var(--text-dim); }
.tool-v { font-family: var(--serif); font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.tool-copy { cursor: pointer; }
@media (max-width: 560px) {
  .tool { padding: 18px; }
  .tool-row { grid-template-columns: 1fr; }
  .tool-cases li { grid-template-columns: 1fr auto; }
  .tool-k { grid-column: 1 / -1; }
  .it-btns { flex-direction: row; }
}

/* The page tools: title page, heading, in-text citations, alphabetizer,
   annotated bibliography and templates (public/tools.js). */
.tool fieldset { border: 0; margin: 0 0 12px; padding: 0; }
.tool legend { padding: 0; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.tool-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.tool-seg label, .tool-check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 400; color: var(--text); cursor: pointer; }
.tool-seg label { padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); }
.tool .tool-seg input, .tool .tool-check input { width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent); }
.tool-seg label:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tool-row-1 { display: grid; grid-template-columns: 1fr; gap: 12px; }
.tool-row-1 + .tool-row, .tool-row + .tool-row-1, .tool-row + .tool-check, .tool-row + .tool-field { margin-top: 12px; }
.tool-hint { font-size: 13px; font-weight: 400; color: var(--text-faint); }
.tool-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.tool-actions .btn { cursor: pointer; }
.tool [hidden] { display: none !important; }
.tool-warn { margin-top: 10px; font-size: 14px; color: var(--text-dim); min-height: 1.4em; }

/* A sheet of US Letter paper, drawn to scale: 1-inch margins, 12-point type, double-spaced. */
.tool-paper { margin-top: 16px; max-width: 460px; container-type: inline-size; }
.tp-sheet {
  position: relative; aspect-ratio: 8.5 / 11; overflow: hidden; padding: 11.76cqw;
  background: #fff; color: #111; border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: var(--shadow-card);
  font-family: 'Times New Roman', Times, serif; font-size: 1.96cqw; line-height: 2;
}
.tp-head { position: absolute; top: 5.88cqw; left: 11.76cqw; right: 11.76cqw; display: flex; justify-content: space-between; line-height: 1; }
.tp-head.tp-right { justify-content: flex-end; }
.tp-line { margin: 0; overflow-wrap: anywhere; }
.tp-c { text-align: center; }
.tp-b { font-weight: 700; }
.tp-i { text-indent: 5.88cqw; }
.tp-g1 { margin-top: 2em; }
.tp-g2 { margin-top: 4em; }
.tp-g3 { margin-top: 6em; }
.tp-faint { color: var(--text-faint); }
.tp-sheet .tp-faint { color: #777; }

/* In-text citations, one row per style */
.it-form { display: block; }
.it-form + .it-form { margin-top: 4px; }
.it-label, .it-note { font-family: var(--sans); font-size: 13px; color: var(--text-faint); }
.it-note { display: block; margin-top: 4px; }
.it-btns { display: flex; flex-direction: column; gap: 6px; }

/* A box that takes pasted citations and keeps their italics */
.tool-box {
  min-height: 160px; max-height: 420px; overflow-y: auto; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--serif); overflow-wrap: anywhere;
}
.tool-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tool-box:empty::before { content: attr(data-placeholder); color: var(--text-faint); }
.an-entry.tool-box { min-height: 64px; }

/* The sorted list and the annotated preview: hanging indents, as on the page */
.ab-out { margin-top: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg); font-family: var(--serif); font-size: 16px; line-height: 2; }
.ab-head, .an-title { margin: 0; text-align: center; }
.ab-list { list-style: none; margin: 0; padding: 0; }
.ab-list li, .an-cite { margin: 0; padding-left: 2em; text-indent: -2em; overflow-wrap: anywhere; }
.ab-single { line-height: 1.4; }
.ab-single li + li { margin-top: 1em; }
.an-note { margin: 0; padding-left: 2em; overflow-wrap: anywhere; }
.an-note.an-mla { padding-left: 4em; }
.an-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.an-row-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--text-dim); }
.an-row textarea { margin-top: 8px; }
.an-remove { cursor: pointer; }

/* Template downloads */
.tpl-files { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.tpl-files li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-raised); }
.tpl-files b { display: block; }
.tpl-files span { font-size: 14px; color: var(--text-faint); }
