/**
 * A Peculiar Existence integration for Charlotte.
 *
 * Keep this file limited to requirements that cannot be met through supported
 * WordPress, Kadence, or Charlotte configuration.
 */

:root {
	--ape-accessible-rose: #925c4c;
	--ape-accessible-error: #a33a3a;
}

/* Preserve Charlotte's H4/H5 presentation after neutralizing decorative labels. */
.ape-presentational-label {
	color: var(--global-palette4);
	font-family: Montserrat, sans-serif;
	font-size: 18px;
	font-style: normal;
	font-weight: 500;
	letter-spacing: 0.18em;
	line-height: 1.7;
	text-transform: uppercase;
}

.ape-presentational-cta {
	color: var(--global-palette4);
	font-family: var(--global-heading-font-family);
	font-size: 32px;
	font-style: normal;
	font-weight: 400;
	letter-spacing: 0.03em;
	line-height: 1.25;
}

.skip-link:focus,
#main .has-theme-palette-2-color,
#main .kt-tab-title-active > .kt-tab-title,
.single-post #main .entry-taxonomies a,
.single-post #main .entry-meta a,
.single-post #main .single-content a:not(.kb-button),
.single-post #main .entry-tags a,
body.archive #main .entry-title a,
body.archive #main .entry-taxonomies a,
body.archive #main .entry-meta a,
body.search #main .entry-title a,
body.search #main .entry-taxonomies a,
body.search #main .entry-meta a,
#main .ape-recovery-links a,
.page-id-3 #main a {
	color: var(--ape-accessible-rose) !important;
}

#main .kb-btn7961_14359f-5c,
#main .kb-btn764_b2e73a-be {
	background: var(--ape-accessible-rose) !important;
	color: #ffffff !important;
}

#main input::placeholder,
#main textarea::placeholder {
	color: var(--ape-accessible-rose);
	opacity: 1;
}

.skip-link:focus-visible,
#main a:focus-visible,
#main button:focus-visible,
#main input:focus-visible,
#main select:focus-visible,
#main textarea:focus-visible {
	outline: 3px solid #222222 !important;
	outline-offset: 3px;
	box-shadow: 0 0 0 2px #ffffff, 0 0 0 5px #222222 !important;
}

.ape-contact-form .ff-btn-submit:focus-visible {
	color: #222222 !important;
	opacity: 1 !important;
}

.ape-contact-form .error.text-danger {
	color: var(--ape-accessible-error) !important;
}

.ape-contact-form .ff-el-is-error .ff-el-form-control {
	border-color: var(--ape-accessible-error) !important;
}

.search-modal-content .ape-search-form-title {
	margin: 0;
	padding: 0 0 30px;
	color: var(--global-palette3, #222222);
	font-family: "Butler Light", "Times New Roman", Times, serif;
	font-size: 32px;
	font-weight: 400;
	letter-spacing: 0.96px;
	line-height: 40px;
}

#offscreen-toggle,
.ape-charlotte-offscreen-close,
#mobile-header .menu-toggle-open,
#mobile-header .search-toggle-open,
#mobile-drawer .menu-toggle-close,
#search-drawer .drawer-toggle {
	min-width: 44px;
	min-height: 44px;
}

#offscreen-toggle:focus-visible,
.ape-charlotte-offscreen-close:focus-visible,
#charlotte-offscreen-widget-area a:focus-visible {
	outline: 2px solid var(--global-palette4, #222222);
	outline-offset: 3px;
}

.ape-charlotte-offscreen-close {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 0 1rem auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--global-palette4, #222222);
	font-family: inherit;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.ape-charlotte-offscreen-close:hover {
	background: transparent;
	color: var(--global-palette2, #d6b3a7);
}

@media (max-width: 1024px) {
	#mobile-header .site-title {
		line-height: 1.08;
	}
}

@media (prefers-reduced-motion: reduce) {
	#charlotte-offscreen-widget-area {
		transition-duration: 0.01ms;
	}
}

.ape-contact-form .ff-message-success {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

/* Preserve the native biography while keeping the single-Post footer local. */
.single-post .entry-author-profile {
	padding-left: 0;
}

.single-post .entry-author-avatar {
	display: none;
}

/* Charlotte hides native Post tags; the APE article contract retains them. */
.single-post .entry-tags {
	display: block;
}

/* Invalid Page-author metadata must not create unnamed, zero-size tab stops in Search. */
body.search #archive-container .entry-meta a.url.fn.n:empty {
	display: none;
}

/* Charlotte's overlap assumes a featured image; remove it when none exists. */
.single-post .single-entry:not(.has-post-thumbnail) .entry-header {
	margin-top: 0;
	margin-bottom: 1rem;
}

/* Keep normal long-form content readable while preserving native wide breakouts. */
@media (min-width: 769px) {
	.single-post .single-entry .entry-content.single-content > :not(.alignwide):not(.alignfull),
	.single-post .single-entry .entry-footer,
	.single-post .entry-author-profile {
		max-width: 720px;
		margin-left: auto;
		margin-right: auto;
	}
}

@media (max-width: 430px) {
	body.archive #archive-container.kadence-posts-list.grid-cols {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}
