/* rekopub.monoexp.com: the monoexp.com stylesheet, plus code, tables, downloads and the converter form */

:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #5f5f5a;
  --border: #e4e4e0;
  --accent: #1c1c1a;
  --tag-bg: #f0f0ed;
  --focus: #2f6fdb;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --max: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1a1a19;
    --text: #ececea;
    --muted: #a3a39e;
    --border: #2c2c2a;
    --accent: #ececea;
    --tag-bg: #252524;
    --focus: #7aa7f5;
  }
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-underline-offset: 3px; }
a:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* Header */
.site-header { border-bottom: 1px solid var(--border); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.wordmark {
  font: 600 18px/1 var(--mono);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark span { color: var(--muted); }
nav { display: flex; gap: 20px; }
nav a {
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
}
nav a:hover { color: var(--text); }

/* About */
.about { padding: 56px 0 40px; }
.about h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 6vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.about p { margin: 0 0 14px; color: var(--muted); max-width: 62ch; }
.about .lede { font-size: 20px; color: var(--text); }

/* Sections */
main section:not(.about) { padding-bottom: 48px; scroll-margin-top: 16px; }
main h2,
main .label {
  margin: 0 0 16px;
  font: 600 13px/1 var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
main h3,
main h4 { margin: 28px 0 8px; font-size: 19px; letter-spacing: -0.01em; }

/* A section that groups others, such as Download / Use ReKoPub */
main .group { padding-top: 40px; border-top: 1px solid var(--border); }
main .group > section:last-child { padding-bottom: 0; }
main h2.section-title {
  margin: 0 0 28px;
  font: 650 clamp(24px, 4.5vw, 30px)/1.2 var(--sans);
  text-transform: none;
  letter-spacing: -0.02em;
  color: var(--text);
}
main section p, main section li { max-width: 68ch; }
main section ul:not(.cards) { padding-left: 22px; }
main section li { margin-bottom: 6px; }
main section li pre { margin: 8px 0 0; }
.small { font-size: 14.5px; color: var(--muted); }

/* Code */
code { font: 0.88em/1.5 var(--mono); }
:not(pre) > code {
  background: var(--tag-bg);
  padding: 2px 5px;
  border-radius: 5px;
  white-space: nowrap;
}
pre {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
}
pre code { font-size: 14px; }

/* Feature cards */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 640px) {
  .cards { grid-template-columns: 1fr 1fr; }
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Tables */
.table-scroll { overflow-x: auto; margin: 0 0 16px; }
table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--border); }
th { font-weight: 600; font-size: 14px; color: var(--muted); }
td:first-child { white-space: nowrap; }
.libraries td:first-child { white-space: normal; min-width: 9em; }
.libraries td:last-child { white-space: nowrap; padding-right: 0; }

/* Download box */
.release {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 20px 6px;
  margin-bottom: 20px;
}
.release-version {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0 0 8px;
}
.release-version strong { font: 600 22px/1.2 var(--mono); letter-spacing: -0.02em; }
.release-version span { color: var(--muted); font-size: 15px; }
.downloads td:last-child a { font: 14.5px/1.5 var(--mono); overflow-wrap: anywhere; }
.downloads td:first-child { white-space: normal; }
@media (max-width: 520px) {
  .downloads thead { display: none; }
  .downloads tr { display: block; padding: 9px 0; border-bottom: 1px solid var(--border); }
  .downloads td { display: block; padding: 0; border: 0; }
  .downloads td:first-child { font-size: 14px; color: var(--muted); }
}

/* Converter form */
.convert {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.convert fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.convert label[for] { display: block; font-weight: 600; margin-bottom: 8px; }
.convert-row { display: flex; gap: 10px; }
.convert input[type="url"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: 16px/1.4 var(--sans);
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.convert button {
  padding: 10px 18px;
  font: 600 16px/1.4 var(--sans);
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
}
.convert input:focus-visible,
.convert button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.convert fieldset:disabled { opacity: 0.55; }
.convert fieldset:disabled button { cursor: not-allowed; }
.convert .formats { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 14px; }
.formats legend { float: left; margin-right: 6px; font-weight: 600; }
.formats label { display: inline-flex; align-items: baseline; gap: 6px; cursor: pointer; }
.formats label span { color: var(--muted); font-size: 14.5px; }
.convert-result:empty { display: none; }
.convert-result {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.convert-result p { margin: 0 0 8px; }
.convert > .small { margin: 16px 0 0; }
main section ul.convert-files { list-style: none; padding: 0; margin: 0 0 8px; }
.convert-files li { margin-bottom: 6px; }
.convert-files a { font: 15px/1.5 var(--mono); overflow-wrap: anywhere; }
.convert-error { font-weight: 600; }
@media (max-width: 520px) {
  .convert-row { flex-direction: column; }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); }
.site-footer p { margin: 0; padding: 24px 0 32px; font-size: 14px; color: var(--muted); }
