/* ACCESSIBILITY */
/*@font-face {
    font-family: 'OpenDyslexic';
    src: url('/assets/accessibility/fonts/OpenDyslexic-Regular.woff2') format('woff2'),
    url('/assets/accessibility/fonts/OpenDyslexic-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}*/

.accessibility-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2001;
  background: #bd2830;
  border: none;
  height: 60px;
  width: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: background 0.3s, transform 0.3s;
}

@media(max-width: 768px) {
  .accessibility-toggle {
    position: fixed;
    bottom: 140px;
    right: 20px;
    z-index: 2001;
    background: #bd2830;
    border: none;
    height: 46px;
    width: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    padding: 16px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    transition: background 0.3s, transform 0.3s;
  }
}


.accessibility-toggle:hover {
    background: #bd2830;
    transform: scale(1.05);
}
.accessibility-toggle svg {
    display: block;
    fill: #fff;
}

#accessibilityMenuBtn img {
  width: 20px;
  height: 20px;
}

.accessibility-toolbar {
    position: fixed;
    bottom: 86px;
    right: 20px;
    width: 340px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    padding: 14px;
    z-index: 2000;
    display: none;
    font-family: Arial, sans-serif;
}

@media(max-width: 768px) {
  .accessibility-toolbar {
    position: fixed;
    bottom: 196px;
    left: 0;
    right: 0;
    width: 80%;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
    padding: 14px;
    z-index: 2000;
    display: none;
    font-family: Arial, sans-serif;
  }
}

.accessibility-toolbar.open {
    display: block;
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}


.toolbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    margin-bottom: 14px;
    font-size: 18px;
}
.toolbar-header .header-actions button {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    margin-left: 8px;
    color: #333;
    transition: transform 0.2s;
}
.toolbar-header .header-actions button:hover {
    transform: scale(1.2);
}

.toolbar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.toolbar-grid button {
    background: #bd2830;
    border: none;
    color: white;
    border-radius: 10px;
    padding: 8px;
    cursor: pointer;
    font-size: 20px;
    transition: background 0.3s, transform 0.2s;
    height: 80px;
}
.toolbar-grid button:hover {
    background: #a01f26;
    transform: translateY(-2px);
}

.feature-icon {
    /*
    background-color: white;
    */
}
body.high-contrast > .cdk-overlay-container {
  color: #fff !important;

  .mdc-menu-surface {
    background: #000;
  }
}

body.high-contrast mat-dialog-container {
    border-radius: 2px;
    border-color: white;
}

body.high-contrast mat-dialog-container * {
    background: #000 !important;
    color: #fff !important;
}

body.high-contrast > *:not(#accessibilityToolbar):not(.cdk-overlay-container):not(#accessibilityMenuBtn):not(#accessibilityMenuBtn *):not(#readingGuideBar),
body.high-contrast > *:not(#accessibilityToolbar):not(.cdk-overlay-container):not(#accessibilityMenuBtn) *:not(.mat-mdc-form-field):not(.mat-mdc-form-field *):not(.language-selector):not(.language-selector *):not(.mdc-button):not(.mdc-button *):not(.feature-icon)
{
    background: #000 !important;
    color: #fff !important;
}

body.high-contrast .mat-mdc-form-field,
body.high-contrast .mat-form-field-disabled *
{
  color: lightgrey !important;
  /*background: black !important;*/
  border-color: white !important;
}

body.high-contrast .mat-mdc-dialog-inner-container {
    border: 2px white solid;
}

body.high-contrast .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mat-mdc-notch-piece  {
  border-color: white !important;
}

body.high-contrast .mdc-text-field--outlined:not(.mdc-text-field--disabled).mdc-text-field--invalid .mdc-floating-label,
body.high-contrast .mat-mdc-form-field:not(.mat-form-field-disabled) .mat-mdc-floating-label.mdc-floating-label {
  color: white !important;
}

body.high-contrast .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-text-field__input {
  color: white !important;
}

body.high-contrast .mat-select-panel .mat-option {
  color: #ffffff !important;
  background: #000 !important;
}


body.high-contrast .mat-mdc-button-disabled  {
  background: #ff6b70 !important;
  color: #ffffff !important;
}

body.high-contrast .mdc-button-enabled  {
  background: #ff5a5f !important;
  color: #ffffff !important;
}

body.high-contrast .mdc-button--outlined {
  background: #000 !important;
  color: #ffffff !important;
}

body.high-contrast .mat-mdc-select-trigger .mat-mdc-select-value-text {
  color: white !important;
}

body.high-contrast > #readingGuideBar,
body.high-contrast > #readingGuideBar,
body.high-contrast > #readingGuideBar * {
    background: rgba(128, 128, 128, 0.4) !important;
}

body.high-contrast > *:not(#accessibilityToolbar) a,
body.high-contrast > *:not(#accessibilityToolbar) * a {
    color: #0ff !important;
}

body.dyslexia-font > *:not(#accessibilityToolbar),
body.dyslexia-font > *:not(#accessibilityToolbar) *:not(.mat-icon) {
    font-family: 'OpenDyslexic', sans-serif !important;
}

.emphasize-links a {
    text-decoration: underline overline !important;
    font-weight: bold;
}

.reading-guide {
    /*cursor: none;*/
}
.reading-guide::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    height: 2px;
    /*
    background: red;
    */
    pointer-events: none;
}

#readingGuideBar {
    position: fixed;
    left: 0;
    width: 100%;
    height: 2rem;
    background: rgba(255, 255, 0, 0.4);
    pointer-events: none;
    z-index: 1999;
}

.text-size-1 *:not(#accessibilityToolbar *) { font-size: 102% !important; }
.text-size-2 *:not(#accessibilityToolbar *) { font-size: 103% !important; }
.text-size-3 *:not(#accessibilityToolbar *) { font-size: 104% !important; }

.feature-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    margin: 5px 0;
}

.feature-label {
    margin-top: 4px;
    text-align: center;
    color: white;
    font-weight: 500;
    font-family: Arial, sans-serif;
}

#accessibilityToolbar .feature-btn.active-feature {
    background: #7a181e;
    border: 2px solid #651418;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

#accessibilityToolbar .feature-btn.active-feature .feature-label {
    color: white;
    font-weight: bold;
}

body.spacing-1 *:not(#accessibilityToolbar *),
body.spacing-2 *:not(#accessibilityToolbar *),
body.spacing-3 *:not(#accessibilityToolbar *) {
    letter-spacing: inherit;
    line-height: inherit;
}

/* Define spacing rules for main page only */
body.spacing-1,
body.spacing-1 *:not(#accessibilityToolbar *):not(#accessibilityWidget *){
    letter-spacing: 2px !important;
    line-height: 1.6 !important;
}

body.spacing-2,
body.spacing-2 *:not(#accessibilityToolbar *):not(#accessibilityWidget *){
    letter-spacing: 4px !important;
    line-height: 1.8 !important;
}

body.spacing-3,
body.spacing-3 *:not(#accessibilityToolbar *):not(#accessibilityWidget *){
    letter-spacing: 6px !important;
    line-height: 2 !important;
}

/* Now isolate the widget so it ignores inherited line-height and spacing */
#accessibilityToolbar,
#accessibilityToolbar * {
    letter-spacing: normal !important;
    line-height: normal !important;
}
