/* FileBench — main.css
   The only stylesheet for the whole site.
   Palette: paper #FAF6EF, ink #1C1A17, amber #C2410C, steel #4B5563,
   success #166534, error #B91C1C, hairline #E3DED2.
   Fonts: system only. Headings Georgia serif; body system-ui;
   code ui-monospace. No external URLs anywhere in this file. */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --paper: #faf6ef;
  --ink: #1c1a17;
  --amber: #c2410c;
  --amber-dark: #9a3412;
  --steel: #4b5563;
  --success: #166534;
  --error: #b91c1c;
  --hairline: #e3ded2;
  --panel: #fffdf8;
  --radius: 4px;
}

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}

h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; margin-top: 2.25rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }

a { color: var(--amber); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--amber-dark); }

img, svg { display: block; max-width: 100%; }
svg { flex-shrink: 0; }

ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }
li { margin-bottom: 0.35rem; }

code, kbd, pre, output, samp {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
}
pre {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
code { background: #f1ece0; padding: 0.1em 0.3em; border-radius: 3px; }
pre code { background: none; padding: 0; }

/* Focus: visible, high contrast, everywhere */
:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ---------- Layout ---------- */

.wrap {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1rem;
}

main { display: block; padding: 2rem 0 3rem; }
main > section { margin-bottom: 2.5rem; }

/* ---------- Header / footer ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--ink);
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; }
.brand-name {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-left: auto;
}
.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--amber); border-bottom-color: var(--amber); }
.site-nav a[aria-current="page"] { color: var(--amber); border-bottom-color: var(--amber); }

.site-footer {
  border-top: 1px solid var(--hairline);
  padding: 1.75rem 0 2.25rem;
  color: var(--steel);
  font-size: 0.95rem;
}
.site-footer .footer-note {
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
  margin-bottom: 1rem;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1rem;
}
.footer-nav a { color: var(--steel); }
.footer-nav a:hover { color: var(--amber); }
.footer-copy { margin: 0; }
.footer-copy a { color: var(--steel); }

/* ---------- Hero / tool panels ---------- */

.tool-hero { margin-bottom: 1.75rem; }
.tool-hero p { color: var(--steel); max-width: 44rem; }
.tool-hero p:last-child { margin-bottom: 0; }

.tool-panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Dropzone + file input (used by every file-based tool) */
.dropzone {
  border: 2px dashed var(--hairline);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 2rem 1.25rem;
  text-align: center;
  cursor: pointer;
  color: var(--steel);
}
.dropzone p { margin: 0 0 0.5rem; }
.dropzone p:last-child { margin-bottom: 0; }
.dropzone svg { margin: 0 auto 0.75rem; color: var(--amber); }
.dropzone.drag-over {
  border-color: var(--amber);
  border-style: solid;
  background: #fdf3ec;
  color: var(--ink);
}
.dropzone:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--ink);
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.btn:hover { border-color: var(--amber); color: var(--amber); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #fff;
}
.btn-primary:hover { background: var(--amber-dark); border-color: var(--amber-dark); color: #fff; }

.btn-secondary {
  background: transparent;
  border-color: var(--steel);
  color: var(--steel);
}
.btn-secondary:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- Results / status / errors ---------- */

.results {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.results h2 { margin-top: 0; }

.status {
  color: var(--steel);
  font-size: 0.98rem;
  margin: 0.75rem 0;
}
.status:empty { display: none; }

.error {
  color: var(--error);
  background: #fdf0ef;
  border: 1px solid #f3c8c4;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}
.error:empty { display: none; }
.error[hidden] { display: none; }

/* ---------- Supporting sections (tool pages) ---------- */

.howto, .tips, .faq, .related {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}
.howto h2, .tips h2, .faq h2, .related h2 { margin-top: 0; }
.howto ol, .tips ul { margin-bottom: 0; }
.faq dt { font-weight: 700; margin: 0.9rem 0 0.25rem; }
.faq dd { margin: 0 0 0.5rem; }
.related ul { list-style: none; padding-left: 0; margin-bottom: 0; }
.related li { margin-bottom: 0.4rem; }

.privacy-line {
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
  color: var(--steel);
  font-size: 0.98rem;
}

/* ---------- Home: search + tool grid ---------- */

.search-box { margin: 1.25rem 0 0.5rem; max-width: 32rem; }
.search-box input[type="search"] { width: 100%; }

.tool-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.tool-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
}
.tool-card a {
  display: block;
  height: 100%;
  padding: 1.1rem 1.25rem;
  color: var(--ink);
  text-decoration: none;
}
.tool-card a:hover { border-color: var(--amber); }
.tool-card a:hover h3 { color: var(--amber); }
.tool-card svg { color: var(--amber); margin-bottom: 0.6rem; }
.tool-card h3 { margin-bottom: 0.3rem; }
.tool-card p { margin: 0; color: var(--steel); font-size: 0.97rem; }

.category-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
}
.category-list a { color: var(--ink); }
.category-list a:hover { color: var(--amber); }

/* ---------- Forms / fields ---------- */

.field { margin-bottom: 1.1rem; }
.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.field .field-hint {
  display: block;
  font-weight: 400;
  color: var(--steel);
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

input, textarea, select, button { font: inherit; }

input[type="text"], input[type="search"], input[type="number"],
input[type="email"], input[type="url"], input[type="password"],
textarea, select {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--steel);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 9rem; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: 3px solid var(--amber);
  outline-offset: 1px;
  border-color: var(--amber);
}
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--amber); }
input[type="range"] { width: 100%; accent-color: var(--amber); }

button { cursor: pointer; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.icon { width: 24px; height: 24px; }

/* ---------- Breakpoints ---------- */

@media (min-width: 768px) {
  h1 { font-size: 2.25rem; }
  .wrap { padding: 0 1.5rem; }
  main { padding: 2.75rem 0 3.5rem; }
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-panel { padding: 1.75rem; }
  .results, .howto, .tips, .faq, .related { padding: 1.5rem 1.75rem; }
  .header-inner { flex-wrap: nowrap; }
}

@media (min-width: 1280px) {
  .tool-grid { grid-template-columns: repeat(3, 1fr); }
  .wrap { max-width: 76rem; }
}
