/* ==========================================================================
   Top Notice Bar
   ========================================================================== */

/*
 * Scrollbar layout-shift fix.
 *
 * Problem: switching tab content changes page height, which causes the
 * browser scrollbar to appear or disappear. On Windows the scrollbar is
 * ~17px wide — when it appears the content area shrinks by 17px, which
 * forces the notice bar (and every 100%-width element) to reflow. The bar
 * appears to "jump" horizontally.
 *
 * Fix: `scrollbar-gutter: stable` permanently reserves the space the
 * scrollbar would occupy, so adding/removing the scrollbar never changes
 * the layout width. Supported in all modern browsers; ignored gracefully
 * in older ones (no visible effect, just no fix).
 */
html {
	scrollbar-gutter: stable;
}

.iwd-top-notice {
	--iwd-notice-bg: #0a0a0a;
	--iwd-notice-color: #ffffff;

	display: block;
	width: 100%;
	background-color: var(--iwd-notice-bg);
	color: var(--iwd-notice-color);
	position: relative;
	z-index: 9999;
}

/* Smooth collapse on dismiss */
.iwd-top-notice.is-hiding {
	overflow: hidden;
	transition: max-height 0.35s ease, opacity 0.35s ease, padding 0.35s ease;
	max-height: 0 !important;
	opacity: 0;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

.iwd-top-notice__inner {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	height: 58px;
	padding: 0 48px 0 16px; /* right padding reserves space for the X */
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
	box-sizing: border-box;
}

/* Notice text / link */
.iwd-top-notice__text {
	flex: 1;
	text-align: center;
	font-size: 15px;
	line-height: 1.5;
	color: var(--iwd-notice-color);
	text-decoration: none;
}

a.iwd-top-notice__text:hover,
a.iwd-top-notice__text:focus {
	text-decoration: underline;
	opacity: 0.9;
	outline-offset: 2px;
}

a.iwd-top-notice__text:focus-visible {
	outline: 2px solid var(--iwd-notice-color);
	border-radius: 2px;
}

/* Close button */
.iwd-top-notice__close {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	padding: 0;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 4px;
	color: var(--iwd-notice-color);
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
	flex-shrink: 0;
}

/* Expand tap area to 44×44px without changing visual size (28 + 8×2 = 44) */
.iwd-top-notice__close::after {
	content: '';
	position: absolute;
	inset: -8px;
}

.iwd-top-notice__close:hover {
	opacity: 1;
	background-color: rgba(255, 255, 255, 0.15);
}

.iwd-top-notice__close:focus-visible {
	outline: 2px solid var(--iwd-notice-color);
	outline-offset: 2px;
	opacity: 1;
}

/* Remove default button styles */
.iwd-top-notice__close::-moz-focus-inner {
	border: 0;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
	.iwd-top-notice__inner {
		height: 48px;
		padding: 0 40px 0 12px;
	}

	.iwd-top-notice__text {
		font-size: 14px;
	}

	.iwd-top-notice__close {
		right: 8px;
	}
}
