/* Accessibility Controls - Standalone CSS */

/*
 * ESCALADO DE FUENTE — usa zoom en .page-scale-wrapper para que
 * escale absolutamente todo el contenido (px, em, rem) sin excepción.
 * El panel de accesibilidad queda fuera del wrapper y no se escala.
 */

.page-scale-wrapper {
    /* base: zoom 1 = sin cambio */
    zoom: 1;
    transition: zoom 0.2s ease;
}

html.font-small  .page-scale-wrapper { zoom: 0.88; }
/* font-normal: zoom 1 (default, no se declara) */
html.font-large  .page-scale-wrapper { zoom: 1.15; }
html.font-xlarge .page-scale-wrapper { zoom: 1.30; }
html.font-2xl    .page-scale-wrapper { zoom: 1.50; }

/* Contraste Normal */
body.contrast-normal {
    --contrast-mode: normal;
}

/* Contraste Medio */
body.contrast-medium {
    --color-primary: #0a0e1a;
    --color-text: #1a1a1a;
    --color-accent: #FFC629;
}

/* Contraste Alto */
body.contrast-high {
    --color-primary: #000000;
    --color-text: #000000;
    --color-white: #FFFFFF;
    --color-accent: #FFD700;
}

/* Blanco y Negro */
body.contrast-bw {
    --color-primary: #000000;
    --color-text: #000000;
    --color-white: #FFFFFF;
    --color-accent: #000000;
    background: white !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Modal Informativo */
[data-accessibility="info-modal"] {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

[data-accessibility="info-modal"].show {
    display: flex;
    opacity: 1;
    visibility: visible;
}

.accessibility-modal-content {
    background: white;
    border-radius: 12px;
    padding: 40px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.accessibility-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #FFC629;
}

.accessibility-modal-header h2 {
    margin: 0;
    color: #151D37;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 24px;
}

.accessibility-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #151D37;
    transition: transform 0.2s ease;
}

.accessibility-modal-close:hover {
    transform: scale(1.2);
}

.accessibility-modal-item {
    margin-bottom: 24px;
    padding: 16px;
    background: #F6F6F6;
    border-left: 4px solid #FFC629;
    border-radius: 4px;
}

.accessibility-modal-item h3 {
    margin: 0 0 8px 0;
    color: #151D37;
    font-size: 16px;
    font-weight: 600;
}

.accessibility-modal-item p {
    margin: 0;
    color: #4b4b4b;
    font-size: 14px;
    line-height: 1.6;
}

[data-accessibility="panel"] {
    position: fixed;
    top: 50%;
    right: 52px; /* ancho del botón tab */
    transform: translateY(-50%) translateX(12px);
    background: linear-gradient(135deg, #FFF 0%, #FEF6E9 100%);
    border: 2px solid #151D37;
    border-radius: 12px;
    padding: 24px;
    box-shadow: -8px 0 32px rgba(21, 29, 55, 0.2);
    z-index: 9999;
    display: none;
    opacity: 0;
    visibility: hidden;
    min-width: 300px;
    max-width: 340px;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

[data-accessibility="panel"].show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.accessibility-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.accessibility-control-group {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.accessibility-label {
    font-weight: 700;
    color: #151D37;
    font-size: 13px;
    margin-bottom: 10px;
    display: block;
    font-family: 'Josefin Sans', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.accessibility-label-with-info {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
}

.accessibility-info-btn {
    background: none;
    border: none;
    color: #FFC629;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.accessibility-info-btn:hover {
    transform: scale(1.2);
}

.accessibility-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 2px solid #151D37;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 20px;
    font-weight: 600;
    color: #151D37;
    flex-shrink: 0;
}

.accessibility-button:hover {
    background: linear-gradient(135deg, #FFC629 0%, #FFD947 100%);
    border-color: #FFC629;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 6px 16px rgba(255, 198, 41, 0.4);
}

.accessibility-button:active {
    transform: scale(0.95);
}

.accessibility-button:focus {
    outline: 3px solid #FFC629;
    outline-offset: 3px;
}

[data-accessibility="toggle"] {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 8px 0 0 8px; /* tab lateral */
    background: linear-gradient(135deg, #FFC629 0%, #FFD947 100%);
    border: none;
    border-right: none;
    cursor: pointer;
    box-shadow: -4px 0 16px rgba(255, 198, 41, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.25s ease;
    font-size: 22px;
    color: #151D37;
    padding: 0;
}

[data-accessibility="toggle"]:hover {
    width: 52px;
    box-shadow: -6px 0 20px rgba(255, 198, 41, 0.65);
}

[data-accessibility="toggle"]:active {
    width: 44px;
}

[data-accessibility="toggle"]:focus {
    outline: 3px solid #151D37;
    outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    [data-accessibility="panel"] {
        top: auto;
        bottom: 0;
        right: 0;
        left: 0;
        transform: none;
        border-radius: 12px 12px 0 0;
        min-width: auto;
        max-width: 100%;
    }

    [data-accessibility="panel"].show {
        transform: none;
    }

    [data-accessibility="toggle"] {
        top: 50%;
        right: 0;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        font-size: 18px;
        border-radius: 8px 0 0 8px;
    }

    [data-accessibility="toggle"]:hover {
        width: 48px;
    }
}

@media (max-width: 480px) {
    .accessibility-button {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ── Tooltip en el botón de accesibilidad ── */
.a11y-toggle-tooltip {
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    background: #151D37;
    color: white;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-family: 'Lexend Deca', sans-serif;
}

.a11y-toggle-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #151D37;
    border-right: none;
}

[data-accessibility="toggle"]:hover .a11y-toggle-tooltip {
    opacity: 1;
}

/* ── Título del panel ── */
.a11y-panel-title {
    font-size: 12px;
    font-weight: 700;
    color: #151D37;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #FFC629;
    font-family: 'Josefin Sans', sans-serif;
}

/* ── Botones de traducción ── */
.a11y-translate-group {
    flex-wrap: wrap;
    gap: 6px;
}

.a11y-translate-btn {
    font-size: 11px !important;
    font-weight: 700;
    width: 38px !important;
    height: 38px !important;
    letter-spacing: 0.3px;
}

.a11y-translate-btn.active {
    background: linear-gradient(135deg, #FFC629 0%, #FFD947 100%) !important;
    border-color: #FFC629 !important;
    color: #151D37;
}
