@tailwind base;
@tailwind components;
@tailwind utilities;
@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
  font-named-instance: 'Regular';
  src: url('/fonts/IBMPlexSansVar-Roman.woff2') format('woff2');
}

@font-face {
  font-family: 'IBM Plex Sans';
  font-weight: 100 900;
  font-display: swap;
  font-style: italic;
  font-named-instance: 'Italic';
  src: url('/fonts/IBMPlexSansVar-Italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif';
  font-weight: 100 900;
  font-display: swap;
  font-style: normal;
  font-named-instance: 'Regular';
  src: url('/fonts/SourceSerif.var.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Serif';
  font-weight: 100 900;
  font-display: swap;
  font-style: italic;
  font-named-instance: 'Italic';
  src: url('/fonts/SourceSerif-Italic.var.woff2') format('woff2');
}

html {
  --scrollbarBG: #ffffff00;
  --thumbBG: #b8b8b8;
}
body::-webkit-scrollbar {
  width: 5px;
}
body {
  scrollbar-width: thin;
  scrollbar-color: var(--thumbBG) var(--scrollbarBG);
}
body::-webkit-scrollbar-track {
  background: var(--scrollbarBG);
}
body::-webkit-scrollbar-thumb {
  background-color: var(--thumbBG);
}

::selection {
  background: rgba(45, 170, 219, 0.3);
}

.wrapper {
  min-height: 100vh;
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  flex-direction: column;
}

.sticky-nav {
  position: sticky;
  z-index: 10;
  top: -1px;
  backdrop-filter: blur(5px);
  transition: all 0.5s cubic-bezier(0.4, 0, 0, 1);
  border-bottom-color: transparent;
}

.remove-sticky {
  position: unset;
}

.sticky-nav-full {
  @apply border-b border-opacity-50 border-gray-200 dark:border-gray-600 dark:border-opacity-50 cursor-pointer;
}

.sticky-nav:not(.sticky-nav-full) .caret {
  opacity: 0 !important;
}

.header-name {
  display: none;
  overflow: hidden;
}

.sticky-nav-full .nav {
  @apply text-gray-600 dark:text-gray-300;
}

nav {
  flex-wrap: wrap;
  line-height: 1.5em;
}

.article-tags::-webkit-scrollbar {
  width: 0 !important;
}

.tag-container ul::-webkit-scrollbar {
  width: 0 !important;
}

.tag-container ul {
  -ms-overflow-style: none;
  overflow: -moz-scrollbars-none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  -khtml-user-select: none;
  user-select: none;
}

@media (min-width: 768px) {
  .sticky-nav-full {
    @apply max-w-full border-b border-opacity-50 border-gray-200 dark:border-gray-600 dark:border-opacity-50;
  }
  .header-name {
    display: grid;
  }
  .site-title,
  .post-title {
    @apply transition duration-500;
  }
  .site-description {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0, 1);
  }
  .sticky-nav-full .site-description {
    @apply opacity-100 transition duration-500;
  }
  .post-title {
    @apply opacity-0;
  }
  .post-title ~ span .site-description {
    @apply hidden;
  }
  .sticky-nav-full .post-title {
    @apply opacity-100;
  }
  .sticky-nav-full .post-title ~ span .site-title {
    @apply opacity-0;
  }
}

@supports not (backdrop-filter: none) {
  .sticky-nav {
    backdrop-filter: none;
    @apply bg-day bg-opacity-90 dark:bg-night dark:bg-opacity-90;
  }
}

.capture-pointer-events * {
  @apply pointer-events-none;
}
