/* ==========================================================================
   Component: datpro_news
   The News index card language. Phase 01 had no news component (the Homepage
   section was removed together with the legacy CMS posts), so /tin-tuc/ owns
   this file and every later listing — search results, a category page, a
   "related articles" strip — should reuse it rather than invent a second card.

     .dp-news-hero        small local tuning of the shared .dp-page-hero
     .dp-news-grid        3-up desktop · 2-up tablet · 1-up mobile
     .dp-news-card        thumbnail + category + date + title (+ optional excerpt)
     .dp-news-empty       spacing wrapper for the shared .dp-empty-state

   Drop 6–12 .dp-news-card items into .dp-news-grid and nothing else has to
   change: the grid is uniform, every card stretches to the row height, and the
   media box is a fixed 16:9 crop so mixed source images stay aligned.

   NAMING — the Homepage owns `.dp-product-card` (product-ecosystem.css). This
   file only ever writes `.dp-news-card…`, so the two never collide.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Hero — the shared block, with one correction.
   The index headline is set in capitals; --ls-heading is a negative tracking
   tuned for mixed case and makes all-caps run together, so it is relaxed here
   only, scoped to this page's hero.
   -------------------------------------------------------------------------- */

.dp-news-hero .dp-page-hero__title {
  letter-spacing: 0.005em;
}

/* --------------------------------------------------------------------------
   .dp-news-grid
   <div class="dp-news-grid">
     <article class="dp-news-card"> … </article>
   </div>
   -------------------------------------------------------------------------- */

.dp-news-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 2.6vw, 2.25rem);
}

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

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

/* --------------------------------------------------------------------------
   .dp-news-card
   <article class="dp-news-card">
     <div class="dp-news-card__media">
       <img …>
       <span class="dp-news-card__flag">…</span>          <!-- optional -->
     </div>
     <div class="dp-news-card__body">
       <div class="dp-news-card__meta">
         <span class="dp-news-card__category">…</span>
         <time class="dp-news-card__date" data-news-date="2026-09-11"
               datetime="2026-09-11">11/09/2026</time>
       </div>
       <h3 class="dp-news-card__title"><a href="…">…</a></h3>
       <p class="dp-news-card__excerpt">…</p>             <!-- optional -->
       <div class="dp-news-card__foot">
         <span class="dp-news-card__more">… <svg><use href="#icon-arrow-right"></use></svg></span>
       </div>
     </div>
   </article>

   The title link is stretched over the whole card, so the card is one target
   with one accessible name. Keep .dp-news-card__more a <span>: a second anchor
   underneath the overlay would be unreachable.

   `data-news-date` is picked up by assets/js/ui.js and reformatted for the
   active locale; author the element with the ISO date in `datetime` and a
   readable Vietnamese fallback as its text.
   -------------------------------------------------------------------------- */

.dp-news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--dp-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.dp-news-card:hover {
  border-color: var(--dp-border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.dp-news-card:focus-within {
  border-color: var(--dp-blue-200);
}

/* ---------- Media --------------------------------------------------------- */

.dp-news-card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--dp-surface-2);
  border-bottom: 1px solid var(--dp-border);
  overflow: hidden;
}

.dp-news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 480ms var(--ease);
}

.dp-news-card:hover .dp-news-card__media img {
  transform: scale(1.03);
}

/* Corner flag — "sample", "announcement", whatever the listing needs to say
   about one entry without changing the card shape. */
.dp-news-card__flag {
  position: absolute;
  top: var(--sp-3);
  left: var(--sp-3);
  max-width: calc(100% - var(--sp-6));
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--dp-border);
  color: var(--dp-text-muted);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Body ---------------------------------------------------------- */

.dp-news-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: clamp(1.125rem, 1.8vw, 1.5rem);
}

.dp-news-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.625rem;
  margin-bottom: var(--sp-3);
}

.dp-news-card__category {
  color: var(--dp-blue);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: var(--ls-eyebrow);
  line-height: 1.4;
  text-transform: uppercase;
}

.dp-news-card__sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--dp-border-strong);
}

.dp-news-card__date {
  color: var(--dp-text-subtle);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}

.dp-news-card__title {
  font-size: var(--fs-h4);
  line-height: 1.42;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.dp-news-card__title a {
  color: var(--dp-text);
  transition: color var(--dur) var(--ease);
}

/* Stretched link — the whole card is the target. */
.dp-news-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--r-lg);
}

.dp-news-card:hover .dp-news-card__title a {
  color: var(--dp-blue);
}

.dp-news-card__excerpt {
  margin-top: var(--sp-2);
  color: var(--dp-text-muted);
  font-size: var(--fs-sm);
  line-height: 1.65;
  overflow-wrap: break-word;
  text-wrap: pretty;
}

.dp-news-card__foot {
  margin-top: auto;
  padding-top: clamp(1rem, 1.8vw, 1.25rem);
}

/* Visual echo of .dp-link-arrow — deliberately not an anchor, see above. */
.dp-news-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  color: var(--dp-blue);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  line-height: 1.4;
}

.dp-news-card__more svg {
  flex: none;
  width: 1em;
  height: 1em;
  transition: transform var(--dur) var(--ease);
}

.dp-news-card:hover .dp-news-card__more svg {
  transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   .dp-news-empty — the honest "nothing else yet" cell.

   It is a grid ITEM, not a block underneath the grid: with a single real card
   the row would otherwise be two-thirds empty white space, which reads as a
   broken listing rather than a young one. Here it fills the remaining columns
   and matches the card height, so the row looks deliberate.

   ▸ DELETE the whole .dp-news-empty element from the markup once the grid
     holds real articles. Nothing else needs changing.
   -------------------------------------------------------------------------- */

.dp-news-empty {
  min-width: 0;
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .dp-news-empty {
    /* 2-up: sits beside the card */
    grid-column: span 1;
  }
}

@media (min-width: 1024px) {
  .dp-news-empty {
    /* 3-up: fills the two remaining columns */
    grid-column: span 2;
  }
}

.dp-news-empty .dp-empty-state {
  height: 100%;
  align-content: center;
}
