/*
 * Shawa — main menu dropdown (child theme module, 2026-11-29)
 * Styles ONLY the sub-menus of the main menu (#mainmenu) and adds Font Awesome icons.
 * Icons come from a 1.5 KB subset of Font Awesome Free 6.7.2 Solid (assets/fontawesome, licence in LICENSE.txt).
 * Icons are matched by link URL, so the WordPress menu itself needs no changes.
 */
@font-face {
	font-family: "Shawa Menu Icons";
	src: url("../../assets/fontawesome/webfonts/shawa-menu-icons.woff2") format("woff2"),
	     url("../../assets/fontawesome/webfonts/shawa-menu-icons.ttf") format("truetype");
	font-weight: 900;
	font-style: normal;
	font-display: block;
}

/* ---------- Icons (by link URL) ---------- */
#mainmenu li li > a::before { content: "\f1ad"; } /* default: building */
#mainmenu li li > a[href*="/services/architecture-design"]::before { content: "\f568"; }   /* compass-drafting */
#mainmenu li li > a[href*="/services/interior-design"]::before { content: "\f4b8"; }       /* couch */
#mainmenu li li > a[href*="/services/fit-out"]::before { content: "\f5aa"; }               /* paint-roller */
#mainmenu li li > a[href*="/services/landscape-design"]::before { content: "\f1bb"; }      /* tree */
#mainmenu li li > a[href*="/services/engineering-supervision"]::before { content: "\f807"; } /* helmet-safety */
#mainmenu li li > a[href$="/fit-out/"]:not([href*="/services/"])::before { content: "\f7d9"; } /* screwdriver-wrench */

#mainmenu li li > a::before {
	font-family: "Shawa Menu Icons";
	font-weight: 900;
	font-style: normal;
	font-variant: normal;
	text-transform: none;
	letter-spacing: 0;
	-webkit-font-smoothing: antialiased;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	box-sizing: border-box;
	border: 1px solid rgba(250, 178, 7, .38);
	border-radius: 50%;
	color: #FAB207;
	line-height: 1;
	transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* ---------- Desktop dropdown ---------- */
@media only screen and (min-width: 993px) {
	/* chevron after "Our Services" (before the theme's yellow dot separator) */
	#mainmenu > li.menu-item-has-children > a { display: inline-flex; align-items: center; }
	#mainmenu > li.menu-item-has-children > a::before {
		content: "\f078";
		font-family: "Shawa Menu Icons";
		font-weight: 900;
		font-size: 8px;
		letter-spacing: 0;
		order: 1;
		margin-left: 8px;
		opacity: .75;
		transition: transform .25s ease, opacity .25s ease;
	}
	#mainmenu > li.menu-item-has-children > a::after { order: 2; }
	#mainmenu > li.menu-item-has-children:hover > a::before,
	#mainmenu > li.menu-item-has-children:focus-within > a::before { transform: rotate(180deg); opacity: 1; }

	#mainmenu > li > ul.sub-menu {
		width: 330px;
		height: auto;
		padding: 10px 0;
		margin: 0;
		background: #141517;
		border-top: 2px solid #FAB207;
		box-shadow: 0 24px 48px rgba(0, 0, 0, .5);
		transform: translateY(10px);
		transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
	}
	#mainmenu > li:hover > ul.sub-menu,
	#mainmenu > li:focus-within > ul.sub-menu { opacity: 1; visibility: visible; top: 100%; transform: none; }

	#mainmenu li li,
	#mainmenu li li:last-child { display: block; float: none; border: 0; font-size: 11px; }
	#mainmenu li li + li > a { border-top: 1px solid rgba(255, 255, 255, .06); }

	#mainmenu li li > a,
	header.smaller #mainmenu li li > a {
		display: flex;
		align-items: center;
		gap: 16px;
		padding: 12px 24px;
		background: transparent;
		color: #cfd1d4;
		font-size: 11px;
		line-height: 1.5;
		letter-spacing: 2px;
		white-space: normal;
		text-align: left;
		transition: background-color .25s ease, color .25s ease, padding-left .25s ease;
	}
	#mainmenu li li > a::before { width: 36px; height: 36px; font-size: 14px; }

	#mainmenu li li > a:hover,
	#mainmenu li li > a:focus-visible { background: rgba(255, 255, 255, .04); color: #fff; padding-left: 28px; outline: none; }
	/* hover: the theme paints the item yellow, so the circle + icon take the text colour and stay visible */
	#mainmenu li li > a:hover::before,
	#mainmenu li li > a:focus-visible::before { background: transparent; border-color: currentColor; color: inherit; }

	#mainmenu li li.current-menu-item > a,
	#mainmenu li li.current_page_item > a { color: #FAB207; }
	#mainmenu li li.current-menu-item > a::before,
	#mainmenu li li.current_page_item > a::before { background: rgba(250, 178, 7, .12); }
}

/* Small laptops (993–1199px): keep all 8 main items on one line next to the logo, narrower dropdown */
@media only screen and (min-width: 993px) and (max-width: 1199px) {
	header #mainmenu > li > a { letter-spacing: 2px; padding-left: 4px; padding-right: 4px; }
	#mainmenu > li > a::after { margin-left: 10px; }
	#mainmenu > li.menu-item-has-children > a::before { margin-left: 6px; }
	#mainmenu > li > ul.sub-menu { width: 300px; }
	#mainmenu li li > a, header.smaller #mainmenu li li > a { padding: 11px 20px; gap: 14px; }
}

/* ---------- Tablet & mobile (theme collapses the menu at 992px) ---------- */
@media only screen and (max-width: 992px) {
	#mainmenu > li.menu-item-has-children > a::before { content: none; }

	#mainmenu li ul.sub-menu { background: rgba(255, 255, 255, .03); }
	header #mainmenu li ul li:first-child { border-top: 1px solid rgba(255, 255, 255, .08); }
	#mainmenu li ul li { padding-left: 0; border: 0; }

	#mainmenu li ul li a {
		display: flex;
		align-items: center;
		gap: 14px;
		padding: 12px 18px 12px 26px;
		border: 0;
		border-bottom: 1px solid rgba(255, 255, 255, .06);
		color: #cfd1d4;
		font-size: 11px;
		line-height: 1.5;
		letter-spacing: 2px;
		white-space: normal;
	}
	#mainmenu li ul li:last-child a { border-bottom: 0; }
	#mainmenu li li > a::before { width: 32px; height: 32px; font-size: 13px; }
	#mainmenu li ul li a:hover,
	#mainmenu li ul li a:focus-visible { background: rgba(255, 255, 255, .05); color: #fff; }
	#mainmenu li ul li a:hover::before,
	#mainmenu li ul li a:focus-visible::before { background: transparent; border-color: currentColor; color: inherit; }
	#mainmenu li li.current-menu-item > a { color: #FAB207; }

	/* open/close arrow: brand chevron instead of the theme PNG */
	header #mainmenu li span.arrow,
	header #mainmenu li span.arrow.active {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		margin-top: 4px;
		background: none;
		color: #FAB207;
	}
	header #mainmenu li span.arrow::before {
		content: "\f078";
		font-family: "Shawa Menu Icons";
		font-weight: 900;
		font-size: 12px;
		transition: transform .25s ease;
	}
	header #mainmenu li span.arrow.active::before { transform: rotate(180deg); }
}

@media (prefers-reduced-motion: reduce) {
	#mainmenu > li > ul.sub-menu,
	#mainmenu li li > a,
	#mainmenu li li > a::before,
	header #mainmenu li span.arrow::before { transition: none; }
}
