/* Site chrome: banner scrolls away; navbar + breadcrumbs stick */

/* Never hide site chrome on cabinet / PM / profile / posting */
body.site-chrome-sticky header,
body.pm-section header,
body.cabinet-section header,
body.profile-section header,
body.posting-section header {
	display: block !important;
}

body.site-chrome-sticky .layout-container:has(.ads-two-banners-row),
body.posting-section .layout-container:has(.ads-two-banners-row) {
	display: block !important;
}

/* Profile, PM, cabinet (login/register/UCP): no ad banners */
body.profile-section .layout-container:has(.ads-two-banners-row),
body.pm-section .layout-container:has(.ads-two-banners-row),
body.cabinet-section .layout-container:has(.ads-two-banners-row),
body.news-section .layout-container:has(.ads-two-banners-row),
body.subscriptions-section .layout-container:has(.ads-two-banners-row) {
	display: none !important;
}

body.profile-section .phpbb-ads,
body.pm-section .phpbb-ads,
body.cabinet-section .phpbb-ads,
body.news-section .phpbb-ads,
body.subscriptions-section .phpbb-ads {
	display: none !important;
}

body.profile-section .left-sidebar,
body.profile-section .right-sidebar,
body.pm-section .left-sidebar,
body.pm-section .right-sidebar,
body.cabinet-section .left-sidebar,
body.cabinet-section .right-sidebar,
body.news-section .left-sidebar,
body.news-section .right-sidebar,
body.subscriptions-section .left-sidebar,
body.subscriptions-section .right-sidebar {
	display: none !important;
}

body.site-chrome-sticky #scroll_to_top,
body.pm-section #scroll_to_top,
body.cabinet-section #scroll_to_top,
body.profile-section #scroll_to_top {
	display: block !important;
}

/* Kill parallax fixed background — it jumps on fast scroll */
body.site-chrome-sticky .header-banner,
body.site-chrome-sticky .header-section .header-image,
body.site-chrome-sticky .header-section {
	background-attachment: scroll !important;
}

body.site-chrome-sticky #page-header .header-section {
	position: relative;
	transform: translateZ(0);
	backface-visibility: hidden;
}

/* Hide Scripts-injected / Zeina sidebar skyscrapers on cabinet & profile only.
   Main forum pages keep Zeina custom_style + right_sidebar banners as configured. */
body.profile-section .drcpa-sidebar-ad-1,
body.profile-section .drcpa-sidebar-ad-2,
body.profile-section .drcpa-sidebar-ad-3,
body.cabinet-section .drcpa-sidebar-ad-1,
body.cabinet-section .drcpa-sidebar-ad-2,
body.cabinet-section .drcpa-sidebar-ad-3,
body.pm-section .drcpa-sidebar-ad-1,
body.pm-section .drcpa-sidebar-ad-2,
body.pm-section .drcpa-sidebar-ad-3,
body.subscriptions-section .drcpa-sidebar-ad-1,
body.subscriptions-section .drcpa-sidebar-ad-2,
body.subscriptions-section .drcpa-sidebar-ad-3,
body.news-section .drcpa-sidebar-ad-1,
body.news-section .drcpa-sidebar-ad-2,
body.news-section .drcpa-sidebar-ad-3 {
	display: none !important;
}

/* Zeina ad sidebars: hide on mobile when ACP “Show sidebar on mobile” is off */
@media (max-width: 1023px) {
	.left-sidebar.sidebar-hide-mobile,
	.right-sidebar.sidebar-hide-mobile {
		display: none !important;
	}
}

body.site-chrome-sticky .navbar,
.navbar {
	position: sticky;
	top: 0;
	z-index: 12;
	width: 100%;
	transform: translateZ(0);
	backface-visibility: hidden;
	/* Light frosted glass (mobile + desktop) */
	background: rgba(255, 255, 255, 0.78) !important;
	-webkit-backdrop-filter: saturate(180%) blur(16px);
	backdrop-filter: saturate(180%) blur(16px);
	border-bottom-color: rgba(60, 60, 67, 0.12);
	box-shadow: none !important;
}

html.dark .navbar,
:is(.dark .navbar) {
	background: rgba(15, 23, 42, 0.78) !important;
	border-bottom-color: rgba(84, 84, 88, 0.35);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
	.navbar {
		background: rgba(255, 255, 255, 0.94) !important;
	}

	html.dark .navbar,
	:is(.dark .navbar) {
		background: rgba(15, 23, 42, 0.94) !important;
	}
}

/* Second menu: scrolls with the page (not sticky) on mobile and desktop */
body.site-chrome-sticky .breadcrumbs-panel,
.breadcrumbs-panel {
	position: static;
	top: auto;
	z-index: auto;
	width: 100%;
	transform: none;
	backface-visibility: visible;
}

/* Top page-load progress (Discourse / Tilda style) */
.page-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 99999;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.page-progress.is-active {
	opacity: 1;
}

.page-progress.is-done {
	opacity: 0;
	transition: opacity 0.35s ease 0.1s;
}

.page-progress__bar {
	height: 100%;
	width: 0;
	transform-origin: left center;
	background: rgba(var(--color-primary, 37 99 235), 1);
	box-shadow:
		0 0 8px rgba(var(--color-primary, 37 99 235), 0.55),
		0 0 2px rgba(var(--color-primary, 37 99 235), 0.8);
	transition: width 0.2s ease-out;
	will-change: width;
}

html.dark .page-progress__bar {
	background: rgba(var(--color-primary-dark, 96 165 250), 1);
	box-shadow:
		0 0 8px rgba(var(--color-primary-dark, 96 165 250), 0.5),
		0 0 2px rgba(var(--color-primary-dark, 96 165 250), 0.75);
}

@media (prefers-reduced-motion: reduce) {
	.page-progress,
	.page-progress__bar {
		transition: none;
	}
}

/* Docs/Word default black → theme text in dark mode (posts + quotes) */
html.dark .content [style*="color:#000"],
html.dark .content [style*="color: #000"],
html.dark .content [style*="color:#000000"],
html.dark .content [style*="color: #000000"],
html.dark .content [style*="color:black"],
html.dark .content [style*="color: black"],
html.dark .content [style*="color:rgb(0, 0, 0)"],
html.dark .content [style*="color: rgb(0, 0, 0)"],
html.dark .content font[color="#000"],
html.dark .content font[color="#000000"],
html.dark .content font[color="black"] {
	color: inherit !important;
}

/* Highlight marker — Light yellow 3 / soft amber in dark */
.content .bbcode-hl,
.bbcode-hl {
	padding: 0.05em 0.2em;
	border-radius: 0.2em;
	background-color: #fff2cc;
}

html.dark .content .bbcode-hl,
html.dark .bbcode-hl {
	background-color: rgba(250, 204, 21, 0.28);
}
