﻿/* DBIM header and accessibility panel.
   All selectors are namespaced (.dbim-*, .a11y-*) so legacy styles are not affected. */

:root {
  /* TODO: replace with the key (darkest) colour of the DBIM group chosen by MEA. */
  --dbim-key: #162f6a;
  --dbim-white: #ffffff;
  --dbim-text: #150202;
  --dbim-border: #c6c6c6;
  --dbim-focus: #0d6efd;
}

input#ContentPlaceHolder1_KeywordSearch1_txtKeyword {
  height: auto;
}

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

/* ---------- Header ---------- */
.dbim-header {
  background: var(--dbim-white);
  color: var(--dbim-text);
  font-family: "Noto Sans", "Noto Sans Devanagari", sans-serif;
  border-bottom: 1px solid #ebeaea;
}

.dbim-header__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px) minmax(0, 1fr);
  align-items: center;
  gap: 16px 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 16px;
}

.dbim-logo {
  display: inline-flex;
  align-items: flex-end;
  gap: 8px;
  text-decoration: none;
  color: #000;
}

.dbim-logo__emblem {
  display: block;
  width: 45px;
  height: auto;
  aspect-ratio: 45 / 71;
  flex: 0 0 auto;
}

.dbim-logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  padding-bottom: 8px;
}

.dbim-logo__line1 {
  font-size: 20px;
  font-weight: 700;
  color: #000;
}

.dbim-logo__line2 {
  font-size: 16px;
  font-weight: 400;
  color: #000;
}

/* Search */
.dbim-search form {
  display: flex;
  margin: 0;
}

.dbim-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  padding: 0 12px;
  font: 400 14px/1.5 "Noto Sans", "Noto Sans Devanagari", sans-serif;
  color: var(--dbim-text);
  background: var(--dbim-white);
  border: 1px solid var(--dbim-key);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  -webkit-appearance: none;
  appearance: none;
}

.dbim-search__input::placeholder {
  color: #606060;
  opacity: 1;
}

.dbim-search__btn {
  flex: 0 0 44px;
  height: 40px;
  box-sizing: border-box;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dbim-key);
  background: var(--dbim-white);
  border: 1px solid var(--dbim-key);
  border-radius: 0 4px 4px 0;
}

.dbim-search__btn:hover {
  background: #ebeaea;
}

/* Utilities */
.dbim-utils {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.dbim-utils__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  justify-content: center;
  padding: 6px;
  box-sizing: border-box;
  color: var(--dbim-key);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font: 500 14px/1.5 "Noto Sans", "Noto Sans Devanagari", sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.dbim-utils__item:hover {
  background: #ebeaea;
}

.dbim-skip__label {
  display: none;
  white-space: nowrap;
}

.dbim-sep {
  width: 1px;
  height: 28px;
  background: var(--dbim-key);
}

.dbim-lang {
  position: relative;
}

.dbim-lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 10020;
  min-width: 150px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--dbim-white);
  border: 1px solid var(--dbim-border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
}

.dbim-lang__menu[hidden] {
  display: none;
}

.dbim-lang__menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  background: none;
  border: 0;
  cursor: pointer;
  font: 400 14px/1.5 "Noto Sans", "Noto Sans Devanagari", sans-serif;
  color: var(--dbim-text);
}

.dbim-lang__menu button:hover {
  background: #ebeaea;
}

.dbim-lang__menu button[aria-current="true"] {
  font-weight: 700;
  color: var(--dbim-key);
}

/* Visible focus on every control */
.dbim-header a:focus-visible,
.dbim-header button:focus-visible,
.dbim-header input:focus-visible,
.a11y-panel a:focus-visible,
.a11y-panel button:focus-visible {
  outline: 2px solid var(--dbim-focus);
  outline-offset: 2px;
}

/* First focusable element on every page; appears only when focused. The visible control is in the utility row. */
.dbim-skip-first {
  position: absolute;
  left: 8px;
  top: -100px;
  z-index: 10040;
  padding: 10px 16px;
  background: var(--dbim-key);
  color: #fff;
  font: 600 14px/1.5 "Noto Sans", sans-serif;
  text-decoration: none;
  border-radius: 0 0 4px 4px;
}

.dbim-skip-first:focus {
  top: 0;
  outline: 2px solid var(--dbim-focus);
  outline-offset: 2px;
}

/* Remove the legacy tricolour strip above the header (not part of the DBIM header) */
#wrapper {
  background: none;
  padding-top: 0;
}

/* Neutralise legacy list/input rules inside the new components */
.a11y-grid::before,
.a11y-grid::after {
  content: none !important;
  display: none !important;
}

.a11y-btn__state:empty {
  display: none;
}

.a11y-grid>li {
  all: unset;
  display: block;
}

.dbim-lang__menu>li {
  all: unset;
  display: block;
}

.dbim-search .dbim-search__input {
  border: 1px solid var(--dbim-key);
  border-right: 0;
  border-radius: 4px 0 0 4px;
  box-shadow: none;
  margin: 0;
  width: auto;
  float: none;
}

.dbim-search .dbim-search__btn {
  margin: 0;
  float: none;
  width: 44px;
}

/* Legacy mobile search icon is replaced by the always-visible search field */
.menuSearchIcon {
  display: none !important;
}

@media (min-width: 1100px) {
  .dbim-skip__label {
    display: inline;
  }
}

@media (max-width: 1023px) {
  .dbim-header__inner {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .dbim-search {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (max-width: 575px) {
  .dbim-header__inner {
    padding: 8px 12px;
    gap: 8px 8px;
  }

  .dbim-logo__emblem {
    width: 36px;
  }

  .dbim-logo__line1 {
    font-size: 16px;
  }

  .dbim-logo__line2 {
    font-size: 12px;
  }

  .dbim-utils {
    gap: 2px;
  }

  .dbim-sep {
    height: 24px;
  }
}

/* ---------- Accessibility panel ---------- */
.a11y-panel {
  position: fixed;
  z-index: 10030;
  top: 72px;
  right: 16px;
  width: 420px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 20px;
  background: var(--dbim-white);
  color: var(--dbim-key);
  border: 1px solid var(--dbim-border);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22);
  font-family: "Noto Sans", "Noto Sans Devanagari", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.a11y-panel[hidden] {
  display: none;
}

.a11y-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.a11y-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #000;
}

.a11y-panel__close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  border-radius: 4px;
  color: var(--dbim-key);
  cursor: pointer;
}

.a11y-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.a11y-btn {
  width: 100%;
  min-height: 96px;
  box-sizing: border-box;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--dbim-white);
  color: var(--dbim-key);
  border: 1px solid var(--dbim-border);
  border-radius: 8px;
  cursor: pointer;
  font: 600 12px/1.3 "Noto Sans", "Noto Sans Devanagari", sans-serif;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: .02em;
}

.a11y-btn:hover {
  border-color: var(--dbim-key);
  background: #f6f7fb;
}

.a11y-btn[aria-pressed="true"] {
  background: #d5e0ff;
  border-color: var(--dbim-key);
  box-shadow: inset 0 0 0 1px var(--dbim-key);
}

.a11y-btn svg {
  flex: 0 0 auto;
}

.a11y-btn__state {
  display: block;
  font-weight: 400;
  text-transform: none;
  font-size: 12px;
  min-height: 1em;
}

.a11y-panel__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--dbim-border);
}

.a11y-panel__foot a,
.a11y-panel__foot button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px;
  background: none;
  border: 0;
  color: var(--dbim-key);
  font: 400 14px/1.5 "Noto Sans", sans-serif;
  text-decoration: underline;
  cursor: pointer;
}

@media (max-width: 479px) {
  .a11y-panel {
    top: auto;
    bottom: 8px;
    right: 8px;
    left: 8px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 16px);
    padding: 16px;
  }

  .a11y-grid {
    grid-template-columns: 1fr;
  }

  .a11y-btn {
    flex-direction: row;
    justify-content: flex-start;
    min-height: 56px;
    padding: 8px 16px;
    text-align: left;
  }
}

/* ---------- Accessibility modes (toggled on <html> by dbim-a11y.js) ---------- */
html.a11y-dark,
html.a11y-dark body,
html.a11y-dark body *:not(img):not(video):not(svg):not(path):not(circle):not(rect) {
  background-color: #000 !important;
  color: #fff !important;
  border-color: #fff !important;
  text-shadow: none !important;
}

html.a11y-dark a,
html.a11y-dark a * {
  color: #ffd600 !important;
}

html.a11y-dark .a11y-btn[aria-pressed="true"] {
  background-color: #222 !important;
  box-shadow: inset 0 0 0 2px #ffd600 !important;
}

html.a11y-dark .dbim-search__input::placeholder {
  color: #ddd !important;
}

html.a11y-dark *:focus-visible {
  outline: 3px solid #ffd600 !important;
}

/* Page-level filters are classes (not inline styles) so legacy scripts cannot clear them. */
html.a11y-invert {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-sat-1 {
  filter: saturate(0.5);
}

html.a11y-sat-2 {
  filter: saturate(2);
}

html.a11y-sat-3 {
  filter: grayscale(1);
}

html.a11y-invert.a11y-sat-1 {
  filter: invert(1) hue-rotate(180deg) saturate(0.5);
}

html.a11y-invert.a11y-sat-2 {
  filter: invert(1) hue-rotate(180deg) saturate(2);
}

html.a11y-invert.a11y-sat-3 {
  filter: invert(1) hue-rotate(180deg) grayscale(1);
}

html.a11y-invert img,
html.a11y-invert video,
html.a11y-invert iframe {
  filter: invert(1) hue-rotate(180deg);
}

html.a11y-links a:not(.a11y-btn) {
  background-color: #ffeb3b !important;
  color: #000 !important;
  text-decoration: underline !important;
  outline: 2px solid #000;
  outline-offset: 1px;
}

html.a11y-noimg img {
  opacity: 0 !important;
}

html.a11y-noimg img.dbim-logo__emblem {
  opacity: 1 !important;
}

html.a11y-noimg *:not(.a11y-panel):not(.a11y-panel *) {
  background-image: none !important;
}

html.a11y-cursor,
html.a11y-cursor * {
  cursor: default !important;
}

@media (prefers-reduced-motion: reduce) {

  .dbim-header *,
  .a11y-panel,
  .a11y-panel * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Hover and focus states stay visible (DBIM 4.5) ----------
   Legacy rules switched link text to the key colour on hover, which is invisible on dark surfaces. */
#nav .menuSubUl li>a:hover,
#nav .menuSubUl li>a:focus,
#nav .menuSubUl li:hover>a {
  background-color: var(--dbim-key) !important;
  color: #fff !important;
  text-decoration: underline;
}

#nav>li>a:focus {
  background-color: #fff !important;
  color: var(--dbim-key) !important;
}

/* Back-to-top button: key colour, with a clear inverted hover/focus state */
#backToTop {
  background: var(--dbim-key);
  border: 1px solid var(--dbim-key);
}

#backToTop:hover,
#backToTop:focus-within {
  background: #fff;
  border: 1px solid var(--dbim-key);
}

#backToTop:hover:before,
#backToTop:focus-within:before {
  color: var(--dbim-key);
}

/* ---------- Main menu: keep dropdowns and flyouts inside the viewport ----------
   The last two top-level items open right-aligned; flyouts of the last three open to the left. */
@media (min-width: 992px) {

  /* Right-aligned boxes cannot be hidden with a negative left margin (legacy technique), so hide with the right margin. */
  #nav>li:nth-last-child(-n+2)>ul {
    left: auto;
    right: 0;
    margin-left: 0;
    margin-right: -9999px;
  }

  #nav>li:nth-last-child(-n+2):hover>ul,
  #nav>li:nth-last-child(-n+2).hover>ul,
  #nav>li:nth-last-child(-n+2).focus>ul,
  #nav>li:nth-last-child(-n+2)>a:focus+ul {
    margin-right: 0;
  }

  #nav>li:nth-last-child(-n+3)>ul ul {
    left: -285px;
  }

  #nav>li:nth-last-child(-n+3)>ul ul li>ul {
    left: -285px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {

  #nav>li:nth-last-child(-n+6)>ul ul,
  #nav>li:nth-last-child(-n+6)>ul ul li>ul {
    left: -285px;
  }
}


/* Mobile slide-in menu: the legacy hover rule turned text the key colour on the key-colour panel. */
#menuPartWrapper a:hover,
#menuPartWrapper a:focus,
#menuPartWrapper li:hover>a {
  color: #fff !important;
  background-color: #214AAB !important;
  text-decoration: underline;
}
/* ---------- Home slider controls: supplied DBIM SVG icons (images/DBIM_*_24d_SVG_#162F6A.svg) ----------
   The icons are key-colour on transparent, so each button has a white disc to stay visible over photographs. */
.indexBanner .contentWidthSlider .sliderControls { width: auto; margin: 0; float: right; }
.sliderControls button.bannerIcon {
  box-sizing: border-box; width: 40px; height: 40px; padding: 6px; margin: 0 0 0 8px; position: static; float: none;
  display: inline-block; line-height: 0; text-align: center; vertical-align: middle; cursor: pointer;
  background: #fff; border: 2px solid #fff; border-radius: 50%; color: var(--dbim-key);
  transition: background-color .2s ease, border-color .2s ease;
}
.sliderControls button.bannerIcon img { display: block; width: 24px; height: 24px; margin: 0; }
.sliderControls button.bannerIcon:hover { background: #d2dfff; border-color: var(--dbim-key); opacity: 1; }
.sliderControls button.bannerIcon:focus-visible { outline: 3px solid #0d6efd; outline-offset: 2px; }
.sliderControls button.bannerIcon.sliderPlay { display: none; }
@media (prefers-reduced-motion: reduce) { .sliderControls button.bannerIcon { transition: none; } }
@media (max-width: 575px) {
  .sliderControlLinks .sliderControlWrap { width: auto; padding-left: 0; float: right; }
  .sliderControls button.bannerIcon { width: 44px; height: 44px; padding: 8px; }
}
