/**
 * Estilos para Texto con Leer Más - SEO Friendly
 * Version: 2.0.0
 */

/* ===== VERSIÓN CSS-ONLY (RECOMENDADA) ===== */
.contenedor-leer-mas.contenedor-css {
    margin: 20px 0;
    position: relative;
}

.contenedor-css .texto-contenido {
    position: relative;
}

.contenedor-css .texto-resumen {
    display: block;
}

.contenedor-css .texto-completo {
    display: none; /* Oculto inicialmente */
}

/* Checkbox oculto */
.leer-mas-checkbox {
    display: none;
}

/* Estado expandido */
.leer-mas-checkbox:checked ~ .texto-contenido .texto-resumen {
    display: none;
}

.leer-mas-checkbox:checked ~ .texto-contenido .texto-completo {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Botón CSS-only */
.boton-leer-mas-css {
    background: #2271b1;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-block;
    margin-top: 10px;
    border: none;
    font-size: 14px;
    transition: background 0.3s ease;
}

.boton-leer-mas-css:hover {
    background: #135e96;
}

/* Textos del botón */
.texto-cerrar {
    display: none;
}

.leer-mas-checkbox:checked ~ .boton-leer-mas-css .texto-abrir {
    display: none;
}

.leer-mas-checkbox:checked ~ .boton-leer-mas-css .texto-cerrar {
    display: inline;
}

.leer-mas-checkbox:checked ~ .boton-leer-mas-css {
    background: #d63638;
}

.leer-mas-checkbox:checked ~ .boton-leer-mas-css:hover {
    background: #b32d2e;
}

/* ===== VERSIÓN JAVASCRIPT (ALTERNATIVA) ===== */
.contenedor-js {
    margin: 20px 0;
    border-left: 3px solid #2271b1;
    padding-left: 15px;
}

.contenedor-js .texto-completo {
    display: none;
}

.contenedor-js .texto-completo.visible {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.boton-leer-mas-js {
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 10px;
    font-size: 14px;
    transition: background 0.3s ease;
}

.boton-leer-mas-js:hover {
    background: #135e96;
}

.boton-leer-mas-js.activo {
    background: #d63638;
}

.boton-leer-mas-js.activo:hover {
    background: #b32d2e;
}

/* ===== ESTILOS COMUNES ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.texto-resumen, .texto-completo {
    line-height: 1.6;
    font-size: 16px;
    color: #333;
}

.texto-leer-mas-completo {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.texto-leer-mas-error {
    color: #d63638;
    padding: 10px;
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .contenedor-leer-mas {
        margin: 15px 0;
    }
    
    .boton-leer-mas-css,
    .boton-leer-mas-js {
        width: 100%;
        text-align: center;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    .texto-completo {
        animation: none;
    }
}

.leer-mas-checkbox:focus ~ .boton-leer-mas-css,
.boton-leer-mas-js:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}