//NOTE: This border style ignores native titlebars
@import "../../../chrome-1/titlebar/base";

// Change offsets for Incognito/pfp when window's maximised
&[sizemode="maximized"],
&[sizemode="fullscreen"] {
	#gkavatar-container > #gk-firefox-account-button,
	#private-browsing-indicator-with-label,
	.private-browsing-indicator-with-label /* Fix for Firefox 133+ */ {
		height: calc(var(--tab-height) - 9px);

		.toolbarbutton-badge-stack,
		.private-browsing-indicator-icon {
			margin-block-end: -4px; //offset for maximised window
		}
	}
}

& {
    --titlebar-border-radius: 3px;
	@media (-moz-platform: macos) {
		--titlebar-border-radius: 9px; //Artificial minimum radii set by macOS's window manager
	}
	--tab-distance-from-top: 10px;
	&[sizemode="maximized"],
	&[sizemode="fullscreen"] {
		--tab-distance-from-top: 3px;
	}
	
	--titlebar-box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

// Visuals
&[is117Plus][windowtype="navigator:browser"] > body {
	border: 1px solid rgba(0, 0, 0, 0.3);
}
// Use the custom titlebar background in Chromium OS's SysTheme
&[gksystheme="chromiumos"]:not([geckium-sixtyeight]) {
	--default-titlebar-active: #C3C3C4;
	--default-titlebar-inactive: #CDCDCE;
	@media (prefers-color-scheme: dark) {
		--default-titlebar-active: #3A3A3B;
		--default-titlebar-inactive: #444446;
	}
	@media (-moz-platform: linux) {
		&[is117Plus]:not([geckium-thirtyseven]) {
			--default-titlebar-active: rgba(255, 255, 255, 0.2);
			--default-titlebar-inactive: rgba(255, 255, 255, 0.2);
			@media (prefers-color-scheme: dark) {
				--default-titlebar-active: rgba(0, 0, 0, 0.2);
				--default-titlebar-inactive: rgba(0, 0, 0, 0.2);
			}
		}
	}
}

// Visuals: Maximised / Fullscreen
&[sizemode="maximized"],
&[sizemode="fullscreen"] {
	--titlebar-box-shadow: none;

	#navigator-toolbox,
	#navigator-toolbox::before {
		border-radius: 0 !important;
	}
	&[windowtype="navigator:browser"] > body {
		border: 0;
	}
	
	&[gksystheme="chromiumos"]:not([gkthemed], [gkchrthemed], [geckium-thirtyseven]) #titlebar {
		background: black !important;
		color: white !important;
	}
}