/* Let main fill the available viewport height so the shared footer reaches the bottom on every device. */
html {
  min-height: 100%;
}

body {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
}

main {
  flex: 1 0 auto !important;
}

body > site-footer {
  display: block;
  flex: 0 0 auto;
  margin-top: auto !important;
}
site-toolbar {
  --toolbar-height: 195px;
  --toolbar-padding: 24px;
  --toolbar-logo-width: min(347.875px, calc(100vw - 130px));
  --toolbar-logo-height: 104px;
  display: block;
}

site-toolbar[size="large"] {
  --toolbar-height: 248px;
  --toolbar-logo-width: min(347.875px, calc(100vw - 130px));
  --toolbar-logo-height: 104px;
}

site-toolbar .toolbar-space {
  min-height: var(--toolbar-height);
}

site-toolbar .sticky-toolbar {
  position: fixed;
  z-index: 1000;
  inset: 0 0 auto;
  width: 100%;
  padding: var(--toolbar-padding) 0;
  background: #ffffff;
}

site-toolbar .toolbar-container {
  position: relative;
  width: min(calc(100% - 48px), 1160px);
  min-height: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

site-toolbar .menu-button {
  position: absolute;
  left: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1b1b1b;
  text-decoration: none;
}

site-toolbar .menu-button svg {
  display: block;
  padding: 6px;
  fill: currentColor;
}

/* Keep every primary green action readable on compact phone screens. */
@media (max-width: 900px) {
  .action-links a,
  .service-links a,
  .assessment-button,
  .outline-button,
  .unesco-button,
  .contact-button,
  .submit-area button,
  .insights-link {
    padding-inline: clamp(16px, 5vw, 20px) !important;
    font-size: clamp(16px, 5.2vw, 20px) !important;
    white-space: nowrap !important;
  }
}

site-toolbar .brand-container,
site-toolbar .brand-link,
site-toolbar .brand-link picture {
  display: block;
}

site-toolbar .brand-logo {
  width: var(--toolbar-logo-width);
  height: var(--toolbar-logo-height);
  max-height: var(--toolbar-logo-height);
  display: block;
  margin: 0 auto;
  object-fit: contain;
  transition: max-height 0.5s;
}

site-toolbar .brand-logo[style*="max-height: 64px"] {
  width: auto;
  height: auto;
}

/* A shared tablet alignment line for the menu, language selector, and page content. */
@media (min-width: 768px) and (max-width: 1440px) {
  site-toolbar .toolbar-container {
    width: min(calc(100% - 96px), 1112px);
  }

  site-toolbar .menu-button {
    left: 0;
  }

  site-toolbar .language-selector {
    right: 0;
  }

  main > section {
    padding-inline: 48px !important;
  }

  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
}
/* On tablet screens, keep the footer at the bottom when a page is shorter than the viewport. */
@media (min-width: 768px) and (max-width: 1440px) {
  body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  main {
    flex: 1 0 auto;
  }

  site-footer {
    display: block;
    flex: 0 0 auto;
  }
}
@media (max-width: 767px) {
  site-toolbar {
    --toolbar-height: 112px;
    --toolbar-padding: 16px;
    --toolbar-logo-width: 224px;
    --toolbar-logo-height: 80px;
  }

  site-toolbar[size="large"] {
    --toolbar-height: 142px;
    --toolbar-padding: 24px;
    --toolbar-logo-width: min(209px, calc(100vw - 118px));
    --toolbar-logo-height: 94px;
  }

  site-toolbar[size="large"][mobile-size="compact"] {
    --toolbar-height: 112px;
    --toolbar-padding: 16px;
    --toolbar-logo-width: 224px;
    --toolbar-logo-height: 80px;
  }

  /* Match the desktop logo size before scrolling; the shared script then reduces it to 64px. */
  site-toolbar,
  site-toolbar[size="large"],
  site-toolbar[size="large"][mobile-size="compact"] {
    --toolbar-height: 195px;
    --toolbar-padding: 24px;
    --toolbar-logo-width: min(347.875px, calc(100vw - 130px));
    --toolbar-logo-height: 104px;
  }

  site-toolbar[size="large"] {
    --toolbar-height: 248px;
  }
  /* Mirror desktop's two logo states on phones: large at the top, compact after scrolling. */
  site-toolbar .brand-logo {
    width: min(347.875px, calc(100vw - 130px)) !important;
    height: 104px !important;
    max-height: 104px !important;
    transition: width 0.5s, height 0.5s, max-height 0.5s;
  }

  site-toolbar .brand-logo[style*="max-height: 64px"] {
    width: 194px !important;
    height: 64px !important;
    max-height: 64px !important;
  }
  site-toolbar .toolbar-container {
    width: calc(100% - 32px);
  }

  site-toolbar .menu-button {
    left: 0;
  }

  site-toolbar:not([size="large"]) .menu-button,
  site-toolbar[size="large"][mobile-size="compact"] .menu-button {
    left: 12px;
    width: 49.05px;
  }
}

@media (prefers-reduced-motion: reduce) {
  site-toolbar .brand-logo {
    transition-duration: 0.01ms;
  }
}

/* Arabic reads from right to left, so the header controls mirror their
   positions while the centered brand remains fixed. */
html[lang="ar"] site-toolbar .menu-button {
  left: auto;
  right: 12px;
}

html[lang="ar"] site-toolbar .language-selector {
  right: auto;
  left: 24px;
}

html[lang="ar"] site-toolbar .language-selector__menu {
  right: auto;
  left: 0;
}

html[lang="ar"] site-toolbar .language-selector__option {
  justify-content: flex-end;
  text-align: right;
}

@media (max-width: 767px) {
  html[lang="ar"] site-toolbar .menu-button,
  html[lang="ar"] site-toolbar:not([size="large"]) .menu-button,
  html[lang="ar"] site-toolbar[size="large"][mobile-size="compact"] .menu-button {
    left: auto;
    right: 0;
  }

  html[lang="ar"] site-toolbar .language-selector {
    right: auto;
    left: 0;
  }
}
:root {
  color-scheme: light;
  color-scheme: only light;
  supported-color-schemes: light;
  background-color: #ffffff;
}

html,
body {
  color-scheme: light;
  color-scheme: only light;
  background-color: #ffffff;
}
