/* ── Reset ─────────────────────────────────────────────────────────── */
/* Use the bundled font directly; the UX4G stylesheet also references optional
   WOFF/WOFF2 variants that are not distributed with this application. */
@font-face {
  font-family: "Noto Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../UX4G/fonts/NotoSans-Regular.b72e420edb95.ttf") format("truetype");
}

html, body {
  margin: 0;
  padding: 0;
}

/* ── Full-height flex layout ─────────────────────────────────────── */
html {
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

#main-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  font-family: var(--bs-body-font-family);
  transition: opacity 150ms ease-in-out;
}

#main-content[aria-busy="true"] {
  opacity: 0.55;
}

/* Normalize rich-text content to the UX4G Noto Sans type system. */
#main-content :where(
  div, span, font, h1, h2, h3, h4, h5, h6, p, a, li,
  dt, dd, th, td, label, strong, em, small, blockquote,
  button, input, select, textarea
) {
  font-family: var(--bs-body-font-family) !important;
}

/* ── UX4G government accessibility bar ───────────────────────────── */
#gov-topbar {
  min-height: 42px;
  background-color: #17151b;
  color: #fff;
  font-size: 0.875rem;
}

.gov-topbar-inner {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gov-india-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 42px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.gov-india-link:hover,
.gov-india-link:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.gov-india-link img {
  display: block;
  width: 32px;
  height: 21px;
  object-fit: cover;
  flex: 0 0 auto;
}

.gov-accessibility-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
}

.gov-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.gov-accessibility-control {
  min-width: 2.25rem;
  min-height: 2rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--bs-border-radius-sm);
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  font: inherit;
  line-height: 1.25;
  cursor: pointer;
}

.gov-accessibility-control:hover,
.gov-accessibility-control:focus-visible {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
  background-color: rgba(255, 255, 255, 0.1);
}

.gov-accessibility-control:focus-visible,
.gov-india-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ── UX4G language switcher ─────────────────────────────────────── */
.language-switcher {
  padding-left: 0.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.language-switcher-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: auto;
  color: #fff;
}

.language-switcher-toggle::after {
  margin-left: 0.125rem;
}

.language-switcher-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.language-switcher-menu {
  z-index: 1030;
  width: 18rem;
  max-width: calc(100vw - 1.5rem);
  margin-top: 0.5rem !important;
  padding: 0;
  overflow: hidden;
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
  box-shadow: var(--bs-box-shadow-lg, 0 1rem 3rem rgba(0, 0, 0, 0.175));
}

.language-switcher-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--bs-border-color);
}

.language-switcher-header strong {
  display: block;
  font-size: 0.9375rem;
}

.language-switcher-options {
  margin: 0;
}

.language-switcher-option + .language-switcher-option {
  border-top: 1px solid var(--bs-border-color);
}

.language-switcher-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 0.75rem 1rem;
  border: 0;
  background-color: transparent;
  color: var(--bs-body-color);
  text-align: left;
  cursor: pointer;
}

.language-switcher-option:hover,
.language-switcher-option:focus-visible {
  background-color: var(--bs-tertiary-bg, #f8f9fa);
}

.language-switcher-option:focus-visible {
  position: relative;
  outline: 2px solid #613af5;
  outline-offset: -2px;
}

.language-switcher-option.active,
.language-switcher-option.active .language-name-local {
  color: #4d22e8;
}

.language-name-local {
  font-weight: 600;
}

.language-selected-icon {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: #4d22e8;
}

@media (max-width: 575.98px) {
  #gov-topbar .container-fluid {
    padding-inline: 0.75rem;
  }

  .gov-topbar-inner,
  .gov-india-link {
    min-height: 40px;
  }

  .gov-india-link {
    gap: 0.375rem;
    font-size: 0.8125rem;
  }

  .gov-india-link img {
    width: 28px;
    height: auto;
  }

  .gov-accessibility-control {
    min-width: 2rem;
    padding-inline: 0.25rem;
  }

  .gov-topbar-actions {
    gap: 0.25rem;
  }

  .language-switcher {
    padding-left: 0.25rem;
  }
}

@media (max-width: 479.98px) {
  .gov-india-link > span:not(.visually-hidden) {
    display: none;
  }
}

/* ── Footer ──────────────────────────────────────────────────────── */
#site-footer {
  flex-shrink: 0;
}

#site-footer p {
  line-height: 1.5;
}

/* ── Announcement ticker (accessible replacement for <marquee>) ─── */
.ticker-wrap {
  background-color: #fff3cd;
  border-bottom: 1px solid #ffc107;
  overflow: hidden;
  padding-block: 0.3125rem;
  font-size: 0.875rem;
}

.ticker-content {
  display: inline-block;
  min-width: max-content;
  margin: 0;
  padding-left: 100vw;
  white-space: nowrap;
  color: #664d03;
  animation: ticker-scroll 25s linear infinite;
  will-change: transform;
}

.ticker-wrap:hover .ticker-content,
.ticker-wrap:focus-within .ticker-content {
  animation-play-state: paused;
}

.ticker-wrap:focus-visible {
  outline: 2px solid #664d03;
  outline-offset: -2px;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}

/* ── Brand typography ───────────────────────────────────────────── */
.brand-government {
  font-size: 0.7rem;
}

.brand-ministry {
  font-size: 0.75rem;
}

.brand-system {
  color: #12477f;
  font-size: 0.85rem;
}

.external-link-icon {
  width: 0.75rem;
  height: 0.75rem;
  flex: 0 0 auto;
}

/* ── Navigation links bar ────────────────────────────────────────── */
.nav-links-bar {
  background-color: #12477f;
  --bs-navbar-color: rgba(255, 255, 255, 0.9);
  --bs-navbar-hover-color: #fff;
  --bs-navbar-active-color: #fff;
}

.nav-links-bar .navbar-nav {
  gap: 0.25rem;
}

.nav-links-bar .nav-link {
  color: #fff;
  border-radius: var(--bs-border-radius-sm);
  padding-inline: 1rem;
  transition: color 150ms ease-in-out, background-color 150ms ease-in-out;
}

.nav-links-bar .nav-link:hover,
.nav-links-bar .nav-link:focus-visible {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.14);
}

.nav-links-bar .nav-link.active,
.nav-links-bar .nav-link[aria-current="page"] {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.2);
}

.nav-links-bar .nav-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Keep a consistent UX4G spacing rhythm before the footer. */
#main-content > .scroll {
  margin: 1.5rem 0 2rem;
}

/* ── Scrolling program cards (used in home.html widget) ──────────── */
.carousel-item img {
  height: 500px;
  object-fit: cover;
}

/* ── Nav list reset ──────────────────────────────────────────────── */
.navbar-nav li {
  list-style-type: none;
}

@media (prefers-reduced-motion: reduce) {
  #main-content {
    transition: none;
  }

  .ticker-content {
    display: block;
    min-width: 0;
    padding-inline: 1rem;
    white-space: normal;
    animation: none;
    will-change: auto;
  }

  .nav-links-bar .nav-link {
    transition: none;
  }
}
