/*
 * GPDM native dark mode.
 * The selectors deliberately target shared WordPress/Astra/Elementor surfaces
 * and GPDM framework components while leaving advertisements, images and
 * branded header colours untouched.
 */

:root {
	--gpdm-dark-bg: #0d0f14;
	--gpdm-dark-surface: #151821;
	--gpdm-dark-surface-2: #1c202a;
	--gpdm-dark-surface-3: #232835;
	--gpdm-dark-text: #eef1f6;
	--gpdm-dark-muted: #aeb5c1;
	--gpdm-dark-border: #2c3240;
	--gpdm-dark-primary: #d7b5ee;
	--gpdm-dark-link: #65d5ff;
	--gpdm-dark-shadow: 0 12px 34px rgba(0, 0, 0, .24);
}

html[data-gpdm-theme="dark"] {
	color-scheme: dark;
	background: var(--gpdm-dark-bg);
}

html[data-gpdm-theme="dark"] body,
html[data-gpdm-theme="dark"] #page,
html[data-gpdm-theme="dark"] .site,
html[data-gpdm-theme="dark"] .site-content,
html[data-gpdm-theme="dark"] .ast-separate-container,
html[data-gpdm-theme="dark"] .ast-plain-container,
html[data-gpdm-theme="dark"] .elementor-location-single,
html[data-gpdm-theme="dark"] .elementor-location-archive,
html[data-gpdm-theme="dark"] .elementor-location-footer {
	background-color: var(--gpdm-dark-bg) !important;
	color: var(--gpdm-dark-text);
}

html[data-gpdm-theme="dark"] main,
html[data-gpdm-theme="dark"] article,
html[data-gpdm-theme="dark"] .entry-content,
html[data-gpdm-theme="dark"] .entry-content p,
html[data-gpdm-theme="dark"] .entry-content li,
html[data-gpdm-theme="dark"] .entry-meta,
html[data-gpdm-theme="dark"] .entry-summary {
	color: var(--gpdm-dark-text);
}

html[data-gpdm-theme="dark"] .entry-content h1,
html[data-gpdm-theme="dark"] .entry-content h2,
html[data-gpdm-theme="dark"] .entry-content h3,
html[data-gpdm-theme="dark"] .entry-content h4,
html[data-gpdm-theme="dark"] .entry-content h5,
html[data-gpdm-theme="dark"] .entry-content h6,
html[data-gpdm-theme="dark"] .entry-title,
html[data-gpdm-theme="dark"] .page-title,
html[data-gpdm-theme="dark"] .elementor-heading-title {
	color: var(--gpdm-dark-text);
}

html[data-gpdm-theme="dark"] main a:not(.button):not(.elementor-button):not(.gpdm-house-ad),
html[data-gpdm-theme="dark"] .entry-content a:not(.button):not(.elementor-button) {
	color: var(--gpdm-dark-link);
}

html[data-gpdm-theme="dark"] hr,
html[data-gpdm-theme="dark"] table,
html[data-gpdm-theme="dark"] th,
html[data-gpdm-theme="dark"] td,
html[data-gpdm-theme="dark"] blockquote {
	border-color: var(--gpdm-dark-border);
}

html[data-gpdm-theme="dark"] input:not([type="submit"]):not([type="button"]),
html[data-gpdm-theme="dark"] select,
html[data-gpdm-theme="dark"] textarea {
	border-color: var(--gpdm-dark-border) !important;
	background-color: var(--gpdm-dark-surface-2) !important;
	color: var(--gpdm-dark-text) !important;
}

html[data-gpdm-theme="dark"] input::placeholder,
html[data-gpdm-theme="dark"] textarea::placeholder {
	color: #87909e;
}

/* Astra navigation drawers and dropdowns. */
html[data-gpdm-theme="dark"] .ast-mobile-popup-drawer .ast-mobile-popup-inner,
html[data-gpdm-theme="dark"] .ast-mobile-popup-content,
html[data-gpdm-theme="dark"] .main-header-menu .sub-menu,
html[data-gpdm-theme="dark"] .ast-desktop .main-header-menu .sub-menu {
	background: var(--gpdm-dark-surface) !important;
	color: var(--gpdm-dark-text) !important;
}

html[data-gpdm-theme="dark"] .ast-mobile-popup-content a,
html[data-gpdm-theme="dark"] .main-header-menu .sub-menu a {
	color: var(--gpdm-dark-text) !important;
}

/* Unified article system. */
html[data-gpdm-theme="dark"] .gpdm-unified-page,
html[data-gpdm-theme="dark"] #gpdm-unified-primary,
html[data-gpdm-theme="dark"] .gpdm-unified-article,
html[data-gpdm-theme="dark"] .gpdm-article-shell,
html[data-gpdm-theme="dark"] .gpdm-article-main {
	background: var(--gpdm-dark-bg) !important;
	color: var(--gpdm-dark-text);
}

html[data-gpdm-theme="dark"] .gpdm-breadcrumbs,
html[data-gpdm-theme="dark"] .gpdm-breadcrumbs a,
html[data-gpdm-theme="dark"] .gpdm-article-meta,
html[data-gpdm-theme="dark"] .gpdm-author-link,
html[data-gpdm-theme="dark"] .gpdm-share-toggle,
html[data-gpdm-theme="dark"] .gpdm-comment-jump {
	color: var(--gpdm-dark-muted);
}

html[data-gpdm-theme="dark"] .gpdm-article-title,
html[data-gpdm-theme="dark"] .gpdm-similar-heading h2,
html[data-gpdm-theme="dark"] .gpdm-reply-title,
html[data-gpdm-theme="dark"] .comments-title {
	color: var(--gpdm-dark-primary) !important;
}

html[data-gpdm-theme="dark"] .gpdm-article-excerpt,
html[data-gpdm-theme="dark"] .gpdm-article-content,
html[data-gpdm-theme="dark"] .gpdm-article-content p,
html[data-gpdm-theme="dark"] .gpdm-article-content li,
html[data-gpdm-theme="dark"] .gpdm-comment-note,
html[data-gpdm-theme="dark"] .comment-metadata,
html[data-gpdm-theme="dark"] .gpdm-article-end {
	color: var(--gpdm-dark-muted) !important;
}

html[data-gpdm-theme="dark"] .gpdm-article-content h1,
html[data-gpdm-theme="dark"] .gpdm-article-content h2,
html[data-gpdm-theme="dark"] .gpdm-article-content h3,
html[data-gpdm-theme="dark"] .gpdm-article-content h4,
html[data-gpdm-theme="dark"] .gpdm-article-content h5,
html[data-gpdm-theme="dark"] .gpdm-article-content h6 {
	color: var(--gpdm-dark-text) !important;
}

html[data-gpdm-theme="dark"] .gpdm-share-menu,
html[data-gpdm-theme="dark"] .gpdm-comments-section,
html[data-gpdm-theme="dark"] .gpdm-native-comment-box,
html[data-gpdm-theme="dark"] .gpdm-comment-list .comment-body,
html[data-gpdm-theme="dark"] .gpdm-similar-stories,
html[data-gpdm-theme="dark"] .gpdm-similar-card {
	border-color: var(--gpdm-dark-border) !important;
	background: var(--gpdm-dark-surface) !important;
	color: var(--gpdm-dark-text) !important;
	box-shadow: var(--gpdm-dark-shadow);
}

html[data-gpdm-theme="dark"] .gpdm-share-menu a,
html[data-gpdm-theme="dark"] .gpdm-similar-card,
html[data-gpdm-theme="dark"] .gpdm-similar-card h3 a,
html[data-gpdm-theme="dark"] .gpdm-similar-card strong {
	color: var(--gpdm-dark-text) !important;
}

html[data-gpdm-theme="dark"] .gpdm-share-menu a:hover,
html[data-gpdm-theme="dark"] .gpdm-share-menu a:focus {
	background: var(--gpdm-dark-surface-3);
}

html[data-gpdm-theme="dark"] .gpdm-similar-card time,
html[data-gpdm-theme="dark"] .gpdm-similar-heading span {
	color: var(--gpdm-dark-muted);
}

html[data-gpdm-theme="dark"] .gpdm-action-row {
	border-color: var(--gpdm-dark-border);
}

html[data-gpdm-theme="dark"] .gpdm-article-end span {
	background-color: var(--gpdm-dark-border);
}

/* Keep advertising creative surfaces neutral and readable. */
html[data-gpdm-theme="dark"] .gpdm-ad-stage,
html[data-gpdm-theme="dark"] .gpdm-ad-sidebar,
html[data-gpdm-theme="dark"] .gpdm-sidebar-ad-stage,
html[data-gpdm-theme="dark"] .gpdm-sticky-ad-panel,
html[data-gpdm-theme="dark"] .gpdm-mgid-slot {
	border-color: var(--gpdm-dark-border) !important;
	background: #171a22 !important;
}

html[data-gpdm-theme="dark"] .itm-native-ad-slide,
html[data-gpdm-theme="dark"] .itm-native-ad,
html[data-gpdm-theme="dark"] .gpdm-sidebar-custom-ad {
	background: #fff !important;
	color: #222 !important;
}

/* Archive system. */
html[data-gpdm-theme="dark"] .gpdm-archive-page,
html[data-gpdm-theme="dark"] #gpdm-archive-primary {
	--gpdm-archive-text: var(--gpdm-dark-text);
	background: var(--gpdm-dark-bg) !important;
	color: var(--gpdm-dark-text);
}

html[data-gpdm-theme="dark"] .gpdm-archive-header,
html[data-gpdm-theme="dark"] .gpdm-archive-card,
html[data-gpdm-theme="dark"] .gpdm-archive-ad,
html[data-gpdm-theme="dark"] .gpdm-archive-empty {
	border-color: var(--gpdm-dark-border) !important;
	background: var(--gpdm-dark-surface) !important;
	color: var(--gpdm-dark-text) !important;
	box-shadow: var(--gpdm-dark-shadow);
}

html[data-gpdm-theme="dark"] .gpdm-archive-heading-copy h1,
html[data-gpdm-theme="dark"] .gpdm-author-profile-copy h1,
html[data-gpdm-theme="dark"] .gpdm-archive-card-title,
html[data-gpdm-theme="dark"] .gpdm-archive-card-title a,
html[data-gpdm-theme="dark"] .gpdm-author-website {
	color: var(--gpdm-dark-primary) !important;
}

html[data-gpdm-theme="dark"] .gpdm-archive-breadcrumbs,
html[data-gpdm-theme="dark"] .gpdm-archive-description,
html[data-gpdm-theme="dark"] .gpdm-author-profile-copy p,
html[data-gpdm-theme="dark"] .gpdm-archive-result-count,
html[data-gpdm-theme="dark"] .gpdm-archive-card-excerpt,
html[data-gpdm-theme="dark"] .gpdm-archive-card-meta {
	color: var(--gpdm-dark-muted) !important;
}

html[data-gpdm-theme="dark"] .gpdm-archive-tools {
	border-color: var(--gpdm-dark-border);
}

html[data-gpdm-theme="dark"] .gpdm-archive-view-switcher {
	border-color: var(--gpdm-dark-border);
	background: var(--gpdm-dark-surface-2);
}

html[data-gpdm-theme="dark"] .gpdm-view-button {
	color: var(--gpdm-dark-muted);
}

html[data-gpdm-theme="dark"] .gpdm-view-button.is-active {
	background: var(--gpdm-dark-surface-3);
	color: var(--gpdm-dark-text);
	box-shadow: none;
}

html[data-gpdm-theme="dark"] .gpdm-archive-card-placeholder,
html[data-gpdm-theme="dark"] .gpdm-archive-card-image {
	background: var(--gpdm-dark-surface-2);
}

/* Search app already uses variables; include the native body class and page. */
html[data-gpdm-theme="dark"] body,
html[data-gpdm-theme="dark"] .gpdm-search-page-shell,
html[data-gpdm-theme="dark"] .gpdm-search-dialog {
	--gpdm-search-bg: var(--gpdm-dark-bg);
	--gpdm-search-card: var(--gpdm-dark-surface);
	--gpdm-search-text: var(--gpdm-dark-text);
	--gpdm-search-muted: var(--gpdm-dark-muted);
	--gpdm-search-border: var(--gpdm-dark-border);
}

html[data-gpdm-theme="dark"] .gpdm-search-dialog,
html[data-gpdm-theme="dark"] .gpdm-search-input,
html[data-gpdm-theme="dark"] .gpdm-search-card,
html[data-gpdm-theme="dark"] .gpdm-search-page-heading,
html[data-gpdm-theme="dark"] .gpdm-search-page-shell > .gpdm-search-app,
html[data-gpdm-theme="dark"] .gpdm-search-filter-panel,
html[data-gpdm-theme="dark"] .gpdm-search-empty {
	border-color: var(--gpdm-dark-border) !important;
	background: var(--gpdm-dark-surface) !important;
	color: var(--gpdm-dark-text) !important;
}

html[data-gpdm-theme="dark"] .gpdm-search-page-heading h1,
html[data-gpdm-theme="dark"] .gpdm-search-card-title,
html[data-gpdm-theme="dark"] .gpdm-search-card-title a {
	color: var(--gpdm-dark-primary) !important;
}

/* Common Elementor/Astra white cards without repainting branded sections. */
html[data-gpdm-theme="dark"] .ast-separate-container .ast-article-post,
html[data-gpdm-theme="dark"] .ast-separate-container .ast-article-single,
html[data-gpdm-theme="dark"] .widget,
html[data-gpdm-theme="dark"] .comments-area,
html[data-gpdm-theme="dark"] .elementor-widget-container > .elementor-posts-container .elementor-post,
html[data-gpdm-theme="dark"] .elementor-posts .elementor-post {
	border-color: var(--gpdm-dark-border) !important;
	background-color: var(--gpdm-dark-surface) !important;
	color: var(--gpdm-dark-text) !important;
}

/* Native Astra header toggle. It is inserted immediately before each Search element. */
.gpdm-dark-mode-source {
	display: none !important;
}

#masthead .gpdm-dark-mode-slot,
.site-header .gpdm-dark-mode-slot {
	position: static !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	align-self: center !important;
	flex: 0 0 34px !important;
	width: 34px !important;
	height: 34px !important;
	margin: 0 8px 0 0 !important;
	padding: 0 !important;
	line-height: 1 !important;
	vertical-align: middle !important;
	box-sizing: border-box !important;
	float: none !important;
	inset: auto !important;
	transform: none !important;
	z-index: auto !important;
}

#masthead .gpdm-dark-mode-toggle,
.site-header .gpdm-dark-mode-toggle {
	-webkit-appearance: none !important;
	appearance: none !important;
	position: static !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	min-height: 32px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	color: #ffd600 !important;
	box-shadow: none !important;
	cursor: pointer !important;
	text-decoration: none !important;
	line-height: 1 !important;
	transform: none !important;
	opacity: 1 !important;
	visibility: visible !important;
	transition: background-color .18s ease, color .18s ease !important;
}

#masthead .gpdm-dark-mode-toggle:hover,
#masthead .gpdm-dark-mode-toggle:focus,
.site-header .gpdm-dark-mode-toggle:hover,
.site-header .gpdm-dark-mode-toggle:focus {
	background: rgba(255, 255, 255, .14) !important;
	color: #ffd600 !important;
	box-shadow: none !important;
	transform: none !important;
	opacity: 1 !important;
}

#masthead .gpdm-dark-mode-toggle:focus-visible,
.site-header .gpdm-dark-mode-toggle:focus-visible {
	outline: 2px solid currentColor !important;
	outline-offset: 2px !important;
}

#masthead .gpdm-dark-mode-icon,
.site-header .gpdm-dark-mode-icon {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: 22px !important;
	height: 22px !important;
	color: inherit !important;
	pointer-events: none !important;
	opacity: 1 !important;
	visibility: visible !important;
}

#masthead .gpdm-dark-mode-icon svg,
.site-header .gpdm-dark-mode-icon svg {
	display: block !important;
	width: 22px !important;
	height: 22px !important;
	fill: none !important;
	stroke: currentColor !important;
	stroke-width: 1.9 !important;
	stroke-linecap: round !important;
	stroke-linejoin: round !important;
	opacity: 1 !important;
	visibility: visible !important;
}

#masthead .gpdm-dark-mode-icon--sun,
.site-header .gpdm-dark-mode-icon--sun,
#masthead .gpdm-dark-mode-toggle[aria-pressed="true"] .gpdm-dark-mode-icon--moon,
.site-header .gpdm-dark-mode-toggle[aria-pressed="true"] .gpdm-dark-mode-icon--moon {
	display: none !important;
}

#masthead .gpdm-dark-mode-toggle[aria-pressed="true"] .gpdm-dark-mode-icon--sun,
.site-header .gpdm-dark-mode-toggle[aria-pressed="true"] .gpdm-dark-mode-icon--sun {
	display: inline-flex !important;
}

@media (max-width: 921px) {
	#masthead .gpdm-dark-mode-slot,
	.site-header .gpdm-dark-mode-slot {
		flex-basis: 30px !important;
		width: 30px !important;
		height: 30px !important;
		margin-right: 7px !important;
	}

	#masthead .gpdm-dark-mode-toggle,
	.site-header .gpdm-dark-mode-toggle,
	#masthead .gpdm-dark-mode-toggle:hover,
	#masthead .gpdm-dark-mode-toggle:focus,
	.site-header .gpdm-dark-mode-toggle:hover,
	.site-header .gpdm-dark-mode-toggle:focus {
		width: 30px !important;
		height: 30px !important;
		min-width: 30px !important;
		min-height: 30px !important;
		background: transparent !important;
		color: #20242b !important;
	}

	html[data-gpdm-theme="dark"] #masthead .gpdm-dark-mode-toggle,
	html[data-gpdm-theme="dark"] .site-header .gpdm-dark-mode-toggle,
	html[data-gpdm-theme="dark"] #masthead .gpdm-dark-mode-toggle:hover,
	html[data-gpdm-theme="dark"] .site-header .gpdm-dark-mode-toggle:hover {
		color: #ffd54d !important;
	}
}

/* Remove every known legacy WP Dark Mode switch during migration. */
.wp-dark-mode-switch,
#wp-dark-mode-switch,
.wp-dark-mode-floating-switch,
#wp-dark-mode-floating-switch,
.wp-dark-mode-switcher,
#wp-dark-mode-switcher,
[data-wp-dark-mode-switch],
[class*="wp-dark-mode-switch"],
[id*="wp-dark-mode-switch"],
.wpdm-switch,
.wpdm-floating-switch,
.elementor-widget-wp-dark-mode,
.wp-block-wp-dark-mode-switch {
	display: none !important;
}

/* Keep Astra's right header section as one aligned row. */
#masthead .site-header-primary-section-right,
.site-header .site-header-primary-section-right,
#masthead .ast-grid-right-section,
.site-header .ast-grid-right-section {
	align-items: center !important;
}

@media (max-width: 921px) {
	#masthead .gpdm-dark-mode-slot,
	.site-header .gpdm-dark-mode-slot {
		flex-basis: 32px !important;
		width: 32px !important;
		height: 32px !important;
		margin-right: 8px !important;
	}

	#masthead .gpdm-dark-mode-toggle,
	.site-header .gpdm-dark-mode-toggle {
		width: 31px !important;
		height: 31px !important;
		min-width: 31px !important;
		min-height: 31px !important;
		border-color: #d5d8de !important;
		background: #ffffff !important;
		color: #222630 !important;
		font-size: 20px !important;
	}

	#masthead .gpdm-dark-mode-toggle:hover,
	#masthead .gpdm-dark-mode-toggle:focus,
	.site-header .gpdm-dark-mode-toggle:hover,
	.site-header .gpdm-dark-mode-toggle:focus {
		border-color: #aeb4bf !important;
		background: #f4f5f7 !important;
		color: #222630 !important;
	}

	html[data-gpdm-theme="dark"] #masthead .gpdm-dark-mode-toggle,
	html[data-gpdm-theme="dark"] .site-header .gpdm-dark-mode-toggle,
	html[data-gpdm-theme="dark"] #masthead .gpdm-dark-mode-toggle:hover,
	html[data-gpdm-theme="dark"] #masthead .gpdm-dark-mode-toggle:focus,
	html[data-gpdm-theme="dark"] .site-header .gpdm-dark-mode-toggle:hover,
	html[data-gpdm-theme="dark"] .site-header .gpdm-dark-mode-toggle:focus {
		border-color: #303642 !important;
		background: #252a35 !important;
		color: #ffd54d !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gpdm-dark-mode-toggle,
	.gpdm-dark-mode-icon svg {
		transition: none;
	}
}
