/* ============================================
   Dark Mode Specific Overrides
   ============================================ */

/* Featured image fallback gradient in dark mode */
[data-theme="dark"] .wp-block-post-template.is-layout-grid .wp-block-post-featured-image {
	background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #2a2a2a 100%);
}

/* Search field in dark mode */
[data-theme="dark"] .fca-header-search .wp-block-search__inside-wrapper {
	background: var(--fca-bg-secondary);
	border-color: var(--fca-border-color);
}

[data-theme="dark"] .fca-header-search .wp-block-search__input {
	color: var(--fca-text-primary);
}

[data-theme="dark"] .fca-header-search .wp-block-search__input::placeholder {
	color: var(--fca-text-secondary);
}

/* Categories toggle in dark mode */
[data-theme="dark"] .fca-categories-toggle {
	border-color: var(--fca-border-color);
	color: var(--fca-text-primary);
}

[data-theme="dark"] .fca-categories-toggle:hover,
[data-theme="dark"] .fca-categories-toggle[aria-expanded="true"] {
	background: var(--fca-text-primary);
	color: var(--fca-bg-primary);
	border-color: var(--fca-text-primary);
}

/* Categories menu items in dark mode */
[data-theme="dark"] .fca-categories-menu a {
	color: var(--fca-text-primary);
}

[data-theme="dark"] .fca-categories-menu li:hover {
	background: var(--fca-bg-secondary);
}

[data-theme="dark"] .fca-category-count {
	background: var(--fca-bg-secondary);
	color: var(--fca-text-secondary);
}

/* Pagination in dark mode */
[data-theme="dark"] .wp-block-query-pagination a:hover {
	background: var(--fca-bg-secondary);
}

[data-theme="dark"] .wp-block-query-pagination span.page-numbers.current {
	background: var(--fca-text-primary);
	color: var(--fca-bg-primary);
}

/* Code blocks in dark mode */
[data-theme="dark"] .wp-block-code,
[data-theme="dark"] pre.wp-block-code,
[data-theme="dark"] pre[class*="language-"],
[data-theme="dark"] .wp-block-preformatted {
	background: var(--fca-code-bg);
	border-color: var(--fca-border-color);
}

/* Inline code in dark mode */
[data-theme="dark"] :not(pre) > code,
[data-theme="dark"] p code:not([class*="language-"]),
[data-theme="dark"] li code:not([class*="language-"]),
[data-theme="dark"] td code:not([class*="language-"]) {
	background: var(--fca-inline-code-bg);
	color: var(--fca-inline-code-text);
	border-color: var(--fca-border-color);
}

/* Blockquotes in dark mode */
[data-theme="dark"] .wp-block-post-content blockquote,
[data-theme="dark"] .wp-block-quote {
	border-left-color: var(--fca-text-secondary);
	color: var(--fca-text-secondary);
}

/* Tables in dark mode */
[data-theme="dark"] table,
[data-theme="dark"] th,
[data-theme="dark"] td {
	border-color: var(--fca-border-color);
}

[data-theme="dark"] th {
	background: var(--fca-bg-secondary);
}

/* Form inputs in dark mode */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
	background: var(--fca-bg-secondary);
	color: var(--fca-text-primary);
	border-color: var(--fca-border-color);
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
	color: var(--fca-text-secondary);
}

/* Links in dark mode - ensure they remain visible */
[data-theme="dark"] a {
	color: var(--fca-text-primary);
}

[data-theme="dark"] a:hover {
	color: var(--fca-text-secondary);
}

/* Post terms/categories pill in dark mode */
[data-theme="dark"] .wp-block-post-terms.is-style-pill a,
[data-theme="dark"] .is-style-fca-posts-list .wp-block-post-terms a {
	background: #2a2a2a;
	color: var(--fca-text-secondary);
}

[data-theme="dark"] .wp-block-post-terms.is-style-pill a:hover,
[data-theme="dark"] .is-style-fca-posts-list .wp-block-post-terms a:hover {
	background: var(--fca-border-color);
	color: var(--fca-text-primary);
}

/* Category filter pills in dark mode */
[data-theme="dark"] .wp-block-categories.is-style-pill a {
	border-color: var(--fca-border-color);
	color: var(--fca-text-secondary);
}

[data-theme="dark"] .wp-block-categories.is-style-pill a:hover {
	background: var(--fca-text-primary);
	color: var(--fca-bg-primary);
	border-color: var(--fca-text-primary);
}

/* Posts list border in dark mode */
[data-theme="dark"] .is-style-fca-posts-list > li,
[data-theme="dark"] .is-style-fca-posts-list > li:first-child {
	border-color: var(--fca-border-color);
}

/* Arrow circle in dark mode */
[data-theme="dark"] .fca-arrow-circle,
[data-theme="dark"] .is-style-fca-posts-list .fca-arrow-circle {
	background: var(--fca-text-primary) !important;
	color: var(--fca-bg-primary) !important;
}

/* Post cards list in dark mode */
[data-theme="dark"] .is-style-fca-posts-list-cards > li,
[data-theme="dark"] .is-style-fca-posts-list-cards > li:first-child {
	border-color: var(--fca-border-color);
}

[data-theme="dark"] .fca-post-card-category a {
	background: var(--fca-bg-secondary);
	border-color: var(--fca-border-color);
	color: var(--fca-text-secondary);
}

[data-theme="dark"] .fca-post-card-category a:hover {
	background: var(--fca-border-color);
	color: var(--fca-text-primary);
}

[data-theme="dark"] .fca-post-card-title a {
	color: var(--fca-text-primary);
}

[data-theme="dark"] .fca-post-card-title a:hover {
	color: var(--fca-text-secondary);
}

[data-theme="dark"] .fca-post-card-date,
[data-theme="dark"] .fca-post-card-separator,
[data-theme="dark"] .fca-post-card-reading-time,
[data-theme="dark"] .fca-reading-time-block {
	color: var(--fca-text-secondary);
}

[data-theme="dark"] .fca-post-card-image-wrapper:not(:has(.fca-post-card-image)) {
	background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

/* Footer border in dark mode */
[data-theme="dark"] .fca-footer {
	border-top-color: var(--fca-border-color);
}

[data-theme="dark"] .fca-footer-bottom {
	border-top-color: var(--fca-border-color);
}

/* Post terms container reset in dark mode */
[data-theme="dark"] .wp-block-post-terms.fca-category-pill {
	border: none !important;
	background: transparent !important;
}

/* Sidebar category pill in dark mode */
[data-theme="dark"] .fca-single-sidebar .wp-block-post-terms a,
[data-theme="dark"] .wp-block-post-terms.fca-category-pill a {
	background: var(--fca-text-primary) !important;
	color: var(--fca-bg-primary) !important;
	border-color: var(--fca-text-primary) !important;
}

[data-theme="dark"] .fca-single-sidebar .wp-block-post-terms a:hover,
[data-theme="dark"] .wp-block-post-terms.fca-category-pill a:hover {
	background: var(--fca-text-secondary) !important;
}

/* TOC in dark mode */
[data-theme="dark"] .fca-toc-list {
	border-left-color: var(--fca-border-color);
}

[data-theme="dark"] .fca-toc-list li.active {
	border-left-color: var(--fca-text-primary);
}

/* Author section in dark mode */
[data-theme="dark"] .fca-author-section {
	border-top-color: var(--fca-border-color);
}

/* Copy link button in dark mode */
[data-theme="dark"] .fca-copy-link:hover {
	background: var(--fca-bg-secondary);
}

/* Related posts in dark mode */
[data-theme="dark"] .fca-related-post-title a:hover {
	color: var(--fca-text-secondary);
}

/* Comments section in dark mode */
[data-theme="dark"] .fca-comments-section .comment-respond {
	border-top-color: var(--fca-border-color);
}

[data-theme="dark"] .fca-comments-section .children {
	border-left-color: var(--fca-border-color);
}

[data-theme="dark"] .fca-comments-section .wp-block-comments-pagination {
	border-top-color: var(--fca-border-color);
}

/* Images with rounded corners */
[data-theme="dark"] .wp-block-post-content .wp-block-image img {
	border: 1px solid var(--fca-border-color);
}

/* Smooth transition for all theme-switchable elements */
body,
.wp-block-group,
.wp-block-post-template,
.fca-categories-menu,
.fca-header-search .wp-block-search__inside-wrapper,
input,
textarea,
select {
	transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

