/* Top bar trigger */
.top-bar .mec-a11y-topbar-btn {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.1rem 0.45rem;
  line-height: 1;
  font-size: 1rem;
}

.top-bar .mec-a11y-topbar-btn:hover,
.top-bar .mec-a11y-topbar-btn:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 2px rgba(142, 192, 79, 0.35);
}

/* Drawer */
.mec-a11y-backdrop {
  position: fixed;
  inset: 0;
  /* Above inner-page top-bar (1200), nav (1190), and footer (1200) */
  z-index: 1340;
  background: rgba(0, 30, 28, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.mec-a11y-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1350;
  width: min(100%, 320px);
  height: 100%;
  max-height: 100dvh;
  background: rgba(255, 255, 255, 0.97);
  color: var(--primary, #003e38);
  box-shadow: -4px 0 24px rgba(0, 62, 56, 0.18);
  transform: translateX(100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  outline: none;
}

html[dir="rtl"] .mec-a11y-panel {
  right: auto;
  left: 0;
  box-shadow: 4px 0 24px rgba(0, 62, 56, 0.18);
  transform: translateX(-100%);
}

.mec-a11y-panel.is-open {
  transform: translateX(0);
}

body.mec-a11y-panel-open {
  overflow: hidden;
}

.mec-a11y-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(0, 62, 56, 0.12);
  background: linear-gradient(180deg, rgba(0, 89, 82, 0.08), transparent);
}

.mec-a11y-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary, #003e38);
}

.mec-a11y-panel__close {
  border: none;
  background: transparent;
  color: var(--primary, #003e38);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.35rem;
  border-radius: 6px;
}

.mec-a11y-panel__close:hover,
.mec-a11y-panel__close:focus-visible {
  background: rgba(0, 62, 56, 0.08);
}

.mec-a11y-panel__body {
  padding: 1rem 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.mec-a11y-panel__lede {
  font-size: 0.85rem;
  color: rgba(0, 62, 56, 0.75);
  margin-bottom: 1rem;
}

.mec-a11y-group {
  margin-bottom: 1rem;
}

.mec-a11y-group__label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(0, 62, 56, 0.7);
  margin-bottom: 0.45rem;
}

.mec-a11y-segmented {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.mec-a11y-segmented__btn {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(0, 62, 56, 0.2);
  background: #fff;
  color: var(--primary, #003e38);
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 500;
}

.mec-a11y-segmented__btn.is-active {
  background: var(--primary-2, #005952);
  border-color: var(--primary-2, #005952);
  color: #fff;
}

.mec-a11y-segmented__btn:focus-visible {
  outline: 2px solid #8ec04f;
  outline-offset: 2px;
}

.mec-a11y-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  margin: 0;
  user-select: none;
}

.mec-a11y-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.mec-a11y-toggle__ui {
  flex-shrink: 0;
  width: 2.5rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(0, 62, 56, 0.15);
  position: relative;
  transition: background 0.2s ease;
}

.mec-a11y-toggle__ui::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

html[dir="rtl"] .mec-a11y-toggle__ui::after {
  left: auto;
  right: 2px;
}

.mec-a11y-toggle input:checked + .mec-a11y-toggle__ui {
  background: var(--primary-2, #005952);
}

.mec-a11y-toggle input:checked + .mec-a11y-toggle__ui::after {
  transform: translateX(1.15rem);
}

html[dir="rtl"] .mec-a11y-toggle input:checked + .mec-a11y-toggle__ui::after {
  transform: translateX(-1.15rem);
}

.mec-a11y-toggle__text {
  font-size: 0.9rem;
  color: var(--primary, #003e38);
}

.mec-a11y-toggle input:focus-visible + .mec-a11y-toggle__ui {
  box-shadow: 0 0 0 2px #8ec04f;
}

/*
 * Inner pages apply large heading/body typography to all h2/p/label.
 * Keep the drawer identical to the home page.
 */
body.inner-page .mec-a11y-panel h2.mec-a11y-panel__title {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0;
  color: var(--primary, #003e38);
  letter-spacing: normal;
}

body.inner-page .mec-a11y-panel h3.mec-a11y-group__label {
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.45rem;
  color: rgba(0, 62, 56, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.inner-page .mec-a11y-panel p.mec-a11y-panel__lede {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  color: rgba(0, 62, 56, 0.75);
}

body.inner-page .mec-a11y-panel .mec-a11y-toggle__text {
  font-size: 0.9rem;
  color: var(--primary, #003e38);
}

body.inner-page .mec-a11y-panel .mec-a11y-segmented__btn {
  font-size: 0.82rem;
  font-weight: 500;
}

body.inner-page .mec-a11y-panel .btn-outline-secondary {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

/* ——— User preference classes (site-wide, theme-safe) ——— */
html.mec-a11y-text-lg {
  font-size: 112.5%;
}

html.mec-a11y-text-xl {
  font-size: 125%;
}

html.mec-a11y-readable-spacing body {
  line-height: 1.75;
}

html.mec-a11y-readable-spacing p,
html.mec-a11y-readable-spacing li {
  line-height: 1.85;
}

html.mec-a11y-underline-links a:not(.btn):not(.nav-link):not(.dropdown-item) {
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
}

html.mec-a11y-focus-strong :focus-visible {
  outline: 3px solid #8ec04f !important;
  outline-offset: 3px !important;
}

html.mec-a11y-reduce-motion *,
html.mec-a11y-reduce-motion *::before,
html.mec-a11y-reduce-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  scroll-behavior: auto !important;
}

/* High contrast: dark text on light surfaces (keeps green header/footer chrome) */
html.mec-a11y-contrast {
  --muted: #111111;
  --accent: #111111;
  --light-bg: #ebebeb;
  --inner-page-bg: #dedede;
}

html.mec-a11y-contrast body {
  color: #111111;
  background-color: var(--inner-page-bg);
}

html.mec-a11y-contrast body.inner-page main {
  color: #111111;
}

html.mec-a11y-contrast main .content-box,
html.mec-a11y-contrast main .modern-card,
html.mec-a11y-contrast main .shadow.bg-white,
html.mec-a11y-contrast main .accordion-body,
html.mec-a11y-contrast main .vision-mission-card {
  color: #111111;
  background-color: #ffffff;
  border-color: #333333;
}

html.mec-a11y-contrast main .content-box {
  box-shadow: 0 0 0 2px #111111;
}

html.mec-a11y-contrast body.inner-page main p,
html.mec-a11y-contrast body.inner-page main li,
html.mec-a11y-contrast body.inner-page main dd,
html.mec-a11y-contrast body.inner-page main dt,
html.mec-a11y-contrast body.inner-page main label,
html.mec-a11y-contrast body.inner-page main .form-label,
html.mec-a11y-contrast main .sec-padding-3 .content-box p,
html.mec-a11y-contrast main .sec-padding-3 .content-box ul,
html.mec-a11y-contrast main .sec-padding-3 .content-box .modern-list li,
html.mec-a11y-contrast main .rti-page,
html.mec-a11y-contrast main .rti-page__intro,
html.mec-a11y-contrast main .rti-page__text,
html.mec-a11y-contrast main .rti-page .modern-list > li,
html.mec-a11y-contrast main .procurement-page__intro,
html.mec-a11y-contrast main .procurement-item__summary,
html.mec-a11y-contrast main .glossary-list dd,
html.mec-a11y-contrast main .glossary-list dt,
html.mec-a11y-contrast main .contact-office-card__text,
html.mec-a11y-contrast main .message-page-intro,
html.mec-a11y-contrast main .overview-functions__lede {
  color: #111111 !important;
}

html.mec-a11y-contrast body.inner-page main h1,
html.mec-a11y-contrast body.inner-page main h2,
html.mec-a11y-contrast body.inner-page main h3,
html.mec-a11y-contrast body.inner-page main h4,
html.mec-a11y-contrast main .rti-page .rti-section-title,
html.mec-a11y-contrast main .glossary-section-heading {
  color: #002a26 !important;
}

html.mec-a11y-contrast main .text-muted,
html.mec-a11y-contrast main .lead,
html.mec-a11y-contrast main .muted {
  color: #1a1a1a !important;
  opacity: 1 !important;
}

html.mec-a11y-contrast main a:not(.btn):not(.nav-link):not(.dropdown-item):not(.carousel-control-prev):not(.carousel-control-next) {
  color: #003e38;
  font-weight: 600;
  text-decoration-thickness: 2px;
}

/* Drawer UI unchanged when high contrast is on */
html.mec-a11y-contrast .mec-a11y-panel {
  background: rgba(255, 255, 255, 0.97);
  color: var(--primary, #003e38);
  box-shadow: -4px 0 24px rgba(0, 62, 56, 0.18);
}

html.mec-a11y-contrast .mec-a11y-panel .mec-a11y-panel__title,
html.mec-a11y-contrast .mec-a11y-panel .mec-a11y-toggle__text,
html.mec-a11y-contrast .mec-a11y-panel .mec-a11y-group__label {
  color: var(--primary, #003e38) !important;
}

html.mec-a11y-contrast .mec-a11y-panel .mec-a11y-panel__lede {
  color: rgba(0, 62, 56, 0.75) !important;
}

html.mec-a11y-contrast .mec-a11y-panel .mec-a11y-segmented__btn {
  background: #fff;
  color: var(--primary, #003e38);
  border: 1px solid rgba(0, 62, 56, 0.2);
}

html.mec-a11y-contrast .mec-a11y-panel .mec-a11y-segmented__btn.is-active {
  background: var(--primary-2, #005952);
  color: #fff;
}

html.mec-a11y-contrast .mec-a11y-panel .btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  border-width: 1px;
  background: transparent;
}

html.mec-a11y-contrast .rti-page .rti-directory-table {
  --bs-table-color: #111111;
  --bs-table-bg: #ffffff;
  --bs-table-border-color: #333333;
}

html.mec-a11y-contrast .rti-page .rti-directory-table thead th {
  background: #003e38 !important;
  color: #ffffff !important;
  border-color: #111111 !important;
}

html.mec-a11y-contrast .rti-page .rti-directory-table tbody td {
  color: #111111 !important;
  border-color: #333333 !important;
}

html.mec-a11y-contrast .accordion-button:not(.collapsed),
html.mec-a11y-contrast .accordion-button {
  color: #111111 !important;
  background-color: #f5f5f5 !important;
}

html.mec-a11y-contrast #FaqAccordion1 .accordion-body {
  color: #111111 !important;
}

html.mec-a11y-contrast main .form-control,
html.mec-a11y-contrast main .form-select {
  color: #111111;
  background-color: #ffffff;
  border: 2px solid #333333;
}

html.mec-a11y-contrast main .btn-outline-primary {
  color: #003e38;
  border-color: #003e38;
  border-width: 2px;
}

/* Preserve legible hero caption on home carousel */
html.mec-a11y-contrast #homeCarousel .carousel-caption,
html.mec-a11y-contrast #homeCarousel .carousel-caption h2,
html.mec-a11y-contrast #homeCarousel .carousel-caption p {
  color: #ffffff;
}

html.mec-a11y-reduce-motion .mec-a11y-panel {
  transition: none;
}

@media (max-width: 575px) {
  .mec-a11y-panel {
    width: min(100%, 100%);
  }
}
