:root {
    /* Paleta de colores */
    --bg: #e6e6e6;
    --panel: #f8f9fa;
    --text: #1fa387;
    --muted: #1fa387;
    --link-color: #1fa387;
    --accent: #294a4e;
    --border-color: #dee2e6;
    --selection-fill: #294a4e;
    --btn-hover-bg: #e75c5c;
    --header-height: 4.375rem;
}

/* =================================================================== */
/* 🎨 ESTILOS BASE */
/* =================================================================== */
html {
    /* Esta propiedad es la que hace la magia */
    scroll-behavior: smooth; 
}
html {
    font-size: 16px;
}

body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Noto Sans', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 0;
}

.wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    gap: 1.5rem;
    box-sizing: border-box;
}

.content-section {
    width: 100%;
    max-width: 75rem;
    margin: 0 auto;
    border-radius: 0.75rem;
    padding: 1.75rem;
    box-sizing: border-box;
}

.full-width {
    max-width: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 0.875rem;
    border-radius: 0.5rem;
    background: var(--link-color);
    color: #fff;
    font-weight: 700;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
    text-align: center;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.2s ease;
    font-size: 1rem;
}

.btn:hover:not([aria-disabled="true"]) {
    background: var(--btn-hover-bg);
    transform: translateY(-0.125rem);
}

.btn[aria-disabled="true"] {
    background: var(--accent);
    opacity: .7;
    cursor: not-allowed;
    pointer-events: none
}

/* HEADER */
header {
    position: relative;
    width: 100%;
    height: var(--header-height);
    background: var(--bg);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.75rem;
    box-sizing: border-box;
}

.header-logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--link-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.header-logo img {
    height: calc(var(--header-height) - 1.5rem);
    max-height: 100%;
    width: auto;
    vertical-align: middle;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 1.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    transition: color 0.2s;
    padding: 0.3125rem 0.625rem;
    font-size: 1rem;
}

.nav-links a:hover {
    color: var(--link-color);
    border-bottom: 2px solid var(--selection-fill);
}

.social-links {
    display: flex;
    gap: 0.9375rem;
}

.social-links a {
    color: var(--text);
    font-size: 1.2rem;
    transition: color 0.2s;
}

.social-links a:hover {
    color: var(--selection-fill);
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    width: 1.5rem;
    height: 1.5rem;
    justify-content: center;
    align-items: center;
}

/* SECCIÓN LOGO SPLASH */
.logo-splash-section {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    padding: 2.5rem 1.75rem;
    background-color: var(--bg);
}

.logo-splash-section .centered-logo {
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    height: auto;
    object-fit: contain;
    display: block;
}

@media (max-width: 600px) {
    .logo-splash-section {
        height: 25rem;
        padding: 1.5rem 1rem;
    }
}

/* INTRO */
.intro-section {
    text-align: center;
    padding-bottom: 1.25rem;
    padding-top: 1.25rem;
    background: var(--bg);
}

.intro-section h1 {
    font-size: 2.5rem;
    color: var(--text);
    margin-bottom: 0.9375rem;
    font-weight: 700;
}

.intro-section p {
    font-size: 1.1rem;
    color: var(--muted);
    max-width: 50rem;
    margin: 0 auto;
}

/* MAPA */
.map-layout {
    display: grid;
    grid-template-columns: 1fr 20rem;
    gap: 1.5rem;
    align-items: start;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.75rem;
    box-sizing: border-box;
    background: var(--bg);
}

.map-box {
    padding: 0.5rem;
    border-radius: 0.625rem;
    min-height: 40rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

svg {
    width: 100%;
    height: 100%;
    display: block;
}

.candidate {
    pointer-events: auto;
}

.info-panel {
    background: var(--panel);
    border-radius: 0.625rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 12.5rem;
}

.info-panel h2 {
    margin: 0 0 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.selected-name {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--link-color);
    min-height: 1.4em;
    margin-bottom: 0.25rem;
}

.info-note {
    color: var(--muted);
    font-size: .9rem;
    margin-top: 0.5rem;
    min-height: 2.7em;
}

.state-shape {
    stroke: #fff;
    stroke-width: 0.0625rem;
    transition: stroke 0.1s ease, fill 0.2s ease, filter 0.1s ease, transform 0.1s ease;
}

.candidate.has-link {
    cursor: pointer;
}

.candidate.nolink {
    cursor: default;
    fill: var(--accent) !important;
    opacity: 0.62;
}

.candidate.selected {
    filter: drop-shadow(0 0.5rem 1.25rem rgba(11, 45, 70, 0.12));
    stroke: #294a4e;
    stroke-width: 0.09375rem;
}

svg *:focus {
    outline: none;
}

/* RESPONSIVE */
@media (max-width:980px) {
    .map-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .info-panel {
        order: 2
    }

    .nav-links {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        flex-direction: column;
        width: 100%;
        background: var(--bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.05);
        transition: max-height 0.3s ease-out;
        max-height: 0;
        overflow: hidden;
    }

    .nav-links.active {
        display: flex;
        max-height: 18.75rem;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a {
        display: block;
        padding: 0.9375rem 0.625rem;
        width: 100%;
        box-sizing: border-box;
        border-bottom: none;
    }

    .social-links {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width:600px) {

    .content-section,
    .map-layout {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    header {
        padding: 0 1rem;
    }

    .map-box {
        min-height: 18.75rem;
    }

    .info-panel {
        padding: 1rem;
        min-height: 11.25rem;
    }

    .intro-section h1 {
        font-size: 2rem;
    }

    .intro-section p {
        font-size: 1rem;
    }

    .accessibility-btn {
        left: 1rem;
        right: unset;
    }

    .accessibility-panel {
        width: 100%;
    }
}

/* =================================================================== */
/* ♿ CSS ACCESIBILIDAD (BASE) */
/* =================================================================== */
/* Debe estar en la sección CSS de tu <style> */
.accessibility-btn.hidden {
    display: none; /* Oculta el botón por completo */
}
.accessibility-btn {
    position: fixed;
    left: 1.25rem;
    bottom: 1.25rem;
    width: 3.4375rem;
    height: 3.4375rem;
    border-radius: 50%;
    background: #fff;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 0.25rem 0.625rem rgba(0, 0, 0, 0.2);
    font-size: 1.8rem;
    display: grid;
    place-items: center;
    text-align: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 2000;
}

.accessibility-btn:hover {
    background: #fff;
    transform: scale(1.05);
}
.accessibility-btn img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    display: block;
}

.accessibility-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 18.75rem;
    height: 100%;
    background: var(--panel);
    box-shadow: 0.25rem 0 0.625rem rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease-out;
    z-index: 1999;
    padding: 1.25rem;
    box-sizing: border-box;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.accessibility-panel.active {
    transform: translateX(0);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.625rem;
}

.panel-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text);
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--link-color);
}

.panel-options {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.option-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    width: 100%;
    text-align: left;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.option-btn i {
    margin-right: 0.625rem;
    width: 1.5rem;
    text-align: center;
    font-size: 1.1rem;
}

.option-btn:hover {
    background: var(--selection-fill);
    color: white;
    border-color: var(--selection-fill);
}

.option-btn[aria-pressed="true"] {
    background: var(--link-color);
    color: white;
    border-color: var(--link-color);
}

/* =================================================================== */
/* 🆕 ESTILOS ACCESIBILIDAD AVANZADA */
/* =================================================================== */

/* Filtros */
#page-wrapper.high-contrast-mode {
    filter: grayscale(0) invert(100%);
    background-color: black !important;
    color: white !important;
}

#page-wrapper.grayscale-mode {
    filter: grayscale(100%);
}

/* 1. Cursor Grande */
.big-cursor-mode,
.big-cursor-mode * {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewport="0 0 48 48" style="fill:black;stroke:white;stroke-width:2px;"><path d="M10 40 L10 4 L30 24 L20 24 L28 36 L24 38 L16 26 L10 40Z" /></svg>') 10 4, auto !important;
}

/* 2. Guía de Lectura (NUEVO DISEÑO "FOCUS") */
#reading-guide {
    position: fixed;
    left: 0;
    width: 100%;
    height: 4.5rem;
    /* Más alto para cubrir párrafos */
    /* Centro transparente, bordes sutiles */
    background-color: transparent;
    /* Sombra masiva para oscurecer el resto de la pantalla (Efecto Cinema) */
    box-shadow: 0 0 0 100vh rgba(0, 0, 0, 0.3);
    border-top: 3px solid rgba(255, 255, 255, 0.8);
    border-bottom: 3px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
    z-index: 9999;
    display: none;
    transform: translateY(-50%);
}

/* 3. Tipografía Dislexia */
body.dyslexia-mode,
body.dyslexia-mode * {
    font-family: 'Open-Dyslexic', 'Comic Sans MS', 'Verdana', sans-serif !important;
    line-height: 1.8 !important;
    letter-spacing: 0.05em !important;
}

/* 4. Resaltar Enlaces */
body.highlight-links-mode a,
body.highlight-links-mode .btn,
body.highlight-links-mode .has-link {
    background-color: #ff0 !important;
    color: #000 !important;
    text-decoration: underline !important;
    text-decoration-thickness: 3px !important;
    font-weight: bold !important;
    fill: #ff0 !important;
    stroke: #000 !important;
}

/* Clase auxiliar para elemento leyendo actualmente */
.speaking-highlight {
    outline: 4px solid #ff0;
    background-color: rgba(255, 255, 0, 0.2);
}


/* CSS */

/* Asegurar que los iconos mantengan su fuente original incluso en modo dislexia */
body.dyslexia-mode .fa,
body.dyslexia-mode .fas,
body.dyslexia-mode .far,
body.dyslexia-mode .fab {
    /* Font Awesome 5 Free es el nombre común, ajusta si usas otra versión */
    font-family: "Font Awesome 5 Free", "FontAwesome" !important; 
}