/* Icegate Accessibility Toolbar Styles */

/* Toolbar Container */

#icg_accessibility{
  float: left;
  margin-top: -27px;
}
.accessibility-toolbar {
  z-index: 10000;
  font-family: 'OpenSans', Arial, sans-serif;
}

/* Toggle Button */
.accessibility-toggle {
  background: none;
  color: white;
  border: none;
  /* border-radius: 50%; */
  /* width: 60px;
  height: 60px; */
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}

.accessibility-toggle:hover {
  background: #e67817;
  transform: scale(1.1);
}

.accessibility-toggle:focus {
  outline: 3px solid #FFD54F;
  outline-offset: 2px;
}

/* Panel */
.accessibility-panel {
  display: none;
  position: absolute;
  top: 40px;
  right: 0;
  background: white;
  border: 2px solid #e67817;
  border-radius: 8px;
  padding: 20px;
  min-width: 250px;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 10001;
}

.accessibility-panel:hover,
.accessibility-panel.show {
  opacity: 1;
  transform: translateY(0);
}

.accessibility-toolbar:hover .accessibility-panel {
  opacity: 1;
  transform: translateY(0);
}

.accessibility-panel h3 {
  margin: 0 0 15px 0;
  color: #e67817;
  font-size: 18px;
  text-align: center;
}

.accessibility-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.accessibility-header h3 {
  margin: 0;
  color: #2196F3;
  font-size: 18px;
  flex-grow: 1;
  text-align: left;
}

.accessibility-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 3px;
  transition: all 0.3s ease;
  line-height: 1;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.accessibility-close:hover {
  background: #f5f5f5;
  color: #333;
}

.accessibility-close:focus {
  outline: 2px solid #2196F3;
  outline-offset: 2px;
}

.accessibility-group {
  margin-bottom: 20px;
}

.accessibility-group h4 {
  margin: 0 0 10px 0;
  color: #333;
  font-size: 14px;
  font-weight: bold;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
}

.accessibility-group-toggle {
  cursor: pointer;
  user-select: none;
  transition: all 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accessibility-group-toggle:hover {
  color: #2196F3;
  background-color: #f5f5f5;
  padding: 5px;
  border-radius: 3px;
}

.accessibility-group-toggle:focus {
  outline: 2px solid #2196F3;
  outline-offset: 2px;
}

.toggle-icon {
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.3s ease;
  color: #ff9800;
  line-height: 1;
}

/* Remove the old overflow hidden rule since we updated it below */

/* Buttons */
.accessibility-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 85px;
  max-width: 100px;
  margin: 5px 3px 5px 0;
  padding: 12px 6px;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  transition: all 0.3s ease;
  text-align: center;
  white-space: normal;
  vertical-align: top;
  line-height: 1.2;
  flex: 1 1 calc(33.333% - 6px);
}

.accessibility-btn::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  margin-bottom: 4px;
  background-size: 20px 20px;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

/* Icon styles for each button */
.accessibility-btn[data-action="high-contrast"]::before {
  content: "🌓";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="dark-contrast"]::before {
  content: "🌙";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="highlight-links"]::before {
  content: "🔗";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="increase-text"]::before {
  content: "🔍";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="decrease-text"]::before {
  content: "🔎";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="reset-text"]::before {
  content: "↺";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="adjust-line-height"]::before {
  content: "📏";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="adjust-spacing"]::before {
  content: "📐";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="big-cursor"]::before {
  content: "👆";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="hide-images"]::before {
  content: "🖼️";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="screen-reader"]::before {
  content: "🎧";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

.accessibility-btn[data-action="reset-all"]::before {
  content: "🔄";
  background: none;
  font-size: 18px;
  line-height: 20px;
}

/* Group content styling for inline buttons - Open by default */
.accessibility-group-content {
  overflow: hidden;
  padding: 5px 0;
  display: flex; /* Changed from none to flex - open by default */
  flex-wrap: wrap;
  gap: 4px;
  justify-content: flex-start;
  align-items: stretch;
}

.accessibility-group-content.show {
  display: flex;
}

/* Hidden state when collapsed */
.accessibility-group-content.hide {
  display: none;
}

.accessibility-btn:hover {
  background: #e3f2fd;
  border-color: #2196F3;
}

.accessibility-btn:focus {
  outline: 2px solid #2196F3;
  outline-offset: 2px;
}

.accessibility-btn.active {
  background: #2196F3;
  color: white;
  border-color: #1976D2;
}

.accessibility-btn.reset-all {
  background: #f44336;
  color: white;
  margin-top: 15px;
  border-color: #d32f2f;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-left: 0;
  margin-right: 0;
  min-width: auto;
}

.accessibility-btn.reset-all:hover {
  background: #d32f2f;
}

/* Accessibility Modes */

/* High Contrast Mode */
body.high-contrast-mode {
  background: #000000 !important;
  color: #ffffff !important;
}

/* Main content areas */
/* Avoid touching toolbar or toolbar children */
body.high-contrast-mode :not(.accessibility-toolbar):not(.accessibility-toolbar *)
  , body.high-contrast-mode :not(.accessibility-panel):not(.accessibility-panel *) {
  color: #ffffff !important;
}

/* More explicit element targeting for main content */
body.high-contrast-mode div:not(.accessibility-toolbar):not(.accessibility-panel),
body.high-contrast-mode span:not(.accessibility-toolbar):not(.accessibility-panel),
body.high-contrast-mode p,
body.high-contrast-mode h1,
body.high-contrast-mode h2,
body.high-contrast-mode h3,
body.high-contrast-mode h4,
body.high-contrast-mode h5,
body.high-contrast-mode h6,
body.high-contrast-mode li,
body.high-contrast-mode td,
body.high-contrast-mode th {
  background-color: transparent !important;
  color: #ffffff !important;
  border-color: #ffffff !important;
}

/* Content containers */
body.high-contrast-mode .container,
body.high-contrast-mode .content,
body.high-contrast-mode .main,
body.high-contrast-mode .page,
body.high-contrast-mode article,
body.high-contrast-mode section {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* Links */
body.high-contrast-mode a,
body.high-contrast-mode a:visited {
  color: #ffff00 !important;
  background-color: transparent !important;
  text-decoration: underline !important;
}

body.high-contrast-mode a:hover,
body.high-contrast-mode a:focus {
  color: #000000 !important;
  background-color: #ffff00 !important;
  text-decoration: underline !important;
}

/* Form elements */
body.high-contrast-mode button,
body.high-contrast-mode input,
body.high-contrast-mode select,
body.high-contrast-mode textarea {
  background: #ffffff !important;
  color: #000000 !important;
  border: 2px solid #ffffff !important;
}

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

/* Images - keep visible but add high contrast border */
/* Keep toolbar images untouched */
body.high-contrast-mode img:not(.accessibility-toolbar img):not(.accessibility-toggle img) {
  border: 2px solid #ffffff !important;
  opacity: 0.9 !important;
}

/* Tables */
body.high-contrast-mode table {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
}

body.high-contrast-mode table td,
body.high-contrast-mode table th {
  border: 1px solid #ffffff !important;
  background: transparent !important;
}

/* Navigation menus */
body.high-contrast-mode nav,
body.high-contrast-mode .menu,
body.high-contrast-mode .navbar {
  background: #000000 !important;
  border: 2px solid #ffffff !important;
}

/* Ensure text content areas are properly styled */
body.high-contrast-mode .field,
body.high-contrast-mode .field-content,
body.high-contrast-mode .view-content,
body.high-contrast-mode .block-content {
  background: transparent !important;
  color: #ffffff !important;
}

/* Drupal specific elements */
body.high-contrast-mode .region,
body.high-contrast-mode .block,
body.high-contrast-mode .node,
body.high-contrast-mode .field-item {
  background: transparent !important;
  color: #ffffff !important;
}

/* Header and footer areas */
body.high-contrast-mode header,
body.high-contrast-mode footer,
body.high-contrast-mode .header,
body.high-contrast-mode .footer {
  background: #000000 !important;
  color: #ffffff !important;
  border: 1px solid #ffffff !important;
}

/* Drupal menus and navigation */


/* Lists */
body.high-contrast-mode ul,
body.high-contrast-mode ol {
  background: transparent !important;
}

/* Ensure visibility of important elements */
body.high-contrast-mode *:not(.accessibility-toolbar):not(.accessibility-panel):not(.accessibility-btn) {
  text-shadow: none !important;
  box-shadow: none !important;
}

/* Dark Contrast Mode */
body.dark-contrast-mode {
  background: #1a1a1a !important;
  color: #e0e0e0 !important;
}

body.dark-contrast-mode * {
  background-color: #1a1a1a !important;
  color: #e0e0e0 !important;
}

body.dark-contrast-mode a {
  color: #4fc3f7 !important;
}

body.dark-contrast-mode button,
body.dark-contrast-mode input,
body.dark-contrast-mode select,
body.dark-contrast-mode textarea {
  background: #333 !important;
  color: #e0e0e0 !important;
  border: 1px solid #666 !important;
}

/* Highlight Links Mode */
body.highlight-links-mode a {
  background: yellow !important;
  color: black !important;
  text-decoration: underline !important;
  padding: 2px 4px !important;
  border-radius: 3px !important;
}

/* Layout Protection for Text Resize - Prevent Breaking on Large Text */
/* Ensure containers handle increased text sizes gracefully */
.container,
.row,
.col-,
[class*="col-"],
.grid,
.flex,
nav,
header,
footer,
main,
section,
aside {
  overflow-wrap: break-word !important;
  word-wrap: break-word !important;
  hyphens: auto !important;
}

/* Ensure menus and navigation remain functional with larger text */
ul,
ol,
nav ul,
nav ol {
  flex-wrap: wrap !important;
}

.menu,
.navbar,
.navigation {
  flex-wrap: wrap !important;
  overflow: visible !important;
}

/* Ensure tables remain responsive with larger text */
table {
  table-layout: auto !important;
  word-wrap: break-word !important;
}

table td,
table th {
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  max-width: 200px !important;
}

/* Prevent horizontal scrolling issues on mobile with large text */
@media (max-width: 768px) {
  body {
    overflow-x: auto !important;
  }
  
  .container,
  .wrapper {
    max-width: 100% !important;
    overflow-x: auto !important;
  }
}

body.increased-text-spacing {
  letter-spacing: 2px !important;  /* Increased from 1px */
  word-spacing: 4px !important;    /* Increased from 2px */
  line-height: 1.6 !important;    /* Added line height bonus */
}

body.increased-text-spacing * {
  letter-spacing: 2px !important;  /* Increased from 1px */
  word-spacing: 4px !important;    /* Increased from 2px */
  line-height: 1.6 !important;    /* Added line height bonus */
}

/* Navigation Adjustments - Big Cursor - Accessibility Standards Compliant */
body.big-cursor-mode {
  /* Use system cursor with CSS transforms for better accessibility */
  cursor: url(../img/cursor.svg), crosshair!important;
}

body.big-cursor-mode *,
body.big-cursor-mode *:before,
body.big-cursor-mode *:after {
  cursor: url(../img/cursor.svg), crosshair!important;
}

body.big-cursor-mode a,
body.big-cursor-mode a *,
body.big-cursor-mode button,
body.big-cursor-mode button *,
body.big-cursor-mode input[type="button"],
body.big-cursor-mode input[type="submit"],
body.big-cursor-mode input[type="reset"],
body.big-cursor-mode input[type="file"],
body.big-cursor-mode select,
body.big-cursor-mode .accessibility-btn,
body.big-cursor-mode .accessibility-btn *,
body.big-cursor-mode [role="button"],
body.big-cursor-mode [role="button"] *,
body.big-cursor-mode [onclick],
body.big-cursor-mode [onclick] *,
body.big-cursor-mode .clickable,
body.big-cursor-mode .clickable *,
body.big-cursor-mode area,
body.big-cursor-mode label[for] {
  cursor: url(../img/pointer.svg), pointer!important;
}

body.big-cursor-mode input[type="text"],
body.big-cursor-mode input[type="email"],
body.big-cursor-mode input[type="password"],
body.big-cursor-mode input[type="search"],
body.big-cursor-mode input[type="tel"],
body.big-cursor-mode input[type="url"],
body.big-cursor-mode input[type="number"],
body.big-cursor-mode textarea {
  cursor: text !important;
}

body.big-cursor-mode input[type="range"] {
  cursor: grab !important;
}

body.big-cursor-mode input[type="range"]:active {
  cursor: grabbing !important;
}

/* Enhanced cursor visibility using CSS filters and scaling */
body.big-cursor-mode {
  /* Add a custom cursor overlay for better visibility */
  position: relative;
}

body.big-cursor-mode::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  pointer-events: none;
  z-index: 9998;
  /* This forces the browser to re-render cursors */
}

/* Visual indicator that big cursor mode is active */
body.big-cursor-mode::after {
  content: 'Big Cursor Active - Enhanced Pointer Visibility';
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff9800;
  color: white;
  padding: 8px 15px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  z-index: 10001;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Alternative implementation using CSS custom cursors with better encoding */
@supports (cursor: url('data:image/svg+xml;base64,')) {
  body.big-cursor-mode,
  body.big-cursor-mode * {
    cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIgMlYyOEw5IDIxSDE4TDEwIDEzTDE4IDVWMloiIGZpbGw9ImJsYWNrIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjEiLz4KPC9zdmc+') 2 2, crosshair !important;
  }
  
  body.big-cursor-mode a,
  body.big-cursor-mode button,
  body.big-cursor-mode input[type="button"],
  body.big-cursor-mode input[type="submit"],
  body.big-cursor-mode input[type="reset"],
  body.big-cursor-mode select,
  body.big-cursor-mode .accessibility-btn,
  body.big-cursor-mode [role="button"],
  body.big-cursor-mode [onclick] {
    cursor: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1zbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwIDJDOSAyIDggMyA4IDRWMTBDOCAxMCA2IDEwIDQgMTJMMiAxOEMyCTIwIDMgMjEgNSAyMUg3VjI5QzcgMzAgOCAzMSA5IDMxSDE3QzE4IDMxIDE5IDMwIDE5IDI5VjIxSDIxQzIyIDIxIDIzIDIwIDIzIDE4TDIxIDEyQzE5IDEwIDE3IDEwIDE3IDEwVjRDMTcgMyAxNiAyIDE1IDJIMTBaIiBmaWxsPSJibGFjayIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIxIi8+Cjwvc3ZnPg==') 16 16, pointer !important;
  }
}

body.hide-images-mode img:not(.accessibility-toolbar img):not(.accessibility-toggle img):not(.MS-left img):not(.MS-right img):not(#icg-sitemap img) {
  display: none !important;
}

body.hide-images-mode img::after {
  content: "[Image Hidden]";
  visibility: visible !important;
  display: block !important;
  background: #f0f0f0;
  padding: 10px;
  border: 1px solid #ccc;
  color: #666;
}
/* body.hide-images-mode #homeSlideCarouse,
body.hide-images-mode .initiativeSection,
body.hide-images-mode .initiative_img
body.hide-images-mode #block-views-block-on-a-day-in-the-icegate-block-1-2 .views-field-nothing,
body.hide-images-mode .icgCarousel .MS-content .item,
body.hide-images-mode #awardSlider.icgCarousel .MS-content .item,
body.hide-images-mode #photoSlider.icgCarousel .MS-content .item {
   min-height: 1px !important;
} */

@media (min-width: 1366px) {
   body.hide-images-mode #homeSlideCarouse{
         height: 1px !important;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
  .accessibility-toolbar {
    top: 10px;
    right: 10px;
  }
  
  .accessibility-toggle {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .accessibility-panel {
    min-width: 250px;
    padding: 15px;
  }
}

/* Focus Indicators */
.accessibility-toolbar *:focus {
  outline: 3px solid #FFD54F !important;
  outline-offset: 2px !important;
}

/* High Contrast Toolbar */
body.high-contrast-mode .accessibility-toolbar .accessibility-toggle {
  background: white !important;
  color: black !important;
  border: 2px solid white !important;
}

body.high-contrast-mode .accessibility-toolbar .accessibility-panel {
  background: black !important;
  border: 2px solid white !important;
}

body.high-contrast-mode .accessibility-toolbar .accessibility-btn {
  background: black !important;
  color: white !important;
  border: 1px solid white !important;
}

body.high-contrast-mode .accessibility-toolbar .accessibility-btn.active {
  background: white !important;
  color: black !important;
}

/* Line Height Adjustment */
body.increased-line-height *,
body.increased-line-height p,
body.increased-line-height div,
body.increased-line-height span,
body.increased-line-height h1,
body.increased-line-height h2,
body.increased-line-height h3,
body.increased-line-height h4,
body.increased-line-height h5,
body.increased-line-height h6,
body.increased-line-height li,
body.increased-line-height td,
body.increased-line-height th,
body.increased-line-height a,
body.increased-line-height label,
body.increased-line-height button,
body.increased-line-height input,
body.increased-line-height textarea,
body.increased-line-height select,
body.increased-line-height blockquote,
body.increased-line-height pre,
body.increased-line-height code {
  line-height: 1.8 !important;
}

/* Specific adjustments for different text elements */
body.increased-line-height p {
  line-height: 2.0 !important;
}

body.increased-line-height h1,
body.increased-line-height h2,
body.increased-line-height h3,
body.increased-line-height h4,
body.increased-line-height h5,
body.increased-line-height h6 {
  line-height: 1.6 !important;
}

body.increased-line-height li {
  line-height: 1.9 !important;
  margin-bottom: 0.3em !important;
}

/* Form elements */
body.increased-line-height input,
body.increased-line-height textarea,
body.increased-line-height select,
body.increased-line-height button {
  line-height: 1.7 !important;
}

/* Table cells */
body.increased-line-height td,
body.increased-line-height th {
  line-height: 1.8 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

body.high-contrast-mode .header_logos .emblem, body.dark-contrast-mode .header_logos .emblem {
    margin-right: 25px;
    background-color: #fff !important;
    padding: 10px;
}

body.high-contrast-mode .header_logos .icegate_log, .header_logos .icegate_log {
background-color: #fff !important;

}

body.high-contrast-mode .tgmenu__navbar-wrap > ul > li > .sub-menu li a, body.dark-contrast-mode .tgmenu__navbar-wrap > ul > li > .sub-menu li a {
color: #fff !important
}

body.high-contrast-mode .accessibility-toolbar .accessibility-toggle{
    background: #333 !important;
    color: #e0e0e0 !important;
    border: 1px solid #666 !important;
}

body.hide-images-mode #block-views-block-new-initiative-gallery-block-1 .new-initiative-footer{
  position: unset;
}