/*
  News: the list at /news/ and each post under it. Loaded after style.css and
  built only from its tokens, so light and dark follow the rest of the site.
  The pages are written by tools/news.mjs; edit the markup there.
*/

.news-back {
  display: inline-block;
  margin: 0 0 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-text);
  text-decoration: none;
}
.news-back:hover { color: var(--text-primary); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.news-back:active { color: var(--primary-text); }

/* --------------------------------------------------------------- the list */

.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.news-card {
  display: grid;
  gap: 8px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s ease, background-color .15s ease;
}
/* The same edge-and-fill states as the buttons in style.css, without the
   press: a whole card shrinking under the thumb reads as a glitch. */
.news-card:hover { border-color: var(--outline); }
.news-card:active { border-color: var(--outline); background: var(--surface-alt); }
.news-card:hover .news-card-more { text-decoration: underline; text-underline-offset: 4px; }
.news-card:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 3px; }

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.news-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--text-primary);
  text-wrap: balance;
}
.news-card-summary { color: var(--text-secondary); line-height: 1.6; }
.news-card-more { font-size: 14px; font-weight: 600; color: var(--primary-text); }

.news-empty {
  padding: 22px 24px;
  border: 1px dashed var(--line-2, var(--line));
  border-radius: var(--radius);
  color: var(--text-secondary);
}

/* Kind of post, as a small label. The same four colours the app uses for
   food, so a fix reads as a fix at a glance. */
.news-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: var(--primary-tint);
  color: var(--primary-text);
}
.news-tag--fix     { background: var(--fresh-tint);    color: var(--fresh); }
.news-tag--feature { background: var(--use-soon-tint); color: var(--use-soon); }
.news-tag--note    { background: var(--tint-2, var(--tint)); color: var(--text-secondary); }

.page-head .eyebrow .news-tag { margin-right: 8px; letter-spacing: .08em; }
.page-head .eyebrow time { color: var(--text-tertiary); letter-spacing: .08em; }

.news-draft,
.news-draft-chip {
  color: var(--expired);
  font-weight: 600;
}
.news-draft { margin: 14px 0 0; font-size: 14px; }
.news-draft-chip { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

/* --------------------------------------------------------------- a post */

.news-post .prose h2 { margin-top: 36px; }
.news-post .prose code {
  font-size: .9em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--tint-2, var(--tint));
}

/* --------------------------------------------------------- follow along */

.news-follow {
  margin-top: clamp(40px, 6vw, 64px);
  padding: clamp(22px, 4vw, 32px);
  background: var(--background-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: grid;
  gap: 14px;
}
.news-follow-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 28px);
  line-height: 1.15;
  color: var(--text-primary);
}
.news-follow-lede,
.news-follow-note { margin: 0; color: var(--text-secondary); line-height: 1.6; }
.news-follow-note { font-size: 14px; }
.news-follow-note strong { color: var(--text-primary); font-weight: 600; }

/* Two by two, so the four never leave one alone on a row; one column on a
   phone. */
.news-follow-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 560px) {
  .news-follow-links { grid-template-columns: 1fr; }
}
.news-follow-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  /* the press itself is the shared one in style.css */
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.news-follow-link:hover { border-color: var(--outline); }
.news-follow-link:active { border-color: var(--outline); background: var(--fill-hover); }
.news-follow-link:focus-visible { outline: 2px solid var(--primary-text); outline-offset: 3px; }
.news-follow-link svg {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--primary-text);
}
.news-follow-link span { display: grid; min-width: 0; }
.news-follow-link strong { font-size: 15px; font-weight: 600; }
.news-follow-link small {
  font-size: 13px;
  color: var(--text-tertiary);
  overflow-wrap: anywhere;
}

/* --------------------------------------------------- the feed in a browser */

/* /news/feed.xml, turned into a page by news/feed.xsl. One line saying what
   the page is for, since a visitor who clicked "RSS feed" may not know. */
.news-feed-note {
  margin: 16px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--background-alt);
  color: var(--text-secondary);
  font-size: 14px;
}
