/* news: the cards open their story; the story page (#/story/<id>, js/news.js) */

a.nitem { color: inherit; border-radius: var(--radius-sm); }
a.nitem .thumb { transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.nitem .ntitle { transition: color 0.15s ease; }
a.nitem:hover .thumb { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); }
a.nitem:hover .ntitle { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a.nitem:active .thumb { transform: none; }
a.nitem:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; }

/* ---------------------------------------------------------------- the story page */

.story-page {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 16px;
  align-items: start;
}

.story-main, .story-side-col { display: grid; gap: 16px; min-width: 0; }

.story-hero {
  background: var(--card);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 14px 20px 22px;
}

.story-head { display: flex; align-items: center; gap: 18px; min-width: 0; }
.story-crest { flex: none; }
.story-crest .crest.xl { width: 76px; height: 76px; border-radius: 16px; }
.story-head-text { min-width: 0; }

.story-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.story-tags span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: var(--tile);
  border-radius: 999px;
  padding: 3px 8px;
}
.story-tags span:first-child { color: var(--on-lime); background: var(--lime); }

.story-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  font-style: italic;
  line-height: 1.08;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.story-date { display: block; margin-top: 10px; font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.story-lead { margin: 0; font-size: 17px; line-height: 1.55; color: var(--ink); text-wrap: pretty; max-width: 62ch; }

/* the match the story is about: the card opens the match page, the two clubs open their team pages */
.story-match {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 16px;
  margin-top: 20px;
  padding: 16px 14px 12px;
  border-radius: var(--radius);
  background: var(--tile);
  transition: background 0.15s ease;
}
.story-match:hover { background: var(--line); }
.story-match-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.story-match-link:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.story-side { position: relative; z-index: 2; display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 700; line-height: 1.2; }
.story-side.home { justify-content: flex-end; text-align: right; }
.story-side.away { flex-direction: row-reverse; justify-content: flex-end; }
.story-side .crest { background: var(--card); }
.story-side:hover span { text-decoration: underline; text-underline-offset: 3px; }
.story-side span { overflow-wrap: anywhere; }

.story-score { display: grid; justify-items: center; gap: 4px; text-align: center; }
.story-score b { font-size: 30px; font-weight: 800; font-style: italic; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-score b.upcoming, .story-score b.tbp { font-size: 16px; font-style: normal; color: var(--ink-3); }
.story-score b.live { color: var(--purple); }
.story-score span { font-size: 11px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }

.story-match-meta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-3);
}
.story-match:hover .story-match-meta { border-top-color: var(--card); }
.story-match-go { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: var(--ink-2); }
.story-match-go svg { width: 14px; height: 14px; }
.story-match:hover .story-match-go { color: var(--ink); }

/* the teams in the story */
.story-teams { display: grid; gap: 2px; padding: 6px; }
.story-team {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "crest name go" "crest meta go";
  column-gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}
.story-team:hover { background: var(--tile); }
.story-team:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.story-team .crest { grid-area: crest; width: 40px; height: 40px; border-radius: 10px; }
.story-team-name { grid-area: name; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; align-self: end; }
.story-team-meta { grid-area: meta; font-size: 12px; color: var(--ink-3); align-self: start; }
.story-go { grid-area: go; color: var(--ink-3); transition: color 0.15s ease, transform 0.15s ease; }
.story-go svg { width: 16px; height: 16px; display: block; }
.story-team:hover .story-go { color: var(--ink); transform: translateX(2px); }

.story-missing .back:hover { color: var(--ink); }

/* a team story's group table, and the other stories in the side column */
.story-table { margin-top: 20px; }
.story-sub { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }
.story-more .nitem { grid-template-columns: 76px minmax(0, 1fr); }

@media screen and (max-width: 1080px) {
  .story-page { grid-template-columns: minmax(0, 1fr); }
  .story-side-col { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

@media screen and (max-width: 760px) {
  .story-side-col { grid-template-columns: minmax(0, 1fr); }
  .story-hero { padding: 12px 14px 18px; }
  .story-head { align-items: flex-start; gap: 12px; }
  .story-crest .crest.xl { width: 52px; height: 52px; border-radius: 12px; }
  .story-title { font-size: 22px; }
  .story-lead { font-size: 15px; }
  .story-match { padding: 14px 10px 10px; gap: 8px 10px; }
  .story-side { flex-direction: column; gap: 6px; font-size: 13px; text-align: center; }
  .story-side.home, .story-side.away { flex-direction: column; justify-content: flex-start; text-align: center; }
  .story-side .crest.lg { width: 44px; height: 44px; }
  .story-score b { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  a.nitem .thumb, .story-go { transition: none; }
}
