@import url('/template-vendor/fontsource/5.3.0/fonts.css');
@theme {
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Space Grotesk", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

/* Custom scrollbar for better visual quality */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Page transit and general keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease-out forwards;
}

/* Shared responsive header navigation. */
header > div > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

header > div > div:first-child > a:first-child {
  min-width: 0;
  max-width: min(24rem, 34vw);
  flex: 0 1 auto;
}

header > div > div:first-child > a:first-child span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

header > div > div:last-child {
  flex: 0 0 auto;
}

.site-primary-nav {
  align-items: center;
  flex: 0 0 auto;
  gap: 0.875rem;
  white-space: nowrap;
}

.site-article-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.site-article-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #475569;
  font-size: 0.875rem;
  font-weight: 700;
  transition: color 0.2s ease;
}

.site-article-menu__trigger::after {
  content: "";
  width: 0.36rem;
  height: 0.36rem;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1px) rotate(45deg);
  opacity: 0.75;
}

.site-article-menu:hover .site-article-menu__trigger,
.site-article-menu:focus-within .site-article-menu__trigger {
  color: #f97316;
}

.site-article-menu__panel {
  position: absolute;
  top: calc(30% + 0.9rem);
  left: 50%;
  z-index: 80;
  width: min(18rem, 72vw);
  max-height: 22rem;
  overflow-y: auto;
  padding: 0.45rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.14);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 0.5rem);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.site-article-menu__panel::before {
  content: "";
  position: absolute;
  top: -0.45rem;
  left: 50%;
  width: 0.75rem;
  height: 0.75rem;
  border-left: 1px solid rgba(226, 232, 240, 0.95);
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  background: #fff;
  transform: translateX(-50%) rotate(45deg);
}

.site-article-menu:hover .site-article-menu__panel,
.site-article-menu:focus-within .site-article-menu__panel {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.site-article-menu__link {
  position: relative;
  z-index: 1;
  display: block;
  padding: 0.65rem 0.75rem;
  border-radius: 0.75rem;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.35;
  white-space: normal;
  transition: background 0.18s ease, color 0.18s ease;
}

.site-article-menu__link:hover {
  background: #fff7ed;
  color: #ea580c;
}

.site-header-search {
  display: none !important;
}

.reader-policy-nav {
  display: none !important;
}

@media (min-width: 640px) {
  .comic-detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1024px) {
  .site-primary-nav {
    display: flex !important;
  }
}

@media (min-width: 1280px) {
  header > div > div:first-child > a:first-child {
    max-width: min(30rem, 38vw);
  }

  .site-primary-nav {
    gap: 1.25rem;
  }

  .site-header-search {
    display: block !important;
  }

  .reader-policy-nav {
    display: flex !important;
  }
}
