/*
 * News Card — global, used on the news listing page.
 * Variants: --featured (big hero) | --compact (medium / mobile list-row)
 * Design source: Figma 407:50057 (desktop), 407:51629 (mobile).
 */

.iw-news-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: transparent;
  font-family: inherit;
  color: #3d3d3d;
  min-width: 0;
  gap: 20px;
}

.iw-news-card__media {
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #f7f7f8;
}

.iw-news-card__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
/* Hover zoom — chỉ áp cho ảnh thật; placeholder skip (no transform). */
.iw-news-card:hover .iw-news-card__image:not(.iw-news-card__image--placeholder) {
  transform: scale(1.05);
}
.iw-news-card__image--placeholder {
  object-fit: contain;
  padding: 24px;
  background: #f7f7f8;
  transition: none;
}

.iw-news-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.iw-news-card__date {
  font-family: inherit;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #888888;
}

.iw-news-card__title {
  margin: 0;
  font-family: inherit;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.4;
  color: #3d3d3d;
  /* 2-line clamp; longer titles get ellipsis. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}
.iw-news-card__title-link {
  color: inherit;
  text-decoration: none;
}
.iw-news-card__title-link:hover { color: var(--iw-accent, #4564ed); }

.iw-news-card__excerpt {
  margin: 0;
  font-family: inherit;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #888888;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.iw-news-card__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 510;
  font-size: 12px;
  line-height: 16px;
  text-decoration: none;
  /* Color/bg set via inline style from iw_news_category_color(). */
}

/* "Xem thêm" link — opt-in via $card['show_more']. Not used on listing
   page; consumed by homepage news section (Figma 407:41846). */
.iw-news-card__more {
  font-family: inherit;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.4;
  color: var(--iw-accent, #4564ed);
  text-decoration: none;
}
.iw-news-card__more:hover { text-decoration: underline; }

/* ===== Featured variant (Figma 407:50061-407:50069) ===================== */

.iw-news-card--featured {
  gap: 24px;
}
.iw-news-card--featured .iw-news-card__media { height: 419px; }

.iw-news-card--featured .iw-news-card__body { gap: 12px; }

.iw-news-card--featured .iw-news-card__title {
  font-weight: 590;
  font-size: 24px;
  line-height: 32px;
  -webkit-line-clamp: 3;
}

/* ===== Compact variant (desktop side-grid items) ======================== */

.iw-news-card--compact .iw-news-card__media { height: 200px; }

@media (max-width: 991px) {
  /* Featured stays vertical on mobile, just smaller image (Figma 407:51632). */
  .iw-news-card--featured {
    gap: 20px;
  }
  
  .iw-news-card--featured .iw-news-card__title {
    font-weight: 590;
    font-size: 18px;
    line-height: 1.5;
    -webkit-line-clamp: 2;
  }

  /* Compact reflows to a horizontal "list" row: image-left + content-right.
     Figma 407:51651: image 161×96, gap 12, content stretches. */
  .iw-news-card--compact {
    flex-direction: row;
    gap: 12px;
    align-items: stretch;
  }
  .iw-news-card--compact .iw-news-card__media {
    flex: 0 0 161px;
    width: 161px;
    height: 96px;
    border-radius: 8px;
  }
  .iw-news-card--compact .iw-news-card__body {
    flex: 1 1 0;
    min-width: 0;
    gap: 8px;
  }
  .iw-news-card--compact .iw-news-card__date {
    font-size: 12px;
    line-height: 20px;
  }
  .iw-news-card--compact .iw-news-card__title {
    font-weight: 590;
    font-size: 14px;
    line-height: 20px;
  }
}

@media (max-width: 540px) {
  .iw-news-card--featured .iw-news-card__media { height: 204px; }
}
