/* ==========================================================
   Unicorn Group - brand helpers
   Colours and fonts come from Elementor Site Settings
   (Global Colors / Global Fonts). Here only effects that
   Elementor free can't do on its own.
   ========================================================== */

:root {
	--ug-teal: #66bdbd;
	--ug-navy: #253645;
	--ug-grey: #e7e8e9;
	--ug-teal-10: #f0f8f8;
	--ug-radius: 6px;
}

/* ---------- Flip card (Manufacturing Skills) ----------
   Elementor structure:
   Container  .ug-flip
     Container .ug-flip__front  (background image + title)
     Container .ug-flip__back   (teal, icon + text)
   Desktop: flips on hover. Touch screens: flips on tap
   (assets/js/unicorn.js toggles .is-flipped).
   Front and back share one grid cell, so the card grows if a
   back text ever needs more room than the design height.
*/
.ug-flip {
	perspective: 1200px;
	min-height: 405px;
	cursor: pointer;
	position: relative;
	-webkit-tap-highlight-color: transparent;
}
.e-con.ug-flip:not(:has(> .e-con-inner)),
.ug-flip > .e-con-inner { display: grid !important; }
.ug-flip .ug-flip__front,
.ug-flip .ug-flip__back {
	grid-area: 1 / 1;
	position: relative !important;
	inset: auto;
	min-height: 405px;
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	border-radius: var(--ug-radius);
	overflow: hidden;
	transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}
.ug-flip .ug-flip__back { transform: rotateY(180deg); }
.ug-flip.is-flipped .ug-flip__front { transform: rotateY(-180deg); }
.ug-flip.is-flipped .ug-flip__back { transform: none; }
@media (hover: hover) {
	.ug-flip:hover .ug-flip__front,
	.ug-flip:focus-visible .ug-flip__front { transform: rotateY(-180deg); }
	.ug-flip:hover .ug-flip__back,
	.ug-flip:focus-visible .ug-flip__back { transform: none; }
}
/* keep text sharp on the turned card */
.ug-flip .ug-flip__back {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
.ug-flip .ug-flip__back .elementor-widget-text-editor p { margin-bottom: 19px; }
.ug-flip .ug-flip__back .elementor-widget-text-editor p:last-child { margin-bottom: 0; }
/* Tablet and phone: keep the desktop card proportions (323 x 405) */
@media (max-width: 1024px) {
	.e-con.ug-flip { aspect-ratio: 323 / 405; min-height: 0 !important; --min-height: 0px; }
	.ug-flip .ug-flip__front,
	.ug-flip .ug-flip__back { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.ug-flip .ug-flip__front,
	.ug-flip .ug-flip__back { transition: opacity .2s; transform: none !important; }
	.ug-flip .ug-flip__back { opacity: 0; }
	.ug-flip.is-flipped .ug-flip__back { opacity: 1; }
	.ug-flip.is-flipped .ug-flip__front { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) and (hover: hover) {
	.ug-flip:hover .ug-flip__back { opacity: 1; }
	.ug-flip:hover .ug-flip__front { opacity: 0; }
}

/* ---------- Text ---------- */
/* No extra space under the last paragraph of a text block */
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* ---------- Brand cards ---------- */
.ug-brand-card {
	transition: box-shadow .25s ease, transform .25s ease;
}
.ug-brand-card:hover {
	box-shadow: 0 10px 30px rgba(37, 54, 69, .12);
	transform: translateY(-2px);
}

/* ---------- Buttons ---------- */
/* Shadow comes from Elementor Site Settings > Buttons */
.elementor-button {
	transition: background-color .2s ease, color .2s ease, transform .15s ease;
}
.elementor-button:active { transform: scale(.98); }

/* Fixed-width buttons from the design (Visit Website, View Available Jobs) */
.ug-btn-290 .elementor-button {
	min-width: 290px;
	min-height: 45px;
	justify-content: center;
	align-items: center;
}
@media (max-width: 400px) {
	.ug-btn-290 .elementor-button { min-width: 0; width: 100%; }
}

/* ---------- Team grid: rounded photos ---------- */
.ug-team .elementor-image-box-img img,
.ug-team img {
	border-radius: 16px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

/* ---------- Header (Header & Footer Builder) ---------- */
/* HFE wraps the header template in #masthead: make it sticky */
#masthead,
.ehf-header #masthead {
	position: sticky;
	top: 0;
	z-index: 999;
}
.admin-bar #masthead, .admin-bar.ehf-header #masthead { top: 32px; }
@media (max-width: 782px) { .admin-bar #masthead, .admin-bar.ehf-header #masthead { top: 46px; } }

.ug-header .elementor-button { white-space: nowrap; }
.ug-header .ug-header-cta { flex-shrink: 0; }
@media (min-width: 1025px) {
	.ug-header .hfe-nav-menu a { white-space: nowrap; }
}

/* "Get in Touch" lives in the menu for mobile only,
   on desktop the teal button is shown instead */
@media (min-width: 1025px) {
	.hfe-nav-menu .ug-mobile-only { display: none !important; }
	/* the hidden item is the real last child, so drop the gap after "Careers" */
	.ug-header .hfe-nav-menu > li:has(+ li.ug-mobile-only) { margin-right: 0 !important; }
	/* gaps from the design (Brands 80 Meet The Team 54 Careers) */
	.ug-header .hfe-nav-menu > li { margin-right: 54px !important; }
	.ug-header .hfe-nav-menu > li:nth-child(1) { margin-right: 80px !important; }
	/* never let the items drop to a second line */
	.ug-header ul.hfe-nav-menu { flex-wrap: nowrap !important; }
	.ug-header .elementor-widget-navigation-menu,
	.ug-header .hfe-nav-menu__layout-horizontal { flex-shrink: 0; }
}

/* Call / Email pills: keep them on the right, stacked, never wrapping */
.ug-header .ug-header-pills .elementor-widget-button { width: auto; }
@media (min-width: 1025px) { .ug-header .ug-header-pills { margin-top: -4px !important; } }
html { scroll-padding-top: 126px; }

/* Smaller desktops: tighten the header so everything stays on one line */
@media (min-width: 1025px) and (max-width: 1400px) {
	.ug-header .hfe-nav-menu > li,
	.ug-header .hfe-nav-menu > li:nth-child(1) { margin-right: 44px !important; }
	.ug-header .ug-header-pills { margin-right: 0 !important; }
	.elementor-47 .elementor-element-2200490 { --gap: 40px; --column-gap: 40px; }
}
@media (min-width: 1025px) and (max-width: 1279px) {
	.ug-header .hfe-nav-menu a.hfe-menu-item { font-size: 16px !important; }
	.ug-header .hfe-nav-menu > li,
	.ug-header .hfe-nav-menu > li:nth-child(1) { margin-right: 26px !important; }
	.elementor-47 .elementor-element-2200490 { --gap: 26px; --column-gap: 26px; }
	.ug-header .ug-header-pills { width: auto !important; }
	.ug-header .ug-header-pills .elementor-button { font-size: 13px; padding: 4px 12px; }
	.ug-header .elementor-widget-site-logo img { width: 150px !important; }
}
/* Mobile dropdown: comfortable tap targets + dividers */
@media (max-width: 1024px) {
	.ug-header .hfe-nav-menu__container .menu-item a.hfe-menu-item {
		border-bottom: 1px solid rgba(255, 255, 255, .12);
	}
}

/* ---------- Footer ---------- */
.ug-footer a,
.ug-footer .elementor-widget-text-editor a {
	color: #fff;
	text-decoration: none;
}
.ug-footer a:hover,
.ug-footer .elementor-widget-text-editor a:hover { color: var(--ug-teal); }
.ug-footer .elementor-widget-text-editor p:last-child { margin-bottom: 0; }
.ug-footer .ug-privacy { font-size: 13px; }
.ug-footer .ug-privacy a { text-decoration: underline; }
.ug-footer .ug-accreditations img { height: 45px; width: auto; object-fit: contain; }
/* Social icons: brand-blue glyph, no tile behind it */
.ug-footer .ug-social .elementor-social-icon { background: transparent !important; }

/* ---------- Responsive ---------- */
/* Hero titles: the design line breaks only make sense on desktop */
@media (max-width: 767px) {
	.ug-hero .elementor-heading-title br { display: none; }
}
/* Team grid: keep photos square when columns get narrower */
@media (max-width: 1024px) {
	.ug-team-grid .elementor-widget-image img {
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 245 / 243;
		object-fit: cover;
	}
}
/* Footer links: comfortable tap area on touch screens */
@media (max-width: 1024px) {
	.ug-footer .elementor-widget-text-editor a {
		display: inline-block;
		padding: 6px 0;
	}
	.ug-footer .elementor-widget-text-editor p { margin-bottom: 4px; }
}

/* ---------- Accessibility ---------- */
a:focus-visible,
.elementor-button:focus-visible {
	outline: 2px solid var(--ug-teal);
	outline-offset: 3px;
}

/* Brands grid: the 1321px row from the design only fits from ~1380px up.
   On small laptops scale the 3 cards down instead of overflowing. */
@media (min-width: 1025px) and (max-width: 1380px) {
	.e-con:has(> .ug-brand-row),
	.e-con:has(> .ug-brand-card) {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
	.e-con > .ug-brand-card { width: calc((100% - 40px) / 3) !important; }
}

/* Team grid: 4 x 245px + 90px gaps only fits from ~1380px up */
@media (min-width: 1025px) and (max-width: 1380px) {
	.e-con.ug-team-grid {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		--column-gap: 40px;
		column-gap: 40px !important;
		grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	}
	.ug-team-grid > .e-con { width: 100% !important; }
	.ug-team-grid .elementor-widget-image img {
		width: 100% !important;
		height: auto !important;
		aspect-ratio: 245 / 243;
		object-fit: cover;
	}
	.ug-team-grid .elementor-widget-heading,
	.ug-team-grid .elementor-widget-text-editor { width: 100% !important; max-width: 100% !important; }
}



/* ---------- Team grid from wp-admin > Team Members: [unicorn_team] ---------- */
.ug-team {
	display: grid;
	grid-template-columns: repeat(4, 245px);
	column-gap: 90px;
	row-gap: 62px;
	width: 1250px;
	max-width: 100%;
	margin-left: 22px;
}
.ug-team__member {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	min-width: 0;
}
.ug-team .ug-team__photo {
	display: block;
	width: 245px;
	height: 243px;
	max-width: 100%;
	object-fit: cover;
	border-radius: 20px;
}
.ug-team .ug-team__name {
	margin: 22px 0 0;
	font-family: "Open Sans", sans-serif;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .01em;
	color: #000;
}
.ug-team .ug-team__role {
	margin: 0;
	font-family: "Open Sans", sans-serif;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.2;
	color: #000;
}
@media (max-width: 1380px) {
	.ug-team {
		width: 100%;
		margin-left: 0;
		grid-template-columns: repeat(4, minmax(0, 245px));
		justify-content: space-between;
		column-gap: 32px;
	}
	.ug-team .ug-team__photo { width: 100%; height: auto; aspect-ratio: 245 / 243; }
}
@media (max-width: 1024px) {
	.ug-team { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 32px; row-gap: 48px; }
}
@media (max-width: 767px) {
	.ug-team { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; row-gap: 32px; }
	.ug-team .ug-team__name { margin-top: 14px; font-size: 16px; }
	.ug-team .ug-team__role { font-size: 14px; }
}

/* ---------- Join the Team photo: keep its proportions on every screen ---------- */
.ug-join-photo img { width: 100% !important; height: auto !important; object-fit: cover; }

/* ---------- Header sub-menus (for future dropdown items) ---------- */
@media (min-width: 1025px) {
	.ug-header .hfe-nav-menu > li.menu-item-has-children { position: relative; }
	.ug-header .hfe-nav-menu > li > .sub-menu {
		top: calc(100% + 52px) !important;
		margin-top: 0 !important;
		left: 50% !important;
		right: auto !important;
		transform: translateX(-50%);
		min-width: 240px;
		padding: 8px 0 !important;
		background: #253645 !important;
		border-top: 3px solid #66bdbd !important;
		border-radius: 0 0 8px 8px;
		box-shadow: 0 12px 24px rgba(0, 0, 0, .25) !important;
	}
	/* invisible bridge so the menu stays open while moving the mouse down */
	.ug-header .hfe-nav-menu > li > .sub-menu::before {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 100%;
		height: 55px;
	}
	.ug-header .hfe-nav-menu .sub-menu .sub-menu::before { display: none; }
	.ug-header .hfe-nav-menu .sub-menu .sub-menu {
		top: -11px !important;
		left: 100% !important;
		border-radius: 0 8px 8px 0;
		border-top-width: 0 !important;
	}
	.ug-header .hfe-nav-menu .sub-menu li { border: 0 !important; }
	.ug-header .hfe-nav-menu .sub-menu a.hfe-sub-menu-item,
	.ug-header .hfe-nav-menu .sub-menu a {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 10px 22px !important;
		background: transparent !important;
		color: #fff !important;
		font-family: "Open Sans", sans-serif;
		font-size: 16px !important;
		font-weight: 500 !important;
		line-height: 1.3 !important;
		white-space: nowrap;
		transition: color .2s, background-color .2s;
	}
	.ug-header .hfe-nav-menu .sub-menu a:hover,
	.ug-header .hfe-nav-menu .sub-menu a:focus-visible,
	.ug-header .hfe-nav-menu .sub-menu .current-menu-item > a {
		color: #66bdbd !important;
		background: rgba(255, 255, 255, .06) !important;
	}
}
.ug-header .hfe-nav-menu .sub-arrow,
.ug-header .hfe-nav-menu .sub-arrow i,
.ug-header .hfe-nav-menu .sub-arrow svg { color: inherit; fill: currentColor; }
@media (max-width: 1024px) {
	.ug-header .hfe-nav-menu .sub-menu { background: #1d2b37 !important; }
	.ug-header .hfe-nav-menu .sub-menu a {
		padding-left: 40px !important;
		color: #fff !important;
		font-size: 16px !important;
		background: transparent !important;
	}
	.ug-header .hfe-nav-menu .sub-menu .sub-menu a { padding-left: 60px !important; }
	.ug-header .hfe-nav-menu .sub-menu a:hover { color: #66bdbd !important; }
}

/* ---------- Mobile / tablet menu: full screen under the header ---------- */
:root { --ug-hh: 126px; --ug-ab: 0px; }
@media (max-width: 1024px) { :root { --ug-hh: 80px; } }
@media (max-width: 767px) { :root { --ug-hh: 72px; } }
.admin-bar { --ug-ab: 32px; }
@media (max-width: 782px) { .admin-bar { --ug-ab: 46px; } }

@media (max-width: 1024px) {
	/* burger flush with the right edge */
	.ug-header .hfe-nav-menu__toggle { margin-left: auto !important; margin-right: 0 !important; }
	.ug-header .elementor-widget-navigation-menu { margin-left: auto; }

	.ug-header nav.hfe-dropdown {
		position: fixed !important;
		top: calc(var(--ug-ab) + var(--ug-hh)) !important;
		left: 0 !important;
		right: 0 !important;
		width: auto !important;
	}
	.ug-header nav.hfe-dropdown .hfe-nav-menu { display: block !important; height: auto !important; }
	.ug-header nav.hfe-dropdown .hfe-nav-menu > li { width: 100%; }
	.ug-header nav.hfe-dropdown.menu-is-active {
		bottom: 0 !important;
		height: auto !important;
		max-height: none !important;
		margin: 0 !important;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		background: #253645 !important;
		box-shadow: none !important;
		z-index: 998;
		padding-bottom: 32px;
	}
	.ug-header nav.hfe-dropdown .hfe-nav-menu { background: transparent !important; }
	.ug-header nav.hfe-dropdown .hfe-nav-menu > li > a.hfe-menu-item {
		padding: 18px 24px !important;
		font-size: 20px !important;
		font-weight: 500 !important;
		color: #fff !important;
		background: transparent !important;
	}
	.ug-header nav.hfe-dropdown .hfe-nav-menu > li > a.hfe-menu-item:hover,
	.ug-header nav.hfe-dropdown .hfe-nav-menu > li.current-menu-item > a.hfe-menu-item { color: #66bdbd !important; }

	/* Call / Email pills at the bottom of the menu */
	.ug-header nav.hfe-dropdown li.ug-menu-pill { border: 0 !important; padding: 0 24px; }
	.ug-header nav.hfe-dropdown li.ug-menu-pill:not(.ug-menu-pill ~ .ug-menu-pill) { margin-top: 28px; }
	.ug-header nav.hfe-dropdown li.ug-menu-pill + li.ug-menu-pill { margin-top: 12px; }
	.ug-header nav.hfe-dropdown li.ug-menu-pill > a.hfe-menu-item {
		display: inline-flex !important;
		width: auto !important;
		padding: 10px 22px !important;
		border: 0 !important;
		border-radius: 50px;
		background: #66bdbd !important;
		color: #fff !important;
		font-size: 16px !important;
		font-weight: 500 !important;
		line-height: 1.2 !important;
	}
	.ug-header nav.hfe-dropdown li.ug-menu-pill > a.hfe-menu-item:hover { background: #fff !important; color: #253645 !important; }
	body.ug-menu-open { overflow: hidden; }
}

/* ---------- Homepage hero (photo in colour, navy fade from the left) ----------
   The text box is ordinary Elementor widgets inside the .ug-hero-box
   container, so the wording can be changed in Elementor any time.
   Desktop fade is the hero's Background Overlay (gradient) in Elementor;
   on narrower screens the text covers the whole photo, so darken it evenly. */
@media (max-width: 1024px) {
	.e-con.ug-hero-home::before {
		background-image: linear-gradient(90deg, rgba(37, 54, 69, .8) 0%, rgba(37, 54, 69, .55) 100%) !important;
		opacity: 1 !important;
	}
}
/* the white frame hugs the text, like the design */
.e-con.ug-hero-box {
	--width: auto;
	width: fit-content !important;
	max-width: 100%;
	box-sizing: border-box;
}
@media (max-width: 767px) {
	.e-con.ug-hero-box { width: 100% !important; }
}

/* ---------- Photos: never stretch ----------
   Elementor's "Object Fit: Cover" only reaches desktop, so on tablet and
   phone photos with a fixed height were squashed. Crop instead. */
.elementor-widget-image img { object-fit: cover; }
.ug-brand-card .elementor-widget-image img,
.ug-accreditations img,
.ug-flip .elementor-widget-image img { object-fit: contain; }

/* Phones: section photos (More than a job, Meet the Team...) get a
   friendly 4:3 frame instead of a thin strip */
@media (max-width: 767px) {
	.e-con > .elementor-widget-image:not(.ug-join-photo):not(.ug-flip *):not(.ug-brand-card *):not(.ug-job-card *):not(.ug-accreditations *) img {
		height: auto !important;
		aspect-ratio: 4 / 3;
	}
}

/* Job cards: photo fills the card width on every screen */
.ug-job-card .elementor-widget-image { width: 100% !important; max-width: 100% !important; }
.ug-job-card .elementor-widget-image img {
	width: 100% !important;
	max-width: 100% !important;
	height: auto !important;
	aspect-ratio: 352 / 200;
}

/* Brands on tablet: one continuous 2-column grid (2 + 2 + 1)
   instead of 2 + 1 + 2 */
@media (min-width: 768px) and (max-width: 1024px) {
	.e-con:has(> .ug-brand-row) {
		flex-direction: row !important;
		flex-wrap: wrap !important;
		justify-content: center !important;
		gap: 20px !important;
	}
	.e-con > .ug-brand-row { display: contents !important; }
	.e-con:has(> .ug-brand-row) > .e-con > .ug-brand-card,
	.ug-brand-row > .ug-brand-card { width: calc(50% - 10px) !important; max-width: calc(50% - 10px) !important; }
}
