/* =====================================================================
   AGC Classic Header
   The original agc.com.cy header (Divi 4 split header) and the project
   category bar. Every rule is scoped to body.agc-classic, which only
   exists while the "AGC Classic Header" child theme is active.

   Values taken from the live site (Nov 2026):
     header 96px (live: 107px), white, fixed (desktop) / in the page flow (mobile)
     links Open Sans 14px 600, black; current and hover #0594b5
     logo 75px high (60px on mobile)
     dropdowns 200px, white, soft teal shadow
     category bar under the header on the 5 category pages, desktop only

   Contents:
     1. Settings
     2. Hide the Theme Builder header (back-up) and make room
     3. Desktop header
     4. Desktop dropdowns
     5. Category bar
     6. Mobile header (980px and below)
     7. Mobile menu
   ===================================================================== */


/* ---------------------------------------------------------------------
   1. SETTINGS
   --------------------------------------------------------------------- */

body.agc-classic {
	--agc-cl-height: 96px;           /* desktop header height: 75px logo + ~12px visible gap above and below the circle (the PNG has ~2px transparent edges) */
	--agc-cl-bar-height: 60px;       /* category bar height */
	--agc-cl-logo: 75px;             /* desktop logo height */
	--agc-cl-logo-mobile: 60px;
	--agc-cl-gap: 22px;              /* space between menu items */
	--agc-cl-text: #000;
	--agc-cl-current: #0594b5;
	--agc-cl-burger: #2ea3f2;        /* hamburger lines and mobile menu top line */
	--agc-cl-font: 'Open Sans', Helvetica, Arial, Lucida, sans-serif;
	--agc-cl-admin: 0px;             /* WordPress admin bar, set below */
}

body.agc-classic.admin-bar {
	--agc-cl-admin: 32px;
}


/* ---------------------------------------------------------------------
   2. HIDE THE THEME BUILDER HEADER, MAKE ROOM FOR OURS
   functions.php already stops Divi printing the Theme Builder header;
   this is a back-up in case a cached page still contains it.
   --------------------------------------------------------------------- */

body.agc-classic .et-l--header {
	display: none !important;
}

@media (min-width: 981px) {

	/* Fixed header: push the page down by its height */
	body.agc-classic #page-container {
		padding-top: var(--agc-cl-height) !important;
	}

	/* Category pages: header + category bar */
	body.agc-classic.agc-cl-catpage #page-container {
		padding-top: calc(var(--agc-cl-height) + var(--agc-cl-bar-height)) !important;
	}
}


/* ---------------------------------------------------------------------
   3. DESKTOP HEADER
   --------------------------------------------------------------------- */

body.agc-classic .agc-cl-header,
body.agc-classic .agc-cl-header *,
body.agc-classic .agc-cl-catbar,
body.agc-classic .agc-cl-catbar * {
	box-sizing: border-box;
}

body.agc-classic .agc-cl-header ul,
body.agc-classic .agc-cl-catbar ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

/* The site CSS gives every li a 15px bottom margin and 135% line height,
   which pushed the menu (and logo) up. Not wanted in the header. */
body.agc-classic .agc-cl-header li,
body.agc-classic .agc-cl-catbar li {
	margin: 0;
	line-height: normal;
}

body.agc-classic .agc-cl-header {
	position: fixed;
	top: var(--agc-cl-admin);
	left: 0;
	right: 0;
	z-index: 99990;
	height: var(--agc-cl-height);
	background: #fff;
	box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
	font-family: var(--agc-cl-font);
	transition: box-shadow 0.4s ease-in-out;
}

/* Stronger shadow once the page is scrolled (as the old fixed header) */
body.agc-classic .agc-cl-header.agc-cl-scrolled {
	box-shadow: 0 0 23px rgba(0, 0, 0, 0.6);
}

body.agc-classic .agc-cl-inner {
	width: 80%;
	max-width: 1080px;
	height: 100%;
	margin: 0 auto;
}

body.agc-classic .agc-cl-nav,
body.agc-classic .agc-cl-menu {
	height: 100%;
}

/* One centred row; the logo is the middle item */
body.agc-classic .agc-cl-menu {
	display: flex;
	justify-content: center;
	align-items: stretch;
	gap: var(--agc-cl-gap);
}

body.agc-classic .agc-cl-menu > li {
	position: relative;
	display: flex;
	align-items: center;
}

body.agc-classic .agc-cl-menu > li > a {
	display: flex;
	align-items: center;
	height: 100%;
	color: var(--agc-cl-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: color 0.4s ease-in-out;
}

body.agc-classic .agc-cl-menu > li > a:hover {
	color: var(--agc-cl-current);
}

/* Current page, and PROJECTS on a category page */
body.agc-classic .agc-cl-menu > li.agc-cl-current > a,
body.agc-classic .agc-cl-menu > li.agc-cl-ancestor > a {
	color: var(--agc-cl-current);
}

/* Small down chevron after PROJECTS and INFORMATION */
body.agc-classic .agc-cl-menu > li.agc-cl-has-sub > a::after {
	content: '';
	width: 5px;
	height: 5px;
	margin: -3px 0 0 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
}

/* Logo */
body.agc-classic .agc-cl-menu > li.agc-cl-logo {
	padding: 0 4px;
}

body.agc-classic .agc-cl-logo img {
	display: block;
	width: auto;
	height: var(--agc-cl-logo);
	max-width: none;
}

body.agc-classic .agc-cl-logo a:hover {
	opacity: 1;
}

/* Desktop only */
body.agc-classic .agc-cl-mobile {
	display: none;
}


/* ---------------------------------------------------------------------
   4. DESKTOP DROPDOWNS
   Open on hover, and on keyboard focus.
   --------------------------------------------------------------------- */

body.agc-classic .agc-cl-sub {
	position: absolute;
	top: 100%;
	left: -10px;
	z-index: 99991;
	width: 200px;
	padding: 4px 0 !important;
	background: #fff;
	box-shadow: -12px 16px 25px -18px rgba(9, 114, 130, 0.61);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
}

body.agc-classic .agc-cl-menu > li:hover > .agc-cl-sub,
body.agc-classic .agc-cl-menu > li:focus-within > .agc-cl-sub,
body.agc-classic .agc-cl-menu > li.agc-cl-open > .agc-cl-sub {
	opacity: 1;
	visibility: visible;
}

body.agc-classic .agc-cl-sub li {
	padding: 0 2px;
}

body.agc-classic .agc-cl-sub a {
	display: block;
	padding: 6px 10px;
	color: var(--agc-cl-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4em;
	text-decoration: none;
	transition: color 0.3s ease-in-out;
}

body.agc-classic .agc-cl-sub a:hover {
	background: #fff;
	color: var(--agc-cl-current);
}

body.agc-classic .agc-cl-sub li.agc-cl-current > a {
	color: var(--agc-cl-current);
}


/* ---------------------------------------------------------------------
   5. CATEGORY BAR
   Under the header on the five project category pages, desktop only.
   --------------------------------------------------------------------- */

body.agc-classic .agc-cl-catbar {
	position: fixed;
	top: calc(var(--agc-cl-admin) + var(--agc-cl-height));
	left: 0;
	right: 0;
	z-index: 99980;
	height: var(--agc-cl-bar-height);
	background: #fff;
	border-top: 1px solid #dbdbdb;
	box-shadow: 0 12px 18px -6px rgba(0, 0, 0, 0.3);
	font-family: var(--agc-cl-font);
}

body.agc-classic .agc-cl-catbar ul {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 0 var(--agc-cl-gap);
	height: 100%;
	width: 80%;
	max-width: 1080px;
	margin: 0 auto;
}

body.agc-classic .agc-cl-catbar a {
	color: rgba(0, 0, 0, 0.6);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: color 0.4s ease-in-out;
}

body.agc-classic .agc-cl-catbar a:hover {
	color: var(--agc-cl-current);
}

body.agc-classic .agc-cl-catbar li.agc-cl-current a {
	color: var(--agc-cl-current);
}


/* ---------------------------------------------------------------------
   6. MOBILE HEADER (980px and below)
   As the old site: centred logo, then a "Select Page" bar. Not fixed;
   it scrolls away with the page. No category bar.
   --------------------------------------------------------------------- */

@media (max-width: 980px) {

	body.agc-classic .agc-cl-header {
		position: relative;
		top: 0;
		height: auto;
		z-index: 99990;
	}

	body.agc-classic .agc-cl-header.agc-cl-scrolled {
		box-shadow: 0 1px 0 rgba(0, 0, 0, 0.1);
	}

	body.agc-classic .agc-cl-nav,
	body.agc-classic .agc-cl-catbar {
		display: none;
	}

	body.agc-classic .agc-cl-mobile {
		display: block;
		padding: 18px 0 20px;
	}

	body.agc-classic .agc-cl-mlogo {
		display: block;
		width: max-content;
		margin: 0 auto 16px;
	}

	body.agc-classic .agc-cl-mlogo img {
		display: block;
		width: auto;
		height: var(--agc-cl-logo-mobile);
		max-width: none;
	}

	/* "Select Page" bar */
	body.agc-classic .agc-cl-mnav {
		position: relative;
	}

	body.agc-classic .agc-cl-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		margin: 0;
		padding: 9px 10px;
		border: 0;
		border-radius: 5px;
		background: rgba(0, 0, 0, 0.05);
		color: #333;
		font-family: var(--agc-cl-font);
		font-size: 14px;
		font-weight: 600;
		line-height: 1.4;
		text-align: left;
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	/* Hamburger: three lines, turns into a cross when open */
	body.agc-classic .agc-cl-burger {
		position: relative;
		width: 22px;
		height: 16px;
	}

	body.agc-classic .agc-cl-burger::before,
	body.agc-classic .agc-cl-burger::after,
	body.agc-classic .agc-cl-burger i {
		content: '';
		position: absolute;
		left: 0;
		width: 100%;
		height: 2px;
		border-radius: 1px;
		background: var(--agc-cl-burger);
		transition: transform 0.25s ease, opacity 0.25s ease, top 0.25s ease;
	}

	body.agc-classic .agc-cl-burger::before { top: 0; }
	body.agc-classic .agc-cl-burger i       { top: 7px; }
	body.agc-classic .agc-cl-burger::after  { top: 14px; }

	body.agc-classic .agc-cl-toggle[aria-expanded="true"] .agc-cl-burger::before {
		top: 7px;
		transform: rotate(45deg);
	}

	body.agc-classic .agc-cl-toggle[aria-expanded="true"] .agc-cl-burger i {
		opacity: 0;
	}

	body.agc-classic .agc-cl-toggle[aria-expanded="true"] .agc-cl-burger::after {
		top: 7px;
		transform: rotate(-45deg);
	}


	/* -------------------------------------------------------------------
	   7. MOBILE MENU
	   Drops down over the page under the "Select Page" bar.
	   ------------------------------------------------------------------- */

	body.agc-classic .agc-cl-mmenu {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		z-index: 99995;
		display: none;
		max-height: calc(100vh - 140px);
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		padding: 5% !important;
		background: #fff;
		border-top: 3px solid var(--agc-cl-burger);
		box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
	}

	body.agc-classic .agc-cl-mmenu.agc-cl-shown {
		display: block;
	}

	body.agc-classic .agc-cl-mmenu a {
		display: block;
		padding: 10px 5%;
		border-bottom: 1px solid rgba(0, 0, 0, 0.03);
		color: var(--agc-cl-text);
		font-size: 14px;
		font-weight: 600;
		line-height: 1.4;
		text-decoration: none;
	}

	/* PROJECTS and INFORMATION: bold, light grey, not links */
	body.agc-classic .agc-cl-mmenu > li.agc-cl-has-sub > a {
		background: rgba(0, 0, 0, 0.03);
		font-weight: 700;
		cursor: default;
	}

	/* Their pages, indented */
	body.agc-classic .agc-cl-mmenu .agc-cl-sub {
		position: static;
		width: auto;
		padding: 0 !important;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
	}

	body.agc-classic .agc-cl-mmenu .agc-cl-sub li {
		padding: 0;
	}

	body.agc-classic .agc-cl-mmenu .agc-cl-sub a {
		padding-left: 10%;
	}

	body.agc-classic .agc-cl-mmenu .agc-cl-sub a:hover {
		background: none;
		color: var(--agc-cl-current);
	}

	body.agc-classic .agc-cl-mmenu li.agc-cl-current > a {
		color: var(--agc-cl-current);
	}
}

/* WordPress admin bar is 46px high on small screens */
@media (max-width: 782px) {
	body.agc-classic.admin-bar {
		--agc-cl-admin: 46px;
	}
}
