@import 'tailwindcss';
@plugin "@tailwindcss/forms";
@plugin '@tailwindcss/typography';
@source '../node_modules/pliny';
@custom-variant dark (&:where(.dark, .dark *));

/* Core theme configuration */
@theme {
  /* Font families */
  --font-sans:
    var(--font-space-grotesk), ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',
    'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

  --color-primary-50: oklch(0.978 0.02 290);
  --color-primary-100: oklch(0.953 0.04 290);
  --color-primary-200: oklch(0.901 0.08 290);
  --color-primary-300: oklch(0.835 0.12 289);
  --color-primary-400: oklch(0.758 0.16 289);
  --color-primary-500: oklch(0.681 0.19 289);
  --color-primary-600: oklch(0.612 0.21 289);
  --color-primary-700: oklch(0.534 0.19 289.1);
  --color-primary-800: oklch(0.412 0.15 288.6);
  --color-primary-900: oklch(0.334 0.12 288);
  --color-primary-950: oklch(0.245 0.09 287);

  --color-gray-50: oklch(0.985 0.002 247.839);
  --color-gray-100: oklch(0.967 0.003 264.542);
  --color-gray-200: oklch(0.928 0.006 264.531);
  --color-gray-300: oklch(0.872 0.01 258.338);
  --color-gray-400: oklch(0.707 0.022 261.325);
  --color-gray-500: oklch(0.551 0.027 264.364);
  --color-gray-600: oklch(0.446 0.03 256.802);
  --color-gray-700: oklch(0.373 0.034 259.733);
  --color-gray-800: oklch(0.278 0.033 256.848);
  --color-gray-900: oklch(0.21 0.034 264.665);
  --color-gray-950: oklch(0.13 0.028 261.692);

  /* Line heights */
  --line-height-11: 2.75rem;
  --line-height-12: 3rem;
  --line-height-13: 3.25rem;
  --line-height-14: 3.5rem;

  /* Z-index values */
  --z-60: 60;
  --z-70: 70;
  --z-80: 80;
}

/*
  The default border color has changed to `currentColor` in Tailwind CSS v4,
  so we've added these compatibility styles to make sure everything still
  looks the same as it did with Tailwind CSS v3.

  If we ever want to remove these styles, we need to add an explicit border
  color utility to any element that depends on these defaults.
*/
@layer base {
  *,
  ::after,
  ::before,
  ::backdrop,
  ::file-selector-button {
    border-color: var(--color-gray-200, currentColor);
  }

  a,
  button {
    outline-color: var(--color-primary-500);
  }

  a:focus-visible,
  button:focus-visible {
    outline: 2px solid;
    border-radius: var(--radius-sm);
    outline-color: var(--color-primary-500);
  }
}

@layer utilities {
  .prose {
    & a {
      color: var(--color-primary-500);
      &:hover {
        color: var(--color-primary-600);
      }
      & code {
        color: var(--color-primary-400);
      }
    }
    & :where(h1, h2) {
      font-weight: 700;
      letter-spacing: var(--tracking-tight);
    }
    & h3 {
      font-weight: 600;
    }
    & :where(code):not(pre code) {
      color: var(--color-indigo-500);
    }
  }

  .prose-invert {
    & a {
      color: var(--color-primary-500);
      &:hover {
        color: var(--color-primary-400);
      }
      & code {
        color: var(--color-primary-400);
      }
    }
    & :where(h1, h2, h3, h4, h5, h6) {
      color: var(--color-gray-100);
    }
  }
}

.task-list-item::before {
  @apply hidden;
}

.task-list-item {
  @apply list-none;
}

.footnotes {
  @apply mt-12 border-t border-gray-200 pt-8 dark:border-gray-700;
}

.data-footnote-backref {
  @apply no-underline;
}

.csl-entry {
  @apply my-5;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none; /* IE and Edge */
  scrollbar-width: none; /* Firefox */
}

/* https://stackoverflow.com/questions/61083813/how-to-avoid-internal-autofill-selected-style-to-be-applied */
input:-webkit-autofill,
input:-webkit-autofill:focus {
  transition:
    background-color 600000s 0s,
    color 600000s 0s;
}

.katex-display {
  overflow: auto hidden;
}

.content-header-link {
  opacity: 0;
  margin-left: -24px;
  padding-right: 4px;
}

.content-header:hover .content-header-link,
.content-header-link:hover {
  opacity: 1;
}

.linkicon {
  display: inline-block;
  vertical-align: middle;
}
@layer base {
  .prose {
    --tw-prose-quotes: theme('colors.gray.600') !important;
    --tw-prose-quote-borders: theme('colors.gray.400') !important;
    --tw-prose-hr: theme('colors.gray.300') !important;
  }
  .dark .prose {
    --tw-prose-quotes: theme('colors.gray.300') !important;
    --tw-prose-quote-borders: theme('colors.gray.500') !important;
    --tw-prose-hr: theme('colors.gray.600') !important;
  }

  .prose :where(h1, h2, h3, h4, h5, h6) {
    @apply pl-3;
  }
}

div[kbar-portal],
div[kbar-container] {
  z-index: 9999;
}

div[kbar-overlay] {
  z-index: 9998;
}

header {
  z-index: 50;
}

main {
  isolation: isolate;
}
