/* Atlas Presets: readable, high-contrast, keyboard-first. No JavaScript is needed anywhere. */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #161616;
  --muted: #4a4a4a;
  --link: #0b4fb3;
  --accent: #0b4fb3;
  --accent-fg: #ffffff;
  --border: #8a8a8a;
  --panel: #f2f2f2;
  --error: #b00020;
  --focus: #e8a100;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --fg: #f1f1f1;
    --muted: #c6c6c6;
    --link: #8fbcff;
    --accent: #8fbcff;
    --accent-fg: #0b1a33;
    --border: #777777;
    --panel: #1f1f1f;
    --error: #ff7b7b;
    --focus: #ffd24d;
  }
}

html { font-size: 112.5%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  background: var(--bg);
  color: var(--fg);
}

a { color: var(--link); }
a:focus, button:focus, input:focus, select:focus, textarea:focus, audio:focus, summary:focus, [tabindex]:focus {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
main:focus { outline: none; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-fg);
  padding: .5rem 1rem;
  z-index: 10;
}
.skip-link:focus { left: 1rem; top: 1rem; }

.site-header {
  border-bottom: 2px solid var(--border);
  padding: .75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 2rem;
  align-items: center;
}
.site-title { margin: 0; font-size: 1.45rem; font-weight: 700; line-height: 1.3; }
.site-title a { text-decoration: none; color: var(--fg); }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 3px; }
.site-header nav[aria-label="Account"] { margin-left: auto; }

main { max-width: 62rem; margin: 0 auto; padding: 1rem; }
/* The banner holds the only level 1 heading. Inside main: level 2 is the page
   title, 3 a section, 4 an item in a list. */
main h2 { font-size: 1.9rem; line-height: 1.2; margin: .5rem 0 1rem; }
main h3 { font-size: 1.35rem; margin: 1.75rem 0 .5rem; }
main h4 { font-size: 1.15rem; margin: 0 0 .4rem; }
.item h3, .item h4 { margin: 0 0 .4rem; }
.lead { font-size: 1.15rem; }
.meta, .help { color: var(--muted); margin: .25rem 0; }
.status { color: var(--error); font-weight: 400; }

button, .button, .link-button {
  font: inherit;
  cursor: pointer;
}
button, .button {
  display: inline-block;
  padding: .55rem 1.1rem;
  border: 2px solid var(--accent);
  border-radius: .35rem;
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  font-weight: 600;
}
button.secondary, .button.secondary { background: transparent; color: var(--link); }
button.danger { background: var(--error); border-color: var(--error); color: #fff; }
.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--link);
  text-decoration: underline;
  font-weight: 400;
}
.inline-form { display: inline; }

input, select, textarea {
  font: inherit;
  width: 100%;
  max-width: 40rem;
  padding: .5rem .6rem;
  border: 2px solid var(--border);
  border-radius: .35rem;
  background: var(--bg);
  color: var(--fg);
  box-sizing: border-box;
}
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; margin-right: .5rem; vertical-align: middle; }
input[type="file"] { border: none; padding: .25rem 0; }
textarea { min-height: 8rem; }

.field { margin: 1.1rem 0; }
.field label { display: block; font-weight: 700; margin-bottom: .25rem; }
.field-checkbox label { display: inline; font-weight: 600; }
.required { font-weight: 400; color: var(--muted); }
.errorlist { color: var(--error); margin: .25rem 0; padding-left: 1.25rem; font-weight: 600; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--error); }
.form-errors { border: 3px solid var(--error); border-radius: .35rem; padding: .75rem 1rem; margin: 1rem 0; }
main .form-errors h3 { margin: 0 0 .5rem; color: var(--error); font-size: 1.2rem; }

.messages { margin: 0 0 1rem; }
.message {
  border-left: 6px solid var(--accent);
  background: var(--panel);
  padding: .75rem 1rem;
  margin: .5rem 0;
}
.message.error { border-color: var(--error); }
main .message h3 { margin-top: 0; font-size: 1.2rem; }

.quick-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .75rem; }
.items { list-style: none; padding: 0; margin: 0; }
.item {
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .9rem 1rem;
  margin: .9rem 0;
  background: var(--panel);
}
.item p { margin: .35rem 0; }

details.filters {
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .5rem 1rem;
  margin: 0 0 1rem;
}
details.filters summary {
  cursor: pointer;
  font-weight: 700;
  padding: .35rem 0;
}
details.filters form {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  align-items: flex-end;
  padding: .5rem 0 .5rem;
}
details.filters .field { margin: 0; flex: 1 1 11rem; }
details.filters .actions { flex: 1 1 100%; margin: .25rem 0 0; }

.actions { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; margin: 1rem 0; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; }
dl.facts dt { font-weight: 700; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.hash { font-size: .85rem; }

audio { display: block; width: 100%; max-width: 40rem; margin: .5rem 0; }
.byline { margin: -.5rem 0 .25rem; font-size: 1.1rem; }
.facts { margin: .25rem 0 .75rem; color: var(--muted); }
.preview-player { margin: .5rem 0 1rem; }
.preview-button { min-width: 11rem; }

table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.contents-table th[scope="row"] { font-weight: 600; }
.contents-table td:last-child { white-space: nowrap; }
caption { text-align: left; font-weight: 700; margin-bottom: .5rem; }
th, td { border: 1px solid var(--border); padding: .5rem .6rem; text-align: left; vertical-align: top; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .95em; }
pre { background: var(--panel); border: 1px solid var(--border); border-radius: .35rem; padding: .75rem 1rem; overflow-x: auto; }
.token { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; }

.pagination ul { list-style: none; padding: 0; display: flex; gap: 1.5rem; }
.contents { padding-left: 1.25rem; }
.tag-list { columns: 2; column-gap: 2rem; padding-left: 1.25rem; }

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

/* The account menu: one button with the member's name, opening a list. */
.account-menu { position: relative; }
.account-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-block;
  padding: .45rem 1rem;
  border: 2px solid var(--accent);
  border-radius: .35rem;
  font-weight: 600;
  color: var(--link);
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu[open] summary { background: var(--accent); color: var(--accent-fg); }
.account-menu ul {
  position: absolute;
  right: 0;
  top: calc(100% + .35rem);
  min-width: 15rem;
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .4rem 0;
  margin: 0;
  z-index: 5;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.account-menu li { display: block; }
.account-menu li a, .account-menu li .link-button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: .5rem 1rem;
  text-align: left;
  text-decoration: none;
  color: var(--fg);
}
.account-menu li a:hover, .account-menu li a:focus,
.account-menu li .link-button:hover, .account-menu li .link-button:focus {
  background: var(--panel);
  text-decoration: underline;
}

.danger-zone {
  border: 2px solid var(--error);
  border-radius: .5rem;
  padding: .25rem 1rem 1rem;
  margin-top: 2rem;
}
main .danger-zone h3 { color: var(--error); }
.warning {
  border-left: 6px solid var(--error);
  background: var(--panel);
  padding: .75rem 1rem;
}

.upload-status:not(:empty) {
  border-left: 6px solid var(--accent);
  background: var(--panel);
  padding: .75rem 1rem;
  margin: 1rem 0;
  font-weight: 600;
}

.site-footer {
  border-top: 2px solid var(--border);
  padding: 1rem;
  margin-top: 2rem;
  color: var(--muted);
  font-size: .95rem;
}

@media (max-width: 40rem) {
  html { font-size: 106%; }
  .account-menu ul { position: static; box-shadow: none; margin-top: .5rem; }
  dl.facts { grid-template-columns: 1fr; gap: 0 }
  dl.facts dd { margin-bottom: .6rem; }
  .tag-list { columns: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
