/*
 * Shared site chrome (header + footer) - Legum Law legal-reference site.
 *
 * Paired with Assets/site-chrome.js, which builds the markup at run
 * time. Link this sheet AFTER a page's own inline <style> block so its body
 * offsets win, then load the script with defer:
 *
 * Both are loaded at the END of <body> so the statute text paints first on a
 * poor connection; the page reserves the header's height in its own inline
 * <style> so nothing shifts when this sheet arrives.
 *
 * --statute-header-base is the header at full height and drives the body's top
 * padding; --statute-header-height tracks its live height for anchor offsets.
 * Keeping them apart is what stops the text shifting when the header compacts.
 */

html {
  scroll-behavior: smooth;
}
:root {
  color-scheme: light;
  --legum-navy: #072f52;
  --legum-blue: #004d91;
  --legum-blue-dark: #003767;
  --legum-gold: #c99532;
  --legum-gold-light: #e1bd72;
  --legum-ivory: #f7f5f0;
  --legum-paper: #fffefa;
  --legum-ink: #18232d;
  --legum-muted: #52616d;
  --legum-rule: #d9dee2;
  --legum-tint: #f7f5f0;
  --legum-shadow: 0 0.5rem 1.8rem rgba(7, 47, 82, 0.09);
  --legum-ui-font: "Open Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --statute-header-base: 6.6rem;
  --statute-header-height: 6.6rem;
}
[id] {
  scroll-margin-top: calc(var(--statute-header-height) + 1rem);
}

.statute-noscript {
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--legum-tint);
  border-left: 0.25rem solid var(--legum-blue);
  font-family: var(--legum-ui-font);
  font-weight: 600;
}
noscript .statute-noscript a { color: var(--legum-blue); }

/* ---------- shell ---------- */
.statute-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1000;
  color: var(--legum-ink);
  background: rgba(255, 254, 250, 0.98);
  border-top: 4px solid var(--legum-gold);
  border-bottom: 1px solid rgba(7, 47, 82, 0.12);
  box-shadow: 0 0.2rem 1.2rem rgba(7, 47, 82, 0.055);
  font-family: var(--legum-ui-font);
  transform: translateY(0);
  transition: transform 200ms ease;
}
.statute-header.is-hidden {
  transform: translateY(calc(-100% - 0.5rem));
}
.statute-header *,
.statute-header *::before,
.statute-header *::after { box-sizing: border-box; }
/* The brand sits in its own column spanning both rows, so the logo can be
   large without making the header any taller than the nav plus the toolbar. */
.statute-header__inner {
  display: flex;
  align-items: stretch;
  width: min(100%, 77.5rem);
  margin: 0 auto;
}
.statute-brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.4rem 1.15rem;
  color: inherit;
  background: rgba(255, 254, 250, 0.98);
  text-decoration: none;
}
.statute-brand img {
  display: block;
  width: auto;
  height: 5.6rem;
  transition: height 180ms ease;
}
.statute-brand__copy {
  display: grid;
  /* Inline-size containment makes this flex child report zero intrinsic
     width, allowing the toolbar to paint over the brand at desktop widths. */
  min-width: 0;
  line-height: 1.15;
}
.statute-brand__copy strong {
  color: var(--legum-navy);
  font-family: "Times New Roman", Times, "Liberation Serif", serif;
  font-size: clamp(1.35rem, 2.5vw, 2.25rem);
  font-weight: 700;
  letter-spacing: normal;
  white-space: nowrap;
}
.statute-brand__copy span {
  margin-top: 0.3rem;
  color: var(--legum-muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.015em;
  white-space: nowrap;
}
.statute-header__stack {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.statute-brand:hover .statute-brand__copy strong,
.statute-brand:focus-visible .statute-brand__copy strong { color: var(--legum-blue); }

/* ---------- site navigation ---------- */
.statute-site-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 1.1rem;
  background: rgba(255, 254, 250, 0.98);
}
.statute-site-nav > .statute-menu { width: 100%; }
.statute-menu,
.statute-submenu {
  margin: 0;
  padding: 0;
  list-style: none;
}
.statute-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.1rem 0.15rem;
}
.statute-menu > li { position: relative; }
.statute-menu > li > a,
.statute-nav-parent > a {
  display: block;
  padding: 0.42rem 0.5rem;
  color: var(--legum-navy);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.68;
  text-decoration: none;
  border-radius: 0.15rem;
}
.statute-menu a:hover,
.statute-menu a:focus-visible { color: var(--legum-blue); outline: none; }
.statute-menu > li > a:focus-visible,
.statute-nav-parent > a:focus-visible { outline: 2px solid var(--legum-gold); outline-offset: 1px; }
.statute-menu a[aria-current="page"] {
  color: var(--legum-blue);
  box-shadow: inset 0 -0.16rem 0 var(--legum-gold);
}
.statute-nav-parent {
  display: flex;
  align-items: center;
}
.statute-submenu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 0.6rem;
  height: 2.75rem;
  margin-left: 0.25rem;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0.15rem;
  cursor: pointer;
}
.statute-submenu-toggle svg {
  display: block;
  width: 0.6rem;
  height: 0.6rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  transition: transform 180ms ease;
}
.statute-submenu-toggle:hover,
.statute-submenu-toggle:focus-visible { color: var(--legum-blue); }
.statute-has-submenu.submenu-open .statute-submenu-toggle svg { transform: rotate(180deg); }
.statute-submenu {
  display: none;
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  min-width: 15.5rem;
  max-width: min(24rem, 88vw);
  max-height: min(38rem, 70vh);
  overflow-y: auto;
  padding: 0.35rem;
  background: var(--legum-paper);
  border: 1px solid var(--legum-rule);
  box-shadow: var(--legum-shadow);
}
.statute-has-submenu:hover > .statute-submenu,
.statute-has-submenu:focus-within > .statute-submenu,
.statute-has-submenu.submenu-open > .statute-submenu { display: block; }
.statute-submenu a {
  display: block;
  padding: 0.45rem 0.6rem;
  color: var(--legum-ink);
  font-size: 0.83rem;
  font-weight: 500;
  text-decoration: none;
}
.statute-submenu a:hover,
.statute-submenu a:focus-visible { color: var(--legum-blue); background: rgba(0, 77, 145, 0.06); outline: none; }

/* The flyout sits a little below its item, and that gap used to close the menu:
   the pointer left both on the way down. This strip appears only while the item
   is hovered and spans the gap, so travel to the flyout is continuous. It is on
   the item rather than the flyout because the flyout scrolls (overflow-y: auto)
   and would clip a bridge of its own. */
.statute-has-submenu::after {
  content: "";
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 0.55rem;
}
.statute-has-submenu:hover::after,
.statute-has-submenu:focus-within::after { display: block; }

/* The footer menu is the same component and behaves the same way: hover or
   focus opens the flyout, and the same bridge keeps it open. */
.statute-footer-nav .statute-has-submenu:hover > .statute-submenu,
.statute-footer-nav .statute-has-submenu:focus-within > .statute-submenu { display: block; }

.statute-menu-toggle {
  display: none;
  flex: 0 0 auto;
  width: 2.3rem;
  height: 2.3rem;
  margin-left: auto;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 1px solid var(--legum-rule);
  border-radius: 0.2rem;
  cursor: pointer;
}
.statute-menu-toggle svg { display: block; width: 1.25rem; height: 1.25rem; margin: 0 auto; fill: currentColor; }
.statute-menu-toggle .statute-icon-close { display: none; }
.statute-header.menu-open .statute-menu-toggle .statute-icon-close { display: block; }
.statute-header.menu-open .statute-menu-toggle .statute-icon-open { display: none; }
.statute-menu-toggle:hover,
.statute-menu-toggle:focus-visible { color: #fff; background: var(--legum-blue); border-color: var(--legum-blue); }

/* ---------- statute toolbar ---------- */
.statute-toolbar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1.1rem;
  background: var(--legum-tint);
}
.statute-toolbar form { margin: 0; }
.statute-tool {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 2.1rem;
  background: #fff;
  border: 1px solid #b9c3cf;
  border-radius: 0.25rem;
}
.statute-tool:focus-within {
  border-color: var(--legum-blue);
  box-shadow: 0 0 0 0.13rem rgba(0, 77, 145, 0.22);
}
.statute-tool__label {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 0.5rem;
  color: var(--legum-muted);
  background: #eef2f7;
  border-right: 1px solid #dbe2ea;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.statute-tool input,
.statute-tool select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 0.45rem;
  color: inherit;
  background: transparent;
  border: 0;
  font-family: var(--legum-ui-font);
  font-size: 0.86rem;
}
.statute-tool input:focus,
.statute-tool select:focus { outline: none; }
.statute-tool input::-webkit-search-cancel-button,
.statute-tool input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

.statute-chapters { flex: 4 1 17rem; }
.statute-chapters select { padding-right: 0.2rem; cursor: pointer; }
.statute-goto { flex: 0 0 auto; }
.statute-goto .statute-tool__label { font-size: 0.95rem; letter-spacing: 0; text-transform: none; }
.statute-goto input { width: 5.2rem; flex: 0 0 5.2rem; text-align: center; }
.statute-goto.is-invalid { border-color: #b3261e; box-shadow: 0 0 0 0.13rem rgba(179, 38, 30, 0.2); }
.statute-search { flex: 3 1 15rem; }
.statute-search__count {
  flex: 0 0 auto;
  padding: 0 0.4rem;
  color: var(--legum-muted);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.statute-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  padding: 0 0.4rem;
  color: var(--legum-ink);
  background: #fff;
  border: 1px solid #b9c3cf;
  border-radius: 0.25rem;
  font-family: var(--legum-ui-font);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}
.statute-btn svg { display: block; width: 1rem; height: 1rem; fill: currentColor; }
.statute-btn:hover:not(:disabled),
.statute-btn:focus-visible {
  color: #fff;
  background: var(--legum-blue);
  border-color: var(--legum-blue);
  outline: none;
}
.statute-btn:focus-visible { box-shadow: 0 0 0 0.13rem rgba(0, 77, 145, 0.3); }
.statute-btn:disabled { opacity: 0.42; cursor: default; }
.statute-tool .statute-btn {
  height: auto;
  align-self: stretch;
  border: 0;
  border-left: 1px solid #e3e9ef;
  border-radius: 0;
  background: transparent;
}
.statute-tool .statute-btn:last-child { border-top-right-radius: 0.2rem; border-bottom-right-radius: 0.2rem; }
.statute-goto .statute-btn { padding: 0 0.6rem; font-weight: 600; }

.statute-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  padding-left: 0.45rem;
  border-left: 1px solid var(--legum-rule);
}

.statute-message {
  display: none;
  width: min(100%, 84rem);
  margin: 0 auto;
  padding: 0.3rem 1.1rem 0.4rem;
  background: var(--legum-tint);
  color: var(--legum-muted);
  font-size: 0.8rem;
}
.statute-message.is-visible { display: block; }
.statute-message.is-error { color: #8a2018; }

/* ---------- reading progress ---------- */
.statute-progress {
  height: 0.2rem;
  background: #e4eaf1;
  border-bottom: 1px solid rgba(0, 36, 69, 0.08);
}
.statute-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--legum-blue) 0%, var(--legum-gold) 100%);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- compact mode while reading ---------- */
.statute-header.is-compact .statute-brand { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.statute-header.is-compact .statute-brand img { height: 3.4rem; }
.statute-header.is-compact .statute-brand__copy span { display: none; }
.statute-header.is-compact .statute-brand__copy strong { font-size: 1.05rem; }
.statute-header.is-compact .statute-menu > li > a,
.statute-header.is-compact .statute-nav-parent > a {
  padding-top: 0.26rem;
  padding-bottom: 0.26rem;
  font-size: 0.84rem;
}

/* ---------- search highlights (no DOM mutation) ---------- */
::highlight(statute-search) {
  background-color: #ffeaa0;
  color: #10161d;
}
::highlight(statute-search-current) {
  background-color: var(--legum-gold);
  color: #10161d;
}
tr.statute-section-target > td,
.statute-section-target { background-color: #fff4cf; }
tr.statute-section-target > td:first-child { box-shadow: inset 0.18rem 0 0 var(--legum-gold); }

/* ---------- site footer ---------- */
/* Mirrors the footer on the landing page, scoped so it cannot collide with an
   enactment's own styles. Injected by Assets/site-chrome.js. */
.statute-footer {
  /* Full bleed without 100vw: site-chrome.js measures the body's own inset so
     the band reaches the viewport edge with no horizontal overflow. */
  margin: 5rem calc(-1 * var(--statute-bleed-x, 0px)) calc(-1 * var(--statute-bleed-b, 0px));
  color: #fff;
  background: linear-gradient(132deg, var(--legum-navy) 0%, var(--legum-blue) 72%, #1167a6 100%);
  border-top: 4px solid var(--legum-gold);
  font-family: var(--legum-ui-font);
  font-size: clamp(1rem, 0.97rem + 0.12vw, 1.075rem);
  line-height: 1.68;
}
.statute-footer *,
.statute-footer *::before,
.statute-footer *::after { box-sizing: border-box; }
.statute-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.75rem 3.5rem;
  width: min(94rem, calc(100% - 4.8rem));
  margin: 0 auto;
  padding: clamp(3.25rem, 5vw, 4.5rem) 1.5rem 0;
}
.statute-footer-grid > div:first-child {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto 1fr;
  align-items: start;
  gap: 0.45rem 3.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
  container-type: inline-size;
}
.statute-footer-grid > div:first-child > .statute-footer-brand { grid-column: 1; grid-row: 1; text-align: start; }
.statute-footer-grid > div:first-child > .statute-footer-since { grid-column: 1; grid-row: 2; text-align: end; }
.statute-footer-grid > div:first-child > p:nth-child(3) { grid-column: 1; grid-row: 3; margin-top: 0.75rem; text-align: justify; }
.statute-footer-grid > div:first-child > .statute-footer-section { grid-column: 3; grid-row: 1 / span 3; align-self: start; display: grid; grid-template-rows: auto auto 1fr; row-gap: 0.5rem; }
.statute-footer-grid > div:first-child > .statute-footer-section > h2,
.statute-footer-grid > div:first-child > .statute-footer-section > p { width: max-content; justify-self: center; }
.statute-footer-grid > div:nth-child(2) { grid-column: 1; }
.statute-footer-grid > div:nth-child(3) { grid-column: 2; justify-self: center; }
.statute-footer-grid > div:nth-child(4) { grid-column: 3; }
.statute-footer h2,
.statute-footer h3 {
  margin: 0;
  color: #fff;
  font-family: "Open Sans", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.statute-footer h3:first-child { margin-top: 0; }
.statute-footer p { margin: 0.75rem 0 0; color: rgba(255, 255, 255, 0.9); font-size: 0.93rem; line-height: 1.62; }
.statute-footer a { color: #fff; text-underline-offset: 0.18em; }
.statute-footer a:hover,
.statute-footer a:focus-visible { color: #ffe7a2; }
.statute-footer .statute-footer-brand {
  margin: 0;
  color: #fff;
  font-family: "Times New Roman", Times, "Liberation Serif", serif;
  font-size: clamp(1.5rem, 3.35vw, 3rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: normal;
}
.statute-footer-grid > div:first-child > .statute-footer-brand,
.statute-footer-grid > div:first-child > .statute-footer-since,
.statute-footer-grid > div:first-child > p:nth-child(3),
.statute-footer-grid > div:first-child > .statute-footer-section > p { margin-top: 0; }
.statute-footer-grid > div:first-child > .statute-footer-section .statute-language-switcher { margin-top: 0.35rem; }
.statute-footer-grid > div:nth-child(2) > p:nth-of-type(-n+3) { font-size: clamp(14px, calc(0.875rem + ((1vw - 3.2px) * 0.217)), 16px); }
.statute-footer-brand a { text-decoration: none; }
.statute-footer-since { text-align: end; }
.statute-language-switcher { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.3rem 0; align-items: center; width: min(100%, 40rem); margin-top: 0.85rem; }
.statute-language-switcher ul { display: contents; list-style: none; }
.statute-language-switcher::after { content: ""; flex-basis: 100%; order: 1; }
.statute-language-switcher li { display: inline-block; margin: 0; }
.statute-language-switcher li:nth-child(n+5) { order: 2; }
.statute-language-switcher li:not(:first-child)::before { content: "•"; padding-inline: 0.55rem; color: var(--legum-gold-light); font-weight: 400; }
.statute-language-switcher li:nth-child(5)::before { content: none; padding: 0; }
.statute-language-link { font-weight: 700; text-decoration: none; }
.statute-language-link:hover,
.statute-language-link:focus-visible { text-decoration: underline; }
.statute-footer-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
}
.statute-footer-nav > li { position: relative; }
.statute-footer-nav a { text-decoration: none; }
.statute-footer-nav > li > a,
.statute-footer-nav .statute-nav-parent > a { display: flex; align-items: center; min-height: 2.75rem; padding: 0.45rem 0; }
.statute-footer-nav .statute-nav-parent { justify-content: center; }
.statute-footer-nav .statute-submenu-toggle { width: 2.75rem; height: 2.75rem; margin-left: 0; color: #fff; }
.statute-footer-nav .statute-submenu-toggle svg { width: 0.75rem; height: 0.75rem; }
.statute-footer-nav .statute-submenu {
  left: 50%;
  transform: translateX(-50%);
  min-width: min(19rem, calc(100vw - 4rem));
  max-width: calc(100vw - 4rem);
  max-height: min(50vh, 24rem);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0.4rem;
  color: var(--legum-ink);
  background: var(--legum-paper);
  border: 1px solid var(--legum-rule);
  box-shadow: var(--legum-shadow);
}
.statute-footer-nav .statute-submenu a { color: var(--legum-ink); }
.statute-footer-nav .statute-submenu a:hover,
.statute-footer-nav .statute-submenu a:focus-visible { color: var(--legum-blue); background: rgba(0, 77, 145, 0.06); }
.statute-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
}
.statute-social li { line-height: 0; }
.statute-social a {
  display: inline-flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  text-decoration: none;
}
.statute-social svg { display: block; width: 1.25rem; height: 1.25rem; fill: currentColor; }
.statute-footer-bottom {
  width: min(102rem, calc(100% - 4.8rem));
  margin: 3.125rem auto 0;
  padding: 1rem 0;
  color: #000;
  background: var(--legum-gold);
  border: 0;
}
.statute-footer-bottom p {
  width: 80%;
  max-width: 80%;
  margin: 0.75rem auto 0;
  color: #000;
  font-size: 0.93rem;
  line-height: 1.62;
  text-align: center;
}
.statute-footer-bottom p a,
.statute-footer-bottom p a:link,
.statute-footer-bottom p a:visited,
.statute-footer-bottom p a:hover,
.statute-footer-bottom p a:active,
.statute-footer-bottom p a:focus-visible { color: #000; }

@media (max-width: 68rem) {
  .statute-menu > li > a,
  .statute-nav-parent > a { padding: 0.42rem 0.34rem; font-size: 0.84rem; }
  .statute-brand__copy strong { font-size: 0.98rem; }
}
@media (max-width: 76rem) {
  /* The menu bar needs more width than the toolbar, so it folds away first
     while the brand column and the toolbar row both stay as they are. */
  .statute-menu-toggle {
    display: block;
    order: 3;
    align-self: center;
    margin: 0 0.7rem;
  }
  .statute-header__stack { order: 2; }
  .statute-site-nav {
    display: none;
    padding: 0;
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
  }
  .statute-header.menu-open .statute-site-nav { display: block; }
  .statute-menu {
    display: block;
    width: 100%;
    padding: 0 1.1rem;
  }
  .statute-menu > li { border-bottom: 1px solid #e7ebf0; }
  .statute-menu > li > a,
  .statute-nav-parent > a { padding: 0.7rem 0.2rem; font-size: 0.95rem; }
  .statute-nav-parent { justify-content: space-between; }
  .statute-nav-parent > a { flex: 1 1 auto; }
  .statute-submenu-toggle { width: 2.4rem; height: 2.4rem; margin: 0; }
  .statute-submenu-toggle svg { width: 0.75rem; height: 0.75rem; }
  .statute-has-submenu:hover > .statute-submenu,
  .statute-has-submenu:focus-within > .statute-submenu { display: none; }
  .statute-has-submenu.submenu-open > .statute-submenu {
    display: block;
    position: static;
    transform: none;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0 0 0.35rem;
    border: 0;
    border-left: 0.18rem solid var(--legum-blue);
    box-shadow: none;
  }
  .statute-submenu a { font-size: 0.88rem; padding: 0.5rem 0.7rem; }
}
@media (max-width: 54rem) {
  /* Too narrow for one toolbar row: chapter + section jump, then search. */
  .statute-chapters { flex: 1 1 calc(100% - 10rem); }
  .statute-search { flex: 1 1 calc(100% - 8.5rem); }
}
@media (max-width: 46rem) {
  /* Too narrow for a brand column: brand becomes a row above the toolbar. */
  .statute-header__inner { display: block; position: relative; }
  .statute-brand {
    padding: 0.3rem 0.7rem;
    gap: 0.6rem;
  }
  .statute-brand img { height: 3.7rem; max-width: 4.5rem; }
  .statute-brand__copy strong { font-size: clamp(1.25rem, 5vw, 1.75rem); line-height: 1.05; }
  .statute-brand__copy span { font-size: 0.72rem; line-height: 1.25; }
  .statute-menu-toggle {
    position: absolute;
    top: 0.45rem;
    right: 0.7rem;
    margin: 0;
  }
  .statute-menu { padding: 0 0.7rem; }
  .statute-toolbar { gap: 0.35rem; padding: 0.4rem 0.7rem; }
  /* Row one: chapter selector + section jump. Row two: search + actions. */
  .statute-chapters { flex: 1 1 calc(100% - 6.5rem); }
  .statute-search { flex: 1 1 calc(100% - 3.1rem); }
  .statute-goto input { width: 4.1rem; flex: 0 0 4.1rem; }
  .statute-goto .statute-btn { display: none; }
  /* Phones have their own back gesture; keep the row for the search field. */
  #history-back,
  #history-forward { display: none; }
  .statute-actions { padding-left: 0.35rem; }
  .statute-actions .statute-btn { min-width: 1.95rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .statute-header,
  .statute-brand img,
  .statute-submenu-toggle svg { transition: none; }
}
@media print {
  .statute-header { display: none; }
  body { padding: 2%; }
  [id] { scroll-margin-top: 0; }
}

@media (max-width: 56rem) {
  .statute-footer-grid { grid-template-columns: 1fr; gap: 1.2rem; width: calc(100% - 3rem); padding-inline: 0; }
  .statute-footer .statute-footer-brand { font-size: min(3rem, 12.5vw); }
  .statute-footer-grid > div:first-child { grid-template-columns: 1fr; grid-template-rows: auto; gap: 0.75rem; }
  .statute-footer-grid > div:first-child > .statute-footer-brand,
  .statute-footer-grid > div:first-child > .statute-footer-since,
  .statute-footer-grid > div:first-child > p:nth-child(3),
  .statute-footer-grid > div:first-child > .statute-footer-section { grid-column: 1; grid-row: auto; text-align: center; }
  .statute-footer-grid > div:nth-child(2),
  .statute-footer-grid > div:nth-child(3),
  .statute-footer-grid > div:nth-child(4) { grid-column: 1; justify-self: stretch; text-align: center; }
  .statute-footer-nav { align-items: center; }
  .statute-footer-bottom { width: calc(100% - 3rem); }
}
@media (max-width: 42rem) {
  .statute-language-switcher { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 0.55rem 1rem; }
  .statute-language-switcher::after { display: none; }
  .statute-language-switcher li:nth-child(n+5) { order: 0; }
  .statute-language-switcher li::before,
  .statute-language-switcher li:nth-child(5)::before { content: "•"; padding-inline: 0 0.55rem; }
  .statute-language-switcher li:nth-child(odd)::before { content: none; padding: 0; }
  .statute-language-switcher li:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; }
}
@media print {
  .statute-footer { display: none; }
}
