/*
  Shared by every page of extworks.com — the catalogue and each extension's pages under /<slug>/:
  colour tokens for both themes, the page column, header with the theme switch, footer, store
  buttons. The theme follows the system unless the visitor picked one: theme.js puts it on
  <html data-theme>. The dark tokens are written twice, for each of the two ways to get there.
*/
:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --bg: #F6F2EA;
  --surface: #FFFCF6;
  --line: #E2DBCF;
  --text: #1B1916;
  --muted: #645D53;
  --accent: #B8391F;
  --on-accent: #FFFCF6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #14120F;
    --surface: #1E1B17;
    --line: #332E27;
    --text: #EFE9DF;
    --muted: #A89F92;
    --accent: #F0704F;
    --on-accent: #14120F;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14120F;
  --surface: #1E1B17;
  --line: #332E27;
  --text: #EFE9DF;
  --muted: #A89F92;
  --accent: #F0704F;
  --on-accent: #14120F;
}

/* Pictures and icons drawn for one theme: .only-light and .only-dark. Only ever hidden, so each
   keeps its own display. */
:root[data-theme="light"] .only-dark,
:root[data-theme="dark"] .only-light { display: none !important; }
@media (prefers-color-scheme: light) { :root:not([data-theme]) .only-dark { display: none !important; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .only-light { display: none !important; } }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: 880px; margin: 0 auto; padding: 28px 16px 40px; }

.site-header { display: flex; align-items: center; gap: 12px; margin-bottom: 56px; }
.brand {
  display: flex; align-items: center; gap: 10px; margin-right: auto;
  color: inherit; text-decoration: none;
  font: 600 18px/1 var(--mono); letter-spacing: -0.02em;
}
.mark { width: 32px; height: 32px; }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.theme-toggle:hover { color: var(--text); border-color: var(--muted); }
.theme-toggle svg { width: 18px; height: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 16px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn[aria-disabled="true"] { background: transparent; border-style: dashed; color: var(--muted); cursor: default; }
.btn[aria-disabled="true"]:hover { border-color: var(--line); color: var(--muted); }

.site-footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line);
  color: var(--muted); font: 13px/1.4 var(--mono);
}
.site-footer a { color: inherit; }
.site-footer a:hover { color: var(--accent); }
