/*
 * Hoja de Estilos para Alto Contraste - Manual Crisis WP
 * ACTUALIZADO: Reglas de alta especificidad para forzar la sobreescritura
 * de estilos en el contenido principal y solucionar el problema de contraste.
 * @version 1.1.0
 * @date 2025-07-09
 * @author Baxahaun
 * // PEV_REF: TAREA_A11Y_01_FixFinal
 */

body.high-contrast {
    background-color: #000 !important;
    color: #fff !important;
}

/* --- ENLACES GENÉRICOS --- */
body.high-contrast a {
    color: #ff0 !important; /* Amarillo para enlaces */
    text-decoration: underline !important;
}
body.high-contrast a:hover,
body.high-contrast a:focus {
    color: #0ff !important; /* Cyan para hover/focus */
    text-decoration: underline !important;
}

/* --- CLASES DE UTILIDAD Y TEXTO GENERAL --- */
body.high-contrast .text-primary {
    color: #ff0 !important;
}
body.high-contrast .text-secondary,
body.high-contrast .text-body-secondary {
    color: #0ff !important;
}
body.high-contrast .text-muted {
    color: #ccc !important;
}
body.high-contrast .lead {
    color: #f0f0f0 !important;
}

/*
 * REGLAS CRÍTICAS DE CONTENIDO (VERSIÓN REFORZADA)
 * Selector de alta especificidad para forzar el color del texto y el fondo
 * en el contenido principal.
 */
body.high-contrast .content-area,
body.high-contrast .main-content,
body.high-contrast .entry-content,
body.high-contrast .page-content {
    background-color: #000 !important;
    color: #fff !important;
}

body.high-contrast .entry-content p,
body.high-contrast .entry-content li,
body.high-contrast .entry-content div,
body.high-contrast .entry-content blockquote,
body.high-contrast .entry-content span:not([class*="material-symbols-filled"]) {
    color: #fff !important;
    background-color: transparent !important; /* Evitar fondos extraños en elementos anidados */
}

/* Se re-especifica el color de los enlaces dentro del contenido para que no sean blancos */
body.high-contrast main#main-content .entry-content a,
body.high-contrast .page-content .entry-content a {
    color: #ff0 !important;
}
body.high-contrast main#main-content .entry-content a:hover,
body.high-contrast main#main-content .entry-content a:focus,
body.high-contrast .page-content .entry-content a:hover,
body.high-contrast .page-content .entry-content a:focus {
    color: #0ff !important;
}


/* --- ELEMENTOS GENERALES Y CONTENEDORES --- */
body.high-contrast .site-header,
body.high-contrast .card:not(.feature-item),
body.high-contrast .alert:not(#emergency-alert-bar-container),
body.high-contrast .offcanvas,
body.high-contrast .modal-content,
body.high-contrast .chapter-carousel .chapter-card,
body.high-contrast .cta-section,
body.high-contrast .hero-section .scenario-card,
body.high-contrast .bg-light,
body.high-contrast .bg-white,
body.high-contrast .intro-section .intro-card,
body.high-contrast .cookie-banner {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #fff !important;
}

/* --- FOOTER --- */
body.high-contrast .site-footer {
    background-color: #000 !important;
    color: #fff !important;
    border-top: 1px solid #fff !important;
}
body.high-contrast .site-footer h5.footer-column-title {
    color: #fff !important;
    border-bottom-color: #ff0 !important;
}
body.high-contrast .site-footer p,
body.high-contrast .site-footer li,
body.high-contrast .site-footer small,
body.high-contrast .site-footer strong,
body.high-contrast .site-footer em {
    color: #fff !important;
}
body.high-contrast .site-footer a {
    color: #ff0 !important;
    text-decoration: underline !important;
    background-color: transparent !important;
}
body.high-contrast .site-footer a:hover,
body.high-contrast .site-footer a:focus {
    color: #0ff !important;
}
body.high-contrast .site-footer .material-symbols-filled {
    color: inherit !important;
}
body.high-contrast .site-footer .footer-bottom {
    border-top-color: #fff !important;
}

/* --- ENCABEZADOS H1-H6 --- */
body.high-contrast h1, body.high-contrast .h1,
body.high-contrast h2, body.high-contrast .h2,
body.high-contrast h3, body.high-contrast .h3,
body.high-contrast h4, body.high-contrast .h4,
body.high-contrast h5, body.high-contrast .h5,
body.high-contrast h6, body.high-contrast .h6,
body.high-contrast .section-title {
    color: #fff !important;
}
body.high-contrast .chapter-carousel .chapter-card .card-title {
    color: #fff !important;
}
body.high-contrast .sidebar-widget .widget-title {
    color: #fff !important;
    border-bottom-color: #ff0 !important;
}
body.high-contrast .chapter-visual-header .entry-title {
    color: #fff !important;
}
body.high-contrast .post-navigation .nav-title {
    color: #fff !important;
}


/* --- BOTONES --- */
body.high-contrast .btn {
    color: #000 !important;
    background-color: #ff0 !important;
    border-color: #fff !important;
}
body.high-contrast .btn:hover,
body.high-contrast .btn:focus {
    color: #000 !important;
    background-color: #0ff !important;
    border-color: #fff !important;
}
body.high-contrast .btn .material-symbols-filled {
    color: #000 !important;
}

body.high-contrast .btn-primary,
body.high-contrast .btn-secondary:not(#download-pdf),
body.high-contrast .cookie-banner #accept-cookies.btn,
body.high-contrast #tts-controls .btn.tts-desktop-btn,
body.high-contrast .mobile-action-bar-button,
body.high-contrast #tts-overlay-play-button.tts-overlay-button,
body.high-contrast .site-header #toggle-a11y-controls-desktop,
body.high-contrast .site-header #toggle-a11y-controls-mobile,
body.high-contrast #accessibility-controls-container .btn-a11y-control {
    background-color: #ff0 !important;
    color: #000 !important;
    border-color: #fff !important;
}
body.high-contrast .btn-primary:hover, body.high-contrast .btn-primary:focus,
body.high-contrast .btn-secondary:not(#download-pdf):hover, body.high-contrast .btn-secondary:not(#download-pdf):focus,
body.high-contrast .cookie-banner #accept-cookies.btn:hover, body.high-contrast .cookie-banner #accept-cookies.btn:focus,
body.high-contrast #tts-controls .btn.tts-desktop-btn:hover, body.high-contrast #tts-controls .btn.tts-desktop-btn:focus,
body.high-contrast .mobile-action-bar-button:hover, body.high-contrast .mobile-action-bar-button:focus,
body.high-contrast #tts-overlay-play-button.tts-overlay-button:hover, body.high-contrast #tts-overlay-play-button.tts-overlay-button:focus,
body.high-contrast .site-header #toggle-a11y-controls-desktop:hover, body.high-contrast .site-header #toggle-a11y-controls-desktop:focus,
body.high-contrast .site-header #toggle-a11y-controls-mobile:hover, body.high-contrast .site-header #toggle-a11y-controls-mobile:focus,
body.high-contrast #accessibility-controls-container .btn-a11y-control:hover, body.high-contrast #accessibility-controls-container .btn-a11y-control:focus,
body.high-contrast #accessibility-controls-container .btn-a11y-control.active {
    background-color: #0ff !important;
    color: #000 !important;
    border-color: #fff !important;
}

body.high-contrast .btn-primary .material-symbols-filled,
body.high-contrast .btn-secondary:not(#download-pdf) .material-symbols-filled,
body.high-contrast .cookie-banner #accept-cookies.btn .material-symbols-filled,
body.high-contrast #tts-controls .btn.tts-desktop-btn .material-symbols-filled,
body.high-contrast .mobile-action-bar-button .material-symbols-filled,
body.high-contrast #tts-overlay-play-button.tts-overlay-button .material-symbols-filled,
body.high-contrast .site-header #toggle-a11y-controls-desktop .material-symbols-filled,
body.high-contrast .site-header #toggle-a11y-controls-mobile .material-symbols-filled,
body.high-contrast #accessibility-controls-container .btn-a11y-control .material-symbols-filled {
    color: #000 !important;
}

body.high-contrast .btn-outline-secondary,
body.high-contrast .chapter-navigation-widget .chapter-nav-btn {
    color: #ff0 !important;
    border-color: #fff !important;
    background-color: transparent !important;
}
body.high-contrast .btn-outline-secondary::before,
body.high-contrast .chapter-navigation-widget .chapter-nav-btn::before {
    background-color: #ff0 !important;
}
body.high-contrast .btn-outline-secondary:hover, body.high-contrast .btn-outline-secondary:focus,
body.high-contrast .chapter-navigation-widget .chapter-nav-btn:not(.disabled):hover, body.high-contrast .chapter-navigation-widget .chapter-nav-btn:not(.disabled):focus {
    color: #000 !important;
    border-color: #fff !important;
}
body.high-contrast .btn-outline-secondary .material-symbols-filled,
body.high-contrast .chapter-navigation-widget .chapter-nav-btn .material-symbols-filled {
    color: #ff0 !important;
}
body.high-contrast .btn-outline-secondary:hover .material-symbols-filled, body.high-contrast .btn-outline-secondary:focus .material-symbols-filled,
body.high-contrast .chapter-navigation-widget .chapter-nav-btn:not(.disabled):hover .material-symbols-filled, body.high-contrast .chapter-navigation-widget .chapter-nav-btn:not(.disabled):focus .material-symbols-filled {
    color: #000 !important;
}


body.high-contrast header.site-header .header-actions-desktop #download-pdf.btn.btn-sm {
    background-color: #ff0 !important;
    color: #000 !important;
    border-color: #fff !important;
}
body.high-contrast header.site-header .header-actions-desktop #download-pdf.btn.btn-sm span,
body.high-contrast header.site-header .header-actions-desktop #download-pdf.btn.btn-sm .material-symbols-filled {
    color: #000 !important;
}
body.high-contrast header.site-header .header-actions-desktop #download-pdf.btn.btn-sm::before {
    background-color: #0ff !important;
}
body.high-contrast header.site-header .header-actions-desktop #download-pdf.btn.btn-sm:hover {
    border-color: #fff !important;
    color: #000 !important;
}
body.high-contrast header.site-header .header-actions-desktop #download-pdf.btn.btn-sm:hover span,
body.high-contrast header.site-header .header-actions-desktop #download-pdf.btn.btn-sm:hover .material-symbols-filled {
    color: #000 !important;
}
body.high-contrast header.site-header .header-actions-desktop #download-pdf.btn.btn-sm:focus-visible {
    outline-color: rgba(0, 255, 255, 0.5);
    border-color: #fff !important;
    color: #000 !important;
}

body.high-contrast .cta-actions .btn {
    border-color: #fff !important;
}
body.high-contrast .cta-actions .btn.btn-light {
    background-color: #ff0 !important;
    color: #000 !important;
}
body.high-contrast .cta-actions .btn.btn-light:hover,
body.high-contrast .cta-actions .btn.btn-light:focus {
    background-color: #0ff !important;
}
body.high-contrast .cta-actions .btn.btn-outline-light {
    background-color: transparent !important;
    color: #ff0 !important;
    border-color: #fff !important;
}
body.high-contrast .cta-actions .btn.btn-outline-light::before {
    background-color: #ff0 !important;
}
body.high-contrast .cta-actions .btn.btn-outline-light:hover,
body.high-contrast .cta-actions .btn.btn-outline-light:focus {
    color: #000 !important;
    border-color: #fff !important;
}

body.high-contrast #chapter-sidebar .sidebar-widget .btn.btn-sm.btn-outline-primary:not(.tts-desktop-btn):not(.chapter-nav-btn),
body.high-contrast #chapter-sidebar .sidebar-widget .btn.btn-sm.btn-outline-secondary:not(.tts-desktop-btn):not(.chapter-nav-btn) {
    background-color: #ff0 !important;
    color: #000 !important;
    border-color: #fff !important;
}
body.high-contrast #chapter-sidebar .sidebar-widget .btn.btn-sm.btn-outline-primary:not(.tts-desktop-btn):not(.chapter-nav-btn) .material-symbols-filled,
body.high-contrast #chapter-sidebar .sidebar-widget .btn.btn-sm.btn-outline-secondary:not(.tts-desktop-btn):not(.chapter-nav-btn) .material-symbols-filled {
    color: #000 !important;
}
body.high-contrast #chapter-sidebar .sidebar-widget .btn.btn-sm.btn-outline-primary:not(.tts-desktop-btn):not(.chapter-nav-btn):hover,
body.high-contrast #chapter-sidebar .sidebar-widget .btn.btn-sm.btn-outline-secondary:not(.tts-desktop-btn):not(.chapter-nav-btn):hover {
    background-color: #0ff !important;
    color: #000 !important;
    border-color: #fff !important;
}


/* --- BARRA DE ALERTA DE EMERGENCIA --- */
body.high-contrast #emergency-alert-bar-container {
    background-color: #000 !important;
    color: #ff0 !important;
    border-bottom: 2px solid #ff0 !important;
    animation: none !important;
}
body.high-contrast #emergency-alert-bar-container .material-symbols-filled,
body.high-contrast #emergency-alert-bar-container .alert-message,
body.high-contrast #emergency-alert-bar-container .alert-source a {
    color: #ff0 !important;
}
body.high-contrast #emergency-alert-bar-container .alert-source a {
    text-decoration: underline !important;
}
body.high-contrast #emergency-alert-bar-container #alert-bar-close-btn {
    filter: invert(1) brightness(10);
    opacity: 1;
}

/* --- IMÁGENES --- */
body.high-contrast img,
body.high-contrast .chapter-carousel .chapter-card-img,
body.high-contrast .chapter-visual-header .chapter-header-background {
    filter: grayscale(100%) contrast(2);
    object-fit: cover !important;
}
body.high-contrast .footer-logo img,
body.high-contrast .site-header .navbar-brand img {
    filter: none !important;
}


/* --- CARRUSEL DE CAPÍTULOS --- */
body.high-contrast .chapter-carousel .carousel-control-prev-icon,
body.high-contrast .chapter-carousel .carousel-control-next-icon {
    filter: none;
    background-color: #ff0;
    border-radius: 2px;
}
body.high-contrast .chapter-carousel .carousel-indicators button {
    background-color: #fff !important;
}
body.high-contrast .chapter-carousel .carousel-indicators button.active {
    background-color: #ff0 !important;
}
body.high-contrast .chapter-carousel .chapter-card .card-text {
    color: #fff !important;
}


/* --- SECCIÓN DE CARACTERÍSTICAS DEL MANUAL (FRONT-PAGE) --- */
body.high-contrast .features-section .feature-item {
    background-color: #ff0 !important;
    border: 1px solid #fff !important;
}

body.high-contrast .features-section .feature-item * {
    color: #000 !important;
}


/* --- SECCIÓN HERO --- */
body.high-contrast .hero-section .scenario-icons-container .material-symbols-filled {
    -webkit-text-fill-color: #ff0 !important;
    text-shadow: 0 0 0 #ff0 !important;
    color: transparent !important;
}
body.high-contrast .hero-section .scenario-title {
    border-bottom-color: #fff !important;
    color: #fff !important;
}


/* --- BÚSQUEDA --- */
body.high-contrast #search-input-field,
body.high-contrast #search-input-field-mobile,
body.high-contrast #search-input-404 {
    background-color: #111 !important;
    color: #ff0 !important;
    border-color: #fff !important;
}
body.high-contrast #search-input-field::placeholder,
body.high-contrast #search-input-field-mobile::placeholder,
body.high-contrast #search-input-404::placeholder {
    color: #ccc !important;
}
body.high-contrast .search-icon-display .material-symbols-filled {
    color: #ff0 !important;
}
body.high-contrast #search-results-container,
body.high-contrast #search-results-container-mobile,
body.high-contrast #search-results-container-404 {
    background-color: #000 !important;
    border-color: #fff !important;
}
body.high-contrast #search-results-container .list-group-item,
body.high-contrast #search-results-container-mobile .list-group-item,
body.high-contrast #search-results-container-404 .list-group-item {
    border-bottom-color: #333 !important;
}
body.high-contrast #search-results-container .list-group-item a,
body.high-contrast #search-results-container-mobile .list-group-item a,
body.high-contrast #search-results-container-404 .list-group-item a {
    color: #fff !important;
}
body.high-contrast #search-results-container .list-group-item a:hover,
body.high-contrast #search-results-container .list-group-item a:focus,
body.high-contrast #search-results-container-mobile .list-group-item a:hover,
body.high-contrast #search-results-container-mobile .list-group-item a:focus,
body.high-contrast #search-results-container-404 .list-group-item a:hover,
body.high-contrast #search-results-container-404 .list-group-item a:focus {
    background-color: #222 !important;
    color: #ff0 !important;
}
body.high-contrast #search-results-container .search-result-title,
body.high-contrast #search-results-container-mobile .search-result-title,
body.high-contrast #search-results-container-404 .search-result-title {
    color: #ff0 !important;
}
body.high-contrast #search-results-container .list-group-item a:hover .search-result-title,
body.high-contrast #search-results-container .list-group-item a:focus .search-result-title,
body.high-contrast #search-results-container-mobile .list-group-item a:hover .search-result-title,
body.high-contrast #search-results-container-mobile .list-group-item a:focus .search-result-title,
body.high-contrast #search-results-container-404 .list-group-item a:hover .search-result-title,
body.high-contrast #search-results-container-404 .list-group-item a:focus .search-result-title {
    color: #0ff !important;
}
body.high-contrast #search-results-container .search-result-excerpt,
body.high-contrast #search-results-container-mobile .search-result-excerpt,
body.high-contrast #search-results-container-404 .search-result-excerpt {
    color: #ccc !important;
}
body.high-contrast .search-highlight {
    background-color: #ff0 !important;
    color: #000 !important;
}

/* --- BANNER DE COOKIES --- */
body.high-contrast .cookie-overlay {
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}


/* --- SINGLE CAPITULO --- */
body.high-contrast .progress-container .progress-bar {
    background-color: #ff0 !important;
}
body.high-contrast .chapter-visual-header {
    background-color: #000 !important;
    color: #fff !important;
}
body.high-contrast .chapter-visual-header .chapter-header-overlay {
    background-color: rgba(0,0,0, 0.7) !important;
}
body.high-contrast .chapter-visual-header .chapter-metadata .material-symbols-filled {
    color: #ccc !important;
}
body.high-contrast .chapter-visual-header .chapter-metadata {
    color: #ccc !important;
}
body.high-contrast .chapter-visual-header .chapter-metadata a {
    color: #ff0 !important;
}
body.high-contrast .chapter-visual-header .chapter-metadata a:hover {
    color: #0ff !important;
}
body.high-contrast .chapter-content-column .entry-content h2,
body.high-contrast .chapter-content-column .entry-content h3 {
    border-bottom-color: #fff !important;
}
body.high-contrast #chapter-sidebar {
    background-color: #000 !important;
    border-color: #fff !important;
}
body.high-contrast #chapter-toc ul {
    border-left-color: #fff !important;
}
body.high-contrast #chapter-toc ul li a {
    color: #fff !important;
}
body.high-contrast #chapter-toc ul li a:hover,
body.high-contrast #chapter-toc ul li a.active {
    background-color: #ff0 !important;
    color: #000 !important;
}
body.high-contrast #tts-status {
    color: #ccc !important;
}
body.high-contrast .post-navigation .nav-links {
    border-color: #fff !important;
}
body.high-contrast .post-navigation .nav-previous {
    border-right-color: #fff !important;
}
body.high-contrast .post-navigation .nav-links a:hover {
    background-color: #222 !important;
}
body.high-contrast .post-navigation .nav-subtitle .material-symbols-filled {
    color: #ccc !important;
}
body.high-contrast .post-navigation .nav-subtitle {
    color: #ccc !important;
}

/* --- ELEMENTOS DEL HEADER --- */
body.high-contrast .site-header .navbar-brand .site-title-container .navbar-text,
body.high-contrast .site-header .navbar-brand .site-title-container small {
    color: #fff !important;
}
body.high-contrast .site-header .search-form-container-desktop .input-group-text.search-icon-display .material-symbols-filled {
    color: #ff0 !important;
}
body.high-contrast .navbar-toggler-icon {
    filter: invert(1) brightness(2) contrast(150%);
}
body.high-contrast .navbar-toggler {
    border-color: #fff !important;
    background-color: transparent !important;
}
body.high-contrast .navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 0, 0.5) !important;
}


/* --- SKIP LINKS --- */
body.high-contrast .skip-links a {
    background: #000 !important;
    color: #ff0 !important;
    border: 1px solid #ff0;
}
body.high-contrast .skip-links a:focus {
    border-color: #0ff;
}

/* --- Colores específicos para variables CSS que eran azules oscuros --- */
body.high-contrast {
    --bs-secondary: #0ff !important;
    --bs-secondary-rgb: 0, 255, 255 !important;
    --pc-prussian-blue: #0ff !important;
    --bs-body-color: #fff !important;
    --bs-secondary-color: #0ff !important;
    --bs-link-hover-color: #0aa !important;
}

/* Offcanvas (menú móvil) */
body.high-contrast .offcanvas-header {
    background-color: #111 !important;
    border-bottom-color: #fff !important;
}
body.high-contrast .offcanvas-title {
    color: #fff !important;
}
body.high-contrast .offcanvas .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}
body.high-contrast .offcanvas-body {
    background-color: #000 !important;
    color: #fff !important;
}
body.high-contrast .offcanvas .nav-link {
    color: #ff0 !important;
}
body.high-contrast .offcanvas .nav-link:hover,
body.high-contrast .offcanvas .nav-link:focus {
    color: #0ff !important;
}
body.high-contrast .offcanvas .dropdown-menu {
    background-color: #111 !important;
}
body.high-contrast .offcanvas .dropdown-item {
    color: #ff0 !important;
}
body.high-contrast .offcanvas .dropdown-item:hover,
body.high-contrast .offcanvas .dropdown-item:focus {
    background-color: #222 !important;
    color: #0ff !important;
}

/* Barra de progreso */
body.high-contrast .progress-container {
    background-color: #222 !important;
}
body.high-contrast .progress-container .progress-bar {
    background-color: #ff0 !important;
}

/* Tooltips en alto contraste */
body.high-contrast .tooltip .tooltip-inner {
    background-color: #ff0 !important;
    color: #000 !important;
    border: 1px solid #000 !important;
}
body.high-contrast .tooltip .tooltip-arrow::before {
    border-top-color: #ff0 !important;
    border-bottom-color: #ff0 !important;
    border-left-color: #ff0 !important;
    border-right-color: #ff0 !important;
}
