/**
 * Sticky main header — hides on scroll down, returns on scroll up.
 */

.irancast-header {
	position: sticky;
	top: 0;
	z-index: 1200;
	width: 100%;
	max-width: none;
	/* Keep shell above page content when stuck */
	isolation: isolate;
	overflow: visible;
	transform: translateY(0);
	transition: transform 0.28s ease;
	will-change: transform;
}

.irancast-header.irancast-header--hidden {
	transform: translateY(-100%);
	pointer-events: none;
}

/* WordPress admin bar offset */
body.admin-bar .irancast-header {
	top: 32px;
	/* Fill the classic sticky+admin-bar double-gap so parchment never shows
	   between #wpadminbar and the black header shell. */
	box-shadow: 0 -32px 0 0 var(--SecondMaincolor, #0d1112);
}

body.admin-bar .irancast-header::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -32px;
	height: 32px;
	background: var(--SecondMaincolor, #0d1112);
	pointer-events: none;
	z-index: 0;
}

@media screen and (max-width: 782px) {
	body.admin-bar .irancast-header {
		top: 46px;
		box-shadow: 0 -46px 0 0 var(--SecondMaincolor, #0d1112);
	}

	body.admin-bar .irancast-header::before {
		top: -46px;
		height: 46px;
	}
}

/* Ensure opaque shell so scrolled content doesn't show through */
.irancast-header > svg {
	position: relative;
	z-index: 1;
	display: block;
	width: 100%;
}

.irancast-header .header-content-both {
	z-index: 3;
	overflow: visible;
}

/* Account dropdown: above breadcrumbs / content, aligned under the button. */
.irancast-header .left-top-header .user-account-div {
	position: relative;
	z-index: 20;
	overflow: visible;
}

.irancast-header .left-top-header .user-account-detail-header {
	z-index: 1300;
	top: calc(100% + 10px);
	inset-inline-end: 0;
	inset-inline-start: auto;
	width: min(240px, calc(100vw - 24px));
	padding: 14px;
	border-radius: 12px;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

.irancast-header .left-top-header .user-account-div:hover .user-account-detail-header,
.irancast-header .left-top-header .user-account-div:focus-within .user-account-detail-header {
	visibility: visible;
	opacity: 1;
	top: calc(100% + 8px);
	pointer-events: auto;
}

.irancast-header .left-top-header .user-account-detail-header::after {
	width: 100%;
	height: 14px;
	top: -12px;
	inset-inline-end: 0;
}

/* Mobile / tablet overrides that previously forced position:relative */
@media screen and (max-width: 992px) {
	.irancast-header {
		position: sticky !important;
		top: 0 !important;
		z-index: 1200 !important;
		max-width: none !important;
	}

	body.admin-bar .irancast-header {
		top: 32px !important;
		box-shadow: 0 -32px 0 0 var(--SecondMaincolor, #0d1112) !important;
	}
}

@media screen and (max-width: 782px) {
	body.admin-bar .irancast-header {
		top: 46px !important;
		box-shadow: 0 -46px 0 0 var(--SecondMaincolor, #0d1112) !important;
	}
}

@media screen and (max-width: 768px) {
	.irancast-header {
		position: sticky !important;
		/* Fallback when curved SVG is hidden in some breakpoints */
		background: var(--SecondMaincolor, #000) !important;
	}
}
