/**
 * Fylgja (https://fylgja.dev)
 * Licensed under MIT Open Source
 */
@view-transition {
  navigation: auto;
}
:root {
  --brand: hsl(260, 84%, 56%);
  --on-brand: hsl(260, 0%, 100%);
  --form-active-color: var(--brand);
  --form-error-color: #e00;
  --control-checked-stroke: var(--brand);
  --control-checked-bg: var(--brand);
  --control-checked-color: var(--on-brand);
  color-scheme: light dark;
  scrollbar-color: var(--scrollthumb-color, var(--brand)) var(--scrolltrack-color, transparent);
  accent-color: var(--brand);
  caret-color: var(--brand);
  interpolate-size: allow-keywords;
}
@media (prefers-color-scheme: dark) {
  :root {
    --root-bg: color-mix(in oklab, #000 82%, var(--brand));
    --root-fg: hsl(0 0% 98%);
    --select-icon: var(--select-dark-scheme);
  }
}

::marker {
  color: var(--brand);
  font-weight: bolder;
}

::selection {
  text-shadow: none;
  background: var(--brand);
  color: var(--on-brand);
}

:focus-visible {
  outline-color: var(--brand);
}

:where(:not(h1, h2, h3, h4, h5, h6, strong) > a) {
  font-weight: 500;
}

blockquote,
hr {
  border-color: var(--brand);
}

:where(tbody tr:nth-child(even) :is(th, td)) {
  background: var(--table-even-bg, var(--surface-color));
}

body {
  display: flex;
  flex-direction: column;
}
body > main {
  flex-grow: 1;
}

:where(body > :is(main, header, footer), article, section, aside) {
  container-type: inline-size;
}

::-webkit-calendar-picker-indicator {
  outline-color: var(--brand);
}

:where(select option:checked) {
  background: var(--brand);
  color: var(--on-brand);
}

:user-invalid:not(:focus) {
  --form-stroke: var(--form-error-color);
  outline: 1px solid var(--form-stroke);
}

:where(.field) {
  display: block;
  margin-block-start: 1em;
}

.btn-primary,
.btn:where(.--primary),
:where([type=submit], form button:not([type])),
:where(input[type=file])::file-selector-button {
  --btn-stroke: transparent;
  --btn-bg: var(--brand);
  --btn-color: var(--on-brand);
  --btn-hover-bg: color-mix(in oklab, var(--brand) 80%, #000);
  --btn-active-bg: color-mix(in oklab, var(--brand) 72%, #000);
}

:where([type=reset]) {
  --btn-color: var(--form-error-color, currentcolor);
}

:where(.btn, button, [type=button], [type=submit], [type=reset]):has(:where(svg:only-child, img:only-child)) {
  --btn-px: var(--btn-py, 0.375rem);
}

:where(dialog).offcanvas {
  --ty: 0;
  --tx: 100%;
  --screen-y: 0;
  --mx: auto 0;
  block-size: 100%;
  inline-size: min(100%, 25rem);
  border-start-end-radius: 0;
  border-end-end-radius: 0;
}
