/* ==========================================================================
   GOVERNMENT WEB PORTAL - ACCESSIBILITY STYLESHEET (accessibility.css)
   WCAG 2.1 AAA Compliant Rules, High Contrast, Zoom, and Screen Reader helpers
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Dynamic Text Sizing Engines (Controlled by js/accessibility.js)
   -------------------------------------------------------------------------- */
html.font-size-small {
  font-size: 87.5% !important; /* 14px */
}

html.font-size-normal {
  font-size: 100% !important;  /* 16px base */
}

html.font-size-large {
  font-size: 115% !important;  /* 18.4px */
}

html.font-size-xlarge {
  font-size: 130% !important;  /* 20.8px */
}

/* --------------------------------------------------------------------------
   2. Keyboard Focus Indicators (WCAG 2.4.7 Level AA)
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid #ff6d00 !important;
  outline-offset: 3px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #ff6d00 !important;
  outline-offset: 2px !important;
}

/* --------------------------------------------------------------------------
   3. Screen Reader Utilities
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.sr-only-focusable:active,
.sr-only-focusable:focus {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
}

/* --------------------------------------------------------------------------
   4. High-Contrast Theme (Black & Yellow / WCAG 7:1+ Contrast)
   -------------------------------------------------------------------------- */
body.high-contrast {
  background-color: #000000 !important;
  color: #ffff00 !important;
}

body.high-contrast .top-gov-bar {
  background-color: #121212 !important;
  color: #ffffff !important;
  border-bottom: 2px solid #ffff00 !important;
}

body.high-contrast .main-header {
  background-color: #000000 !important;
  border-bottom: 3px solid #ffff00 !important;
}

body.high-contrast .board-title-hi,
body.high-contrast .board-title-en,
body.high-contrast .section-title,
body.high-contrast .service-card h3,
body.high-contrast .modal-title,
body.high-contrast .leader-details h4,
body.high-contrast .stat-info h3,
body.high-contrast .initiative-item strong {
  color: #ffff00 !important;
}

body.high-contrast .ministry-title,
body.high-contrast .section-desc,
body.high-contrast .service-card p,
body.high-contrast .leader-quote,
body.high-contrast .stat-info p,
body.high-contrast .initiative-item small,
body.high-contrast .form-note,
body.high-contrast .footer-col p {
  color: #ffffff !important;
}

body.high-contrast .main-nav {
  background-color: #1f1f1f !important;
  border-bottom: 2px solid #ffff00 !important;
}

body.high-contrast .nav-link {
  color: #ffff00 !important;
}

body.high-contrast .nav-link:hover,
body.high-contrast .nav-link.active {
  background-color: #333333 !important;
  border-bottom-color: #ffff00 !important;
}

body.high-contrast .dropdown-menu {
  background-color: #000000 !important;
  border: 2px solid #ffff00 !important;
}

body.high-contrast .dropdown-item a {
  color: #ffff00 !important;
  border-bottom: 1px solid #333333 !important;
}

body.high-contrast .dropdown-item a:hover {
  background-color: #ffff00 !important;
  color: #000000 !important;
}

body.high-contrast .news-ticker-bar {
  background-color: #121212 !important;
  border-bottom: 2px solid #ffff00 !important;
}

body.high-contrast .ticker-item a {
  color: #ffff00 !important;
}

body.high-contrast .hero-section {
  background: #000000 !important;
  border-bottom: 3px solid #ffff00 !important;
}

body.high-contrast .hero-carousel-card,
body.high-contrast .service-card,
body.high-contrast .tabbed-container,
body.high-contrast .leader-card,
body.high-contrast .initiative-item,
body.high-contrast .mission-stats-bar,
body.high-contrast .modal-card,
body.high-contrast .helpline-box {
  background-color: #121212 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
}

body.high-contrast .btn-primary {
  background: #ffff00 !important;
  color: #000000 !important;
  font-weight: 900 !important;
  border: 2px solid #ffff00 !important;
}

body.high-contrast .btn-primary:hover {
  background: #000000 !important;
  color: #ffff00 !important;
}

body.high-contrast .btn-outline-white {
  border-color: #ffff00 !important;
  color: #ffff00 !important;
}

body.high-contrast .btn-outline-white:hover {
  background: #ffff00 !important;
  color: #000000 !important;
}

body.high-contrast .tabs-nav {
  background: #000000 !important;
  border-bottom: 2px solid #ffff00 !important;
}

body.high-contrast .tab-btn {
  color: #ffffff !important;
}

body.high-contrast .tab-btn.active {
  background: #1f1f1f !important;
  color: #ffff00 !important;
  border-bottom-color: #ffff00 !important;
}

body.high-contrast .gov-table th {
  background: #1f1f1f !important;
  color: #ffff00 !important;
  border: 1px solid #ffff00 !important;
}

body.high-contrast .gov-table td {
  border: 1px solid #333333 !important;
  color: #ffffff !important;
}

body.high-contrast .gov-table tr:hover td {
  background: #222222 !important;
}

body.high-contrast .gov-footer {
  background: #000000 !important;
  border-top: 3px solid #ffff00 !important;
}

body.high-contrast .footer-bottom {
  background: #121212 !important;
  border-top: 1px solid #333333 !important;
}

body.high-contrast .form-input,
body.high-contrast .form-select,
body.high-contrast .form-textarea,
body.high-contrast .search-input {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
}

/* --------------------------------------------------------------------------
   5. Reduced Motion (For Cognitive & Vestibular Accessibility)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .ticker-list {
    animation: none !important;
  }
}

/* --------------------------------------------------------------------------
   6. Print Stylesheet for Official Government Circulars
   -------------------------------------------------------------------------- */
@media print {
  .top-gov-bar,
  .main-nav,
  .news-ticker-bar,
  .hero-cta-group,
  .carousel-controls,
  .table-filter-bar,
  .modal-backdrop,
  .skip-to-content,
  .header-actions-right {
    display: none !important;
  }
  
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 12pt;
  }
  
  .main-header {
    border-bottom: 2px solid #000000;
  }
  
  .gov-footer {
    background: transparent !important;
    color: #000000 !important;
    border-top: 1px solid #000000;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.75rem;
  }
}
