/* Shared typography and navigation for the public information pages. */
@media screen {
  html body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", system-ui, "Hiragino Sans", "Yu Gothic UI", sans-serif;
    -webkit-font-smoothing: antialiased;
  }
  body h1 {
    font-family: inherit;
    font-weight: 700;
    letter-spacing: -.045em;
    text-wrap: balance;
    overflow-wrap: anywhere;
  }
  body h1:lang(ja), body h1:lang(zh) { letter-spacing: -.025em; }
  body h2, body h3 { text-wrap: pretty; }
  body vcp-header .main-nav, body vcp-header .language-switcher {
    --vcp-nav-bg: #fafafc;
    --vcp-panel-bg: #fff;
    --vcp-nav-text: #1d1d1f;
    --vcp-nav-muted: #525258;
    --vcp-nav-line: #d8d8dc;
    --vcp-nav-hover: #ededf1;
    --vcp-nav-accent: #005bb5;
    color-scheme: light;
  }
  body vcp-header .main-nav { box-shadow: 0 1px 0 rgb(29 29 31 / 5%); }
  body vcp-header .main-nav .logo-image { filter: none; }
  body vcp-header .main-nav .nav-link { font-weight: 550; }
  body vcp-header .main-nav .dropdown-menu { border-radius: 18px; }
  body :is(.hero-v11, .official-channel, .entry) { overflow-wrap: anywhere; }
  body .partner-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
  body .before-after-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
  body .media-logo-card img { max-width: min(100%, 180px); }

  /* Keep long identifiers inside a flexible track without clipping copy. */
  @media (max-width: 600px) {
    body .grid > * { min-width: 0; }
    body :where(main, section, article) :is(code, .official-channel a) { overflow-wrap: anywhere; }
  }
}

/* The archive keeps historical notice cards in their original, darker palette. */
@media screen {
  body.news-archive {
    color-scheme: light;
    background: #fff !important; /* Overrides the archive's inline loading background. */
    color: #333336;
  }
  .news-archive .archive-header { border-color: #d2d2d7; }
  .news-archive .archive-hero { padding-block: clamp(2.5rem, 6vw, 5rem) 1rem; }
  .news-archive .archive-hero h1 {
    color: #1d1d1f;
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    line-height: 1.12;
  }
  .news-archive :is(.archive-eyebrow, .news-category, .archive-record summary),
  .news-archive a:not(.archive-original a) { color: #005bb5; }
  .news-archive :is(.archive-hero p, .archive-count, .news-meta, .news-summary, .archive-controls label, .archive-footer) { color: #515155; }
  .news-archive .archive-controls,
  .news-archive .news-status { color: #272729; background: #f5f5f7; border-color: #d2d2d7; border-radius: 14px; }
  .news-archive .archive-history-label { color: #614821; }
  .news-archive .archive-controls :is(select, input, button) { color: #1d1d1f; background: #fff; border-color: #86868b; }
  .news-archive .archive-month > h2,
  .news-archive .news-row > div > h3 { color: #1d1d1f; }
  .news-archive .news-row { border-color: #dedee2; }
  .news-archive .archive-original { color-scheme: dark; color: #dce5f3; }
  .news-archive .news-new { color: #125527; border-color: currentColor; }
}

/* VCP v1.1 reference diagrams retain their columns inside a local scroll area. */
@media screen and (max-width: 640px) {
  body:has(.hero-v11) section p { overflow-wrap: anywhere; }
  .layer-diagram .layer-box > .flex { flex-wrap: wrap; }
  body:has(.hero-v11) .code-block:has(pre.inline-block) {
    max-width: 100%;
    text-align: start;
    overflow-x: auto;
  }
  body:has(.hero-v11) .code-block pre.inline-block,
  body:has(.hero-v11) .code-block pre.inline-block code {
    white-space: pre;
    overflow-wrap: normal;
    word-break: normal;
  }
}
@media screen and (max-width: 400px) {
  body:has(.hero-v11) .grid.grid-cols-2.gap-3 { grid-template-columns: minmax(0, 1fr); }
}

/* Give the language choices their own row. The fixed nav occupies the first 70px. */
@media screen {
  body:has(> vcp-header .language-switcher) { padding-top: 0; }
  body > vcp-header:has(.language-switcher) {
    display: block;
    padding-top: 70px;
    background: #fafafc;
  }
  body > vcp-header .language-switcher {
    position: static;
    width: min(1160px, calc(100% - 32px));
    margin-inline: auto;
    padding: 0;
    min-height: 34px;
    justify-content: flex-end;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body > vcp-header .language-switcher .lang-link {
    font-size: .75rem;
    color: #424247;
    padding: .375rem;
  }
  body > vcp-header .language-switcher .lang-link.active {
    color: #1d1d1f;
    text-decoration: underline;
    text-underline-offset: .22em;
  }
}

@media screen and (max-width: 480px) {
  .sec-hero .text-sm, .card-pap, .gradient-pap ~ section .architecture-diagram {
    overflow-wrap: anywhere;
  }
  .gradient-pap ~ section .architecture-diagram .flex-1 { min-width: 0; }

  body:has(.partner-grid) :is(h2, h3) {
    font-size: clamp(1.5rem, 7vw, 2.25rem);
    overflow-wrap: anywhere;
  }
  body:has(.partner-grid) .benefits-grid { grid-template-columns: minmax(0, 1fr); }
  body:has(.partner-grid) :is(.cta-box, .hero-gradient) { padding: 1.25rem; }
  body:has(.partner-grid) .btn { padding-inline: 1rem; }
}

@media screen {
  .receipt-contact, .clarification-email-address {
    max-inline-size: 100%;
    overflow-wrap: anywhere;
  }
  .media-source-note { flex-wrap: wrap; }
}
