/* Advoke CV — Skeleton Loading Component */

.skeleton {
  display: block;
  background-color: var(--ink-100);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: skeleton-shimmer 1.6s infinite linear;
  will-change: transform;
}

@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

@keyframes skeleton-shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton--text {
  height: 1em;
  border-radius: var(--radius-sm);
  margin-block: 0.25em;
}

.skeleton--text-sm {
  height: 0.75em;
}

.skeleton--text-lg {
  height: 1.25em;
}

.skeleton--title {
  height: 1.5em;
  width: 60%;
  border-radius: var(--radius-sm);
}

.skeleton--title-lg {
  height: 2em;
  width: 70%;
}

.skeleton--avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.skeleton--avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.skeleton--avatar-xl {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.skeleton--thumbnail {
  width: 100%;
  aspect-ratio: 210 / 297;
  border-radius: var(--radius-md);
}

.skeleton--image {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
}

.skeleton--card {
  width: 100%;
  height: 100%;
  min-height: 220px;
  border-radius: var(--radius-xl);
}

.skeleton--button {
  height: 44px;
  width: 120px;
  border-radius: var(--radius-lg);
}

.skeleton--input {
  height: 44px;
  width: 100%;
  border-radius: var(--radius-md);
}

.skeleton--chip {
  height: 36px;
  width: 80px;
  border-radius: var(--radius-full);
}

.skeleton--circle {
  border-radius: var(--radius-full);
}

.skeleton--square {
  border-radius: var(--radius-md);
}

.skeleton--w-full    { width: 100%; }
.skeleton--w-3-4     { width: 75%; }
.skeleton--w-2-3     { width: 66%; }
.skeleton--w-1-2     { width: 50%; }
.skeleton--w-1-3     { width: 33%; }
.skeleton--w-1-4     { width: 25%; }
.skeleton--w-4-5     { width: 80%; }
.skeleton--w-1-6     { width: 16%; }

.skeleton-text {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 100%;
}

.skeleton-text .skeleton--text:last-child {
  width: 60%;
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background-color: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
}

.skeleton-card__media {
  width: 100%;
  aspect-ratio: 210 / 297;
  border-radius: var(--radius-md);
}

.skeleton-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  width: 100%;
}

.skeleton-list__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
}

.skeleton-list__content {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  flex: 1 1 auto;
  min-width: 0;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: var(--space-5);
  width: 100%;
}

.skeleton-grid .skeleton--card {
  aspect-ratio: 210 / 297;
  height: auto;
  min-height: 0;
}

.skeleton--dark {
  background-color: var(--ink-200);
}

.skeleton--dark::after {
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 100%
  );
}

.skeleton--no-animation {
  animation: none;
}

.skeleton--no-animation::after {
  display: none;
}

.skeleton--static {
  animation: none;
}

.skeleton--static::after {
  animation: none;
  background: none;
}

.skeleton--loaded {
  animation: none;
  background: none;
}

.skeleton--loaded::after {
  display: none;
}

.sr-only-loading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
  }
  .skeleton::after {
    animation: none;
    display: none;
  }
}