/* ==========================================================================
   ebg header - Layout H01 (.header-area.header-1). Values are ebg's
   computed values at 1920px (ebg-core.css):
   - logo: height from Blocksy's header Logo Height (ebg's slot is 136x39);
   - bar: white, 15px side margins, 15px below, 12px bottom radius, 90px tall
     (menu links: 37px block padding + 16px line), inline padding 30px
     (ebg container 12px + wrapper 18px);
   - menu: 16px/500, 30px gap, current/hover in accent; dropdown 220px, 10px
     radius, scaleY reveal; caret is ebg-icons \e929 rotating on hover;
   - actions: 20px gap; search 48px circle on surface-0; CTA = ebg-pill with a
     38px disc (48px tall); off-canvas bars 25/18/25px;
   - <=1024px: only logo and a 50px accent menu button (opens #offcanvas).
   Sticky (data-ebg-sticky, _core/js/ebg-header.js): once the bar has left the
   view, it hides on scroll-down and slides in on scroll-up with a shadow (ebg
   .header-duplicate.sticky-up), using one element instead of a duplicate. On
   the way up it stays stuck until the page top hands it back to the flow
   (ebg's duplicate slides away first, leaving no header for a moment).
   ========================================================================== */

@layer components {

	.ebg-hdr {
		position: relative;
		z-index: 99;
		margin: 0 15px 15px;
		border-end-start-radius: 12px;
		border-end-end-radius: 12px;
		background: var(--ebg-surface-1);
		color: var(--ebg-ink);
		transition: box-shadow 0.5s ease;
	}

	.ebg-hdr__bar {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 20px;
		padding-inline: 30px;
	}

	.ebg-hdr__brand {
		flex: none;

		/* Height from Blocksy's Logo Height setting (desktop / tablet / mobile,
		   Blocksy breakpoints 1000px and 690px); width follows the image. */
		& .ebg-logo__img {
			inline-size: auto;
			max-inline-size: none;
			block-size: var(--ebg-hdr-logo-h, 50px);
			max-block-size: none;

			@media (max-width: 999.98px) { block-size: var(--ebg-hdr-logo-h-t, var(--ebg-hdr-logo-h, 50px)); }
			@media (max-width: 689.98px) { block-size: var(--ebg-hdr-logo-h-m, var(--ebg-hdr-logo-h-t, 50px)); }
		}
	}

	.ebg-hdr__logo--text {
		color: var(--ebg-ink);
		font-size: var(--fs-24);
		font-weight: 600;
		text-decoration: none;
	}

	/* Menu */
	.ebg-hdr__menu {
		display: flex;
		align-items: center;
		column-gap: 30px;
		margin: 0;
		padding: 0;
		list-style: none;

		& li {
			position: relative;
			z-index: 1;
		}

		& > li > a {
			position: relative;
			display: block;
			padding-block: 37px;
			color: var(--ebg-ink);
			font-size: 1.09375rem; /* 17.5px. ebg 16/500; owner: larger and bolder (2026-11-05: 17/600; 2026-11-12: 17.5/700, it read small next to the headings) */
			font-weight: 700;
			line-height: 1;
			text-decoration: none;
			transition: color 0.3s ease-in-out;
		}

		& > li.menu-item-has-children > a {
			padding-inline-end: 20px;

			&::after {
				content: "\e929";
				position: absolute;
				top: 40px;
				inset-inline-end: 0;
				color: inherit;
				font-family: "ebg-icons";
				font-size: 0.75rem;
				line-height: 1;
				transition: rotate 0.3s ease-in-out;
			}
		}

		& > li:is(:hover, :focus-within) > a::after { rotate: -180deg; }

		& > li:is(.current-menu-item, .current-menu-ancestor, :hover, :focus-within) > a { color: var(--ebg-accent); }

		& .sub-menu {
			position: absolute;
			top: 100%;
			inset-inline-start: 0;
			z-index: 99;
			display: block;
			inline-size: 220px;
			margin: 0;
			padding: 10px 0;
			list-style: none;
			border-radius: 10px;
			background: var(--ebg-surface-1);
			box-shadow: 0 0 15px 0 rgb(0 0 0 / 0.1);
			opacity: 0;
			visibility: hidden;
			transform: scaleY(0);
			transform-origin: top;
			transition: opacity 0.4s, visibility 0.4s, transform 0.4s;

			& .sub-menu {
				top: 10px;
				inset-inline-start: 100%;
			}

			& a {
				position: relative;
				display: block;
				padding: 6px 20px;
				color: var(--ebg-ink-2);
				font-size: var(--fs-16);
				font-weight: 500;
				line-height: 1.5;
				text-decoration: none;
				transition: 0.3s ease-in-out;
				transition-property: color, padding;
			}

			& li:is(:hover, :focus-within, .current-menu-item) > a {
				padding-inline-start: 25px;
				color: var(--ebg-accent);
			}
		}

		& li:is(:hover, :focus-within) > .sub-menu {
			opacity: 1;
			visibility: visible;
			transform: scaleY(1);
			transition: opacity 0.5s ease, visibility 0.5s ease, transform 0.5s ease;
		}
	}

	/* Dropdown service rows: sub-items with an icon (functions.php adds
	   .ebg-hdr__svc). Layout H01 Services mega menu (.mega-menu-service). */
	.ebg-hdr__menu .sub-menu:has(> .ebg-hdr__svc) {
		inline-size: 345px;
		padding-block: 15px;

		& > li { border-block-end: 1px solid #C9D1D1; } /* ebg --tj-color-border-1 */
		& > li:last-child { border-block-end: 0; }
	}

	.ebg-hdr__menu .sub-menu > .ebg-hdr__svc > a,
	.ebg-hdr__menu .sub-menu > .ebg-hdr__svc:is(:hover, :focus-within, .current-menu-item) > a {
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 15px 25px;
		overflow: hidden;
		color: var(--ebg-ink-2);
		font-size: var(--fs-16);
		font-weight: 500;
		letter-spacing: -0.03em;
		line-height: 1.375;
	}

	.ebg-hdr__menu .sub-menu > .ebg-hdr__svc:is(:hover, :focus-within) > a { color: var(--ebg-accent); }

	.ebg-hdr__svc-icon {
		display: inline-flex;
		flex-shrink: 0;
		align-items: center;
		justify-content: center;
		inline-size: 54px;
		block-size: 54px;
		border-radius: 50%;
		background: linear-gradient(-45deg, rgba(var(--ebg-accent-rgb), 0.3) 0%, rgba(var(--ebg-accent-rgb), 0) 50%, rgba(var(--ebg-accent-rgb), 0.3) 100%);
		background-color: transparent;
		color: var(--ebg-accent);
		font-size: 2.5rem;
		transition: 0.4s ease-in-out;

		/* Font Awesome glyphs are wider-set than the theme's: keep them in the disc. */
		& i[class*="fa-"] { font-size: 1.5rem; }
	}

	.ebg-hdr__svc:is(:hover, :focus-within) .ebg-hdr__svc-icon {
		background-color: var(--ebg-accent);
		color: #FFFFFF;
	}

	.ebg-hdr__svc-title {
		display: inline-block;
		max-inline-size: 171px;
	}

	.ebg-hdr__svc-nav {
		position: relative;
		inset-inline-end: -16px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-inline-size: 45px;
		margin-inline-start: auto;
		overflow: hidden;
		color: var(--ebg-accent);
		font-size: 1.6em;
		line-height: 1;
		opacity: 0;
		rotate: -45deg;
		transition: opacity 0.3s;

		& i { transition: translate 0.4s ease-in-out; }
		& i:last-child { position: absolute; translate: -150% 0; }
	}

	.ebg-hdr__svc:is(:hover, :focus-within) .ebg-hdr__svc-nav {
		opacity: 1;

		& i:first-child { translate: 150% 0; }
		& i:last-child { translate: 0 0; }
	}

	/* Optional per-item icons (Customizer > Κεφαλίδα; legacy variant) */
	/* Font Awesome Free (assets/vendor/fontawesome-free); fixed width so mixed
	   glyphs line up (fa-fw). */
	.ebg-hdr__icon {
		display: inline-block;
		inline-size: 1.25em;
		margin-inline-end: 0.35em;
		font-size: 0.95em;
		text-align: center;
	}

	/* Actions */
	.ebg-hdr__actions {
		display: flex;
		flex: none;
		align-items: center;
		gap: 20px;
	}

	.ebg-hdr__search {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		inline-size: 48px;
		block-size: 48px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: var(--ebg-surface-0);
		color: var(--ebg-ink);
		font-size: var(--fs-20);
		line-height: 1;
		cursor: pointer;
		transition: background-color 0.2s ease, color 0.2s ease;
		&:hover { color: var(--ebg-accent); }
	}

	.ebg-hdr__cta .wp-block-button__link { --ebg-btn-disc-size: 38px; }

	.ebg-hdr__burger {
		display: inline-flex;
		flex-direction: column;
		justify-content: center;
		gap: 6px;
		inline-size: 25px;
		block-size: 25px;
		margin-inline-start: 5px;
		padding: 0;
		border: 0;
		background: none;
		cursor: pointer;

		& span {
			display: block;
			inline-size: 18px;
			block-size: 2px;
			margin-inline-end: auto;
			border-radius: 10px;
			background: var(--ebg-ink);
			transition: inline-size 0.3s;
		}

		& span:first-child,
		& span:last-child { inline-size: 25px; }

		&:hover span { inline-size: 100%; }
	}

	/* Desktop button opens the side panel, the mobile one Blocksy's menu (#offcanvas). */
	@media (min-width: 1025px) {
		.ebg-hdr__burger--mobile { display: none; }
	}

	/* Phone: body size (17px) with a 17px glyph, as tuned on legacy
	   (override.css sets .header-contact { font-size: inherit }); ebg's
	   default is 20px, 18px at 1201-1399. */
	.ebg-hdr__phone .wp-block-button__link {
		--ebg-phone-icon: var(--fs-17);

		margin-block-start: 6px; /* the 3px underline padding lifted the number 2.5px above the menu and CTA centre line (user, 2026-11-05) */
		font-size: var(--fs-17);
	}

	@media (max-width: 1024px) {
		.ebg-hdr__burger--desktop { display: none; }
	}

	@media (min-width: 1201px) and (max-width: 1399px) {
		.ebg-hdr__bar { padding-inline: 20px; }
		.ebg-hdr__menu { column-gap: 22px; }
	}

	@media (min-width: 1025px) and (max-width: 1200px) {
		.ebg-hdr__bar { padding-inline: 16px; }
		.ebg-hdr__menu { column-gap: 16px; }
		.ebg-hdr__actions { gap: 12px; }
		.ebg-hdr__search { inline-size: 44px; block-size: 44px; font-size: var(--fs-18); }
		.ebg-hdr__cta .wp-block-button__link { --ebg-btn-disc-size: 35px; }
		.ebg-hdr__burger { margin-inline-start: 0; }
	}

	@media (max-width: 1024px) {
		.ebg-hdr__bar { padding: 15px 12px; }

		.ebg-hdr__nav,
		.ebg-hdr__phone,
		.ebg-hdr__search,
		.ebg-hdr__cta { display: none; }

		.ebg-hdr__burger {
			inline-size: 50px;
			block-size: 50px;
			margin: 0;
			padding: 12px;
			border-radius: 7px;
			background: var(--ebg-accent);

			& span { background: #FFFFFF; }
		}
	}

	@media (max-width: 767px) {
		.ebg-hdr { margin-inline: 0; }
	}

	/* Side panel (ebg .tj-offcanvas-area, legacy dark search field).
	   470px, 15px from the viewport edges, slides in from the end edge. */
	.ebg-sidebar {
		position: fixed;
		inset-block-start: calc(15px + var(--wp-admin--admin-bar--height, 0px));
		inset-inline-end: 15px;
		z-index: 99999;
		inline-size: min(470px, calc(100vw - 30px));
		block-size: calc(100dvh - 30px - var(--wp-admin--admin-bar--height, 0px));
		overflow-y: auto;
		scrollbar-width: none;
		border-radius: 12px;
		background: var(--ebg-surface-anchor);
		box-shadow: -5px 0 20px -5px rgb(0 0 0 / 0.5);
		color: var(--ebg-on-dark-2);
		font-size: var(--fs-16);
		line-height: 1.5;
		visibility: hidden;
		translate: calc(100% + 30px) 0;
		transition: translate 0.5s ease, visibility 0.5s ease;

		&.is-open {
			visibility: visible;
			translate: 0 0;
		}
	}

	.ebg-sidebar__wrap {
		position: relative;
		isolation: isolate;
		display: flex;
		flex-direction: column;
		justify-content: space-between;
		gap: 40px;
		min-block-size: 100%;
		padding: 40px;

		/* Accent glow, top end corner: .ebg-glow (_core/elements/decor.css). */
		--ebg-glow-top: 3%;
		--ebg-glow-end: 3%;

		@media (max-width: 575px) { padding-inline: 20px; }
	}

	.ebg-sidebar__top {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin-block-end: 30px;

		& .ebg-logo__img {
			inline-size: auto;
			max-inline-size: 240px;
			block-size: 38px;
			max-block-size: none;
		}
	}

	.ebg-sidebar__close {
		display: inline-flex;
		padding: 0;
		border: 0;
		background: none;
		color: #FFFFFF;
		cursor: pointer;
		transition: color 0.3s ease-in-out, rotate 0.3s ease-in-out;

		& svg { inline-size: 35px; block-size: 35px; }

		&:hover { color: var(--ebg-accent); rotate: 90deg; }
	}

	.ebg-sidebar__text { margin: 0 0 40px; }

	/* Menu accordion (<=1024px; ebg meanmenu in .hamburger-area). */
	.ebg-sidebar__nav { display: none; margin-block-end: 45px; }

	.ebg-sidebar__menu {
		margin: 0;
		padding: 0;
		list-style: none;

		& li { position: relative; }

		& > li { border-block-end: 1px solid rgb(255 255 255 / 0.1); }
		& > li:last-child { border-block-end: 0; }

		& a {
			display: block;
			padding: 17px 40px 17px 0;
			color: #FFFFFF;
			font-size: var(--fs-18);
			font-weight: 500;
			line-height: 1.3;
			text-decoration: none;
			transition: color 0.3s ease-in-out;

			&:hover { color: var(--ebg-accent); }
		}

		& .current-menu-item > a,
		& .current-menu-ancestor > a { color: var(--ebg-accent); }

		& .sub-menu {
			display: none;
			margin: 0 0 12px;
			padding: 0 0 0 16px;
			list-style: none;

			& a {
				padding-block: 8px;
				color: var(--ebg-on-dark-2);
				font-size: var(--fs-16);
				font-weight: 400;
			}
		}

		& li.is-expanded > .sub-menu { display: block; }
	}

	.ebg-sidebar__toggle {
		position: absolute;
		inset-block-start: 9px;
		inset-inline-end: 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		inline-size: 40px;
		block-size: 40px;
		padding: 0;
		border: 0;
		background: none;
		color: #FFFFFF;
		font-size: 0.875rem;
		cursor: pointer;
		transition: rotate 0.3s ease-in-out;

		li.is-expanded > & { rotate: 180deg; }
	}

	@media (max-width: 1024px) {
		.ebg-sidebar__nav { display: block; }
		.ebg-sidebar__desk { display: none; }
	}

	.ebg-sidebar__block { margin-block-end: 45px; }

	.ebg-sidebar__title {
		margin: 0 0 25px;
		color: #FFFFFF;
		font-size: var(--fs-22);
		font-weight: 500;
		line-height: 1;
	}

	.ebg-sidebar__search {
		position: relative;

		& input {
			inline-size: 100%;
			block-size: 60px;
			padding: 0 70px 0 16px;
			border: 1px solid var(--ebg-rim);
			border-radius: 10px;
			background: var(--ebg-ink-2);
			color: #CED4DA;
			font: inherit;
			font-size: var(--fs-18);
			transition: border-color 0.3s ease-in-out;

			&::placeholder { color: rgb(206 212 218 / 0.6); }
			&:focus { border-color: var(--ebg-accent); }
			&:focus-visible { outline: 2px solid var(--ebg-accent); outline-offset: 2px; }
		}

		& button {
			position: absolute;
			inset-block-start: 1px;
			inset-inline-end: 1px;
			display: inline-flex;
			align-items: center;
			justify-content: center;
			inline-size: 58px;
			block-size: 58px;
			padding: 0;
			border: 0;
			border-inline-start: 1px solid var(--ebg-rim);
			background: none;
			color: #CED4DA;
			font-size: var(--fs-24);
			cursor: pointer;

			&:hover { color: #FFFFFF; }
		}
	}

	.ebg-sidebar__info {
		margin: 0;

		& > div { padding-block: 15px 10px; }
		& > div:first-child { padding-block-start: 0; }

		& dt {
			margin-block-end: 7px;
			font-size: var(--fs-14);
			line-height: 1;
		}

		& dd {
			margin: 0;
			color: #FFFFFF;
		}

		& a {
			color: inherit;
			text-decoration: none;
			transition: color 0.3s ease-in-out;

			&:hover { color: var(--ebg-accent); }
		}
	}

	/* Row: _core/elements/social.css; ebg white discs at 0.3 opacity. */
	.ebg-sidebar__socials .ebg-socials {
		--ebg-social-size: 28px;
		--ebg-social-gap: 11px;
		--ebg-social-bg: #FFFFFF;
		--ebg-social-ink: var(--ebg-surface-anchor);
		--ebg-social-opacity: 0.3;
	}

	.ebg-sidebar-overlay {
		position: fixed;
		inset: 0;
		z-index: 9999;
		backdrop-filter: blur(10px);
		opacity: 0;
		transition: opacity 0.4s ease;

		&.is-open { opacity: 1; }
	}

	@media (prefers-reduced-motion: reduce) {
		.ebg-sidebar,
		.ebg-sidebar-overlay { transition: none; }
	}

	/* Sticky on scroll-up. Blocksy's <header id="header"> is the sticky box; the
	   legacy theme rule (sections.css) makes it always sticky, so reset it here. */
	#header:has(> .ebg-hdr) {
		position: relative;
		transform: none;
		transition: transform 0.5s ease, visibility 0.5s ease;
	}

	#header.ebg-hdr-away,
	#header.ebg-hdr-stuck {
		position: sticky;
		top: var(--wp-admin--admin-bar--height, 0px);
		z-index: 999;
	}

	#header.ebg-hdr-away {
		visibility: hidden;
		transform: translateY(-120%);
	}

	#header.ebg-hdr-stuck { transform: translateY(calc(-1 * var(--ebg-hdr-offset, 0px))); }

	#header.ebg-hdr-stuck .ebg-hdr { box-shadow: 0 0 15px 0 rgb(0 0 0 / 0.1); }

	/* Set by ebg-header.js for one frame when the bar enters or leaves the page
	   flow, where the stuck and flow positions match or the bar is out of view. */
	#header.ebg-hdr-instant { transition: none; }

	@media (prefers-reduced-motion: reduce) {
		#header:has(> .ebg-hdr) { transition: none; }
	}

	/* --------------------------------------------------------------------
	   Mobile Drawer Navigation Elements (Blocksy offcanvas panel)
	   -------------------------------------------------------------------- */
	.ebg-mobile-nav { margin-block-end: var(--space-l); }
	.ebg-mobile-nav__list {
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;

		li {
			border-block-end: 1px solid var(--ebg-hairline);
			margin: 0;
		}
		a {
			display: block;
			padding-block: 0.875rem;
			font-family: var(--font-sans);
			font-size: var(--fs-17);
			font-weight: 700;
			color: var(--ebg-heading-ink);
			text-decoration: none;
			transition: color var(--dur-fast) var(--ease-snap);
		}
		a:hover { color: var(--ebg-accent); }
	}
	.ebg-mobile-nav__extra {
		display: flex;
		flex-direction: column;
		gap: var(--space-s);
		margin-block-start: var(--space-m);
	}
	.ebg-mobile-phone {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		font-family: var(--font-sans);
		font-size: var(--fs-16);
		font-weight: 700;
		color: var(--ebg-heading-ink);
		text-decoration: none;
	}
	.ebg-mobile-phone:hover { color: var(--ebg-accent); }
	.ebg-mobile-cta {
		width: 100%;
		justify-content: space-between;
	}
	.ebg-btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: var(--space-2xs);
		min-height: 46px;
		padding: .75rem 1.5rem;
		border: 1px solid transparent;
		border-radius: var(--radius-pill);
		background-color: transparent;
		--ebg-link-ink: var(--ebg-heading-ink);
		--ebg-link-decoration: none;
		font-family: var(--font-sans);
		font-size: var(--text-sm);
		font-weight: 600;
		line-height: 1;
		letter-spacing: .01em;
		cursor: pointer;
		text-decoration: none;
		transition: var(--dur-fast) var(--ease-snap);
		transition-property: background-color, border-color, color, box-shadow, transform;
	}
	.ebg-btn--primary {
		background-color: var(--ebg-accent);
		color: var(--ebg-on-dark, #FFFFFF);
		box-shadow: var(--shadow-sm);
	}
	.ebg-btn--primary:hover {
		background-color: var(--ebg-accent-bright, var(--ebg-accent));
		color: var(--ebg-surface-anchor, #FFFFFF);
		box-shadow: var(--shadow-md);
		transform: translateY(-1px);
	}
	.ebg-btn__chip {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 24px;
		height: 24px;
		border-radius: var(--radius-pill);
		background-color: var(--ebg-surface-anchor);
		color: #FFFFFF;
		font-size: var(--fs-13);
		line-height: 1;
		transition: transform var(--dur-fast) var(--ease-snap);
	}
	.ebg-btn--primary:hover .ebg-btn__chip {
		transform: translate(2px, -2px);
	}
}
