/* News listing + article detail — TrailSight design system.
   Layered on _tokens.css + _components.css.
   v4-alpine-light still loaded for the shared footer + alpine-btn fallback. */

/* ---------- Topo wash background (same recipe as event/race) ---------- */
.ts-news {
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(ellipse 55% 45% at 82% 18%, rgba(242, 100, 25, 0.07), transparent 60%),
    radial-gradient(ellipse 55% 45% at 15% 90%, rgba(74, 107, 138, 0.06), transparent 65%),
    linear-gradient(180deg, var(--ts-paper-3) 0%, #F4F3EF 100%);
  min-height: 100vh;
}
.ts-news::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("/images/auth-topo.svg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.05;
  pointer-events: none;
}

/* ---------- Listing hero ---------- */
.ts-news-hero {
  padding: 96px 72px 56px;
}
.ts-news-hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.ts-news-hero__title {
  font-size: clamp(48px, 8vw, 96px);
  margin: 0;
}
.ts-news-hero__lede {
  font-family: var(--ts-font-display);
  font-size: clamp(17px, 1.6vw, 20px);
  line-height: 1.5;
  color: var(--ts-body);
  max-width: 640px;
  margin: 28px 0 0;
}

/* ---------- Listing grid ---------- */
.news-section {
  padding: 24px 0 96px;
}
.news-section .ts-container {
  padding-left: 72px;
  padding-right: 72px;
  max-width: var(--ts-container);
}
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.news-empty {
  font-family: var(--ts-font-mono);
  font-size: 13px;
  color: var(--ts-muted);
  text-align: center;
  padding: 64px 24px;
}
.news-card {
  background: var(--ts-paper);
  border: 1px solid var(--ts-line-2);
  border-radius: var(--ts-r-lg);
  box-shadow: var(--ts-shadow-card);
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 200ms ease, border-color 180ms ease;
}
.news-card:hover {
  transform: translateY(-2px);
  border-color: var(--ts-accent-line);
  box-shadow: var(--ts-shadow-card-hover);
}
.news-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.news-card__link:hover { text-decoration: none; color: inherit; }
.news-card__image,
.news-card__placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: linear-gradient(135deg, var(--ts-ink-2), var(--ts-ink));
}
.news-card__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: rgba(255, 255, 255, 0.18);
}
.news-card__body {
  padding: 22px 24px 24px;
}
.news-card__date {
  font-family: var(--ts-font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ts-muted);
  text-transform: uppercase;
  margin: 0 0 10px;
}
.news-card__title {
  font-family: var(--ts-font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ts-ink);
  line-height: 1.2;
  margin: 0 0 12px;
  text-wrap: balance;
}
.news-card__excerpt {
  font-family: var(--ts-font-display);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ts-body);
  margin: 0 0 16px;
}
.news-card__more {
  font-family: var(--ts-font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ts-accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Article hero ---------- */
.ts-article-hero {
  padding: 96px 72px 24px;
}
.ts-article-hero .ts-event-hero__back {
  margin-bottom: 32px;
}
.ts-article-hero__eyebrow {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.ts-article-hero__title {
  font-size: clamp(40px, 6vw, 72px);
  margin: 0;
}
.ts-article-hero__lede {
  font-family: var(--ts-font-display);
  font-size: clamp(18px, 1.8vw, 22px);
  font-style: italic;
  font-weight: 400;
  line-height: 1.45;
  color: var(--ts-body);
  margin: 28px 0 0;
  max-width: 720px;
  border-left: 3px solid var(--ts-accent);
  padding-left: 20px;
  text-wrap: balance;
}

/* ---------- Cover image (after hero, magazine-style) ---------- */
.ts-article-cover {
  margin: 40px auto 56px;
  max-width: 1200px;
  padding: 0 72px;
}
.ts-article-cover img {
  width: 100%;
  height: auto;
  border-radius: var(--ts-r-lg);
  display: block;
  box-shadow: var(--ts-shadow-card);
}

/* ---------- Article body ---------- */
.ts-article-body {
  max-width: 720px;
  margin: 0 auto 96px;
  padding: 0 24px;
  font-family: var(--ts-font-display);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ts-ink-3);
}
.ts-article-body h2,
.ts-article-body h3,
.ts-article-body h4 {
  font-family: var(--ts-font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ts-ink);
  margin: 48px 0 16px;
  line-height: 1.2;
}
.ts-article-body h2 { font-size: 32px; }
.ts-article-body h3 { font-size: 24px; }
.ts-article-body h4 { font-size: 20px; }
.ts-article-body p { margin: 0 0 20px; }
.ts-article-body ul,
.ts-article-body ol {
  padding-left: 24px;
  margin: 0 0 20px;
}
.ts-article-body li { margin-bottom: 8px; }
.ts-article-body strong { font-weight: 700; color: var(--ts-ink); }
.ts-article-body a {
  color: var(--ts-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.ts-article-body a:hover { filter: brightness(0.9); }
.ts-article-body blockquote {
  border-left: 3px solid var(--ts-accent);
  padding: 12px 4px 12px 20px;
  margin: 28px 0;
  font-style: italic;
  color: var(--ts-body);
  background: var(--ts-accent-soft);
  border-radius: 0 var(--ts-r) var(--ts-r) 0;
}
.ts-article-body blockquote p:last-child { margin-bottom: 0; }
.ts-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--ts-r);
  margin: 24px 0;
  display: block;
  box-shadow: var(--ts-shadow-card);
}
.ts-article-body pre {
  background: var(--ts-ink);
  color: #f4f4f4;
  padding: 18px 20px;
  border-radius: var(--ts-r);
  font-family: var(--ts-font-mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-x: auto;
  margin: 24px 0;
}
.ts-article-body code {
  font-family: var(--ts-font-mono);
  font-size: 0.9em;
  background: var(--ts-line-2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ts-ink);
}
.ts-article-body pre code { background: transparent; padding: 0; color: inherit; }

.ts-article-body__footer {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--ts-line-2);
}
.ts-article-body__footer .ts-event-hero__back { margin-bottom: 0; }

/* ---------- 404 article fallback ---------- */
.article-not-found {
  text-align: center;
  padding: 120px 24px 96px;
}
.article-not-found__code {
  font-family: var(--ts-font-display);
  font-size: clamp(72px, 12vw, 144px);
  font-weight: 700;
  letter-spacing: -0.05em;
  background: linear-gradient(135deg, var(--ts-accent), var(--ts-accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin: 0 0 16px;
}
.article-not-found__text {
  font-family: var(--ts-font-display);
  font-size: 18px;
  color: var(--ts-body);
  margin: 0 0 32px;
}

/* ---------- Featured strip ---------- */
.news-featured {
  padding: 32px 0 16px;
}
.news-featured .ts-container,
.news-featured > .ts-container {
  padding-left: 72px;
  padding-right: 72px;
  max-width: var(--ts-container);
  margin: 0 auto;
}
.ts-event-hero__chip--accent {
  background: var(--ts-accent);
  color: #fff;
  border-color: var(--ts-accent);
}
.news-featured__grid {
  display: grid;
  gap: 24px;
}
.news-featured__grid--1 { grid-template-columns: 1fr; }
.news-featured__grid--2 { grid-template-columns: 1fr 1fr; }
.news-featured__grid--3 {
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.news-featured__grid--3 .news-featured__card--lead {
  grid-row: 1 / 3;
}

.news-featured__card {
  display: grid;
  grid-template-columns: 1fr;
  text-decoration: none;
  color: inherit;
  background: var(--ts-paper);
  border: 1px solid var(--ts-line-2);
  border-top: 2px solid var(--ts-accent);
  border-radius: var(--ts-r-lg);
  box-shadow: var(--ts-shadow-card-hover);
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 240ms ease, border-color 200ms ease;
}
.news-featured__card:hover {
  transform: translateY(-3px);
  border-color: var(--ts-accent-line);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  text-decoration: none;
  color: inherit;
}

.news-featured__grid--1 .news-featured__card,
.news-featured__grid--3 .news-featured__card--lead {
  grid-template-columns: 1.1fr 1fr;
}

.news-featured__media {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ts-ink-2), var(--ts-ink));
  min-height: 200px;
}
.news-featured__image {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.news-featured__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 48px;
  color: rgba(255, 255, 255, 0.18);
}

.news-featured__body {
  padding: 28px 32px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  justify-content: center;
}
.news-featured__eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.news-featured__date {
  font-family: var(--ts-font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ts-muted);
  text-transform: uppercase;
}
.news-featured__title {
  font-family: var(--ts-font-display);
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  color: var(--ts-ink);
}
.news-featured__card--lead .news-featured__title {
  font-size: clamp(28px, 3vw, 44px);
}
.news-featured__excerpt {
  font-family: var(--ts-font-display);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ts-body);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-featured__more {
  font-family: var(--ts-font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ts-accent);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .news-featured__grid--2,
  .news-featured__grid--3 {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .news-featured__grid--3 .news-featured__card--lead { grid-row: auto; }
  .news-featured__grid--1 .news-featured__card,
  .news-featured__grid--3 .news-featured__card--lead {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .ts-news-hero { padding: 72px 24px 40px; }
  .ts-article-hero { padding: 72px 24px 24px; }
  .ts-article-cover { padding: 0 24px; margin: 24px auto 40px; }
  .news-section .ts-container { padding-left: 24px; padding-right: 24px; }
  .news-featured .ts-container { padding-left: 24px; padding-right: 24px; }
  .news-featured__body { padding: 22px 24px 24px; }
  .news-grid { gap: 18px; }
  .ts-article-body { padding: 0 20px; margin-bottom: 64px; }
  .ts-article-body h2 { font-size: 26px; margin-top: 36px; }
  .ts-article-body h3 { font-size: 21px; margin-top: 32px; }
}
