/* GodWeb - Card Text Contrast Fix (Enhanced)
 * Ensures card text is readable in BOTH dark and light modes.
 * Aligned with enhanced Xianxia palette.
 * Loads last for specificity.
 * ---------------------------------------------------------------- */

/* ================================================================
 * Dark mode (default) - warm gold headings, warm cream text
 * ================================================================ */
.card h3, .card h4, .card-title,
.feature-card h3, .post-card h3, .product-card h3 {
    color: var(--amber-100, #e8e4d9);
}

.card p, .card-body p, .card-text,
.feature-card p, .post-card p, .product-card p {
    color: var(--text-color, #e8e4d9);
}

.card-meta, .card-meta span {
    color: var(--text-light, #9ca3af);
}

.section-title p, .page-header p {
    color: var(--text-light, #9ca3af);
}

.empty-state h3 { color: var(--amber-100, #e8e4d9); }
.empty-state p { color: var(--text-light, #9ca3af); }

.comment p, .comment-author { color: var(--text-color, #e8e4d9); }

.post-content, .post-content p, .post-content li { color: var(--text-color, #e8e4d9); }
.post-content h2, .post-content h3, .post-content h4 { color: var(--amber-100, #e8e4d9); }

.premium-card-title { color: var(--amber-100, #e8e4d9); }
.premium-card-text { color: var(--text-color, #e8e4d9); }

.card-price, .card-price span { color: var(--amber-400, #fbbf24); }
.stock-badge.in-stock { color: #4ade80; }
.stock-badge.out-of-stock { color: #ef4444; }

/* ================================================================
 * Light mode overrides
 * ================================================================ */
body.light-mode .card h3, body.light-mode .card h4, body.light-mode .card-title,
body.light-mode .feature-card h3, body.light-mode .post-card h3, body.light-mode .product-card h3 {
    color: #1e293b;
}

body.light-mode .card p, body.light-mode .card-body p, body.light-mode .card-text,
body.light-mode .feature-card p, body.light-mode .post-card p, body.light-mode .product-card p {
    color: #475569;
}

body.light-mode .card-meta, body.light-mode .card-meta span {
    color: #64748b;
}

body.light-mode .section-title p, body.light-mode .page-header p {
    color: #64748b;
}

body.light-mode .empty-state h3 { color: #1e293b; }
body.light-mode .empty-state p { color: #64748b; }

body.light-mode .comment p { color: #475569; }
body.light-mode .comment-author { color: #1e293b; }

body.light-mode .post-content, body.light-mode .post-content p, body.light-mode .post-content li { color: #475569; }
body.light-mode .post-content h2, body.light-mode .post-content h3, body.light-mode .post-content h4 { color: #1e293b; }

body.light-mode .premium-card-title { color: #1e293b; }
body.light-mode .premium-card-text { color: #475569; }

body.light-mode .card-price, body.light-mode .card-price span { color: #c08b00; }
body.light-mode .stock-badge.in-stock { color: #16a34a; }
body.light-mode .stock-badge.out-of-stock { color: #dc2626; }

/* ================================================================
 * Additional dark-on-dark fixes: elements in style.css that hard-code
 * color: var(--dark-color) which resolves to near-black under the
 * xianxia dark palette, leaving them invisible on dark surfaces.
 * Loads last, so these override style.css without touching it.
 * ================================================================ */

/* Dark theme overrides */
.notification-menu-header,
.notification-menu-header strong {
    color: var(--amber-100, #e8e4d9);
    background: transparent;
}

/* `.section-title h2` is intentionally NOT restyled here.
 * xianxia-theme.css paints it with a jade/gold -webkit-background-clip
 * text gradient (color: transparent). Adding a flat color would clobber
 * the gradient and render section headings as flat amber on every page.
 * The gradient already has sufficient contrast against the dark palette,
 * and xianxia-theme-light.css supplies a parallel gradient for light
 * mode. */

.stat-card .value {
    color: var(--amber-100, #e8e4d9);
}

.table th {
    color: #e8e4d9;
}

.form-label {
    color: #e8e4d9;
}

.mobile-menu-header .brand-name {
    color: var(--amber-100, #e8e4d9);
}

.product-title {
    color: var(--amber-100, #e8e4d9);
}

/* Light-mode restorations: fall back to the legacy near-black ink. */
body.light-mode .notification-menu-header,
body.light-mode .notification-menu-header strong {
    color: #1e293b;
}

body.light-mode .stat-card .value {
    color: #1e293b;
}

body.light-mode .table th {
    color: #1e293b;
}

body.light-mode .form-label {
    color: #334155;
}

body.light-mode .mobile-menu-header .brand-name {
    color: #1e293b;
}

body.light-mode .product-title {
    color: #1e293b;
}
