/*
 * News row (SPEC §2.6) and its date + tag line (.news-meta), which the news
 * card (§2.7) and the news detail header (§3.4) reuse. Values from
 * tokens.css only.
 *
 * HTML contract
 *   <ul class="news-list">                  (TOP: add .news-list--compact)
 *     <li class="news-row">
 *       <a class="news-row__link" href="/news/…/">
 *         <span class="news-meta">
 *           <time class="news-meta__date" datetime="2026-12-10">2026.12.10</time>
 *           <span class="tag">お知らせ</span>
 *         </span>
 *         <span class="news-row__title">WEBサイトを公開いたしました</span>
 *       </a>
 *     </li>
 *   </ul>
 *   The whole row is one link (ASSUMPTION, SPEC §2.5–2.6); its name reads
 *   date, category, title. Design v2 (no detail pages): the row is a
 *   <div class="news-row__link">, same layout, no states (they are scoped
 *   to :any-link). The list is a <ul> because the rows are a set of
 *   peers in date order; the section heading above it names it.
 *
 * XD: date body 16/28.8 ink-900, tag (§2.5) 106 from the date's left edge,
 * title body ink-700 filling the row, 1px line divider under every row
 * (none above the first). TOP: title 8 below the tag; golfer pages: 16.
 * Width comes from the page: 1194 TOP PC, 1000 golfer PC, 358 SP.
 *
 * States (ASSUMPTION, SPEC §2.6): hover = title green-700 + underline and
 * a green-700 divider; active = the same with a green-800 title (no 1px
 * shift, like the header's text links); focus = the base ring around the
 * whole row.
 */

/* ---- List ---- */

.news-list {
  display: flex;
  flex-direction: column;

  /* XD measures from the divider's centre line */
  gap: calc(var(--news-row-gap) - var(--border-thin) / 2);
}

.news-list--compact {
  --news-row-title-gap: var(--news-row-title-gap-compact);
}

/* ---- Row ---- */

.news-row__link {
  display: block;
  padding-block-end: calc(var(--news-row-divider-gap) - var(--border-thin) / 2);
  color: var(--color-ink-700);
  text-decoration: none;
  border-block-end: var(--border-thin) solid var(--color-line);
  transition: border-color var(--duration-hover);
}

/* The gap is measured from the tag's bottom; the meta line is taller than
   the tag because the date sits lower (--news-meta-date-offset). */
.news-row__title {
  display: block;
  margin-block-start: calc(
    var(--news-row-title-gap) -
      (var(--news-meta-date-offset) + var(--text-body-lh) - var(--tag-height))
  );
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
  text-decoration-thickness: var(--underline-thickness);
  text-underline-offset: var(--underline-offset);
  transition: color var(--duration-hover);
}

@media (hover: hover) {
  .news-row__link:any-link:hover {
    border-block-end-color: var(--color-green-700);
  }

  .news-row__link:any-link:hover .news-row__title {
    color: var(--color-green-700);
    text-decoration-line: underline;
  }
}

.news-row__link:any-link:active {
  border-block-end-color: var(--color-green-700);
}

.news-row__link:any-link:active .news-row__title {
  color: var(--color-green-800);
  text-decoration-line: underline;
}

/* ---- Date + tag line (shared) ---- */

.news-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-start;
}

.news-meta__date {
  flex: none;
  min-inline-size: var(--news-meta-date-width);
  margin-block-start: var(--news-meta-date-offset);
  font-size: var(--text-body-size);
  line-height: var(--text-body-lh);
  color: var(--color-ink-900);
  white-space: nowrap;
}
