@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

:root {
  --font-family: "Barlow", sans-serif;
  --hover-color: var(--color-border-darker);
  --hover-size: 0.1em;
  --hover-filter: brightness(1);
}

html, body {
  -webkit-text-size-adjust: none;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-family);
  line-height: 1.4;
  overflow: initial;
  text-size-adjust: none;
}

/* Links */
:where(a:not([class]):not(:has(img))) {
  color: var(--link-color, var(--color-link));

  @media (any-hover: hover) {
    &:where(:not(:active):hover) {
      --hover-filter: brightness(1.3);

      filter: var(--hover-filter);
    }
  }
}

:where(button, input, textarea, summary, .input, .btn) {
  --outline-size: min(0.2em, 2px);
  border: solid 1 var(--lch-gray);
  font: inherit;
  line-height: inherit;
  text-decoration: none;
  touch-action: manipulation;
  transition: box-shadow 150ms ease, outline-offset 150ms ease, background-color 150ms ease, opacity 150ms ease, filter 150ms ease;
  /* Hover */
  @media (any-hover: hover) {
    &:where(:not(:active):hover) {
      filter: var(--hover-filter);
      box-shadow: 0 0 0 var(--hover-size) var(--hover-color);
    }
  }

  /* Keyboard navigation */
  &:where(:not(:active)):focus-visible {
    outline-width: var(--outline-size);
    outline-color: var(--outline-color, var(--color-link));
    outline-offset: var(--outline-offset, calc(var(--outline-size) * 2));
  }

  /* Pressing */
  &:focus:not(:focus-visible) {
    --outline-offset: 0;
  }

  /* Disabled */
  &:where([disabled]):not(:hover):not(:active) {
    cursor: not-allowed;
    filter: brightness(0.75);
  }
}

/* Turbo */
turbo-frame,
turbo-cable-stream-source {
  display: contents;
}

/* For settings */
fieldset {
  border: 2px solid var(--fieldset-border-color, var(--color-border));
  border-block-end: 0;
  border-inline: 0;
  display: flex;
  flex-wrap: wrap;
  /* max-inline-size: 50ch; */
  padding: var(--block-space) 0;

  &.border {
    border-color: var(--color-border-darker);
    border-style: solid;
    border-width: 1px;
  }
}

legend {
  align-items: center;
  display: flex;
  justify-content: center;
  margin-inline: auto;
  text-align: center;
}

.membership-item:has(.btn.invisible) {
  opacity: 0.5;
}

/* Dialogs */
.dialog {
  --width: 50ch;

  background-color: var(--color-bg);
  margin-inline: var(--inline-space);
  inline-size: var(--width);
  max-inline-size: calc(100dvw - var(--inline-space) * 2);
  position: relative;

  &::backdrop {
    background-image: linear-gradient(
      45deg,
      #fff500,
      #ff9f00,
      #f00,
      #ec0061
    );
    opacity: 0.75;
  }
}

.dialog__close {
  position: absolute;
  inset: calc(var(--block-space) * 1.5) var(--inline-space) auto auto;
}

/* Misc */
menu {
  outline: 0;
}

code {
  background: var(--color-bg);
  border: 1px solid var(--color-border-dark);
  padding: 0.2em 0.4em;
  border-radius: 0.3em;
  font-weight: 500;
}

pre {
  background-color: var(--color-bg);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monaco, monospace;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Nicer scrollbars on Chrome 29+. This is intended for Windows machines, but */
/* there's not a way to target Windows using CSS, so Chrome on Mac will have */
/* slightly thinner scrollbars than normal. #C1C1C1 is the default color on Macs. */
@media screen and (-webkit-min-device-pixel-ratio:0) and (min-resolution:.001dpcm) {
  * {
    scrollbar-color: #C1C1C1 transparent;
    scrollbar-width: thin;
  }
}