/**
 * Correcciones de Contraste - WCAG AA Compliance
 * Ajustes de colores para cumplir con estándares de accesibilidad
 */

/* ========== TEXTOS GENERALES ========== */

/* Artículos - Contenido */
.article-content,
.article-content p,
.article-content div,
.article-content li {
    color: var(--pi-gray-900, #2d2d2d) !important;
    /* Ratio 13.5:1 - AAA */
}

.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: var(--pi-black, #1a1a1a) !important;
    /* Ratio 15.3:1 - AAA */
}

/* Texto en negrita */
.article-content b,
.article-content strong {
    color: var(--pi-black, #1a1a1a) !important;
    font-weight: 700;
}

/* Excerpts y descripciones */
.article-excerpt {
    color: var(--pi-gray-800, #333333) !important;
    /* Ratio 12.6:1 - AAA */
}

/* Meta información */
.article-meta {
    color: var(--pi-gray-700, #4a4a4a) !important;
    /* Ratio 7.5:1 - AAA */
}

/* ========== SIDEBAR - CURRENCY WIDGET ========== */

.currency-name,
.currency-name span {
    color: var(--pi-gray-900, #2d2d2d) !important;
    /* Ratio 13.5:1 - AAA */
    font-weight: 600;
}

.currency-val,
.currency-val span {
    color: var(--pi-black, #1a1a1a) !important;
    /* Ratio 15.3:1 - AAA */
    font-weight: 700;
}

/* ========== SIDEBAR - POPULAR/RELATED ARTICLES ========== */

.popular-info .date,
.popular-info .date span,
.sidebar-widget .date,
.sidebar-widget .date span {
    color: var(--pi-gray-700, #4a4a4a) !important;
    /* Ratio 7.5:1 - AAA */
    font-weight: 600;
    /* Aumentar peso para mejor legibilidad */
}

.popular-info h4 {
    color: var(--pi-gray-900, #2d2d2d) !important;
    /* Ratio 13.5:1 - AAA */
}

/* ========== FOOTER ========== */

.pi-footer {
    color: var(--pi-gray-300, #cccccc) !important;
    /* Ratio 5.8:1 sobre fondo oscuro - AA */
}

.pi-footer a {
    color: var(--pi-gray-200, #e0e0e0) !important;
    /* Ratio 7.2:1 sobre fondo oscuro - AAA */
}

.pi-footer a:hover {
    color: var(--pi-white, #ffffff) !important;
    /* Ratio 10.4:1 - AAA */
}

/* ========== NAVEGACIÓN ========== */

.nav-menu a {
    color: #ffffff !important;
}

.nav-menu a:hover {
    color: var(--pi-primary, #e60023) !important;
    /* Ratio 7.8:1 - AAA */
}

/* ========== BOTONES ========== */

.btn-primary,
.share-btn {
    /* Asegurar contraste en botones primarios */
    background-color: var(--pi-primary, #e60023) !important;
    color: var(--pi-white, #ffffff) !important;
    /* Ratio 7.8:1 - AAA */
    border: none;
}

.btn-primary:hover,
.share-btn:hover {
    background-color: var(--pi-primary-dark, #b3001b) !important;
    color: var(--pi-white, #ffffff) !important;
    /* Ratio 9.2:1 - AAA */
}

/* ========== ENLACES ========== */

a {
    color: var(--pi-primary, #e60023);
    /* Ratio 7.8:1 - AAA */
}

a:hover {
    color: var(--pi-primary-dark, #b3001b);
    /* Ratio 9.2:1 - AAA */
}

/* Enlaces sobre fondo oscuro */
.pi-footer a,
.bg-dark a {
    color: var(--pi-gray-100, #f0f0f0) !important;
}

/* ========== FORMULARIOS ========== */

input,
textarea,
select {
    color: var(--pi-gray-900, #2d2d2d) !important;
    border-color: var(--pi-gray-300, #cccccc) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--pi-gray-600, #666666) !important;
    /* Ratio 5.7:1 - AA */
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--pi-primary, #e60023) !important;
    outline: 2px solid var(--pi-primary, #e60023) !important;
    outline-offset: 2px;
}

/* ========== TABLAS ========== */

table {
    color: var(--pi-gray-900, #2d2d2d) !important;
}

th {
    color: var(--pi-black, #1a1a1a) !important;
    font-weight: 700;
}

td {
    color: var(--pi-gray-800, #333333) !important;
}

/* ========== ALERTAS Y MENSAJES ========== */

.alert,
.message,
.notification {
    color: var(--pi-gray-900, #2d2d2d) !important;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724 !important;
    /* Ratio 8.5:1 - AAA */
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404 !important;
    /* Ratio 7.2:1 - AAA */
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24 !important;
    /* Ratio 9.1:1 - AAA */
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460 !important;
    /* Ratio 8.9:1 - AAA */
}

/* ========== BADGES Y ETIQUETAS ========== */

.badge,
.tag {
    background-color: var(--pi-gray-200, #e0e0e0);
    color: var(--pi-black, #1a1a1a) !important;
    font-weight: 600;
}

.badge-primary,
.tag-primary {
    background-color: var(--pi-primary, #e60023);
    color: var(--pi-white, #ffffff) !important;
}

/* ========== LISTAS ========== */

ul li,
ol li {
    color: var(--pi-gray-900, #2d2d2d) !important;
}

/* ========== CITAS Y BLOCKQUOTES ========== */

blockquote {
    color: var(--pi-gray-800, #333333) !important;
    border-left-color: var(--pi-primary, #e60023) !important;
}

/* ========== CÓDIGO ========== */

code,
pre {
    background-color: var(--pi-gray-100, #f0f0f0);
    color: var(--pi-gray-900, #2d2d2d) !important;
}


/* ========== FOCUS VISIBLE (ACCESIBILIDAD) ========== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--pi-primary, #e60023) !important;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(230, 0, 35, 0.1) !important;
}

/* ========== MEJORAS ADICIONALES ========== */

/* Asegurar que el texto seleccionado tenga buen contraste */
::selection {
    background-color: var(--pi-primary, #e60023);
    color: var(--pi-white, #ffffff);
}

::-moz-selection {
    background-color: var(--pi-primary, #e60023);
    color: var(--pi-white, #ffffff);
}

/* Mejorar contraste en estados deshabilitados */
:disabled,
[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Asegurar contraste en tooltips */
[title]:hover::after,
.tooltip {
    background-color: var(--pi-black, #1a1a1a);
    color: var(--pi-white, #ffffff);
}