/* /writing-tools/word-counter/ — a counter that runs on the text in the box and nothing else. */

.wc {
  max-width: 760px;
  margin: 0 auto;
}

.wc-tool {
  margin: 28px 0 8px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}

.wc-input {
  display: block;
  width: 100%;
  min-height: 260px;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-family: 'Lora', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  resize: vertical;
}

.wc-input:focus {
  outline: none;
}

.wc-input::placeholder {
  color: var(--muted);
}

.wc-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  padding: 0;
  background: var(--border);
  list-style: none;
}

.wc-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 16px;
  background: var(--panel);
}

.wc-stats b {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.wc-stats span {
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--muted);
}

.wc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 0;
}

.wc-actions .wc-file-label { cursor: pointer; }

.wc-file-input:focus-visible + .wc-file-label {
  outline: 2px solid var(--st-green, #0d6248);
  outline-offset: 2px;
}

.wc-note {
  margin: 0;
  font-size: .84rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .wc-input { min-height: 200px; padding: 15px; }
  .wc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wc-stats b { font-size: 1rem; }
}

/* The tool page's only label is for screen readers; landing.css has no utility for that. */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}


/* ---------- Markdown preview tool ---------- */
.md-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0 10px;
}
.md-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}
.md-pane-head {
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .68rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.md-textarea {
  flex: 1;
  min-height: 340px;
  padding: 16px 18px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88rem;
  line-height: 1.6;
  resize: vertical;
}
.md-textarea:focus { outline: none; }
.md-output {
  flex: 1;
  max-height: 520px;
  overflow: auto;
  padding: 8px 20px 18px;
}
.md-output > :first-child { margin-top: .7em; }
.md-output h1 { font-size: 1.5rem; }
.md-output h2 { font-size: 1.2rem; }
.md-output h3 { font-size: 1.05rem; }
.md-output p, .md-output li { color: var(--muted); }
.md-output code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: .85em;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(0,0,0,.06);
}
.md-output pre {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0,0,0,.06);
  overflow-x: auto;
}
.md-output pre code { padding: 0; background: none; }
.md-output blockquote {
  margin: 1em 0;
  padding-left: 14px;
  border-left: 3px solid var(--border);
  color: var(--muted);
}
@media (max-width: 820px) {
  .md-grid { grid-template-columns: 1fr; }
}

