@import "variables.css";

.instrument-sans-500 {
  font-family: "Instrument Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  font-variation-settings: "wdth" 100;
}

.playfair-display-500 {
  font-family: "Playfair Display", serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

/* Reset and base styles */
*, *:before, *:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior-y: none;
}

body {
  background-color: var(--color-background);
  color: var(--color-text);
}

/* header {
  position: sticky;
  top: 16px;
} */

h1, h2, h3, h4, h5, h6 { font-family: "Playfair Display"; }

dialog[open] {
  border: none;
  margin: auto;
  max-width: 90%;
  outline: none;
  padding: 16px;
  border-radius: 16px;
  width: var(--max-width-md);
}

a {
  color: unset;
  text-decoration: none;
}

select,
input,
button {
  color: unset;
  border: unset;
  background-color: unset;
  outline: none;
  font-size: unset;
  padding: unset;
}

button {
  cursor: pointer;
  transition: all 0.15s ease-in-out;

  align-items: center;
  border-radius: 8px;
  display: flex;
  justify-content: center;

  padding: 8px;
  /* &:active {
    scale: 0.95;
  } */

  &.icon {}

  &.primary {
    background-color: var(--color-charcoal);
    color: var(--color-surface);
    fill: var(--color-surface);

    &:hover  { background-color: var(--color-charcoal-hover); }
    &:active { background-color: var(--color-charcoal-active); }
  }

  &.secondary {
    background-color: var(--color-surface);
    color: var(--color-text);
    fill: var(--color-text);

    &:hover  { background-color: var(--color-surface-hover); }
    &:active { background-color: var(--color-surface-active); }
  }

  &.danger {
    background-color: var(--color-surface);
    color: var(--color-error);
    fill: var(--color-error);

    &:hover  { background-color: var(--color-surface-hover); }
    &:active { background-color: var(--color-surface-active); }
  }

  &:disabled {
    opacity: 0.75;
    pointer-events: none;
  }
}

ul, ol {
  display: flex;
  flex-direction: column;
  gap: 4px;

  padding: 0;
  margin: 0;
  list-style-type: none;
}

.list-item {
  border-radius: var(--spacer);
  background-color: var(--color-surface);

  &.pressable {
    &:hover {
      cursor: pointer;
      background-color: var(--color-surface-hover);
    }

    &:active {
      background-color: var(--color-surface-active);
    }
  }

  &:first-child { border-top-left-radius: 16px; border-top-right-radius: 16px; }
  &:last-child { border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; }
}

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

.spinner {
  width: 25px;
  height: 25px;
  border: 3px solid var(--color-surface);
  border-top: 3px solid var(--color-charcoal);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
