body.frontmatter h1 {
    color: blue;
    font-weight: bold;
}

/* Add spacing below collapsed navigation sections */
.md-nav--primary .md-nav__item>.md-nav__link {
    margin-bottom: 8px;
}

/* Reset the section counter and prepare for subsections */
body {
    counter-set: section var(--section-number);
}

h1 {
    counter-reset: subsection;
    counter-reset: figure;

}

h2 {
    counter-reset: subsubsection;
    counter-increment: subsection;
}

h3 {
    counter-reset: subsubsubsection;
    counter-increment: subsubsection;
}

h4 {
    counter-reset: subsubsubsubsection;
    counter-increment: subsubsubsection;
}

h5 {
    counter-reset: subsubsubsubsection;
    counter-increment: subsubsubsection;
}

figcaption {
    counter-increment: figure;
}

/* Section numbering for body and annex (unified with variable) */
h1::before {
    content: "Section " counter(section, var(--section-style)) " ";
}

h2::before {
    content: counter(section, var(--section-style)) "." counter(subsection) " ";
}

h3::before {
    content: counter(section, var(--section-style)) "." counter(subsection) "." counter(subsubsection) " ";
}

h4::before {
    content: counter(section, var(--section-style)) "." counter(subsection) "." counter(subsubsection) "." counter(subsubsubsection) " ";
}

h5::before {
    content: counter(section, var(--section-style)) "." counter(subsection) "." counter(subsubsection) "." counter(subsubsubsection) "." counter(subsubsubsubsection) " ";
}

figcaption {
    font-weight: bold;
}

figcaption::before {
    content: "Figure " counter(section, var(--section-style)) "-" counter(figure) " ";
    font-weight: bold;
}

next-fig::before {
    counter-increment: figure 1;
    content: "Figure " counter(section, var(--section-style)) "-" counter(figure);
}

next-fig::after {
    counter-increment: figure -1;
    content: '';
}

/* General styling for status badges */
.status-badge {
    display: inline-block !important;
    padding: 5px 10px !important;
    border-radius: 5px !important;
    font-weight: bold !important;
    margin-bottom: 1em !important;
    font-size: 0.9em !important;
    text-align: center;
}

/* Proposal - Gray */
.status-badge.proposal {
    background-color: #B0B0B0 !important;
    /* Gray */
    color: black !important;
}

/* Draft - Yellow */
.status-badge.draft {
    background-color: #FFD700 !important;
    /* Yellow */
    color: black !important;
}

/* Preliminary - Orange */
.status-badge.preliminary {
    background-color: #FFA500;
    /* Orange */
    color: black;
}

/* Recommended */
.status-badge.recommended {
    background-color: #1E90FF;
    /* Blue */
    color: white;
}

/* Approved - Green */
.status-badge.approved {
    background-color: #0AA00A;
    /* Green */
    color: white;
}

/* TOC numbering (mirrors content structure, uses separate counters to avoid conflicts) */
.md-nav--secondary {
    counter-set: toc-section var(--section-number);
}

.md-nav--secondary .md-nav__list {
    counter-reset: toc-subsection;
}

.md-nav--secondary .md-nav__list>.md-nav__item {
    counter-increment: toc-subsection;
}

.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav__link::before {
    content: counter(toc-section, var(--section-style)) "." counter(toc-subsection) " ";
}

/* Level 3 (h3/subsubsection) */
.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list {
    counter-reset: toc-subsubsection;
}

.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item {
    counter-increment: toc-subsubsection;
}

.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav__link::before {
    content: counter(toc-section, var(--section-style)) "." counter(toc-subsection) "." counter(toc-subsubsection) " ";
}

/* Level 4 (h4/subsubsubsection) */
.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list {
    counter-reset: toc-subsubsubsection;
}

.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item {
    counter-increment: toc-subsubsubsection;
}

.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav__link::before {
    content: counter(toc-section, var(--section-style)) "." counter(toc-subsection) "." counter(toc-subsubsection) "." counter(toc-subsubsubsection) " ";
}

/* Level 5 (h5/subsubsubsubsection) */
.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list {
    counter-reset: toc-subsubsubsubsection;
}

.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item {
    counter-increment: toc-subsubsubsubsection;
}

.md-nav--secondary .md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav>.md-nav__list>.md-nav__item>.md-nav__link::before {
    content: counter(toc-section, var(--section-style)) "." counter(toc-subsection) "." counter(toc-subsubsection) "." counter(toc-subsubsubsection) "." counter(toc-subsubsubsubsection) " ";
}

/* Hide first column in tables with class 'hide-first-col' */
.md-typeset table.hide-first-col th:first-child,
.md-typeset table.hide-first-col td:first-child {
    display: none;
}

/* Same draft stamps as the ISO 24315 site.
   draft4 DRAFT — terms changed since the last approved release.
   <div class="draft4-watermark" aria-hidden="true"></div> */
.draft1-watermark,
.draft2-watermark,
.draft3-watermark,
.draft4-watermark,
.draft5-watermark {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  margin: 0;
  color: #d32f2f;
  font-family: "Arial Black", Impact, "Segoe UI", sans-serif;
  font-size: clamp(2.15rem, 7vw, 3.4rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.08;
  text-align: center;
  white-space: pre;
  pointer-events: none;
  user-select: none;
  opacity: 0.28;
  transform: rotate(-18deg);
}

.draft1-watermark::before,
.draft2-watermark::before,
.draft3-watermark::before,
.draft4-watermark::before,
.draft5-watermark::before {
  white-space: pre;
}

.draft1-watermark::before {
  content: "NOT READY\A FOR REVIEW";
}

.draft2-watermark {
  font-size: clamp(2.65rem, 9vw, 4.8rem);
}

.draft2-watermark::before {
  content: "PRE-DRAFT";
}

.draft3-watermark {
  font-size: clamp(2.65rem, 9vw, 4.8rem);
}

.draft3-watermark::before {
  content: "PRE-DRAFT";
}

.draft4-watermark {
  font-size: clamp(3.25rem, 12vw, 6.25rem);
  opacity: 0.22;
}

.draft4-watermark::before {
  content: "DRAFT";
}

.draft5-watermark::before {
  content: "FINAL DRAFT";
}
