/* News index and article — variant C. Scoped to body classes from the preview.
   Article bodies stay white-space: pre-wrap (plain text + newlines from newsPage.js). */

.page-news .news-mast,
.page-article .news-mast {
  position: relative;
  isolation: isolate;
}

.page-news .news-mast::before,
.page-article .news-mast::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 50%;
  top: -2.5rem;
  width: min(760px, 100%);
  height: 280px;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse at 32% 42%, rgba(61, 220, 151, 0.18), transparent 64%),
    radial-gradient(ellipse at 72% 38%, rgba(56, 189, 248, 0.12), transparent 62%);
  filter: blur(2px);
  pointer-events: none;
}

.page-article .news-mast::before {
  height: 340px;
  top: -1.5rem;
  background:
    radial-gradient(ellipse at 38% 40%, rgba(61, 220, 151, 0.22), transparent 62%),
    radial-gradient(ellipse at 68% 46%, rgba(56, 189, 248, 0.14), transparent 60%);
}

.page-news .news-mast > .wrap,
.page-article .news-mast > .wrap {
  position: relative;
  z-index: 1;
}

.page-news .section-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
}

/* Index */

.page-news .news-index-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.85rem;
  padding: 0;
}

.page-news .news-index-list > li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  padding: 1.15rem 1.2rem 1.2rem;
  border-top: 0;
  cursor: pointer;
}

.page-news .news-index-featured {
  grid-column: 1 / -1;
  min-height: 17.5rem;
  justify-content: flex-end;
  padding: 2rem 2.15rem 1.9rem;
  border-color: rgba(61, 220, 151, 0.28);
  background:
    radial-gradient(420px circle at var(--x) var(--y), rgba(61, 220, 151, 0.2), transparent 46%),
    radial-gradient(460px 240px at 100% 0%, rgba(56, 189, 248, 0.14), transparent 58%),
    radial-gradient(520px 280px at 0% 110%, rgba(61, 220, 151, 0.12), transparent 55%),
    rgba(255, 255, 255, 0.045);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.page-news .news-index-list time {
  margin-bottom: 0.55rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.page-news .news-index-featured time {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  color: var(--mint);
}

.page-news .news-index-featured time::after {
  content: "";
  width: 2.4rem;
  height: 1px;
  background: linear-gradient(90deg, var(--mint), var(--cyan));
}

.page-news .news-index-list a.news-index-title {
  position: static;
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.28;
  text-decoration: none;
  text-wrap: balance;
}

.page-news .news-index-list a.news-index-title::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.page-news .news-index-featured a.news-index-title {
  max-width: 18em;
  font-family: var(--display);
  font-size: clamp(1.85rem, 3.1vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.page-news .news-index-item a.news-index-title {
  font-size: 1.06rem;
  line-height: 1.35;
}

.page-news .news-index-list p {
  position: relative;
  z-index: 1;
  max-width: 68ch;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
}

.page-news .news-index-featured p {
  max-width: 62ch;
  margin-top: 0.85rem;
  color: var(--text-soft);
  font-size: 1.05rem;
  line-height: 1.65;
}

.page-news .news-index-item p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.page-news .news-index-list a.news-index-title:hover {
  color: var(--text);
}

.page-news .news-index-item:hover a.news-index-title,
.page-news .news-index-featured:hover a.news-index-title {
  color: var(--mint);
}

/* Article */

.page-article .news-mast > .wrap.narrow {
  width: min(100% - 2 * var(--gutter), 56rem);
}

.page-article .news-article {
  width: min(100%, calc(70ch + 5rem));
  margin-inline: auto;
  padding: clamp(1.25rem, 3vw, 2.25rem) clamp(1.15rem, 3vw, 2.5rem) clamp(1.15rem, 2.5vw, 1.7rem);
  font-size: 1.125rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028) 28%),
    var(--glass);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
}

.page-article .news-article-date {
  margin-bottom: 0.9rem;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--mint);
}

.page-article .news-article h1 {
  max-width: 70ch;
  margin: 0 0 1.15rem;
  font-family: var(--display);
  font-size: clamp(1.85rem, 3.4vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.12;
  text-wrap: balance;
}

.page-article .news-article-body {
  max-width: 70ch;
  color: var(--text-soft);
  font-size: 1em;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.page-article .news-article-body :is(h2, h3, h4) {
  margin: 1.65rem 0 0.55rem;
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  white-space: normal;
}

.page-article .news-article-body h2 {
  font-size: 1.35rem;
}

.page-article .news-article-body h3 {
  font-size: 1.14rem;
}

.page-article .news-article-body h4 {
  font-size: 1.02rem;
}

.page-article .news-article-body p {
  margin: 0 0 0.9rem;
  white-space: normal;
}

.page-article .news-article-body :is(ul, ol) {
  margin: 0.45rem 0 1.05rem;
  padding-left: 1.25rem;
  white-space: normal;
}

.page-article .news-article-body li + li {
  margin-top: 0.4rem;
}

.page-article .news-article-body li::marker {
  color: var(--mint);
}

.page-article .news-article-body a {
  color: var(--mint);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(61, 220, 151, 0.45);
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.page-article .news-article-body a:hover {
  text-decoration-color: var(--mint);
}

.page-article .news-article-body blockquote {
  margin: 1.2rem 0;
  padding: 0.15rem 0 0.15rem 1rem;
  border-left: 2px solid var(--mint);
  color: var(--text);
  font-size: 1.05em;
  line-height: 1.7;
  white-space: normal;
}

.page-article .news-article-body :not(pre) > code {
  font-family: var(--mono);
  font-size: 0.84em;
  padding: 0.12em 0.4em;
  border: 1px solid rgba(61, 220, 151, 0.18);
  border-radius: 6px;
  background: rgba(61, 220, 151, 0.08);
  color: var(--text);
}

.page-article .news-article-body pre {
  margin: 1.15rem 0;
  padding: 0.95rem 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  font-family: var(--mono);
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--text);
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.page-article .news-article-body pre code {
  padding: 0;
  border: 0;
  background: none;
  font-size: inherit;
  color: inherit;
}

.page-article .news-article-body img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  margin: 1.25rem 0;
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.page-article .news-article-back {
  position: relative;
  z-index: 1;
  margin-top: 1.85rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
}

.page-article .news-article-back a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
}

.page-article .news-article-back a::before {
  content: "←";
  font-size: 0.95em;
}

.page-article .news-article-back a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

@media (max-width: 860px) {
  .page-news .news-index-list {
    grid-template-columns: 1fr;
  }

  .page-news .news-index-featured {
    min-height: 0;
    padding: 1.35rem 1.2rem 1.3rem;
  }

  .page-news .news-index-featured a.news-index-title {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-news .news-index-list > li,
  .page-article .news-article {
    transform: none;
  }
}
