/* VonCMS Framework Skeleton & Global CSS */

/* Factory Clean Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

.dark ::-webkit-scrollbar-thumb {
  background: #404040;
}

body {
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
}

.voncms-boot-canvas {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  background: inherit;
}

.voncms-public-route-loader {
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 2rem;
}

.voncms-theme-image-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  background: #e5e7eb;
  opacity: 1;
  transition: opacity 180ms ease;
}

.voncms-theme-image-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.58), transparent);
  animation: shimmer 1.6s infinite;
}

.dark .voncms-theme-image-placeholder {
  background: #27272a;
}

.dark .voncms-theme-image-placeholder::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}

.voncms-theme-image-placeholder.is-loaded,
.voncms-theme-image-placeholder.is-failed {
  opacity: 0;
}

.voncms-theme-image-placeholder.is-failed::after {
  animation: none;
}

.voncms-theme-image {
  position: relative;
  z-index: 1;
}

.prose img {
  border-radius: 0.75rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Skeleton Loader (FOUC Prevention) */
.skeleton-loader,
.skeleton-loader-react {
  box-sizing: border-box;
  width: 100%;
  font-family: 'Inter', sans-serif;
  padding: clamp(1rem, 4vw, 2rem);
  max-width: 1280px;
  margin: 0 auto;
}

.sk-nav {
  box-sizing: border-box;
  height: 56px;
  background: #e5e7eb;
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
}

.sk-hero {
  box-sizing: border-box;
  height: 160px;
  background: #e5e7eb;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
}

.sk-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
}

.sk-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 220px;
  background: #e5e7eb;
  border-radius: 1rem;
}

.sk-card-tablet {
  display: none;
}

@media (min-width: 640px) {
  .sk-nav {
    height: 64px;
    margin-bottom: 2rem;
  }

  .sk-hero {
    height: 180px;
    margin-bottom: 1.5rem;
  }

  .sk-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
  }

  .sk-card {
    height: 260px;
  }
}

@media (min-width: 640px) and (max-width: 959px) {
  .sk-card-tablet {
    display: block;
  }
}

@media (min-width: 960px) {
  .sk-nav {
    margin-bottom: 3rem;
  }

  .sk-hero {
    height: 200px;
    margin-bottom: 2rem;
  }

  .sk-grid {
    grid-template-columns: repeat(3, minmax(0, 300px));
    justify-content: center;
    gap: 1.5rem;
  }

  .sk-card {
    height: 240px;
  }
}

.dark .sk-nav,
.dark .sk-hero,
.dark .sk-card {
  background: #202124;
  border: 1px solid #34343a;
}

/* Shimmer Effect */
.sk-nav,
.sk-hero,
.sk-card {
  position: relative;
  overflow: hidden;
}

.sk-nav::after,
.sk-hero::after,
.sk-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0,
    rgba(255, 255, 255, 0.2) 20%,
    rgba(255, 255, 255, 0.5) 60%,
    rgba(255, 255, 255, 0)
  );
  animation: shimmer 2s infinite;
}

.dark .sk-nav::after,
.dark .sk-hero::after,
.dark .sk-card::after {
  background-image: linear-gradient(
    90deg,
    rgba(32, 33, 36, 0) 0,
    rgba(69, 69, 77, 0.18) 20%,
    rgba(255, 255, 255, 0.14) 60%,
    rgba(32, 33, 36, 0)
  );
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .voncms-theme-image-placeholder::after,
  .sk-nav::after,
  .sk-hero::after,
  .sk-card::after {
    animation: none;
    transform: none;
    opacity: 0;
  }
}
