/* ==========================================================================
   THE HEADER OVER THE HOME FILM

   On the home page the header belongs ON the hero, not above it: no white
   band, no gap, the film running from the very top of the window and the
   navigation sitting on it. Everywhere else the header is exactly as it was.

   HOW IT IS SCOPED
   template-parts/header.php adds .sud-hd--over on the front page only, so
   nothing here can reach an inner page. Each rule names that class.

   OUT OF THE FLOW, NOT JUST TRANSPARENT
   A sticky header still occupies its own height at the top of the document,
   which is what pushed the film down and left the white band. Fixed takes it
   out of the flow entirely, so the hero starts at y=0 and the header floats
   over it. It stays put while the page scrolls, which is what sticky was
   doing anyway.

   READABLE AT REST, SOLID ONCE SCROLLED
   Over the film the links are white. The film is dark enough under the
   navigation that no scrim is needed for the logo or the links, but a soft
   top-down wash is laid behind them anyway so the text holds up whatever
   frame the film happens to be on — it is a gradient to transparent, not a
   panel, so it reads as part of the picture.

   Past the hero the header would be white text on white sections, so at the
   first scroll — header.js adds .is-stuck beyond 4px — it returns to the
   ordinary solid header. That transition is the only moment anything changes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. The shell
   -------------------------------------------------------------------------- */

.sud-hd--over {
	position: fixed;
	inset-inline: 0;
	inset-block-start: 0;
	background: transparent;
	border-bottom-color: transparent;
	box-shadow: none;
	transition:
		background .38s var(--sud-ease),
		border-color .38s var(--sud-ease),
		box-shadow .38s var(--sud-ease);
}

/*
 * The wash. Strongest at the very top and gone by the header's bottom edge, so
 * there is no visible seam where it ends.
 */
.sud-hd--over::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(
		to bottom,
		rgba(6, 26, 19, .42) 0%,
		rgba(6, 26, 19, .22) 55%,
		rgba(6, 26, 19, 0) 100%
	);
	opacity: 1;
	transition: opacity .38s var(--sud-ease);
	pointer-events: none;
}

/* Once the film is behind us, the ordinary header returns. */
.sud-hd--over.is-stuck {
	background: var(--sud-surface);
	border-bottom-color: var(--sud-line);
}

.sud-hd--over.is-stuck::before { opacity: 0; }

/* --------------------------------------------------------------------------
   2. The mark — coloured device, reversed wordmark, while over the film
   -------------------------------------------------------------------------- */

/*
 * header.css sets `.sud-hd__logo img { display: block }`, which is (0,1,1);
 * a single class here would tie on nothing and lose. Naming the anchor as
 * well makes these (0,2,0), one class above it.
 */
.sud-hd__logo .sud-hd__logo-img--light { display: none; }

.sud-hd--over:not(.is-stuck) .sud-hd__logo .sud-hd__logo-img--dark  { display: none; }
.sud-hd--over:not(.is-stuck) .sud-hd__logo .sud-hd__logo-img--light { display: block; }

/* --------------------------------------------------------------------------
   3. The navigation, in white, while over the film
   -------------------------------------------------------------------------- */

.sud-hd--over:not(.is-stuck) .sud-hd__link,
.sud-hd--over:not(.is-stuck) .sud-hd__wordmark {
	color: #fff;
}

.sud-hd--over:not(.is-stuck) .sud-hd__item.is-current > .sud-hd__link,
.sud-hd--over:not(.is-stuck) .sud-hd__item.is-open > .sud-hd__link,
.sud-hd--over:not(.is-stuck) .sud-hd__link:hover {
	color: #fff;
}

/* The underline is the brand green on white; on the film it is white. */
.sud-hd--over:not(.is-stuck) .sud-hd__link::after {
	background: #fff;
}

.sud-hd--over:not(.is-stuck) .sud-hd__caret {
	opacity: .8;
}

/* A text shadow rather than a heavier scrim: it costs nothing and keeps the
   labels legible over a bright frame without dimming the picture. */
.sud-hd--over:not(.is-stuck) .sud-hd__nav,
.sud-hd--over:not(.is-stuck) .sud-hd__logo {
	text-shadow: 0 1px 2px rgba(6, 26, 19, .35);
}

/* The burger, on phones, in white over the film. */
.sud-hd--over:not(.is-stuck) .sud-hd__burger span {
	background: #fff;
}

/*
 * The mega panel is a solid sheet in its own right and must stay readable, so
 * it keeps its own ground and ink even while the bar above it is transparent.
 */
.sud-hd--over .sud-mega {
	text-shadow: none;
}

/* --------------------------------------------------------------------------
   4. THE HOME HERO — the full window, starting at the top

   The banner no longer has a header above it to allow for, so it takes the
   whole window. --sud-hero-bar is the admin bar's height, set in
   home-video-banner.css and 0 for a signed-out visitor, so the film still
   ends exactly at the fold for an editor.

   The film keeps the `cover` it already used: its subject is centred, so the
   trim comes off the sides and nothing of the mark is lost. No stretch, no
   letterbox, no wash.
   -------------------------------------------------------------------------- */

@media (min-width: 768px) {

	.sud-hd--over ~ .elementor .e-con.sud-banner.sud-vbanner,
	body.home .elementor .e-con.sud-banner.sud-vbanner {
		aspect-ratio: auto;
		block-size: calc(100vh - var(--sud-hero-bar, 0px));
		block-size: calc(100svh - var(--sud-hero-bar, 0px));
		min-block-size: 0;
		max-block-size: none;
	}
}

/* --------------------------------------------------------------------------
   5. THE MENU, A LITTLE SMOOTHER

   The underline, the colour fade, the caret and the panel were all already
   animated; these only refine them. Nothing is restyled and no link changes.
   -------------------------------------------------------------------------- */

.sud-hd__link {
	transition:
		color .28s var(--sud-ease),
		transform .28s var(--sud-ease);
}

@media (hover: hover) {
	/*
	 * The 1px hover lift was removed on 2026-11-11: moving the pointer along
	 * the bar made each item jump as it was entered and drop as it was left,
	 * which read as the whole menu shaking. Items now stay exactly in place;
	 * the colour, the growing underline and the caret carry the hover.
	 */

	/* The caret leans before the panel opens, then completes the turn. */
	.sud-hd__item:not(.is-open) > .sud-hd__link:hover .sud-hd__caret {
		transform: rotate(-8deg);
		opacity: .9;
	}
}

/* The panel's own easing, slightly longer on the way in than on the way out. */
.sud-hd__item.is-open .sud-mega {
	transition:
		opacity .34s var(--sud-ease),
		transform .42s var(--sud-ease),
		visibility .42s;
}

@media (prefers-reduced-motion: reduce) {
	.sud-hd__link,
	.sud-hd__caret,
	.sud-hd--over,
	.sud-hd--over::before {
		transition: none;
	}

	.sud-hd__item > .sud-hd__link:hover { transform: none; }
}

/* --------------------------------------------------------------------------
   6. THE HERO ON A PHONE — LEAVE IT TO THE PHONE'S OWN SECTION

   The home page carries TWO hero sections, and the editor decides which one a
   visitor sees:

     ccf0431  .sud-banner.sud-vbanner   hide_mobile                -> desktop + tablet
     2adc7de  (holds video widget f2c86b9)  hide_desktop + hide_tablet -> phones

   Section 4 above gives the desktop banner the whole window. That rule carried
   no media query, so it reached the phone too, and the block that used to sit
   here then re-laid the desktop banner out for a phone: 62svh tall, with the
   film absolute across it and `cover`.

   It also said `display: flex`, and that is the part that did the damage.
   Elementor hides a container on phones with `.elementor-hidden-mobile {
   display: none }` — a single class — so any `display` on a heavier selector
   overrides it, and that one was (0,4,1). The desktop banner came back from
   the dead on phones, on top of the phone's own section, so a phone showed
   BOTH heroes stacked:

     y   0-523   ccf0431, forced to 62svh, film cropped to 42% of the frame
     y 523-764   2adc7de, the phone's real hero, 16:9 and whole

   Measured at 390x844. The first is the "broken mobile" in the brief; the
   second is what was there before it and is correct.

   So the phone is handed back to its own section. Section 4 is now behind
   min-width 768 and everything else that used to be here is gone, which leaves
   the editor's own visibility setting to decide — as it already does on
   desktop and tablet, where 2adc7de is display:none and nothing has to force
   it.

   The one rule kept is a guard. home-video-banner.css also sets a `display` on
   this banner inside its own phone block (`display: block`, (0,4,0)), written
   when the banner was still the phone's hero, and it would override the hidden
   class in exactly the same way. Rather than reach into that file and change a
   rule that is correct on its own terms, the hidden class is restored here,
   above both.
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {

	/*
	 * Whatever else is declared, a banner the editor hid on phones stays
	 * hidden. (0,5,1) and (0,5,0), so it outranks every `display` written for
	 * this container in this file and in home-video-banner.css.
	 */
	body.home .elementor .e-con.sud-banner.sud-vbanner.elementor-hidden-mobile,
	.elementor .e-con.sud-banner.sud-vbanner.elementor-hidden-mobile {
		display: none;
	}
}
/* --------------------------------------------------------------------------
   7. THE MEGA MENU, AS A FLOATING PANEL — HOME, DESKTOP

   Against a white header a full-bleed sheet reads as part of the bar. Over a
   film it reads as a white slab dropped across the picture: 1425px wide and
   230px tall, with ~49px of padding top and bottom, for five links.

   So on this page it becomes what it should be — a panel belonging to the
   item that opened it. It is anchored to that item rather than to the header,
   centred beneath it, sized to its own content, and given the corner, border
   and shadow of something floating above the page. The film stays visible
   around it.

   The content is untouched: same eyebrow, same blurb, same links, same order,
   same hrefs. Only the frame around them changes, and the link list goes to a
   single column because the panel is no longer wide enough for two.

   min-width 1151px is where header.css puts the desktop navigation; below it
   the drawer takes over and none of this applies, so the phone and tablet
   menus behave exactly as they did.
   -------------------------------------------------------------------------- */

@media (min-width: 1151px) {

	/* The panel measures from its own item, not from the header. */
	.sud-hd--over .sud-hd__item { position: relative; }

	.sud-hd--over .sud-mega {
		inset-inline: auto;
		inset-inline-start: 50%;
		inset-block-start: calc(100% - 4px);

		inline-size: max-content;
		min-inline-size: 19rem;
		max-inline-size: min(25rem, calc(100vw - 3rem));

		background: rgba(255, 255, 255, .94);
		-webkit-backdrop-filter: saturate(1.6) blur(18px);
		backdrop-filter: saturate(1.6) blur(18px);

		border: 1px solid rgba(11, 31, 23, .08);
		border-radius: 18px;
		box-shadow:
			0 1px 2px rgba(11, 31, 23, .04),
			0 18px 48px -12px rgba(11, 31, 23, .22);
		overflow: hidden;

		/* Composed with the centring, so the slide does not undo it. */
		transform: translateX(-50%) translateY(-8px);
	}

	.sud-hd--over .sud-hd__item.is-open .sud-mega {
		transform: translateX(-50%) translateY(0);
	}

	/* One column, and the padding of a panel rather than of a section. */
	.sud-hd--over .sud-mega__inner {
		display: block;
		inline-size: auto;
		max-inline-size: none;
		margin-inline: 0;
		padding: 1rem 1.15rem 1.15rem;
	}

	/* The blurb keeps its words and gives up its column. */
	.sud-hd--over .sud-mega__lead {
		padding: 0 0 .75rem;
		margin-block-end: .65rem;
		border-block-end: 1px solid rgba(11, 31, 23, .09);
	}

	.sud-hd--over .sud-mega__blurb {
		margin-block-end: 0;
		font-size: .8125rem;
		line-height: 1.5;
	}

	.sud-hd--over .sud-mega__links {
		display: grid;
		grid-template-columns: 1fr;
		gap: 1px;
		inline-size: auto;
	}

	.sud-hd--over .sud-mega__links a {
		border-radius: 10px;
		padding-block: .5rem;
		white-space: nowrap;
	}

	/* The "all of it" link sits on the panel's own edge. */
	.sud-hd--over .sud-mega__all {
		margin-block-start: .6rem;
		padding-block-start: .6rem;
		border-block-start: 1px solid rgba(11, 31, 23, .09);
	}

	/*
	 * A FULLER PANEL GOES TO TWO COLUMNS.
	 *
	 * One column suits three to five links. Therapeutic Areas has eight, and in
	 * a single column the panel ran 490px — 61% of an 900px window, which is
	 * the "covers too much of the hero" the brief warns against. Two columns
	 * halve the rows and cost only width, which there is room for.
	 *
	 * Keyed on the sixth link existing, so a menu that grows or shrinks picks
	 * the right shape on its own. Where :has() is unsupported the panel simply
	 * stays one column — longer, but correct.
	 */
	.sud-hd--over .sud-mega:has(.sud-mega__links li:nth-child(6)) {
		max-inline-size: min(36rem, calc(100vw - 3rem));
	}

	.sud-hd--over .sud-mega:has(.sud-mega__links li:nth-child(6)) .sud-mega__links {
		grid-template-columns: 1fr 1fr;
		column-gap: .5rem;
	}

	/* With two narrower columns a long name may need a second line. */
	.sud-hd--over .sud-mega:has(.sud-mega__links li:nth-child(6)) .sud-mega__links a {
		white-space: normal;
	}
}

/* --------------------------------------------------------------------------
   5. THE PHONE HEADER OVER THE HOME HERO — COLOUR LOGO, GREEN BURGER

   Asked for: the full-colour mark instead of the white one, and the menu
   button as a dark green disc with three white rules, on phones, over the home
   hero only. The header stays transparent with its gradient behind it.

   NOTHING NEW IS ADDED. Both marks are already in the markup —
   template-parts/header.php prints sudair-logo.svg as .sud-hd__logo-img--dark
   and sudair-logo-white.svg as --light, and section 2 above simply swaps which
   one is shown. This flips that swap back on phones. The green is
   --sud-green-700 (#006344), the token the burger's own border already used at
   30% and the colour its :hover state already paints.

   WHY THE BURGER HAD NO LINES AT ALL. Two correct rules met and cancelled:
   header.css gives the button `background: var(--sud-surface)` — white — and
   section 3 above gives its rules `background: #fff` so they read over a dark
   film. White rules on a white disc. On the home hero it was a blank white
   circle, which is what the reference screenshot is replacing. Painting the
   disc green settles it: the rules were already white and now have a ground to
   sit on. Size, shape, border radius and position are untouched — only two
   colours change.

   :focus IS COVERED DELIBERATELY. header.css carries
   `.sud-hd .sud-hd__actions .sud-hd__burger:focus`, at (0,4,0), restoring the
   white disc and green rules — it exists because the Elementor kit used to
   repaint the button after it had been clicked once. A rule that only styled
   the resting state would be undone the moment the drawer was opened and
   closed, which is the exact fault its own comment describes. So the focus
   state is restated here at (0,5,0), green like the rest.

   SCOPE. `.sud-hd--over` is added in template-parts/header.php behind
   `is_front_page()`, so no other page can match these rules — the same
   guarantee every rule in this file relies on, which is why `body.home` is not
   repeated here. `max-width: 767px` keeps desktop and tablet on the white mark
   they have now. The video, the hero and the header's own background are not
   named at all.
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {

	/* The colour mark, as on the ordinary white header. */
	.sud-hd--over:not(.is-stuck) .sud-hd__logo .sud-hd__logo-img--dark  { display: block; }
	.sud-hd--over:not(.is-stuck) .sud-hd__logo .sud-hd__logo-img--light { display: none; }

	/*
	 * THE BURGER IS NO LONGER OVERRIDDEN HERE. It was, briefly: a green disc
	 * for the white rules, because header.css painted a white disc and section
	 * 3 painted the rules white, so over the hero the button showed nothing at
	 * all. The green disc is now header.css's own default on every page, so
	 * repeating it here would be two rules saying one thing. See the note on
	 * `.sud-hd .sud-hd__burger` there.
	 */
}

/* --------------------------------------------------------------------------
   8. THE PHONE HERO STARTS AT THE TOP OF THE SCREEN

   The phone's own hero (2adc7de, holding video f2c86b9) kept Elementor's
   boxed-container padding: 24px above the film and 24px below it. The header
   is fixed and transparent, so those 24px showed as a pale band behind the
   logo, and the film began under it instead of at the top edge.

   The padding goes, so the film starts at y=0 with the header over it. The
   frame is 16:10 rather than 16:9 — a little taller, so the logo and burger sit
   on the picture with the subject still clear below them. The film keeps
   `cover` and is centred, so only a sliver comes off each side.

   Phones only; desktop and tablet use the other banner (ccf0431).
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {

	body.home .elementor .elementor-element.elementor-element-2adc7de > .e-con-inner {
		padding-block: 0;
	}

	body.home .elementor .elementor-element.elementor-element-f2c86b9 .e-hosted-video {
		aspect-ratio: 16 / 10;
		background: #0b2a1f;
	}

	body.home .elementor .elementor-element.elementor-element-f2c86b9 video.elementor-video {
		inline-size: 100%;
		block-size: 100%;
		object-fit: cover;
		object-position: 50% 50%;
	}
}

/*
 * The colour mark is green, and on a phone it now sits directly on a green
 * lawn. A soft white halo — not a panel — lifts the wordmark off the film so
 * "SPC" and the Arabic name stay readable on every frame. Phones, over the
 * hero only; once the header turns solid on scroll the halo goes.
 */
@media (max-width: 767px) {
	.sud-hd--over:not(.is-stuck) .sud-hd__logo .sud-hd__logo-img--dark {
		filter:
			drop-shadow(0 0 1px rgba(255, 255, 255, .95))
			drop-shadow(0 0 5px rgba(255, 255, 255, .75));
	}
}

/* --------------------------------------------------------------------------
   9. A STILL NAVIGATION BAR (2026-11-11)

   Two things moved the bar while the pointer crossed it:
   - The Elementor kit's link-HOVER typography (Site Settings) switched every
     hovered link from the "Accent" style (600, 1.6px tracking) to the "Text"
     style (400, normal tracking) - each item resized by up to 21px and pushed
     its neighbours. That setting is removed at its source (the kit); the rule
     below also pins the header links' weight and tracking to their resting
     values in every state, so no future global link style can resize them.
   - Hover "lifts" (translateY) on the items and on Contact Us.
   Colour, underline, caret and the button's colour/shadow still respond.
   -------------------------------------------------------------------------- */

.sud-hd .sud-hd__nav .sud-hd__link,
.sud-hd .sud-hd__nav .sud-hd__link:hover,
.sud-hd .sud-hd__nav .sud-hd__link:focus,
.sud-hd .sud-hd__nav .sud-hd__item.is-open > .sud-hd__link {
	/* The values the resting state already uses (the kit's "Accent" link type). */
	font-weight: var(--e-global-typography-accent-font-weight);
	letter-spacing: var(--e-global-typography-accent-letter-spacing);
	transform: none;
}

.sud-hd .sud-hd__cta,
.sud-hd .sud-hd__cta:hover,
.sud-hd .sud-hd__cta:focus,
.sud-hd .sud-hd__cta:active {
	transform: none;
}

/* --------------------------------------------------------------------------
   10. ROOM FOR AN EIGHTH MENU ITEM (Medical Information, 2026-11-15)

   Eight top-level labels measured ~1,070px (EN) / ~960px (AR) against a nav
   track of ~872px, so the last item ran under Contact Us at every desktop
   width. Same font, size and weight as before; the menu is simply denser:
   - tracking 1.6px -> 0.5px (0 in the narrow 1151-1279px band),
   - slimmer link padding and gaps between items,
   - the header row may use up to 1440px on wide screens (page content
     keeps its own width).
   Measured clear of the logo and the button by >= 22px at 1151-1920px, on one
   line, in English and Arabic. Tracking is identical in every state, so the
   hover stability of section 9 is kept.
   -------------------------------------------------------------------------- */

@media (min-width: 1151px) {
	.sud-hd .sud-hd__nav .sud-hd__link,
	.sud-hd .sud-hd__nav .sud-hd__link:hover,
	.sud-hd .sud-hd__nav .sud-hd__link:focus,
	.sud-hd .sud-hd__nav .sud-hd__item.is-open > .sud-hd__link {
		letter-spacing: .5px;
	}

	.sud-hd .sud-hd__link { padding-inline: clamp(.25rem, .4vw, .45rem); }
	.sud-hd .sud-hd__list { gap: clamp(.05rem, .25vw, .2rem); }
	.sud-hd .sud-hd__grid { max-width: min(1440px, 100%); }
}

@media (min-width: 1151px) and (max-width: 1279px) {
	.sud-hd .sud-hd__nav .sud-hd__link,
	.sud-hd .sud-hd__nav .sud-hd__link:hover,
	.sud-hd .sud-hd__nav .sud-hd__link:focus,
	.sud-hd .sud-hd__nav .sud-hd__item.is-open > .sud-hd__link {
		letter-spacing: 0;
	}

	.sud-hd .sud-hd__link { padding-inline: .2rem; }
	.sud-hd .sud-hd__list { gap: 0; }
	.sud-hd .sud-hd__grid { column-gap: .5rem; padding-inline: 1rem; }
}
