/*
 * Overdrive — v1.6.0 runtime delivery guards.
 * Loaded after design-polish.css to protect the masthead animation and keep the
 * preferred-source prompt clear of advertising without altering article layouts.
 */

/* --------------------------------------------------------------------------
   1. Two-state editorial masthead
   -------------------------------------------------------------------------- */
body.go-verge,
body.go-verge .go-header--editorial {
	--go-header-expanded-height: 94px;
	--go-header-compact-height: 58px;
}

body.go-verge .go-header--editorial {
	isolation: isolate;
}

body.go-verge .go-header--editorial .go-header__bar {
	will-change: auto;
	transition:
		height 320ms cubic-bezier(.16, 1, .3, 1),
		column-gap 280ms cubic-bezier(.16, 1, .3, 1) !important;
}

body.go-verge .go-header--editorial .go-header__logo-full,
body.go-verge .go-header--editorial .go-header__logo-icon,
body.go-verge .go-header--editorial.is-compact .go-header__logo-full,
body.go-verge .go-header--editorial.is-compact .go-header__logo-icon {
	display: inline-flex !important;
	visibility: visible !important;
	backface-visibility: hidden;
	transform-origin: left center;
	pointer-events: none;
	transition:
		opacity 210ms cubic-bezier(.4, 0, .2, 1),
		transform 320ms cubic-bezier(.16, 1, .3, 1) !important;
}

body.go-verge .go-header--editorial .go-header__logo-full {
	opacity: 1;
	transform: translate3d(0, 0, 0) scale(1);
}

body.go-verge .go-header--editorial .go-header__logo-icon {
	opacity: 0;
	transform: translate3d(0, 1px, 0) scale(.94);
}

body.go-verge .go-header--editorial.is-compact .go-header__logo-full {
	opacity: 0;
	transform: translate3d(0, -1px, 0) scale(.975);
}

body.go-verge .go-header--editorial.is-compact .go-header__logo-icon {
	opacity: 1;
	transform: translate3d(0, 0, 0) scale(1);
}

/* Últimas has real layout height only while the large home masthead is open. */
body.go-verge .go-header--editorial + .go-latest-bar {
	top: var(--go-header-expanded-height);
	max-height: 46px;
	margin: 0;
	overflow: clip;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate3d(0, 0, 0);
	transform-origin: top center;
	transition:
		max-height 320ms cubic-bezier(.16, 1, .3, 1),
		top 320ms cubic-bezier(.16, 1, .3, 1),
		opacity 180ms ease,
		transform 300ms cubic-bezier(.16, 1, .3, 1),
		border-color 180ms ease,
		box-shadow 180ms ease,
		visibility 0s linear 0s !important;
}

body.go-verge .go-header--editorial.is-compact + .go-latest-bar,
body.go-verge .go-header--editorial + .go-latest-bar.is-hidden {
	top: var(--go-header-compact-height);
	max-height: 0 !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	transform: translate3d(0, -8px, 0) !important;
	border-color: transparent !important;
	box-shadow: none !important;
	transition:
		max-height 300ms cubic-bezier(.16, 1, .3, 1),
		top 300ms cubic-bezier(.16, 1, .3, 1),
		opacity 150ms ease,
		transform 260ms cubic-bezier(.16, 1, .3, 1),
		border-color 150ms ease,
		box-shadow 150ms ease,
		visibility 0s linear 300ms !important;
}

/* No opening/closing animation before JS resolves restored scroll position. */
body.go-verge .go-header--editorial:not(.is-header-ready) .go-header__bar,
body.go-verge .go-header--editorial:not(.is-header-ready) .go-header__logo-full,
body.go-verge .go-header--editorial:not(.is-header-ready) .go-header__logo-icon,
body.go-verge .go-header--editorial:not(.is-header-ready) + .go-latest-bar {
	transition: none !important;
}

@media (max-width: 960px) {
	body.go-verge,
	body.go-verge .go-header--editorial {
		--go-header-expanded-height: 74px;
		--go-header-compact-height: 56px;
	}
}

@media (max-width: 520px) {
	body.go-verge,
	body.go-verge .go-header--editorial {
		--go-header-expanded-height: 66px;
		--go-header-compact-height: 54px;
	}

	body.go-verge .go-header--editorial + .go-latest-bar {
		max-height: 42px;
	}
}

/* --------------------------------------------------------------------------
   2. Preferred-source prompt: clear the bottom advertising zone
   -------------------------------------------------------------------------- */
body.go-verge .go-preferred-toast {
	right: auto !important;
	left: max(18px, calc((100vw - 1160px) / 2)) !important;
	bottom: calc(var(--go-bottom-anchor-space, 0px) + 112px + env(safe-area-inset-bottom)) !important;
}

@media (max-width: 768px) {
	body.go-verge .go-preferred-toast {
		display: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.go-verge .go-header--editorial .go-header__bar,
	body.go-verge .go-header--editorial .go-header__logo-full,
	body.go-verge .go-header--editorial .go-header__logo-icon,
	body.go-verge .go-header--editorial + .go-latest-bar,
	body.go-verge .go-preferred-toast {
		transition: none !important;
	}
}

/* --------------------------------------------------------------------------
   3. Mobile floating controls: balanced corners and icon-only accessibility
   -------------------------------------------------------------------------- */
.go-a11y__toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}

.go-a11y__icon {
	display: none;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.7;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (max-width: 767px) {
	body.go-verge {
		--go-mobile-control-bottom: calc(6px + env(safe-area-inset-bottom));
	}

	/* Measured by assets/js/go-anchor-host.js; 0px when no anchor is present. */
	body.go-verge.go-has-bottom-anchor {
		--go-mobile-control-bottom: calc(var(--go-bottom-anchor-space, 0px) + 8px + env(safe-area-inset-bottom));
	}

	body.go-verge .go-a11y {
		left: max(12px, env(safe-area-inset-left)) !important;
		right: auto !important;
		bottom: var(--go-mobile-control-bottom) !important;
	}

	body.go-verge .go-backtop {
		left: auto !important;
		right: max(12px, env(safe-area-inset-right)) !important;
		bottom: var(--go-mobile-control-bottom) !important;
		z-index: 999;
	}

	body.go-verge .go-a11y__toggle,
	body.go-verge .go-backtop {
		width: 48px;
		height: 48px;
		min-width: 48px;
		min-height: 48px;
		padding: 0;
		border-radius: 50%;
	}

	body.go-verge .go-a11y__label {
		display: none;
	}

	body.go-verge .go-a11y__icon {
		display: block;
	}

	body.go-verge .go-a11y__panel {
		bottom: 56px;
	}
}
