/* IBM Plex, latin subsets, SIL OFL 1.1 (../fonts/OFL.txt). The Sans file is
   variable and covers every weight between 400 and 600. */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-600-latin.woff2") format("woff2");
}

/* Light only, as the simulator's design is. */

:root {
  color-scheme: light;
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-alt: #fafbfc;
  --sunken: #eef1f6;
  --border: #d3dae4;
  --rule: #dde3ea;
  --divider: #b9c3cf;
  --text: #12202e;
  --text-muted: #5a6b7c;
  --text-dim: #8593a0;
  --accent: #1a5ec4;
  --accent-hover: #124a9e;
  --accent-soft: #eaf1fb;
  --selected: #cfe0f7;
  --mate: #e6effb;
  --hover: #f7fafd;
  --danger: #c23b3b;
  --danger-soft: #f7e7e7;
  --warn: #8a6d1f;
  --warn-soft: #f6efdc;
  --ok: #157a63;
  --ok-soft: #e4f2ee;
  --code-bg: #12202e;
  --code-text: #d8e2ec;
  --radius: 5px;
  --header: 56px;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 var(--sans);
}

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

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.2;
}

/* Layout */

header {
  flex: none;
  min-height: var(--header);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

header > a {
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Messages -- class names match Django's message tags */

.messages {
  list-style: none;
  margin: 16px 24px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.messages li {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  white-space: pre-line;
}

.messages .error {
  border-left-color: var(--danger);
}

/* Controls */

button,
.button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button[disabled] {
  cursor: default;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font: 15px/1.4 var(--sans);
  outline: none;
}

textarea {
  padding: 10px 14px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  min-height: 0;
  accent-color: var(--accent);
}

/* htmx */

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
  display: inline-block;
}

/* Alpine: avoids a flash of un-initialised markup */

[x-cloak] {
  display: none !important;
}
