@tailwind base;
@tailwind components;
@tailwind utilities;

/* Tippy tooltips */
.tippy-box[data-theme~="bm"] {
  @apply bg-stone-900 font-sans text-sm text-stone-50 dark:bg-zinc-950 dark:text-zinc-50;
}
.tippy-box[data-theme~="bm"][data-placement^="top"] > .tippy-arrow::before {
  @apply border-t-stone-900 dark:border-t-zinc-950;
}
.tippy-box[data-theme~="bm"][data-placement^="bottom"] > .tippy-arrow::before {
  @apply border-b-stone-900 dark:border-b-zinc-950;
}
.tippy-box[data-theme~="bm"][data-placement^="left"] > .tippy-arrow::before {
  @apply border-l-stone-900 dark:border-l-zinc-950;
}
.tippy-box[data-theme~="bm"][data-placement^="right"] > .tippy-arrow::before {
  @apply border-r-stone-900 dark:border-r-zinc-950;
}

/* Shiki */
@media not print {
  .dark .astro-code,
  .dark .astro-code span {
    color: var(--shiki-dark) !important;
    background-color: var(--shiki-dark-bg) !important;
  }
}

@layer components {
  .text-link,
  .pagefind-ui .pagefind-ui__result-link {
    @apply text-stone-800 hover:text-bm-500 focus:text-bm-500 dark:text-zinc-300 dark:hover:text-bm-400 dark:focus:text-bm-400;
  }

  /* Pagefind */
  .pagefind-ui {
    --pagefind-ui-primary: theme(colors.stone.800);
    --pagefind-ui-text: theme(colors.stone.900);
    --pagefind-ui-background: theme(colors.stone.50);
    --pagefind-ui-border: theme(colors.stone.400);
    --pagefind-ui-tag: theme(colors.bm.300);

    --pagefind-ui-scale: 0.8;
    --pagefind-ui-font: theme(fontFamily.sans);
    --pagefind-ui-border-width: 1px;
    --pagefind-ui-border-radius: 8px;
    --pagefind-ui-image-border-radius: 0px;
  }
  @media screen(md) {
    .pagefind-ui {
      --pagefind-ui-scale: 0.9;
    }
  }
  @media not print {
    .dark .pagefind-ui {
      --pagefind-ui-primary: theme(colors.stone.200);
      --pagefind-ui-text: theme(colors.stone.100);
      --pagefind-ui-background: theme(colors.stone.700);
      --pagefind-ui-border: theme(colors.stone.500);
      --pagefind-ui-tag: theme(colors.green.800);
    }
  }
}
