/*
 * Edumall 4.8.3 compatibility layer for the Charisma child theme.
 *
 * The live site runs on Edumall 3.4.4. Edumall 4.8.3 ships new/changed parent rules that
 * break visual parity with the live site. Each block below cancels one such rule and names
 * the QA work item it fixes. Loaded after the child stylesheets (Assets::enqueue()).
 */

/* QA #27101 - article title hidden on single posts.
 * 4.8.3: `.title-bar-has-post-title .entry-title{display:none}`. The blog title bar on the
 * live site (title-bar-06, empty "blog_single_title_bar_title") adds that body class, but the
 * title bar does not print the post title, so the h1 in the article must stay visible. */
body.title-bar-has-post-title .entry-title {
	display: block;
}

/* QA #27099 + #27104 - suggested-article box and audio player squeezed on mobile.
 * 4.8.3: `.single-post .page-content > .container{padding:0 15px}` beats the child's mobile
 * `.container{padding:0}`, so the article column is 30px narrower than on the live site:
 * the related-article box wraps (icon shrinks, "+" drops to its own line) and the audio
 * player's buttons get squashed. Restore the live mobile gutter. */
@media (max-width: 767px) {
	body.single-post .page-content > .container {
		padding-left: 0;
		padding-right: 0;
	}
}

/* QA #27105 - header menus broken (desktop mega menu, mobile header and menu).
 *
 * (a) Desktop mega menu ("خدمات کاریزما" etc.): 4.8.3 adds
 *     `.elementor-container.elementor-column-gap-*>.elementor-column>.elementor-element-populated{padding:0 Npx}`
 *     for flexbox sections without .elementor-row (3.4.4 only targeted the old .elementor-row
 *     markup). That removes the vertical column padding of every Elementor section, so the
 *     mega menu columns and inner sections collapse onto each other (e.g. "کارگزاری" over
 *     "دریافت کد بورسی"). Restore Elementor's own gaps. Same specificity (0,4,0) as the parent
 *     rule and loaded after it, but before the Elementor post CSS, so per-element paddings set
 *     in Elementor still win. */
.elementor-column-gap-narrow > .elementor-column > .elementor-element-populated.elementor-element-populated {
	padding: 5px;
}
.elementor-column-gap-default > .elementor-column > .elementor-element-populated.elementor-element-populated {
	padding: 10px;
}
.elementor-column-gap-extended > .elementor-column > .elementor-element-populated.elementor-element-populated {
	padding: 15px;
}
.elementor-column-gap-wide > .elementor-column > .elementor-element-populated.elementor-element-populated {
	padding: 20px;
}
.elementor-column-gap-wider > .elementor-column > .elementor-element-populated.elementor-element-populated {
	padding: 30px;
}

/* Mega menu call-to-action buttons: 4.8.3 gives small Elementor buttons min-height 48px and
 * weight 500 (live: 32px high, bold), which pushes the panel content down. */
.mega-menu .elementor-element .elementor-button.elementor-size-sm {
	min-height: 0;
	font-weight: 700;
}

/* (a2) Desktop primary menu position as on live. 3.4.4 kept its LTR spacing in RTL
 *      (navigation margin on the left, items floated right with no inline-block gaps);
 *      4.8.3 mirrors it, which moves the whole menu ~30px and spreads the items. */
.header-04 .page-navigation {
	margin: 0 0 0 30px;
}
.desktop-menu .header-04 .page-navigation {
	padding: 0 9px 0 0;
}
.desktop-menu .sm-simple > li {
	display: block;
	float: right;
}

@media (max-width: 767px) {
	/* (b) Mobile header: 4.8.3 turns .header-right-inner into a hidden drop-down
	 *     (absolute, opacity 0) opened by a "more tools" button the child does not use;
	 *     on live the header icons sit inline. */
	.header-right-inner {
		position: static;
		visibility: visible;
		opacity: 1;
		transform: none;
		box-shadow: none;
		border-radius: 0;
		flex-wrap: nowrap;
	}

	/* Live (3.4.4 RTL) keeps a 30px gap between the header icons and the logo on mobile:
	 * its style-rtl.css sets this padding outside any media query. 4.8.3 resets it to 0. */
	.rtl .header-04 .header-right {
		padding: 0 30px 0 0;
	}
}

/* (c) Mobile menu: 4.8.3 forces mega menu headings to white (made for its dark mobile
 *     menu); the live mobile menu is white, so the headings disappeared. Live colour. */
.mobile-menu .mega-menu .elementor-heading-title {
	color: #080808 !important;
}
