/* ==========================================================================
   RealtyDataLabs — Article Card Styles
   ========================================================================== */

/* ── Base Card ─────────────────────────────────────────────────────────── */
.article-card {
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.article-card:hover {
  border-color: rgba(45, 91, 227, 0.5);
  box-shadow: 0 8px 32px rgba(45, 91, 227, 0.15);
  transform: translateY(-2px);
}

/* ── Card Image Wrapper ────────────────────────────────────────────────── */
.card-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
  opacity: 0;
}

.card-image-wrap img.loaded {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.article-card:hover .card-image-wrap img {
  transform: scale(1.05);
}

/* ── Image Fallback ────────────────────────────────────────────────────── */
.card-image-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  font-size: 2rem;
}

/* ── Card Body ─────────────────────────────────────────────────────────── */
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
}

/* ── Card Meta Row ─────────────────────────────────────────────────────── */
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-timestamp {
  font-size: 0.7rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Headline ──────────────────────────────────────────────────────────── */
.card-headline {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* ── Excerpt ───────────────────────────────────────────────────────────── */
.card-excerpt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

/* ── Card Footer ───────────────────────────────────────────────────────── */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.card-source {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.card-read-more {
  font-size: 0.78rem;
  color: var(--accent-teal);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.card-read-more::after {
  content: '→';
}

.article-card:hover .card-read-more {
  gap: 8px;
}

/* ── Featured Card Variant ─────────────────────────────────────────────── */
.article-card.card-featured {
  grid-column: span 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 12px;
}

.card-featured .card-image-wrap {
  aspect-ratio: auto;
  height: 100%;
  min-height: 280px;
  border-radius: 12px 0 0 12px;
}

.card-featured .card-body {
  padding: 32px;
}

.card-featured .card-headline {
  font-size: 1.35rem;
  -webkit-line-clamp: 3;
}

.card-featured .card-excerpt {
  -webkit-line-clamp: 4;
}

/* ── Skeleton Card ─────────────────────────────────────────────────────── */

/* Shared shimmer animation used by all .skeleton elements */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-secondary) 25%,
    rgba(255, 255, 255, 0.05) 50%,
    var(--bg-secondary) 75%
  );
  background-size: 200% 100%;
  animation: card-shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes card-shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

.article-card.card-skeleton {
  pointer-events: none;
  cursor: default;
}

.article-card.card-skeleton:hover {
  transform: none;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.skeleton-image {
  width: 100%;
  aspect-ratio: 16 / 9;
}

.skeleton-badge {
  height: 18px;
  width: 80px;
}

.skeleton-headline {
  height: 16px;
  width: 90%;
  margin-bottom: 6px;
}

.skeleton-headline-2 {
  height: 16px;
  width: 70%;
}

.skeleton-excerpt-1 {
  height: 12px;
  width: 100%;
}

.skeleton-excerpt-2 {
  height: 12px;
  width: 90%;
}

.skeleton-excerpt-3 {
  height: 12px;
  width: 60%;
}

/* ── Verified Free Badge ───────────────────────────────────────────────── */
.card-meta-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.card-verified {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #00C48C;
  box-shadow: 0 0 5px rgba(0, 196, 140, 0.6);
  flex-shrink: 0;
}

/* ── Report Paywall Link ────────────────────────────────────────────────── */
.card-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-link {
  font-size: 0.68rem;
  color: rgba(160, 160, 176, 0.45);
  cursor: pointer;
  transition: color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}

.report-link:hover {
  color: rgba(255, 100, 100, 0.7);
}

.report-link.report-link-sent {
  color: rgba(0, 196, 140, 0.7);
  pointer-events: none;
}

/* ── Skeleton Line Variants (used by feeds.js card builder) ────────────── */
.skeleton-line {
  height: 13px;
  background: var(--bg-secondary);
  border-radius: 4px;
  margin-bottom: 8px;
  animation: card-shimmer 1.5s infinite;
  background: linear-gradient(90deg, var(--bg-secondary) 25%, rgba(255,255,255,0.05) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
}

.skeleton-line.full   { width: 100%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.short  { width: 40%; }

/* ── Feed Notice / Error States ────────────────────────────────────────── */
.feed-notice,
.feed-error {
  grid-column: 1 / -1;
  padding: 32px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
}

.feed-error {
  border-color: rgba(255, 77, 77, 0.3);
  color: #FF4D4D;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .article-card.card-featured {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .card-featured .card-image-wrap {
    border-radius: 12px 12px 0 0;
    min-height: 200px;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}
