/* ============================================
   Theme Toggle Switch
   ============================================ */

.fca-theme-toggle {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

/* Fix shortcode wrapper for theme toggle */
.fca-theme-toggle,
p:has(.fca-theme-toggle) {
	margin: 0;
	line-height: 1;
}

.fca-theme-toggle-btn {
	position: relative;
	width: 48px;
	height: 26px;
	min-width: 48px;
	min-height: 26px;
	background: var(--fca-bg-secondary);
	border: 1px solid var(--fca-border-color);
	border-radius: var(--fca-radius-pill);
	cursor: pointer;
	transition: all 0.3s ease;
	padding: 0;
}

.fca-theme-toggle-btn:hover {
	border-color: var(--fca-text-secondary);
}

.fca-theme-toggle-btn:focus-visible {
	outline: 2px solid var(--fca-text-primary);
	outline-offset: 2px;
}

.fca-theme-toggle-btn::before {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 20px;
	height: 20px;
	background: var(--fca-text-primary);
	border-radius: var(--fca-radius-circle);
	transition: transform 0.3s ease;
}

[data-theme="dark"] .fca-theme-toggle-btn::before {
	transform: translateX(22px);
}

.fca-theme-toggle-icon {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 14px;
	height: 14px;
	transition: opacity 0.3s ease;
}

.fca-theme-toggle-icon--sun {
	left: 5px;
	opacity: 1;
	color: #f59e0b;
}

.fca-theme-toggle-icon--moon {
	right: 5px;
	opacity: 0.4;
	color: var(--fca-text-secondary);
}

[data-theme="dark"] .fca-theme-toggle-icon--sun {
	opacity: 0.4;
}

[data-theme="dark"] .fca-theme-toggle-icon--moon {
	opacity: 1;
	color: #fbbf24;
}

/* ============================================
   Legacy Visual Composer Alert Boxes
   ============================================ */

.fca-vc-row {
	margin-bottom: 1.5rem;
}

.fca-alert {
	padding: 1rem 1.25rem;
	border-radius: var(--fca-radius-md);
	margin-bottom: 1.5rem;
	border-left: 4px solid;
}

.fca-alert-title {
	font-weight: 600;
}

.fca-alert-info {
	background-color: var(--fca-alert-info-bg);
	border-color: var(--fca-alert-info-border);
	color: var(--fca-alert-info-text);
}

.fca-alert-success {
	background-color: var(--fca-alert-success-bg);
	border-color: var(--fca-alert-success-border);
	color: var(--fca-alert-success-text);
}

.fca-alert-warning {
	background-color: var(--fca-alert-warning-bg);
	border-color: var(--fca-alert-warning-border);
	color: var(--fca-alert-warning-text);
}

.fca-alert-danger {
	background-color: var(--fca-alert-danger-bg);
	border-color: var(--fca-alert-danger-border);
	color: var(--fca-alert-danger-text);
}

/* ============================================
   Inline Code Styles
   ============================================ */

tt,
code:not([class*="language-"]):not(.prism-processed) {
	background-color: var(--fca-inline-code-bg);
	color: var(--fca-inline-code-text);
	padding: 0.125rem 0.375rem;
	border-radius: var(--fca-radius-xs);
	font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	font-size: 0.875em;
}

/* ============================================
   Edit Post Link
   ============================================ */

.fca-edit-link {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	padding: 0.25rem 0.75rem;
	background-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
	border-radius: var(--fca-radius-pill);
	transition: background-color 0.2s ease;
}

.fca-edit-link:hover {
	background-color: var(--wp--preset--color--contrast-2);
	color: var(--wp--preset--color--base);
}

[data-theme="dark"] .fca-edit-link {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

[data-theme="dark"] .fca-edit-link:hover {
	background-color: var(--wp--preset--color--base-2);
	color: var(--wp--preset--color--contrast);
}

/* ============================================
   Header Search
   ============================================ */

.fca-header-search {
	max-width: 220px;
	transition: max-width 0.3s ease;
}

.fca-header-search:focus-within {
	max-width: 300px;
}

.fca-header-search .wp-block-search__inside-wrapper {
	background: var(--wp--preset--color--base);
	border-radius: var(--fca-radius-pill);
	padding: 0 0.25rem 0 1rem;
	height: 40px;
}

.fca-header-search .wp-block-search__input {
	border: none;
	background: transparent;
	padding: 0;
	height: 100%;
	font-size: var(--wp--preset--font-size--small);
}

.fca-header-search .wp-block-search__input:focus {
	outline: none;
	box-shadow: none;
}

.fca-header-search .wp-block-search__button {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border: none;
	border-radius: var(--fca-radius-circle);
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}

.fca-header-search .wp-block-search__button:hover {
	background: var(--wp--preset--color--contrast-2);
}

.fca-header-search .wp-block-search__button svg {
	width: 16px;
	height: 16px;
}

/* ============================================
   Mobile Search Modal
   ============================================ */

/* Toggle button - hidden on desktop */
.fca-mobile-search-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: var(--fca-radius-circle);
	color: var(--wp--preset--color--contrast);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.fca-mobile-search-toggle:hover {
	background: var(--wp--preset--color--base-2);
}

/* Show toggle on mobile, hide regular search */
@media (max-width: 640px) {
	.fca-header-search {
		display: none !important;
	}

	.fca-mobile-search-toggle {
		display: flex;
	}
}

/* Modal overlay and container */
.fca-search-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 15vh;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.fca-search-modal.is-open {
	opacity: 1;
	visibility: visible;
}

.fca-search-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	backdrop-filter: blur(4px);
}

.fca-search-modal-content {
	position: relative;
	width: 90%;
	max-width: 500px;
	transform: translateY(-20px);
	transition: transform 0.3s ease;
}

.fca-search-modal.is-open .fca-search-modal-content {
	transform: translateY(0);
}

/* Close button */
.fca-search-modal-close {
	position: absolute;
	top: -60px;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	background: transparent;
	border: none;
	color: #ffffff;
	cursor: pointer;
	opacity: 0.7;
	transition: opacity 0.2s ease;
}

.fca-search-modal-close:hover {
	opacity: 1;
}

/* Search form */
.fca-search-modal-form {
	display: flex;
	align-items: center;
	background: var(--wp--preset--color--base);
	border-radius: var(--fca-radius-pill);
	padding: 0.5rem 0.5rem 0.5rem 1.5rem;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.fca-search-modal-input {
	flex: 1;
	height: 48px;
	padding: 0;
	background: transparent;
	border: none;
	font-size: 1.125rem;
	color: var(--wp--preset--color--contrast);
	outline: none;
}

.fca-search-modal-input::placeholder {
	color: var(--wp--preset--color--contrast-2);
}

.fca-search-modal-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	background: var(--wp--preset--color--contrast);
	border: none;
	border-radius: var(--fca-radius-circle);
	color: var(--wp--preset--color--base);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.fca-search-modal-submit:hover {
	background: var(--wp--preset--color--contrast-2);
}

/* Dark mode */
[data-theme="dark"] .fca-search-modal-form {
	background: var(--fca-bg-secondary);
}

[data-theme="dark"] .fca-search-modal-input {
	color: var(--fca-text-primary);
}

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

[data-theme="dark"] .fca-search-modal-submit {
	background: var(--fca-text-primary);
	color: var(--fca-bg-primary);
}

/* ============================================
   Focus States - Accessibility
   ============================================ */

/* Focus visible for all interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--fca-text-primary);
	outline-offset: 2px;
}

/* Remove focus outline for mouse users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible),
select:focus:not(:focus-visible),
[tabindex]:focus:not(:focus-visible) {
	outline: none;
}

/* ============================================
   Touch Target Improvements - Mobile
   ============================================ */

/* Category pills minimum touch target */
.wp-block-post-terms a,
.wp-block-categories a,
.fca-category-pill a {
	min-height: 44px;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.5rem 1rem;
}

/* Login/user button minimum touch target */
.fca-login-link,
.fca-user-dropdown-toggle {
	min-height: 44px;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ============================================
   Category Pills Navigation
   ============================================ */

.fca-category-pills,
.wp-block-fca-category-pills {
	margin-bottom: var(--wp--preset--spacing--50);
	border: none !important;
	outline: none !important;
	background: transparent !important;
	box-shadow: none !important;
}

.fca-category-pills-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fca-space-sm);
	list-style: none;
	margin: 0;
	padding: 0;
	border: none !important;
	outline: none !important;
	background: transparent !important;
}

.fca-category-pill-item {
	margin: 0;
}

/* Individual pill links in category navigation */
.fca-category-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	padding: 0.5rem 1rem;
	background: transparent;
	border: 1px solid var(--wp--preset--color--contrast-3);
	border-radius: var(--fca-radius-pill);
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.fca-category-pill:hover {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.fca-category-pill.is-active {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	font-weight: 600;
}

/* Post terms container with fca-category-pill class (single post) */
.wp-block-post-terms.fca-category-pill {
	display: flex;
	flex-wrap: wrap;
	gap: var(--fca-space-sm);
	border: none;
	background: transparent;
	padding: 0;
}

.wp-block-post-terms.fca-category-pill a {
	display: inline-flex;
	align-items: center;
	padding: 0.5rem 1rem;
	background: transparent;
	border: 1px solid var(--wp--preset--color--contrast-3);
	border-radius: var(--fca-radius-pill);
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	text-decoration: none;
	transition: all 0.2s ease;
	white-space: nowrap;
}

.wp-block-post-terms.fca-category-pill a:hover {
	background: var(--wp--preset--color--contrast);
	border-color: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.fca-category-pill-count {
	font-size: 0.6875rem;
	opacity: 0.7;
}

/* Dark mode */
[data-theme="dark"] .fca-category-pill {
	border-color: var(--fca-border-color);
	color: var(--fca-text-secondary);
}

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

[data-theme="dark"] .fca-category-pill.is-active {
	background: var(--fca-text-primary);
	border-color: var(--fca-text-primary);
	color: var(--fca-bg-primary);
}

/* Mobile: horizontal scroll */
@media (max-width: 640px) {
	.fca-category-pills-list {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		padding-bottom: 0.5rem;
	}

	.fca-category-pills-list::-webkit-scrollbar {
		display: none;
	}

	.fca-category-pill {
		flex-shrink: 0;
	}
}
