/* News Detail V1 page composition. Public modules and Content Document keep ownership. */
.news-detail-v1-page { min-width: 0; }

.news-detail-v1 {
  min-width: 0;
  overflow: clip;
  color: var(--ui-color-text, #334155);
  background: var(--ui-color-page, #f8fafc);
}

.news-detail-v1 *,
.news-detail-v1 *::before,
.news-detail-v1 *::after { box-sizing: border-box; }

.news-detail-v1__breadcrumb-bar {
  position: relative;
  z-index: 3;
  border-bottom: 1px solid var(--ui-color-border-subtle, #e2e8f0);
  background: color-mix(in srgb, var(--ui-color-surface, #fff) 92%, transparent);
  backdrop-filter: blur(12px);
}

.news-detail-v1__hero {
  --news-detail-hero-title-inherit: var(--ui-color-text-strong, #0f172a);
  --news-detail-hero-summary-inherit: var(--ui-color-text-muted, #64748b);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--ui-color-accent, #0891b2) 14%, transparent), transparent 34%),
    radial-gradient(circle at 4% 92%, color-mix(in srgb, var(--ui-color-primary, #0f766e) 8%, transparent), transparent 32%),
    linear-gradient(135deg, #fbfdfd 0%, #f5f9fa 52%, #eef6f7 100%);
}

.news-detail-v1 :is(
  .news-detail-v1__hero,
  .news-detail-v1__content,
  .news-detail-v1__navigation
)[data-section-background="white"] { background: #fff; }

.news-detail-v1 :is(
  .news-detail-v1__hero,
  .news-detail-v1__content,
  .news-detail-v1__navigation
)[data-section-background="surface"] {
  background: var(--ui-color-surface-muted, #f8fafc);
}

.news-detail-v1 :is(
  .news-detail-v1__hero,
  .news-detail-v1__content,
  .news-detail-v1__navigation
)[data-section-background="brand-gradient"] {
  background: var(--ui-section-bg-brand-gradient,
    linear-gradient(135deg, #f4fbfb, #fff 58%, #f7f5ff));
}

.news-detail-v1 :is(
  .news-detail-v1__hero,
  .news-detail-v1__content,
  .news-detail-v1__navigation
)[data-section-background="accent-soft"] {
  background: color-mix(in srgb,
    var(--ui-color-accent, #0891b2) 9%, var(--ui-color-surface, #fff));
}

.news-detail-v1 :is(
  .news-detail-v1__hero,
  .news-detail-v1__content,
  .news-detail-v1__navigation
)[data-section-background="custom"][data-section-background-fill="solid"] {
  background: var(--news-detail-section-background-start, #fff);
}

.news-detail-v1 :is(
  .news-detail-v1__hero,
  .news-detail-v1__content,
  .news-detail-v1__navigation
)[data-section-background="custom"][data-section-background-fill="gradient"] {
  background: linear-gradient(
    var(--news-detail-section-background-angle, 90deg),
    var(--news-detail-section-background-start, #fff),
    var(--news-detail-section-background-end, #e0f2fe)
  );
}

.news-detail-v1__hero::after {
  position: absolute;
  inset: auto -9% -42% auto;
  z-index: -1;
  width: clamp(260px, 35vw, 540px);
  aspect-ratio: 1;
  border: 1px solid color-mix(in srgb, var(--ui-color-accent, #0891b2) 14%, transparent);
  border-radius: 50%;
  content: "";
}

.news-detail-v1__hero:not([data-section-background="inherit"])::after {
  opacity: 0;
}

.news-detail-v1__hero[data-foreground="light"] {
  --news-detail-hero-title-inherit: var(--ui-color-on-accent, #fff);
  --news-detail-hero-summary-inherit: rgba(255, 255, 255, .82);
}

.news-detail-v1__hero[data-foreground="light"] .news-detail-v1__hero-meta,
.news-detail-v1__hero[data-foreground="light"] .news-detail-v1__hero-meta :is(time, strong) {
  color: rgba(255, 255, 255, .76);
}

.news-detail-v1__hero-inner {
  display: grid;
  min-height: 460px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  column-gap: clamp(32px, 3.5vw, 44px);
  row-gap: 22px;
  padding-block: clamp(56px, 6.5vw, 84px);
}

.news-detail-v1__tag-row {
  grid-column: 1 / -1;
}

.news-detail-v1__hero-copy {
  min-width: 0;
  max-width: 820px;
}

.news-detail-v1__hero[data-title-align="center"] :is(
  .news-detail-v1__tag-row,
  .news-detail-v1__hero-copy
) { text-align: center; }

.news-detail-v1__hero[data-title-align="right"] :is(
  .news-detail-v1__tag-row,
  .news-detail-v1__hero-copy
) { text-align: right; }

.news-detail-v1__hero[data-title-align="center"] .news-detail-v1__hero-copy,
.news-detail-v1__hero[data-title-align="center"] .news-detail-v1__summary {
  margin-inline: auto;
}

.news-detail-v1__hero[data-title-align="right"] .news-detail-v1__hero-copy,
.news-detail-v1__hero[data-title-align="right"] .news-detail-v1__summary {
  margin-inline-start: auto;
}

.news-detail-v1__hero[data-title-align="center"] .news-detail-v1__hero-meta {
  justify-content: center;
}

.news-detail-v1__hero[data-title-align="right"] .news-detail-v1__hero-meta {
  justify-content: flex-end;
}

.news-detail-v1__eyebrow {
  margin: 0;
  text-decoration: none;
}

.news-detail-v1__hero h1 {
  max-width: none;
  margin: 0;
  color: var(--news-detail-hero-title-color,
    var(--news-detail-hero-title-inherit, var(--ui-color-text-strong, #0f172a)));
  font-size: min(var(--news-detail-hero-title-size, 50px), clamp(38px, 4.5vw, 58px));
  font-weight: var(--news-detail-hero-title-weight, 700);
  line-height: 1.14;
  letter-spacing: -.035em;
  text-wrap: pretty;
}

.news-detail-v1__hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 24px;
  color: var(--ui-color-text-muted, #64748b);
  font-size: 13px;
  line-height: 1.6;
}

.news-detail-v1__hero-meta :is(time, strong) {
  color: var(--ui-color-text-secondary, #334155);
  font-weight: 600;
}

.news-detail-v1__summary {
  max-width: 760px;
  margin: 20px 0 0;
  color: var(--news-detail-hero-summary-color,
    var(--news-detail-hero-summary-inherit, var(--ui-color-text-muted, #64748b)));
  font-size: var(--news-detail-hero-summary-size, 16px);
  line-height: 1.85;
}

.news-detail-v1__hero-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--ui-color-surface-muted, #eef2f5);
  border: 1px solid color-mix(in srgb, var(--ui-color-accent, #0891b2) 12%, var(--ui-color-border, #e2e8f0));
  border-radius: var(--ui-radius-lg, 16px);
  box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
}

.news-detail-v1__hero-media::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
}

.news-detail-v1__hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-detail-v1__content {
  --news-detail-reading-measure: 820px;
  padding-block: clamp(58px, 7vw, 96px);
  border-block-start: 1px solid var(--ui-section-divider-color, var(--ui-color-border, #e2e8f0));
  background: var(--ui-section-bg-brand-gradient, #f5f8f9);
}

.news-detail-v1__content[data-reading-measure="narrow"] {
  --news-detail-reading-measure: 680px;
}

.news-detail-v1__content[data-reading-measure="wide"] {
  --news-detail-reading-measure: 900px;
}

.news-detail-v1__content[data-foreground="light"] {
  --ui-color-text: rgba(255, 255, 255, .86);
  --ui-color-text-secondary: rgba(255, 255, 255, .82);
  --ui-color-text-strong: #fff;
  --ui-color-text-muted: rgba(255, 255, 255, .72);
  --ui-color-border: rgba(255, 255, 255, .2);
  --ui-color-surface-muted: rgba(255, 255, 255, .08);
}

.news-detail-v1__reading-layout {
  --news-detail-reading-column: var(--news-detail-reading-measure, 820px);
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, var(--news-detail-reading-column)) minmax(190px, 230px);
  justify-content: space-between;
  gap: clamp(36px, 4vw, 64px);
}

.news-detail-v1__content[data-has-toc="0"] .news-detail-v1__reading-layout {
  max-width: 1040px;
  margin-inline: auto;
  grid-template-columns: minmax(0, var(--news-detail-reading-column));
  justify-content: start;
}

.news-detail-v1__reading-document {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
}

.news-detail-v1__reading-document .ui-content-document--measure {
  max-width: var(--news-detail-reading-column);
  margin-inline: 0;
}

.news-detail-v1-page [data-news-detail-quote-rail="square"] blockquote {
  background: var(--ui-color-accent-soft,
    color-mix(in srgb, var(--ui-color-accent, #0891b2) 8%, transparent));
  border-start-start-radius: 0;
  border-end-start-radius: 0;
}

.news-detail-v1__toc-rail {
  position: sticky;
  top: calc(var(--site-fixed-header-safe-area, 81px) + 15px);
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  max-height: calc(100vh - var(--site-fixed-header-safe-area, 81px) - 47px);
}

.news-detail-v1__toc-rail nav {
  max-height: calc(100vh - var(--site-fixed-header-safe-area, 81px) - 47px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: var(--ui-space-5, 20px) var(--ui-space-4, 16px);
  background: transparent;
  border: 1px solid var(--ui-color-border, #e2e8f0);
  border-radius: var(--ui-radius-md, 12px);
}

.news-detail-v1__toc-rail nav > strong {
  display: block;
  margin-bottom: var(--ui-space-5, 20px);
  color: var(--ui-color-text-strong, #0f172a);
  font-size: var(--ui-text-lg, 18px);
  font-weight: 700;
}

.news-detail-v1__toc-rail ol,
.news-detail-v1__toc-mobile ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.news-detail-v1__toc-rail li[data-toc-level="3"],
.news-detail-v1__toc-rail li[data-toc-level="4"],
.news-detail-v1__toc-rail li[data-toc-level="5"],
.news-detail-v1__toc-mobile li[data-toc-level="3"],
.news-detail-v1__toc-mobile li[data-toc-level="4"],
.news-detail-v1__toc-mobile li[data-toc-level="5"] { padding-inline-start: 14px; }

.news-detail-v1__toc-rail a,
.news-detail-v1__toc-mobile a {
  display: block;
  padding: 4px 6px;
  color: var(--ui-color-text-muted, #64748b);
  font-size: 13px;
  line-height: 1.45;
  border-radius: var(--ui-radius-xs, 4px);
  text-decoration: none;
}

.news-detail-v1__toc-rail a:hover,
.news-detail-v1__toc-mobile a:hover { color: var(--ui-color-accent-deep, #0891b2); }

.news-detail-v1__toc-mobile {
  display: none;
  max-width: var(--ui-container-narrow, 880px);
  margin: 0 auto 28px;
  background: transparent;
  border: 1px solid var(--ui-color-border, #e2e8f0);
  border-radius: var(--ui-radius-md, 12px);
}

.news-detail-v1__toc-mobile summary {
  padding: var(--ui-space-4, 16px) var(--ui-space-5, 20px);
  color: var(--ui-color-text-strong, #0f172a);
  font-size: var(--ui-text-lg, 18px);
  font-weight: 700;
}

.news-detail-v1__toc-mobile nav {
  padding: 0 var(--ui-space-5, 20px) var(--ui-space-5, 20px);
}

.news-detail-v1__navigation {
  padding-block: clamp(44px, 6vw, 72px);
  border-block-start: 1px solid var(--ui-color-border-subtle, #e2e8f0);
  background: var(--ui-color-page, #f8fafc);
}

.news-detail-v1__navigation-inner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ui-grid-gap, 24px);
}

.news-detail-v1__navigation-link {
  display: grid;
  min-width: 0;
  gap: 7px;
  padding: clamp(22px, 3vw, 30px);
  color: var(--ui-color-text-secondary, #334155);
  background: var(--ui-color-surface, #fff);
  border: 1px solid var(--ui-color-border, #e2e8f0);
  border-radius: var(--ui-radius-lg, 16px);
  box-shadow: var(--ui-shadow-xs, 0 1px 2px rgba(15, 23, 42, .05));
  text-decoration: none;
  transition: border-color var(--ui-duration, 260ms) var(--ui-ease), box-shadow var(--ui-duration, 260ms) var(--ui-ease), transform var(--ui-duration, 260ms) var(--ui-ease);
}

.news-detail-v1__navigation-link.is-next { text-align: right; }

.news-detail-v1__navigation-link span,
.news-detail-v1__navigation-link time {
  color: var(--ui-color-text-faint, #94a3b8);
  font-size: 12px;
}

.news-detail-v1__navigation-link strong {
  color: var(--ui-color-text-strong, #0f172a);
  font-size: 17px;
  line-height: 1.5;
}

.news-detail-v1__navigation-link:hover {
  color: inherit;
  border-color: color-mix(in srgb, var(--ui-color-accent, #0891b2) 35%, var(--ui-color-border, #e2e8f0));
  box-shadow: var(--ui-shadow-md, 0 4px 12px rgba(15, 23, 42, .08));
  transform: translateY(-3px);
}

.news-detail-v1__navigation[data-foreground="light"] .news-detail-v1__navigation-link {
  color: rgba(255, 255, 255, .78);
  background: color-mix(in srgb, #fff 8%, transparent);
  border-color: rgba(255, 255, 255, .22);
}

.news-detail-v1__navigation[data-foreground="light"] .news-detail-v1__navigation-link strong {
  color: #fff;
}

.news-detail-v1__navigation[data-foreground="light"] .news-detail-v1__navigation-link :is(span, time) {
  color: rgba(255, 255, 255, .66);
}

@media (max-width: 1024px) {
  .news-detail-v1__hero-inner {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 38%);
    column-gap: 32px;
  }

  .news-detail-v1__reading-layout {
    max-width: var(--ui-container-narrow, 880px);
    grid-template-columns: minmax(0, 1fr);
  }

  .news-detail-v1__content[data-has-toc="0"] .news-detail-v1__reading-layout {
    max-width: var(--ui-container-narrow, 880px);
  }

  .news-detail-v1__toc-rail { display: none; }
  .news-detail-v1__toc-mobile { display: block; }
}

@media (max-width: 767px) {
  .news-detail-v1__hero-inner {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 24px;
    padding-block: 48px 56px;
  }

  
  .news-detail-v1__summary { margin-top: 14px; font-size: 15px; }
  .news-detail-v1__hero-meta { margin-top: 18px; }
  .news-detail-v1__hero-media { aspect-ratio: 16 / 10; }

  .news-detail-v1__content { padding-block: 52px; }

  .news-detail-v1__navigation-inner { grid-template-columns: minmax(0, 1fr); }
  .news-detail-v1__navigation-link.is-next { text-align: left; }

  .news-detail-v1__hero[data-mobile-title-align="center"] :is(
    .news-detail-v1__tag-row,
    .news-detail-v1__hero-copy
  ) { text-align: center; }

  .news-detail-v1__hero[data-mobile-title-align="center"] .news-detail-v1__hero-meta {
    justify-content: center;
  }

  .news-detail-v1__hero[data-mobile-title-align="left"] :is(
    .news-detail-v1__tag-row,
    .news-detail-v1__hero-copy
  ) { text-align: left; }

  .news-detail-v1__hero[data-mobile-title-align="left"] :is(
    .news-detail-v1__hero-copy,
    .news-detail-v1__summary
  ) { margin-inline: 0; }

  .news-detail-v1__hero[data-mobile-title-align="left"] .news-detail-v1__hero-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 420px) {
  
  .news-detail-v1__hero-meta { gap: 6px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .news-detail-v1__navigation-link { transition: none; }
}

/* Mobile H1 scale: preserve smaller editor values; desktop/tablet stay unchanged. */
@media (max-width: 767px) {
  .news-detail-v1__hero h1 {
    font-size: min(var(--news-detail-hero-title-size, 50px), 22px);
    line-height: 1.45;
  }
}

@media (max-width: 360px) {
  .news-detail-v1__hero h1 {
    font-size: min(var(--news-detail-hero-title-size, 50px), 22px);
  }
}
