/* ==========================================================================
   News Cards Component
   ========================================================================== */

/* Base Card
   ========================================================================== */
.card {
  background-color: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  color: inherit;
}

.card-image {
  position: relative;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.card-image .category-tag {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 1;
}

.card-content {
  padding: var(--space-md);
}

.card-title {
  margin-bottom: var(--space-xs);
  transition: color var(--transition-fast);
}

.card:hover .card-title {
  color: var(--color-secondary);
}

.card-excerpt {
  color: var(--color-text-muted);
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}

/* Featured Card (Hero)
   ========================================================================== */
.card-featured {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 400px;
}

@media (min-width: 768px) {
  .card-featured {
    min-height: 500px;
  }
}

.card-featured .card-image {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.card-featured .card-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
}

.card-featured .card-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-lg);
  color: white;
  z-index: 1;
}

.card-featured .category-tag {
  position: static;
  margin-bottom: var(--space-sm);
}

.card-featured .card-title {
  color: white;
  font-size: var(--fs-xl);
}

@media (min-width: 768px) {
  .card-featured .card-title {
    font-size: var(--fs-2xl);
  }
}

.card-featured .card-excerpt {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--fs-base);
  display: none;
}

@media (min-width: 768px) {
  .card-featured .card-excerpt {
    display: block;
  }
}

.card-featured .card-meta {
  color: rgba(255, 255, 255, 0.8);
}

/* Large Card
   ========================================================================== */
.card-large .card-image {
  aspect-ratio: 16 / 9;
}

.card-large .card-title {
  font-size: var(--fs-lg);
}

/* Medium Card
   ========================================================================== */
.card-medium .card-image {
  aspect-ratio: 16 / 9;
}

.card-medium .card-title {
  font-size: var(--fs-md);
}

.card-medium .card-excerpt {
  display: none;
}

@media (min-width: 768px) {
  .card-medium .card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Small Card (Compact)
   ========================================================================== */
.card-small {
  display: flex;
  flex-direction: row;
  gap: var(--space-sm);
}

.card-small .card-image {
  flex-shrink: 0;
  width: 100px;
  height: 75px;
}

@media (min-width: 576px) {
  .card-small .card-image {
    width: 120px;
    height: 90px;
  }
}

.card-small .card-content {
  padding: var(--space-xs);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-small .card-title {
  font-size: var(--fs-sm);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-small .card-excerpt,
.card-small .category-tag {
  display: none;
}

.card-small .card-meta {
  margin-top: auto;
}

/* Horizontal Card (for sidebar)
   ========================================================================== */
.card-horizontal {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
  border-radius: 0;
  box-shadow: none;
}

.card-horizontal:last-child {
  border-bottom: none;
}

.card-horizontal:hover {
  transform: none;
  box-shadow: none;
  background-color: var(--color-background);
}

.card-horizontal .card-image {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.card-horizontal .card-content {
  padding: 0;
  flex: 1;
}

.card-horizontal .card-title {
  font-size: var(--fs-sm);
  line-height: 1.3;
  margin-bottom: 0;
}

/* News Grid Layouts
   ========================================================================== */
.news-grid {
  display: grid;
  gap: var(--space-md);
}

/* 2 columns grid */
.news-grid--2 {
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .news-grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 3 columns grid */
.news-grid--3 {
  grid-template-columns: 1fr;
}

@media (min-width: 576px) {
  .news-grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .news-grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mixed layout (1 large + 2 medium) */
.news-grid--mixed {
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .news-grid--mixed {
    grid-template-columns: 1fr 1fr;
  }

  .news-grid--mixed .card:first-child {
    grid-row: span 2;
  }

  .news-grid--mixed .card:first-child .card-image {
    aspect-ratio: auto;
    height: 100%;
  }
}

/* List layout for small cards */
.news-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
