/* Skeleton Loading States - Prevents layout shift during initial load */
/* WP07 T031: Matches final card dimensions for zero CLS */

@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.skeleton {
  animation: shimmer 1.2s ease-in-out infinite;
  background: linear-gradient(
    to right,
    #f0f0f0 0%,
    #e0e0e0 20%,
    #f0f0f0 40%,
    #f0f0f0 100%
  );
  background-size: 800px 104px;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(
    to right,
    #2a2a2a 0%,
    #1a1a1a 20%,
    #2a2a2a 40%,
    #2a2a2a 100%
  );
}

/* Skeleton card matches .article-card structure */
.skeleton-card {
  display: flex;
  flex-direction: column;
  min-height: 200px;
  padding: 1.5rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--color-border-subtle, #e5e7eb);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.05),
    0 4px 16px rgba(0, 0, 0, 0.08);
  margin-bottom: 1.5rem;
}

[data-theme="dark"] .skeleton-card {
  background: rgba(31, 41, 55, 0.8);
  border-color: var(--color-border-subtle);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Skeleton header */
.skeleton-header {
  margin-bottom: 0.75rem;
}

.skeleton-source {
  width: 120px;
  height: 14px;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}

.skeleton-title {
  width: 85%;
  height: 28px;
  margin-bottom: 0.5rem;
  border-radius: 0.25rem;
}

.skeleton-title:last-child {
  width: 65%;
}

/* Skeleton badges */
.skeleton-badges {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.skeleton-badge {
  width: 80px;
  height: 32px;
  border-radius: 16px;
}

/* Skeleton summary (content preview) */
.skeleton-summary {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.skeleton-summary-line {
  width: 100%;
  height: 16px;
  border-radius: 0.25rem;
}

.skeleton-summary-line:nth-child(2) {
  width: 95%;
}

.skeleton-summary-line:nth-child(3) {
  width: 80%;
}

/* Skeleton metadata footer */
.skeleton-metadata {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border-subtle, #e5e7eb);
  gap: 1rem;
}

.skeleton-date {
  width: 100px;
  height: 14px;
  border-radius: 0.25rem;
}

.skeleton-actions {
  display: flex;
  gap: 0.5rem;
}

.skeleton-action-button {
  width: 70px;
  height: 32px;
  border-radius: 0.5rem;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    opacity: 0.6;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .skeleton-card {
    padding: 1rem;
    min-height: 180px;
  }

  .skeleton-title {
    height: 20px;
  }

  .skeleton-badge {
    width: 60px;
    height: 24px;
  }

  .skeleton-action-button {
    width: 60px;
    height: 28px;
  }
}
