/**
 * ==========================================================================
 * DECLARACIÓN DE ACCESIBILIDAD - ESTILOS ESPECÍFICOS (declaracion-accesibilidad.css)
 * ==========================================================================
 * Contiene los estilos de la sección legal siguiendo el formato corporativo.
 * Los estilos de Header, Footer y variables se importan de global.css.
 * ==========================================================================
 */

/* ==========================================================================
 * MEJORAS DE ACCESIBILIDAD (WCAG 2.2 AA)
 * ========================================================================== */
:focus-visible {
    outline: 3px solid var(--color-verde-acento, #28CC43) !important;
    outline-offset: 4px !important;
    border-radius: inherit;
}

[data-theme="light"] :focus-visible {
    outline: 3px solid #000957 !important;
}

/* ==========================================================================
 * 1. ESTILOS BASE (Escritorio y compartidos)
 * ========================================================================== */

.legal-section {
    display: flex;
    justify-content: center;
    padding: 60px 20px;
    min-height: 55vh;
}

.legal-box {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 60px;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    border-left: 4px solid var(--color-verde-acento, #28CC43);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

[data-theme="light"] .legal-box {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}

/* Títulos Principales */
.main-legal-title {
    color: var(--color-verde-acento, #28CC43);
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 800;
    text-align: center;
}

[data-theme="light"] .main-legal-title {
    color: #000957;
}

/* Texto introductorio */
.legal-intro-text {
    font-size: 0.95rem;
    color: #ffffff;
    font-style: italic;
    margin: 0 auto 40px auto;
    max-width: 650px;
    line-height: 1.6;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 30px;
}

[data-theme="light"] .legal-intro-text {
    color: #000957;
    border-bottom: 1px solid rgba(0, 9, 87, 0.1);
}

/* Imagen superior - Ajustada para verse completa */
.legal-hero-img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 350px;
    object-fit: contain;
    border-radius: 8px;
    margin: 20px auto 40px auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

[data-theme="light"] .legal-hero-img {
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Párrafos y Secciones Numeradas */
.legal-clause {
    margin-bottom: 35px;
}

.legal-clause h3 {
    color: var(--color-verde-acento, #28CC43);
    font-size: 1.25rem;
    margin-bottom: 15px;
    font-weight: 800;
}

.legal-clause h4 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 700;
}

[data-theme="light"] .legal-clause h4 {
    color: #000957;
}

.legal-clause p {
    color: var(--color-texto-claro, #ffffff);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 15px;
    text-align: justify;
}

[data-theme="light"] .legal-clause p {
    color: #000957;
}

/* Listas */
.legal-clause ul {
    list-style-type: disc;
    padding-left: 20px;
    margin-bottom: 20px;
}

.legal-clause li {
    color: var(--color-texto-claro, #ffffff);
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 8px;
    padding-left: 5px;
}

[data-theme="light"] .legal-clause li {
    color: #000957;
}

.legal-clause strong {
    color: #ffffff;
    font-weight: 700;
}

[data-theme="light"] .legal-clause strong {
    color: #000957;
}

/* Enlaces dentro del texto legal */
.legal-link {
    color: var(--color-verde-acento, #28CC43);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-link:hover {
    text-decoration: underline;
}

/* ==========================================================================
 * 2. BOTÓN DE RETORNO
 * ========================================================================== */
.btn-return {
    display: inline-block;
    margin-top: 40px;
    border: 2px solid var(--color-verde-acento, #28CC43);
    padding: 12px 35px;
    font-weight: 700;
    color: var(--color-verde-acento, #28CC43);
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-return:hover {
    background-color: var(--color-verde-acento, #28CC43);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(40, 204, 67, 0.4);
}

/* ==========================================================================
 * 3. DISEÑO RESPONSIVO (Móviles y Tablets)
 * ========================================================================== */
@media (max-width: 768px) {
    .legal-section {
        padding: 40px 15px;
    }

    .legal-box {
        padding: 30px 20px;
    }

    .main-legal-title {
        font-size: 2rem;
    }

    /* MODIFICACIÓN: Texto introductorio ahora justificado y con guiones automáticos */
    .legal-intro-text {
        font-size: 0.9rem;
        text-align: justify;
        -webkit-hyphens: auto;
        -moz-hyphens: auto;
        -ms-hyphens: auto;
        hyphens: auto;
        word-break: break-word;
        margin-bottom: 30px;
    }

    .legal-clause h3 {
        font-size: 1.15rem;
    }

    /* MODIFICACIÓN: Cláusulas, párrafos y listas justificadas con soporte de guiones en móvil */
    .legal-clause p, .legal-clause li {
        font-size: 0.95rem;
        text-align: justify;
        -webkit-hyphens: auto;
        -moz-hyphens: auto;
        -ms-hyphens: auto;
        hyphens: auto;
        word-break: break-word;
    }
}
