/* ==========================================================================
   ebg footer - opc directory: ported from e-Business.gr template-parts/home/footer.php
   and its sections.css rules (.ebg-footer, .ebg-cta-band, .ebg-btn--dark).
   Dark anchor surface with diagonal hairline texture and two accent blooms;
   accent CTA band pulled half its height over the section above; brand / two
   menus / contact grid; bottom bar; faint oversized wordmark.
   Tokens missing from the starter carry the e-Business.gr values as fallbacks.
   ========================================================================== */

@layer components {

	.ebg-ftd {
		--ebg-ftd-rule: rgb(49 61 61); /* ebg footer dashed rules */
		--ebg-ftd-band-lift: clamp(5.5rem, 6.5vw, 7rem);
		--ebg-heading-ink: var(--ebg-on-dark);
		--ebg-body-ink: var(--ebg-on-dark-2);
		--ebg-ink: var(--ebg-on-dark);
		--ebg-ink-2: var(--ebg-on-dark-2);

		position: relative;
		z-index: 1;
		overflow-x: clip;
		inline-size: 100%;
		margin-block-start: var(--ebg-ftd-band-lift);
		padding-block-end: clamp(2.5rem, 5vw, 4rem);
		border-block-start: 1px solid var(--ebg-rim);
		background-color: var(--ebg-surface-anchor);
		color: var(--ebg-on-dark);

		& :where(h2, h3, p, ul) { margin: 0; } /* :where keeps the reset below the component rules */
		& :where(ul) { padding: 0; list-style: none; }

		/* Hairline texture + accent blooms: .ebg-texture-lines .ebg-blooms (_core/elements/decor.css). */
	}

	/* CTA band */
	.ebg-ftd__band-shell {
		position: relative;
		z-index: 10;
		inline-size: 100%;
		max-inline-size: var(--container);
		margin-inline: auto;
		padding-inline: var(--gutter);
		transform: translateY(-50%);
	}

	.ebg-ftd__band {
		--ebg-heading-ink: var(--ebg-on-accent, #FFFFFF);
		--ebg-body-ink: var(--ebg-on-accent-2, rgb(255 255 255 / 0.88));

		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: var(--space-l);
		padding: clamp(1.75rem, 3vw, 2.25rem) clamp(1.75rem, 3.5vw, 3rem);
		border-radius: var(--radius-md);
		background-color: var(--ebg-accent);
		color: var(--ebg-on-accent, #FFFFFF);
		box-shadow: var(--shadow-lg);
	}

	.ebg-ftd__band-eyebrow {
		margin-block-end: var(--space-3xs);
		color: var(--ebg-on-accent-2, rgb(255 255 255 / 0.88));
		font-family: var(--font-mono);
		font-size: var(--fs-11);
		font-weight: 700;
		letter-spacing: var(--tr-eyebrow);
	}

	.ebg-ftd__band-title {
		margin-block-end: var(--space-2xs);
		color: var(--ebg-on-accent, #FFFFFF);
		font-family: var(--font-display);
		font-size: var(--fs-32);
		font-weight: 750;
		line-height: var(--lh-tight);
	}

	.ebg-ftd__band-desc {
		color: var(--ebg-on-accent-2, rgb(255 255 255 / 0.88));
		font-size: var(--text-sm);
	}

	/* Legacy .ebg-btn.ebg-btn--dark with its arrow chip. */
	.ebg-ftd__band-btn {
		--ebg-link-ink: var(--ebg-on-dark);
		--ebg-link-decoration: none;

		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: var(--space-2xs);
		min-block-size: 46px;
		padding: 0.75rem 1.5rem;
		border: 1px solid var(--ebg-rim);
		border-radius: var(--radius-pill);
		background-color: var(--ebg-surface-anchor);
		color: var(--ebg-on-dark);
		font-family: var(--font-sans);
		font-size: var(--text-sm);
		font-weight: 600;
		line-height: 1;
		letter-spacing: 0.01em;
		text-decoration: none;
		white-space: nowrap;
		transition: var(--dur-base) var(--ease-snap);
		transition-property: transform, background-color, color;

		&:is(:hover, :focus-visible) {
			--ebg-link-ink: var(--ebg-on-dark);

			background-color: var(--ebg-surface-anchor-2);
			color: var(--ebg-on-dark);
			transform: translateY(-2px);
		}
	}

	.ebg-ftd__band-chip {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		inline-size: 30px;
		block-size: 30px;
		margin-inline-start: 0.55rem;
		border-radius: var(--radius-pill);
		background-color: var(--ebg-glass-chip, rgb(255 255 255 / 0.2));
		color: inherit;
		font-size: var(--fs-12);
		line-height: 1;
		transition: transform var(--dur-base) var(--ease-snap);
	}

	/* Main area */
	.ebg-ftd__inner {
		position: relative;
		z-index: 1;
		display: flex;
		flex-direction: column;
		gap: var(--space-2xl);
		inline-size: 100%;
		max-inline-size: var(--container);
		margin-inline: auto;
		padding-inline: var(--gutter);
		padding-block-start: clamp(1rem, 2.5vw, 2.5rem);
	}

	.ebg-ftd__grid {
		display: grid;
		grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
		gap: clamp(1.5rem, 3vw, 3rem);
	}

	/* --ebg-ftd-logo-lift: the logo's wordmark starts below the image's top
	   edge (e-Business.gr: 10 of 48px), so it is pulled up until the letters
	   line up with the cap tops of the column headings (measured 2026-11-14,
	   1440: 7px). Re-measure for another logo file; 0 for a tight-cropped one. */
	.ebg-ftd__logo {
		--ebg-ftd-logo-lift: -7px;

		margin-block: var(--ebg-ftd-logo-lift) var(--space-s);

		& :is(a, img, svg) { display: block; inline-size: auto; max-block-size: 44px; object-fit: contain; }
	}

	/* Hover: a white light streak crosses the logo once (owner pick 2026-11-14
	   over a teal streak and an accent glow), clipped to the logo's own
	   shape (mask = the light logo file, --ebg-logo-light-src from
	   _core/php/elements.php). Without the variable the mask fails and no
	   streak shows. */
	.ebg-ftd__logo .ebg-logo {
		position: relative;
		inline-size: fit-content;

		&::after {
			content: "";
			position: absolute;
			inset: 0;
			background: linear-gradient(105deg, transparent 35%, rgb(255 255 255 / 0.9) 50%, transparent 65%) 150% 0 / 250% 100% no-repeat;
			mask: var(--ebg-logo-light-src) center / 100% 100% no-repeat;
			pointer-events: none;
		}

		&:is(:hover, :focus-visible)::after {
			background-position: -50% 0;
			transition: background-position 0.8s ease-in-out;
		}
	}

	@media (prefers-reduced-motion: reduce) {
		.ebg-ftd__logo .ebg-logo::after { display: none; }
	}

	.ebg-ftd__brand-title {
		display: block;
		margin-block-end: var(--space-xs);
		color: var(--ebg-on-dark);
		font-family: var(--font-display);
		font-size: var(--fs-24);
		font-weight: 800;
	}

	.ebg-ftd__brand-desc {
		max-inline-size: 55ch;
		margin-block-end: var(--space-s);
		color: var(--ebg-on-dark-2);
		font-size: var(--fs-15);
		line-height: var(--lh-body);
	}

	/* Row: _core/elements/social.css. In the middle of the bottom bar, as on
	   Layout H11: 28px discs at white 30%, dark icon, 8px apart; hover accent. */
	.ebg-ftd__socials {
		--ebg-social-size: 28px;
		--ebg-social-gap: 8px;
		--ebg-social-fs: 0.875rem;
		--ebg-social-bg: rgb(255 255 255 / 0.3);
		--ebg-social-ink: var(--ebg-surface-anchor);
		--ebg-social-border: transparent;
		--ebg-social-hover-bg: var(--ebg-accent);
		--ebg-social-hover-ink: #FFFFFF;
		--ebg-social-hover-border: transparent;

		margin: 0;
	}

	.ebg-ftd__badge {
		display: inline-block;
		padding: 0.3rem 0.65rem;
		border: 1px solid var(--ebg-rim);
		border-radius: var(--radius-xs, 4px);
		background-color: var(--ebg-glass-fill, rgb(255 255 255 / 0.08));
		color: var(--ebg-accent-bright);
		font-family: var(--font-mono);
		font-size: var(--fs-11);
		font-weight: 700;
		letter-spacing: var(--tr-eyebrow);
		text-decoration: none;
		transition: var(--dur-fast) ease-out;
		transition-property: border-color, background-color;
	}

	a.ebg-ftd__badge:is(:hover, :focus-visible) {
		border-color: var(--ebg-accent-bright);
		background-color: color-mix(in oklab, var(--ebg-accent-bright) 12%, transparent);
	}

	.ebg-ftd__heading {
		margin-block-end: var(--space-s);
		color: var(--ebg-on-dark);
		font-family: var(--font-sans);
		font-size: var(--fs-14);
		font-weight: 700;
		letter-spacing: var(--tr-eyebrow);
		text-transform: uppercase;
	}

	.ebg-ftd__links {
		display: flex;
		flex-direction: column;
		gap: var(--space-xs);

		& a {
			--ebg-link-ink: var(--ebg-on-dark-2);
			--ebg-link-decoration: none;

			color: var(--ebg-on-dark-2);
			font-size: var(--fs-15);
			text-decoration: none;
			transition: color var(--dur-fast);

			&:is(:hover, :focus-visible) { --ebg-link-ink: var(--ebg-accent-bright); color: var(--ebg-accent-bright); }
		}
	}

	.ebg-ftd__line {
		margin-block-end: var(--space-2xs);
		color: var(--ebg-on-dark-2);
		font-size: var(--fs-15);
		line-height: var(--lh-body); /* a wrapped line (long hours) needs room */

		/* Same ink as the plain lines. Hover draws a 1px line from the start, like
		   the second half of the header phone's ebg-line-redraw; no line at rest. */
		& a {
			--ebg-link-ink: inherit;
			--ebg-link-decoration: none;

			padding-block-end: 2px;
			background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat;
			color: inherit;
			text-decoration: none;
			transition: color var(--dur-fast), background-size 0.4s linear;

			&:is(:hover, :focus-visible) { --ebg-link-ink: var(--ebg-accent-bright); color: var(--ebg-accent-bright); background-size: 100% 1px; }
		}
	}

	.ebg-ftd__icon {
		display: inline-block;
		margin-inline-end: 0.5rem;
		color: var(--ebg-accent);
		font-size: 1rem;
		vertical-align: middle;
	}

	.ebg-ftd__band-icon { font-size: 1.125rem; line-height: 1; }

	/* Bottom bar: copyright | socials | credit. ebg's dashed rule runs the page
	   width less 15px either side (as the marquee band), so the bar bleeds out
	   and pads its content back to the shell; content sits 43px under the rule (ebg 31). */
	.ebg-ftd__bottom {
		--ebg-ftd-bleed: calc(50vw - 50% - 15px);

		display: grid;
		grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
		align-items: center;
		gap: var(--space-s);
		margin-inline: calc(-1 * var(--ebg-ftd-bleed));
		padding-block-start: 43px; /* ebg 31; a little more air under the marquee's lower rule */
		padding-inline: var(--ebg-ftd-bleed);
		border-block-start: 1px dashed var(--ebg-ftd-rule);
		color: var(--ebg-on-dark-2);
		font-size: var(--fs-13);

		& > * { margin: 0; }
		& .ebg-ftd__copy { justify-self: start; }
		& .ebg-ftd__socials { justify-self: center; }
		& .ebg-ftd__note { grid-column: 3; justify-self: end; text-align: end; }
	}

	/* Outlined-words marquee (Layout H11 footer): full width less 15px each
	   side, 75px under the columns (ebg 91); equal cap-height gaps between the rules. The inner column
	   gap (--space-2xl) is subtracted; .ebg-ftd clips the 100vw overshoot. */
	.ebg-ftd__marquee {
		--ebg-marquee-speed: 110;

		margin-inline: calc(50% - 50vw + 15px);
		border-block-start: 1px dashed var(--ebg-ftd-rule); /* ebg: rgb(49 61 61) at the band's top edge */
		margin-block: calc(75px - var(--space-2xl)) calc(0px - var(--space-2xl)); /* top: ebg 91, less at the user's request */

		/* Between the rules, the gap over the capitals equals the gap under the
		   baseline (user): the 1.2 line box leaves ~0.26em over the cap height and
		   ~0.22em under the baseline, so 0.045em is added below. ebg: 10px + 20px. */
		& .ebg-outline-words { padding-block-end: calc(var(--ebg-ow-fs) * 0.045); }
	}

	.ebg-ftd__wordmark {
		position: absolute;
		inset-inline: 0;
		inset-block-end: -1.5rem;
		z-index: 0;
		overflow: hidden;
		color: var(--ebg-on-dark);
		font-family: var(--font-display);
		font-size: var(--text-wordmark, var(--fs-64));
		font-weight: 850;
		line-height: 0.75;
		letter-spacing: -0.04em;
		text-align: center;
		white-space: nowrap;
		opacity: 0.045;
		pointer-events: none;
		-webkit-user-select: none;
		user-select: none;
	}

	@media (max-width: 980px) {
		.ebg-ftd__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	}

	@media (max-width: 820px) {
		.ebg-ftd__band { flex-direction: column; align-items: flex-start; gap: 1.25rem; padding: 1.5rem 1.25rem; }
	}

	/* As the title wraps the band grows (~365px stacked at 390), and pulling half
	   of it up covered the last control of the section above (contact form
	   submit, measured 2026-11-05: overlap from 1024 down, 1px clear at 1025). Sit it inside the
	   dark surface instead. */
	@media (max-width: 1199px) {
		.ebg-ftd { margin-block-start: 0; }
		.ebg-ftd__band-shell { padding-block: var(--space-l) var(--space-m); transform: none; }
	}

	@media (max-width: 767px) {
		.ebg-ftd__bottom {
			grid-template-columns: minmax(0, 1fr);
			justify-items: center;
			text-align: center;

			& :is(.ebg-ftd__copy, .ebg-ftd__socials, .ebg-ftd__note) { grid-column: auto; justify-self: center; text-align: center; }
			& .ebg-ftd__socials { order: -1; }
		}
	}

	@media (max-width: 600px) {
		.ebg-ftd__grid { grid-template-columns: minmax(0, 1fr); }
	}

	@media (prefers-reduced-motion: reduce) {
		.ebg-ftd__line a { transition: none; }
	}

	.ebg-ftd__note .ebg-credit { font-size: inherit; } /* _core/php/credit.php */
}
