/* Base CSS (SSOT) — shared across all html pages
 * - Mobile-first, progressive, minimal specificity
 * - Contains theme variables (:root) directly; no separate theme-vars.css required
 */

/* 0) Theme variables (:root) */
:root {
  /* System font stacks (sans Arial) */

  /* prettier-ignore  */
  --font-base:
    system-ui, -apple-system, blinkmacsystemfont, "Segoe UI Variable", "Segoe UI", roboto, "Noto Sans", ubuntu, cantarell, "Liberation Sans", "DejaVu Sans", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;

  /* prettier-ignore  */
  --font-header:
    system-ui, -apple-system, blinkmacsystemfont, "Segoe UI Variable", "Segoe UI", roboto, "Noto Sans", ubuntu, cantarell, "Liberation Sans", "DejaVu Sans", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;

  /* Brand core */
  --primary-color: #e0162b; /* locked */
  --secondary-color: #f9faff; /* white */
  --tertiary-color: #002786; /* locked */
  --text-color: #212121; /* locked */
  --icon-color-on-lt: #8a94a8; /* locked */
  --icon-color-on-dk: #f5f8ff; /* locked */

  /* Layout surfaces */
  --background-color: #798ea4; /* page background behind light content */
  --footer-background: #3e4b5b;
  --blkquot-background: #f0f2f5;
  --body-bgcolor: var(--secondary-color); /* body background */
  --surface-color: #eee; /* menu/content surface */
  --surface-muted: #f0f0ee; /* light alt surface */
  --surface-soft: #fffaf0; /* neutral soft background */
  --surface-warm: #fff; /* hover menu warm neutral alt */
  --surface-1: #fffffa; /* medium light surface */
  --surface-2: #fffaf0; /* very light gray surface */

  /* Links */
  --link-color: #205fff; /* derived from brand blue */
  --link-hover: var(--primary-color);
  --link-visited: #630094;
  --link-active: var(--primary-color) /* Semantic states */;
  --pager-text-color: var(--text-color);
  --success-color: #0f6d2a;
  --success-bg: #e6f7ee;
  --success-border: #2f7d51;
  --danger-color: #e0162b; /* align with primary */
  --danger-bg: #fce9e9;
  --danger-border: #870200;
  --warning-color: #66008e;
  --warning-bg: #f0f0ee;
  --warning-border: #6330da;
  --info-color: #005e8d;
  --info-bg: #d9edf7;
  --info-border: #3a87ad;

  /* Answers (current + suggested alternates) */
  --answer-bgcolor: #93ffc5; /* current */
  --answer-txtcolor: #083615; /* current */
  --answer-bgcolor-alt: #8df8a6; /* suggested themed */
  --answer-txtcolor-alt: #0b501e; /* suggested themed */
  --answer-border: #0c5a1e; /* suggested themed */

  /* Navigation/menu links */
  --menu-text: #616978; /* accessible muted slate on white */
  --menu-text-hover: var(--primary-color);
  --menu-icon-pad-inline: 7px;
  --menu-link-bg: var(--surface-color);
  --menu-state-bg: var(--white);
  --menu-state-border: var(--primary-color);
  --menu-state-text: var(--primary-color);

  /*  Left Menu  */
  --left-menu-font-size: clamp(0.86rem, calc(0.72rem + 0.45vw), 0.96rem);

  /* scale text responsively across breakpoints */

  --left-menu-icon-size: clamp(1.25rem, calc(var(--left-menu-font-size) * 1.2), 1.45rem);

  /* keep icon height proportionate and enforce a floor */
  --left-menu-icon-slot: calc(var(--left-menu-icon-size) * 1.32);

  /* reserve matching horizontal space for icons */
  --left-menu-icon-gap: calc(var(--left-menu-font-size) * 0.6);

  /* allow sidebar spacing to track responsive sizing */
  --icon-gap: calc(var(--left-menu-font-size) * 0.55);

  /* let spacing scale with type/icon sizing */
  --icon-size: var(--left-menu-icon-size);

  /* re-use global icon hook with responsive size */
  --icon-slot: var(--left-menu-icon-slot);

  /* sync button column with icon growth */
  --left-menu-font-weight: 500;

  /* keep navigation copy readable without heavy bolding */
  --flyout-toggle-size: max(var(--left-menu-icon-size), 24px);

  /* keep flyout toggles in step with icon scale */

  /* Shape */
  --radius: 3px;

  /* Legacy button accents (for older components) */
  --btn-warning: #f89406;
  --btn-danger: #bd362f;
  --btn-success: #51a351;
  --btn-info: #49afcd;

  /* Neutrals and utility */
  --color-strong: #444;
  --color-muted: #666;
  --color-subtle: #888;
  --border-color: #aaa;
  --divider-color: #aaa;
  --border-subtle: #ccc;
  --border-light: var(--icon-color-on-lt); /* default border color */
  --border-dark: var(--icon-color-on-dk);
  --shadow-color: rgb(0 0 0 / 20%);

  /* Flyout/Menu theming */
  --flyout-width-desktop: 250px;
  --flyout-border: rgb(0 0 0 / 22%);
  --flyout-divider: rgb(0 0 0 / 15%);
  --flyout-shadow-menu: 0 2px 10px rgb(0 0 0 / 6%);
  --flyout-shadow-panel: 0 8px 24px rgb(0 0 0 / 12%);
  --hover-surface-overlay: rgb(0 0 0 / 2%);
  --flyout-anim-duration: 0.25s;
  --flyout-anim-ease: ease;

  /* Focus ring shadow (for accessibility states) */
  --focus-ring-shadow: 0 0 0 2px rgb(0 94 141 / 25%);

  /* Basic whites/blacks for legacy mappings */
  --white: #fff;
  --black: #000;

  /* Flyout item spacing */
  --flyout-item-padding-x: 8px;
  --flyout-item-padding-y: 6px;
  --flyout-item-gap: 6px;
  --flyout-icon-size: 20px;
  --flyout-item-min-width: 16ch;
  --flyout-item-min-width-left: 140px;
  --flyout-item-min-width-right: 155px;

  /* Flyout item spacing */
  --lists-icon-gap: var(--menu-toggle-icon-gap, 6px);
  --lists-icon-size: var(--flyout-toggle-size);
  --lists-icon-slot: calc(var(--lists-icon-size) + var(--lists-icon-gap));
  --lists-icon-pad-block: 0;
  --menu-icon-pad-inline-start: var(--lists-icon-pad-start, 0);
  --menu-icon-pad-inline-end: var(--lists-icon-gap);

  /* Exercise vars */
  --exercise-success: #166534;
  --exercise-success-bg: #e6f4ea;
  --exercise-error: #b3261e;
  --exercise-error-bg: #fdecea;
}

/* 1) Global resets and defaults */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  text-size-adjust: 100%;
}

body {
  /* Revert: use body background token (light) */
  background: var(--secondary-color);
  color: var(--text-color);
  font-family: var(--font-base);
  line-height: 1.5;
  margin: 0;
}

/* Container */
.container {
  margin: 0 auto;
  max-width: 1100px;
  padding: 0 18px;
}

/* Container */
.container2 {
  margin: 0 auto;
  max-width: 1085px;
  padding: 0 18px;
}

/* Footer */
.footer {
  min-height: 80px;
}

.footer .inner-footer {
  background-color: var(--footer-background);
  border-radius: var(--radius);
  color: var(--secondary-color);
  min-height: inherit;
}

.footer .inner-footer a,
.footer .inner-footer a:visited,
.footer .inner-footer a:hover,
.footer .inner-footer a:focus,
.footer .inner-footer a:active {
  color: inherit;
}

.mar10 {
  margin: 0.625rem;
}

.padme1 {
  padding-top: 3rem !important;
}

/* 2) Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-color);
  font-family: var(--font-header);
  margin: 0 0 0.5rem;
}

h1 {
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.2rem);
}

h2 {
  font-size: clamp(1.4rem, 1.1rem + 1.5vw, 2rem);
}

h3 {
  font-size: clamp(1.2rem, 1.05rem + 1vw, 1.6rem);
}

h4 {
  font-size: 1.125rem;
}

h5 {
  font-size: 1rem;
}

h6 {
  font-size: 0.95rem;
}

p {
  margin: 0 0 1rem;
}

small {
  font-size: 0.875em;
}

/* 3) Links and focus */
a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover,
a:focus {
  color: var(--link-hover);
}

a:focus-visible {
  box-shadow: var(--focus-ring-shadow);
  outline: none;
}

/* 4) Media */
img,
video {
  height: auto;
  max-width: 100%;
}

svg {
  height: auto;
  max-width: 100%;
}

/* 5) Lists, tables, code */
ul,
ol {
  margin: 0 0 1rem 1.25rem;
  padding: 0;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border: 1px solid var(--divider-color);
  padding: 0.5rem;
  text-align: left;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

pre {
  background: var(--surface-1);
  padding: 0.75rem;
  overflow: auto;
}

/* 6) Utilities */
.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  white-space: nowrap;
  width: 1px;
}

.icon-sprite {
  height: 0;
  overflow: hidden;
  position: absolute;
  width: 0;
}

/* Legacy float utilities still used in markup */
.pull-left {
  float: left;
}

.pull-right {
  float: right;
}

/* 7) Grid (mobile-first, minimal) */
.row-fluid {
  display: flex;
  flex-wrap: wrap;
  margin-left: -8px;
  margin-right: -8px;
}

.row-fluid > [class*="span"],
.row-fluid > #aside {
  box-sizing: border-box;
  flex: 0 0 100%;
  max-width: 100%;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
}

@media (width >= 768px) {
  .row-fluid > .span2,
  .row-fluid > #aside {
    flex: 0 0 16.6667%;
    max-width: 16.6667%;
  }

  .row-fluid > .span8 {
    flex: 0 0 66.6667%;
    max-width: 66.6667%;
  }

  /* Keep side rails readable while letting content flex. */
  #sidebar {
    min-width: 130px;
  }

  #aside {
    min-width: 120px;
  }

  #content {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
  }
}

#sidebar {
  --menu-icon-pad-inline-start: 0;
  --menu-icon-pad-inline-end: 7px;
}

/* Content band: span the three-column region with a light surface */
.grid-modern .row-fluid {
  background: var(--secondary-color);
  border-radius: 6px;
  margin-block: 12px; /* small gap above/below band */
  padding-block: 8px; /* breathing room inside band */
}

/* 8) Header basics */
.header {
  margin-bottom: 1rem;
}

.header .brand img {
  display: block;
  height: auto;
  max-width: 100%;
}

/* 9) Pager */
.pager {
  align-items: var(--pager-align, stretch);
  display: flex;
  flex-wrap: var(--pager-flex-wrap, nowrap);
  gap: var(--pager-gap-y, 8px) var(--pager-gap-x, 12px);
  justify-content: var(--pager-justify, space-between);
  list-style: none;
  margin: var(--pager-margin, 1rem 0 2rem);
  max-width: 100%;
  padding: 0;
  width: 100%;
}

.pager > li {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
}

.pager > li > a {
  align-items: center;
  background-color: var(--pager-background, var(--surface-color));
  border: 1px solid var(--pager-border-color, var(--border-color));
  border-radius: var(--pager-border-radius, var(--radius));
  box-shadow: var(--pager-link-shadow, none);
  color: var(--pager-text-color, var(--link-color));
  display: inline-flex;
  text-decoration: none;
  font-size: var(--pager-font-size, inherit);
  font-weight: var(--pager-font-weight, 500);
  gap: calc(var(--pager-gap-x, 12px) * 0.5);
  justify-content: space-between;
  min-height: calc(var(--pager-icon-size, 1.25rem) + (var(--pager-padding-block, 0.6rem) * 2));
  overflow: hidden;
  padding: var(--pager-padding-block, 0.6rem) var(--pager-padding-inline, 0.95rem);
  text-overflow: var(--pager-label-truncate, ellipsis);
  transition:
    color 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  white-space: var(--pager-label-wrap, nowrap);
  width: 100%;
}

.pager > li > a:focus,
.pager > li > a:hover {
  border-color: var(--primary-color, var(--link-hover));
  box-shadow: var(--pager-hover-shadow, 0 0 0 2px rgb(0 94 141 / 25%));
  color: var(--primary-color, var(--link-hover));
  outline: none;
}

.pager > li > a:focus-visible {
  outline: none;
}

.pager > li > a:active {
  box-shadow: inset 0 0 0 2px rgb(224 22 43 / 15%);
}

.pager .previous > a {
  justify-content: flex-start;
}

.pager .next {
  margin-left: auto;
}

.pager .next > a {
  justify-content: flex-start;
  text-align: left;
}

.pager .pager-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: var(--pager-label-truncate, ellipsis);
  text-align: left;
  white-space: var(--pager-label-wrap, nowrap);
}

.pager > li > a svg,
.pager > li > a img {
  flex: 0 0 auto;
  height: var(--pager-icon-size, 12px);
  width: var(--pager-icon-size, 12px);
}

.pager > li > a svg {
  fill: currentcolor;
}

@media (width <= 599px) {
  .pager {
    flex-wrap: var(--pager-flex-wrap-mobile, wrap);
  }

  .pager > li {
    flex-basis: var(--pager-mobile-item-width, 100%);
  }
}

/* Ensure pager icons reserve space and avoid layout shifts */
.pager img {
  height: var(--pager-icon-size, 12px);
  width: var(--pager-icon-size, 12px);
}

/* 9b) Exercise form CLS guard (gated conversion) */
.exercise-form__last-attempt {
  min-height: 1.5rem;
}

/* 10) Breadcrumb */
.breadcrumb {
  align-items: center;
  color: var(--color-muted);
  display: flex;
  gap: 8px;
  list-style: none;
  margin: 1rem 0 1.42rem;
  padding: 0;
}

/* 10b) Icon utilities for inline SVG */
.icon {
  display: inline-block;
  height: 1em;
  line-height: 1;
  vertical-align: -0.125em;
  width: 1em;
}

/* When nested SVG used inside an icon wrapper */
.icon > svg {
  height: 100%;
  width: 100%;
}

.icon-lg {
  height: 1.5rem;
  width: auto;
}

.icon-lt {
  opacity: 0.85;
}

.icon-shift-up-1 {
  transform: translateY(-1px);
}

.icon-shift-up-2 {
  transform: translateY(-2px);
}

.icon-shift-up-3 {
  transform: translateY(-3px);
}

.breadcrumb > li {
  display: inline;
}

.breadcrumb.breadcrumb-truncate {
  flex-wrap: nowrap;
  min-width: 0;
  overflow: hidden;
}

.breadcrumb.breadcrumb-truncate > li {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.breadcrumb.breadcrumb-truncate > li.breadcrumb-segment-truncate {
  flex: 0 1 clamp(8rem, 23vw, 15rem);
  max-width: clamp(8rem, 23vw, 15rem);
  overflow: hidden;
}

.breadcrumb.breadcrumb-truncate > li.breadcrumb-segment-current {
  flex: 0 1 clamp(9rem, 28vw, 20rem);
  max-width: clamp(9rem, 28vw, 20rem);
  overflow: hidden;
}

.breadcrumb.breadcrumb-truncate > li > .pathway {
  display: inline-flex;
  max-width: 100%;
  min-width: 0;
}

.breadcrumb.breadcrumb-truncate > li > .divider {
  flex: 0 0 auto;
  margin-inline: 0.35rem 0;
}

.breadcrumb.breadcrumb-truncate > li.breadcrumb-segment-truncate [itemprop="name"],
.breadcrumb.breadcrumb-truncate > li.breadcrumb-segment-current [itemprop="name"] {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

@media (width <= 767px) {
  .breadcrumb.breadcrumb-truncate > li.breadcrumb-segment-truncate {
    max-width: clamp(6.5rem, 34vw, 9.5rem);
  }

  .breadcrumb.breadcrumb-truncate > li.breadcrumb-segment-current {
    max-width: clamp(7rem, 40vw, 11rem);
  }

  .breadcrumb-wrap {
    display: none;
  }
}

/* 11) Mobile navigation (works with template592f.js) */

.mobile-nav-enabled #sidebar,
#sidebar {
  /* Reduce rendering cost and isolate layout; sidebar is offscreen on mobile */
  contain: layout paint;
}

.mobile-menu-toggle {
  background: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  height: 40px;
  left: auto;
  position: fixed;
  right: 12px;
  top: 12px;
  width: 40px;
  z-index: 1200;

  /* place on the right */
}

/* Ensure toggle is visible on small viewports */
@media (width <= 767px) {
  .mobile-menu-toggle {
    display: block;
  }
}

.mobile-menu-toggle::before {
  color: var(--white);
  content: "\2261";
  display: block;
  font-size: 22px;
  line-height: 40px;
  text-align: center;

  /* primary on button, white icon */
}

.mobile-menu-toggle.open::before {
  content: "\00D7";
}

/* Interaction states */
.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus {
  box-shadow: var(--focus-ring-shadow);
  outline: none;
}

.mobile-nav-overlay {
  background: transparent; /* keep overlay for click-to-close, but no dimming */
  display: none;
  inset: 0;
  position: fixed;
  z-index: 1100;
}

.mobile-nav-overlay.active {
  display: block;
}

body.mobile-nav-enabled #sidebar {
  background: transparent;
  height: 100vh;
  left: -260px;
  overflow: auto;
  position: fixed;
  top: 0;
  transition: left 0.2s ease;
  width: 260px;
  z-index: 1201;
}

body.mobile-nav-enabled #sidebar.mobile-nav-open {
  left: 0;
}

@media (width >= 768px) {
  .mobile-menu-toggle,
  .mobile-nav-overlay {
    display: none !important;
  }

  body.mobile-nav-enabled #sidebar {
    height: auto;
    left: 0;
    position: static;
    width: auto;
  }
}

/* 7) Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* Tablesty1 style  */
.tablesty1 {
  border-collapse: collapse !important;
  box-sizing: border-box;
  line-height: 1.3em !important;
  margin: 1.5em 0 2em !important;
  width: 100% !important;
}

.tablesty1 td,
.tablesty1 th {
  border: 1px solid var(--border-color) !important;
  padding: 7px 7px 7px 0.5em !important;
}

.hie21 {
  height: 1.3125rem;
}

.tablesty1 tr:nth-child(even) {
  background-color: var(--surface-warm) !important;
}

.tablesty1 tr:hover {
  background-color: rgb(255 214 98 / 50%) !important;
  color: var(--color-strong) !important;
}

.tablesty1 th {
  background-color: var(--primary-color) !important;
  color: white !important;
  padding-bottom: 12px !important;
  padding-top: 12px !important;
  text-align: center !important;
}

.tabstytit1 {
  background-color: var(--primary-color) !important;
  box-sizing: border-box;
  color: white !important;
  font-weight: bold !important;
  line-height: 1.9em;
  padding-bottom: 12px !important;
  padding-top: 12px !important;
  text-align: center !important;
}

.primary-color {
  color: var(--primary-color);
}

/* examplebox style */
.examplebox {
  margin: 2em 0 !important;
  padding: 0 10px !important;
}

.xborder2 {
  border: 1px solid var(--primary-color) !important;
}

.padx-t0r5b0l15 {
  padding: 0 5px 0 15px;
}

h4.box-head4 {
  background: var(--secondary-color);
  color: var(--primary-color);
  display: table;
  margin: -10px 0 5px;
  padding: 0 20px;
}

.uline {
  text-decoration: underline;
}

.nodisplay,
.hidden {
  display: none;
}

.trans {
  color: transparent;
}

.tm01 {
  display: block;
  margin-top: 1rem !important;
}

.tm02 {
  display: block;
  margin-top: 2rem !important;
}

.blkquot {
  /*  background-color: var(--blkquot-background);
  border: 1px solid var(--footer-background);
  border-radius: var(--radius); */
  color: var(--text-color);
  font-style: italic;
  margin: 1.4rem;
  padding: 5px;
}

.exinstruct {
  background: linear-gradient(to bottom left, #d4d4d4 5%, #f5f5f5 35%);
  border: 1px solid var(--background-color, #798ea4);
  border-radius: var(--radius);
  display: block;
  margin-bottom: 1rem;
  padding: 1rem;
  width: 100%;
}

.lessinstruct {
  background: linear-gradient(to bottom left, #dcf0ff 5%, #f5f5f5 35%);
  border: 1px solid var(--tertiary-color, #002786);
  border-radius: var(--radius);
  display: block;
  margin-bottom: 1rem;
  padding: 1rem;
  width: 100%;
}

.blockdiv {
  display: block;
  margin-bottom: 1rem;
  padding: 0 7%;
}

.blockdivless {
  display: block;
  margin-bottom: 1rem;
  padding: 0 1rem;
}

.blockwrap {
  display: block;
  font-weight: 600;
  line-height: 2.15em;
  margin: 0 auto;
  overflow-wrap: normal;
  text-align: center;
  white-space: pre-wrap;
  word-break: normal;
}

.blockwrapless {
  font-weight: 600;
  line-height: 2em;
  margin: 0 auto;
  overflow-wrap: normal;
  text-align: center;
  white-space: pre-wrap;
  word-break: normal;
}

.blockwrap-txt {
  display: inline-block;
  font-weight: 600;
  line-height: 1.45em;
  margin: 0 auto;
  overflow-wrap: normal;
  text-align: left;
  white-space: pre-wrap;
  word-break: normal;
}

.olform {
  margin: 0;
  line-height: 1.25rem;
  padding: 5px inherit;
}

.blockwrap-ol {
  display: block;
  font-weight: 600;
  line-height: 1.4em;
  margin: 0 auto;
  overflow-wrap: normal;
  white-space: normal;
  word-break: normal;
}

.undies {
  font-weight: 600;
  text-decoration: underline;
}

.undies-lt {
  font-weight: 400;
  text-decoration: underline;
}

/* stylelint-disable-next-line selector-not-notation */
main#content ul:not(.breadcrumb):not(.pager):not(.pagenav) > li::before {
  content: "\2605"; /* ★ */
  color: #e0162b;
  display: inline-block;
  line-height: 2rem;
  width: 1.2em;
  margin-left: -1.2em;
}

/* optional utility class */
main#content .star-solid::before {
  content: "\2605";
  color: #e0162b;
}

.hr1x1 {
  list-style: none;
  display: block;
  margin: 2rem 0;
}

.fs1-25 {
  margin: 1rem 0;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 500;
}

.bm-5 {
  display: block;
  margin-bottom: 1rem;

}
