/* ==========================================================================
   News (/news/ and /news/{ID}/) — page-only rules on top of style.css §26.
   Enqueued from functions.php when welive_news_request() is set.
   The list reuses the home rows (§27 .home-news__*); this file is mostly the
   article: a head (date · category, title) and the 本文 written by the news
   prompt tool. That HTML carries no classes or inline styles (both are
   stripped by welive_news_body_html()), so everything in .news-body is styled
   by element here.
   ========================================================================== */

/* §26's ≤1024px `.sub-section { padding }` comes after --flush-top and wins on
   source order; on these pages flush-top must hold at every width */
main .sub-section--flush-top { padding-top: 0; }

/* ── List: straight under the hero, whose rule is the list's top rule ── */
.news-index { padding-bottom: 0; }
.news-list { margin: 0; border-top: 0; }

/* ── Article head ── */
.news-hero .breadcrumb-current {   /* the title can be long; one line, cut */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-hero { padding-bottom: var(--space-xl); }
.news-hero__head {
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-mid);
}
.news-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-md);
  margin: 0 0 var(--space-md);
  font-size: var(--t-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.news-hero__cat { font-size: var(--t-xs); color: var(--accent); }
.news-hero__title {
  max-width: 28em;
  margin: 0;
  font-size: clamp(1.75rem, 1rem + 2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
}

/* ── Body: one reading column on the left of the page grid ── */
.news-body {
  max-width: 44rem;   /* rem, so the foot below matches it at any font size */
  font-size: 1.0625rem;
  line-height: 2;
  color: var(--ink-mid);
  word-break: auto-phrase;
  overflow-wrap: anywhere;
}
.news-body > :first-child { margin-top: 0; }
.news-body > :last-child,
.news-body > :last-child > :last-child { margin-bottom: 0; }   /* e.g. a map in its <div> */

.news-body p { margin: 0 0 var(--space-md); }
.news-body strong { color: var(--ink); font-weight: 700; }
.news-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.news-body h2,
.news-body h3,
.news-body h4 {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.6;
}
.news-body h2 {
  margin: var(--space-xl) 0 var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-mid);
  font-size: clamp(1.25rem, 1rem + 0.6vw, 1.5rem);
}
.news-body h3 {
  margin: var(--space-lg) 0 var(--space-xs);
  font-size: 1.125rem;
}
.news-body h4 {
  margin: var(--space-lg) 0 var(--space-xs);
  font-size: 1rem;
}

.news-body ul,
.news-body ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.5em;
}
.news-body ul { list-style: disc; }
.news-body ol { list-style: decimal; }
.news-body li + li { margin-top: var(--space-2xs); }
.news-body li::marker { color: var(--ink-muted); }

/* Tables: ruled key/value rows, like .sub-facts. The prompt asks for
   <th style="width:120px">; the style is stripped, so the label column sizes
   to its longest label here instead and never breaks (新住所, 取引銀行…). */
.news-body table {
  width: 100%;
  margin: 0 0 var(--space-lg);
  border-collapse: collapse;
  border-top: 1px solid var(--border-mid);
  font-size: 0.9375rem;
  line-height: 1.8;
}
.news-body th,
.news-body td {
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  border-bottom: 1px solid var(--border-mid);
  text-align: left;
  vertical-align: top;
}
.news-body th {
  width: 1%;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
}
.news-body thead th { width: auto; }
.news-body td:last-child,
.news-body th:last-child { padding-right: 0; }

.news-body figure { margin: var(--space-xl) 0; }
.news-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  background: var(--surface-tint);
}
.news-body figcaption {
  margin-top: var(--space-xs);
  font-size: var(--t-sm);
  line-height: 1.7;
  color: var(--ink-muted);
}

.news-body blockquote {
  margin: var(--space-lg) 0;
  padding-left: var(--space-lg);
  border-left: 2px solid var(--border-mid);
  color: var(--ink-mid);
}

/* Google Map: the only iframe the sanitiser keeps. The prompt wraps it in a
   padded <div> with inline styles; those are gone, so the ratio is set here. */
.news-body iframe {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  margin: 0 0 var(--space-lg);
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-tint);
}

/* ── Foot: 関連リンク, back to the list ── */
.news-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
  max-width: 44rem;
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-mid);
}
.news-foot .sub-link { overflow-wrap: anywhere; }
.news-foot__back { margin-left: auto; }

@media (max-width: 768px) {
  .news-hero__head { padding-bottom: var(--space-lg); }
  .news-body { font-size: 1rem; }
  .news-body iframe { aspect-ratio: 4 / 3; }
}
