/* Boiebyen base: tokens, type, buttons and fields shared by the login page and the dashboard. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --ink: #141416;
  --ink-2: #57544d;
  --line: #e2dfd6;
  --line-strong: #cbc7bb;
  --accent: #e8471c;
  --accent-ink: #b5330e;
  --focus: #2457ff;

  --scheduled: #2450d6;
  --scheduled-bg: #e8edfc;
  --posted: #18744a;
  --posted-bg: #e2f2e9;
  --failed: #bd2a2a;
  --failed-bg: #fbe6e3;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(20, 20, 22, 0.04), 0 8px 24px rgba(20, 20, 22, 0.06);
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f0f11;
    --surface: #18181b;
    --surface-2: #222226;
    --ink: #f1efe9;
    --ink-2: #aba79d;
    --line: #2b2b30;
    --line-strong: #3d3d44;
    --accent: #ff6a3d;
    --accent-ink: #ff8b66;
    --focus: #84a4ff;

    --scheduled: #93abff;
    --scheduled-bg: #1b2340;
    --posted: #72d3a2;
    --posted-bg: #132a1e;
    --failed: #ff8f88;
    --failed-bg: #351b19;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
    color-scheme: dark;
  }
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

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

.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
}

.mark {
  width: 22px;
  height: 22px;
  flex: none;
}

.mark .mark-block {
  fill: var(--ink);
}

.mark .mark-window {
  fill: var(--accent);
}

/* ---------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, opacity 0.15s, transform 0.15s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.86;
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--line-strong);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--ink-2);
}

.btn-quiet {
  color: var(--ink-2);
}

.btn-quiet:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--ink);
}

.btn-danger {
  color: var(--failed);
  border-color: color-mix(in srgb, var(--failed) 35%, transparent);
}

.btn-danger:hover:not(:disabled) {
  background: var(--failed-bg);
}

.btn-small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 8px;
}

.btn-block {
  width: 100%;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- fields */

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 600;
}

.field-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.field-head span:last-child {
  color: var(--ink-2);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 15px;
  font-weight: 400;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:disabled {
  opacity: 0.6;
}

.alert {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--failed-bg);
  color: var(--failed);
  font-size: 14px;
  font-weight: 600;
}

.alert-info {
  background: var(--surface-2);
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
