/*
 * © 2026 Sony Corporation
 */

/* ── Design tokens ── */
:root {
  --font-size: 16px;
  --line-height: 1.6;
  --text: #111;
  --bg: #fff;
  --focus: #0a66c2;
}

/* ── Base ── */
html {
  font-size: var(--font-size);
}

/* EN font stack (default) */
body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans", "Noto Sans JP", sans-serif;
  line-height: var(--line-height);
  color: var(--text);
  background: var(--bg);
}

/* JA font stack override */
html[lang="ja"] body {
  font-family: "Noto Sans JP", "Noto Sans", "Noto Serif JP", sans-serif;
}

/* ── Skip link (accessibility) ── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: #fff;
  border: 2px solid var(--focus);
  z-index: 1000;
}

/* ── Layout ── */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
}
h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1.25rem;
  margin: 1.75rem 0 0.75rem;
}

/* Section-numbered headings (EN) */
h2.sec::before {
  content: attr(data-sec) ". ";
}

p {
  white-space: pre-wrap;
  margin: 0.5rem 0;
}

.blank {
  min-height: 1em;
}

/* Plain text blocks for documents whose numbering is embedded in the text */
.text-block {
  margin: 0.5rem 0 0.5rem 1.5rem;
}
.text-block .text-block {
  margin-left: 1.75rem;
}
.text-block > p {
  margin: 0;
  white-space: pre-wrap;
}
.text-block > p + p {
  margin-top: 0.25rem;
}

/* JA headings: preserve whitespace */
html[lang="ja"] h1,
html[lang="ja"] h2,
html[lang="ja"] h3 {
  white-space: pre-wrap;
}

/* ── Lists ── */
ol, ul {
  margin: 0.5rem 0 0.5rem 1.5rem;
  padding: 0;
}
ol ol, ol ul, ul ul, ul ol {
  margin-left: 1.75rem;
}
li {
  margin: 0.25rem 0;
}
li > p {
  margin: 0;
  white-space: pre-wrap;
}
li > p + p {
  margin-top: 0.25rem;
}
.li-head {
  margin: 0;
}
.li-continue {
  margin-top: 0.25rem;
}

/* Hierarchical numbering with explicit prefix (e.g. "2.1. ") */
ol.sec-list {
  list-style: none;
  counter-reset: item;
}
ol.sec-list li {
  counter-increment: item;
  position: relative;
  padding-left: 3.2em;
}
ol.sec-list li::before {
  content: attr(data-prefix) "." counters(item, ".") ". ";
  position: absolute;
  left: 0;
  top: 0;
}

/* Roman numeral sub-lists */
ol.roman-list {
  list-style: none;
  counter-reset: roman;
}
ol.roman-list li {
  counter-increment: roman;
  position: relative;
  padding-left: 3.2em;
}
ol.roman-list li::before {
  content: "(" counter(roman, lower-roman) ") ";
  position: absolute;
  left: 0;
  top: 0;
}

/* Text-list: numbering already in content */
ol.text-list {
  list-style: none;
  margin: 0.5rem 0 0.5rem 1.5rem;
  padding: 0;
}
ol.text-list ol, ol.text-list ul,
ul.text-list ul, ul.text-list ol {
  margin-left: 1.75rem;
}
ol.text-list li {
  margin: 0.25rem 0;
}
ol.text-list li > p {
  margin: 0;
  white-space: pre-wrap;
}
ol.text-list li > p + p {
  margin-top: 0.25rem;
}

/* Hide auto markers (JA docs where numbering is in original text) */
ol.list-none, ul.list-none {
  list-style: none;
}
ol.list-none ol.list-none, ol.list-none ul.list-none,
ul.list-none ul.list-none, ul.list-none ol.list-none {
  margin-left: 1.75rem;
}

/* ── Focus ── */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ── Tables ── */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
}

th,
td {
  border: 1px solid #ccc;
  padding: 0.5rem;
  vertical-align: top;
  text-align: left;
}

caption {
  font-weight: 600;
  margin-bottom: 0.5rem;
}
