/* Every page on releasefolio.tenhatch.com: the public pages, the sellers' security pages and the
   dashboard. Every colour pair is measured in test/unit/package.test.ts. */

:root {
  --bg: #ffffff;
  --text: #14161f;
  --muted: #4a5163;
  --line: #7a8194;
  --link: #2a4fb8;
  --focus: #2a4fb8;
  --box: #eef2fb;
  --button: #2a4fb8;
  --button-text: #ffffff;
  --error: #b3261e;
  --ok: #17663a;
  --warn: #8a4b00;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11131a;
    --text: #eef0f6;
    --muted: #b9bfcd;
    --line: #8a91a3;
    --link: #9db7ff;
    --focus: #b7c9ff;
    --box: #1b2133;
    --button: #9db7ff;
    --button-text: #11131a;
    --error: #ffb4ab;
    --ok: #8fe0a8;
    --warn: #f5c06b;
    color-scheme: dark;
  }
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    'Segoe UI',
    -apple-system,
    BlinkMacSystemFont,
    Roboto,
    'Helvetica Neue',
    sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 16px;
  top: 8px;
  background: var(--bg);
  padding: 6px 10px;
  z-index: 10;
}

header.site {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

header.site a,
header.site .brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  text-decoration: none;
  min-height: 24px;
}

header.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-left: auto;
}

header.site nav a {
  font-weight: 400;
  font-size: 16px;
  color: var(--link);
  text-decoration: underline;
}

h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 12px;
}

h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 32px 0 8px;
}

h3 {
  font-size: 18px;
  margin: 20px 0 6px;
}

a {
  color: var(--link);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.lede {
  font-size: 19px;
}

.muted {
  color: var(--muted);
}

.box {
  background: var(--box);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 16px 0;
}

.box > :first-child {
  margin-top: 0;
}

.box > :last-child {
  margin-bottom: 0;
}

ul.plain {
  padding-left: 20px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 2px solid var(--button);
  border-radius: 8px;
  background: var(--button);
  color: var(--button-text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button.secondary,
button.secondary {
  background: transparent;
  color: var(--link);
}

button.small {
  min-height: 32px;
  padding: 4px 12px;
}

button[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.table-wrap {
  /* Positioned, so text kept for screen readers inside a wide table scrolls with it. */
  position: relative;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}

caption {
  text-align: left;
  font-weight: 600;
  margin-bottom: 4px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 8px 6px;
  vertical-align: top;
  /* Words break only when a column cannot hold them, so tables keep their natural widths. */
  overflow-wrap: break-word;
}

form label,
.field label {
  display: block;
  font-weight: 600;
  margin: 12px 0 4px;
}

label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

input[type='email'],
input[type='text'],
input[type='url'],
input[type='number'],
input[type='month'],
input[type='datetime-local'],
select,
textarea {
  width: 100%;
  max-width: 560px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

textarea {
  min-height: 120px;
}

input[type='checkbox'] {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
}

/* Date and month fields put the focus on their parts, so the field itself shows the ring. */
input:focus,
select:focus,
textarea:focus,
input:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.field {
  max-width: 100%;
  min-width: 0;
}

input,
select,
textarea {
  min-width: 0;
}

.row .field {
  flex: 1 1 220px;
}

.hint {
  color: var(--muted);
  font-size: 15px;
  margin: 4px 0 0;
}

.error {
  color: var(--error);
  font-weight: 600;
}

.ok {
  color: var(--ok);
  font-weight: 600;
}

.warn {
  color: var(--warn);
  font-weight: 600;
}

.honeypot {
  display: none;
}

blockquote {
  margin: 8px 0;
  padding: 4px 14px;
  border-left: 4px solid var(--line);
}

.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;
}

footer.site {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
}

footer.site nav {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

footer.site a {
  display: inline-block;
  min-height: 24px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.card h3 {
  margin-top: 0;
}

.price {
  font-size: 28px;
  font-weight: 700;
}

.notice {
  border-left: 4px solid var(--warn);
  padding-left: 12px;
  margin: 16px 0;
}

pre.draft {
  white-space: pre-wrap;
  background: var(--box);
  color: var(--text);
  border-radius: 8px;
  padding: 12px;
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 15px;
}

/* The dashboard. */

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.top .grow {
  flex: 1;
}

.top select {
  width: auto;
  min-width: 200px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 16px;
}

.tabs button {
  background: transparent;
  color: var(--link);
  border-color: var(--line);
}

.tabs button[aria-current='page'] {
  background: var(--button);
  color: var(--button-text);
  border-color: var(--button);
}

.banner {
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0 16px;
  border: 2px solid var(--line);
}

.banner.bad {
  border-color: var(--error);
}

.banner.ok {
  border-color: var(--ok);
}

.clock {
  display: inline-block;
  min-width: 7em;
  font-weight: 600;
}

.state-overdue {
  color: var(--error);
  font-weight: 700;
}

.state-due {
  color: var(--warn);
  font-weight: 700;
}

.state-sent {
  color: var(--ok);
  font-weight: 700;
}

.state-waiting {
  color: var(--muted);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

details {
  margin: 8px 0;
}

summary {
  cursor: pointer;
  min-height: 24px;
  font-weight: 600;
}

@media print {
  .top,
  .tabs,
  .buttons,
  footer.site,
  .no-print {
    display: none;
  }
}
