/*
Theme Name:   CYS Child
Theme URI:    https://cys.dtma.site/
Description:  Astra child theme for CYS Structural Engineers. Pages are built in Elementor; this file holds only the styles Elementor controls cannot express.
Author:       Codinative
Template:     astra
Version:      1.0.0
Text Domain:  cys-child
*/

/* ------------------------------------------------------------------ */
/* Bracket button: corner brackets around every Elementor button.      */
/* Colours, type and padding come from the Elementor kit.             */
/* ------------------------------------------------------------------ */

:is(.elementor-widget-button, .cys-form) .elementor-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	white-space: normal;
	text-align: center;
	transition-property: color, background-color, border-color, fill, stroke;
	transition-duration: 0.15s;
	transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

:is(.elementor-widget-button, .cys-form) .elementor-button::before,
:is(.elementor-widget-button, .cys-form) .elementor-button::after {
	content: "";
	position: absolute;
	width: 22px;
	height: 16px;
	border-color: currentColor;
	pointer-events: none;
	transition: width 0.2s, height 0.2s;
}

:is(.elementor-widget-button, .cys-form) .elementor-button::before {
	top: 0;
	left: 0;
	border-top: 2px solid;
	border-left: 2px solid;
}

:is(.elementor-widget-button, .cys-form) .elementor-button::after {
	right: 0;
	bottom: 0;
	border-right: 2px solid;
	border-bottom: 2px solid;
}

:is(.elementor-widget-button, .cys-form) .elementor-button:hover::before,
:is(.elementor-widget-button, .cys-form) .elementor-button:hover::after,
:is(.elementor-widget-button, .cys-form) .elementor-button:focus-visible::before,
:is(.elementor-widget-button, .cys-form) .elementor-button:focus-visible::after {
	width: 32px;
	height: 22px;
}

:is(.elementor-widget-button, .cys-form) .elementor-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 5px;
}

:is(.elementor-widget-button, .cys-form) .elementor-button-content-wrapper {
	align-items: center;
	gap: 8px;
}

:is(.elementor-widget-button, .cys-form) .elementor-button-icon svg {
	width: 16px;
	height: 16px;
}

/* Line icons: Elementor fills button SVGs with the text colour, which turns the arrow solid. */
:is(.elementor-widget-button, .cys-form) .elementor-button-icon svg path {
	fill: none;
}

/* ------------------------------------------------------------------ */
/* Container width steps from the design (640 / 768 / 1024 / 1280 /    */
/* 1344px). Side padding is set on each section in Elementor.          */
/* ------------------------------------------------------------------ */

@media (min-width: 640px) {
	.elementor .e-con {
		--container-max-width: 640px;
	}
}

@media (min-width: 768px) {
	.elementor .e-con {
		--container-max-width: 768px;
	}
}

@media (min-width: 1024px) {
	.elementor .e-con {
		--container-max-width: 1024px;
	}
}

@media (min-width: 1280px) {
	.elementor .e-con {
		--container-max-width: 1280px;
	}
}

@media (min-width: 1536px) {
	.elementor .e-con {
		--container-max-width: 1344px;
	}
}

/* ------------------------------------------------------------------ */
/* Media helpers                                                      */
/* ------------------------------------------------------------------ */

/* Fixed 4:3 crop for photos, whatever size the client uploads. */
.cys-ratio-4-3 img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* Astra adds a drop shadow to images and figures on single posts; the design has none. */
.single-project .ast-article-single img,
.single-project .ast-article-single figure {
	box-shadow: none;
}

/* Wide 16:8 crop for the project detail photo. */
.cys-ratio-16-8 img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 8;
	object-fit: cover;
}

/* Inline theme icons printed by the "Theme Icon" dynamic tag. */
.cys-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.cys-icon-20 {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

/* Row numbers 01, 02 ... for repeater lists ("ACF Repeater for Elementor" rows). */
.arfe-repeater-grid {
	counter-reset: cys-row;
}

.arfe-repeater-item {
	counter-increment: cys-row;
}

.cys-row-num {
	display: block;
	font-family: var(--e-global-typography-cys_eyebrow-font-family), monospace;
	font-size: 10px;
	font-weight: 500;
	line-height: 1.3;
	text-transform: uppercase;
	transition: color 0.3s;
}

.cys-row-num::before {
	content: counter(cys-row, decimal-leading-zero);
}

.cys-row-num--green {
	color: var(--e-global-color-secondary);
}

.cys-row-num--caption {
	color: var(--e-global-color-cys_caption);
}

.cys-row-num--white {
	color: var(--e-global-color-cys_white_45);
}

/* ------------------------------------------------------------------ */
/* Header: mobile/tablet menu (hamburger dropdown)                     */
/* ------------------------------------------------------------------ */

/* 44px tap area; the icon sits on the right content edge. */
.cys-header-nav .elementor-menu-toggle {
	width: 44px;
	height: 44px;
	padding: 0;
	justify-content: flex-end;
}

.cys-header-nav .elementor-nav-menu--dropdown {
	border-top: 1px solid var(--e-global-color-cys_border);
	border-bottom: 1px solid var(--e-global-color-cys_border);
	box-shadow: 0 20px 40px rgba(36, 41, 92, 0.08);
}

/* ------------------------------------------------------------------ */
/* Projects: tiles                                                     */
/* ------------------------------------------------------------------ */

.cys-project-photo {
	overflow: hidden;
}

.cys-project-photo img {
	transition: transform 0.6s;
}

.cys-project-card:hover .cys-project-photo img,
.cys-project-card:focus-visible .cys-project-photo img {
	transform: scale(1.035);
}

.cys-project-card:focus-visible {
	outline: 2px solid var(--e-global-color-secondary);
	outline-offset: 4px;
}

/* ------------------------------------------------------------------ */
/* Expertise: discipline rows                                         */
/* ------------------------------------------------------------------ */

.e-con.cys-discipline-row {
	--padding-top: 28px;
	--padding-bottom: 28px;
	--padding-left: 0px;
	border-top: 1px solid var(--e-global-color-cys_border);
	transition: background-color 0.35s, padding-left 0.35s, padding-inline-start 0.35s, border-color 0.35s;
}

.e-con.cys-discipline-row:hover,
.e-con.cys-discipline-row:focus-visible {
	--padding-left: 18px;
	background-color: color-mix(in srgb, #268f44 6%, transparent);
	border-top-color: #268f44;
}

.cys-discipline-row .cys-icon {
	color: var(--e-global-color-primary);
	transition: transform 0.35s, color 0.35s;
}

.cys-discipline-row:hover .cys-icon {
	color: #268f44;
	transform: translate(4px, -4px);
}

/* ------------------------------------------------------------------ */
/* Markets: flow list with drawn line and nodes                        */
/* ------------------------------------------------------------------ */

.cys-flow .arfe-repeater-grid {
	position: relative;
}

.cys-flow .arfe-repeater-grid::before {
	content: "";
	position: absolute;
	top: 26px;
	bottom: 26px;
	left: 11px;
	width: 1px;
	background: var(--e-global-color-primary);
	opacity: 0.22;
	transform-origin: top;
	transition: transform 1.5s cubic-bezier(0.6, 0.1, 0.2, 1);
}

.e-con.cys-flow-row {
	--padding-top: 13px;
	--padding-bottom: 13px;
	--padding-left: 0px;
	border-bottom: 1px solid var(--e-global-color-cys_border);
	transition: background-color 0.3s, padding-left 0.3s, padding-inline-start 0.3s;
}

.cys-flow .arfe-repeater-item:last-child .cys-flow-row {
	border-bottom: 0;
}

.e-con.cys-flow-row:hover {
	--padding-left: 8px;
	background-color: color-mix(in srgb, var(--e-global-color-secondary) 5%, transparent);
}

.cys-flow-node {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
}

.cys-flow-node::before {
	content: "";
	width: 9px;
	height: 9px;
	border: 1.5px solid var(--e-global-color-primary);
	border-radius: 50%;
	background: #fff;
	transition: background-color 0.3s, border-color 0.3s, transform 0.3s;
}

.cys-flow-row:hover .cys-flow-node::before {
	background: var(--e-global-color-secondary);
	border-color: var(--e-global-color-secondary);
	transform: scale(1.25);
}

.cys-flow-icon {
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	color: var(--e-global-color-primary);
	opacity: 0.78;
	transition: color 0.3s, opacity 0.3s;
}

.cys-flow-icon svg {
	width: 24px;
	height: 24px;
}

.cys-flow-row:hover .cys-flow-icon {
	color: var(--e-global-color-secondary);
	opacity: 1;
}

.cys-flow-index {
	justify-self: end;
}

.cys-flow-row:hover .cys-row-num {
	color: var(--e-global-color-secondary);
}

/* Scroll reveal, armed by assets/js/reveal.js. */
.cys-reveal.is-armed .arfe-repeater-grid::before {
	transform: scaleY(0);
}

.cys-reveal.is-drawn .arfe-repeater-grid::before {
	transform: none;
}

.cys-reveal.is-armed .arfe-repeater-item {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.8s, transform 0.8s;
}

.cys-reveal.is-drawn .arfe-repeater-item {
	opacity: 1;
	transform: none;
}

.cys-reveal .arfe-repeater-item:nth-child(1) { transition-delay: 120ms; }
.cys-reveal .arfe-repeater-item:nth-child(2) { transition-delay: 200ms; }
.cys-reveal .arfe-repeater-item:nth-child(3) { transition-delay: 280ms; }
.cys-reveal .arfe-repeater-item:nth-child(4) { transition-delay: 360ms; }
.cys-reveal .arfe-repeater-item:nth-child(5) { transition-delay: 440ms; }
.cys-reveal .arfe-repeater-item:nth-child(6) { transition-delay: 520ms; }
.cys-reveal .arfe-repeater-item:nth-child(7) { transition-delay: 600ms; }
.cys-reveal .arfe-repeater-item:nth-child(8) { transition-delay: 680ms; }

/* ------------------------------------------------------------------ */
/* Careers band                                                        */
/* ------------------------------------------------------------------ */

.e-con.cys-career-band {
	overflow: hidden;
}

/* Blueprint grid lines and the green top rule. */
.cys-career-band::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		linear-gradient(#18848729 1px, transparent 1px),
		linear-gradient(90deg, #18848729 1px, transparent 1px);
	background-size: 80px 80px;
	opacity: 0.5;
	pointer-events: none;
}

.cys-career-band::after {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 4px;
	background: var(--e-global-color-secondary);
}

.cys-career-band > .e-con-inner {
	position: relative;
	z-index: 1;
}

.cys-career-points .arfe-repeater-grid {
	border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.e-con.cys-career-point {
	--padding-top: 20px;
	--padding-bottom: 20px;
	--padding-left: 0px;
	border-bottom: 1px solid rgba(255, 255, 255, 0.16);
	transition: background-color 0.3s, padding-left 0.3s, padding-inline-start 0.3s;
}

.e-con.cys-career-point:hover {
	--padding-left: 12px;
	background-color: rgba(255, 255, 255, 0.05);
}

.cys-career-icon {
	display: grid;
	place-items: center;
	width: 46px;
	height: 46px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	color: #fff;
	transition: color 0.3s, border-color 0.3s, transform 0.3s;
}

.cys-career-icon svg {
	width: 20px;
	height: 20px;
}

.cys-career-point:hover .cys-career-icon {
	color: var(--e-global-color-secondary);
	border-color: var(--e-global-color-secondary);
	transform: translateY(-2px);
}

/* ------------------------------------------------------------------ */
/* Team cards                                                         */
/* ------------------------------------------------------------------ */

.e-con.cys-team-portrait {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border: 1px dashed rgba(36, 41, 92, 0.35);
	background: rgba(36, 41, 92, 0.03);
	color: rgba(36, 41, 92, 0.45);
	transition: border-color 0.3s, color 0.3s;
}

.cys-team-card:hover .cys-team-portrait {
	border-color: var(--e-global-color-secondary);
	color: var(--e-global-color-secondary);
}

.cys-team-portrait .cys-icon {
	width: 44px;
	height: 44px;
}

.elementor .cys-team-portrait .elementor-heading-title {
	color: inherit;
}

/* An uploaded photo covers the placeholder. */
.cys-team-photo {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.cys-team-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* ------------------------------------------------------------------ */
/* Forms (Elementor Pro Form widget with class "cys-form")             */
/* Colours, borders and type come from the widget; sizes live here.    */
/* ------------------------------------------------------------------ */

.cys-form .elementor-field-group .elementor-field-textual,
.cys-form .elementor-field-group .elementor-upload-field {
	min-height: 44px;
	padding: 12px;
	line-height: 18px;
}

.cys-form .elementor-field-group select.elementor-field-textual {
	min-height: 45px;
	padding-right: 32px;
}

.cys-form .elementor-field-group textarea.elementor-field-textual {
	min-height: 116px;
}

.cys-form .elementor-upload-field {
	width: 100%;
	border: 1px solid var(--e-global-color-cys_border);
	border-radius: 2px;
	background: #fff;
	color: var(--e-global-color-primary);
	font-size: 12px;
}

.cys-form .elementor-field-group .elementor-field-textual:focus,
.cys-form .elementor-upload-field:focus {
	outline: 2px solid var(--e-global-color-secondary);
	outline-offset: 1px;
}

/* Submit button sits on the left with its natural width, like the other buttons. */
.cys-form .e-form__buttons {
	justify-content: flex-start;
}

.cys-form .elementor-form .elementor-button[type="submit"] {
	width: auto;
	flex-grow: 0;
	min-height: 48px;
}

/* File inputs render taller than text inputs; pin them to the same 44px. */
.cys-form .elementor-field-group .elementor-upload-field {
	height: 44px;
	padding-top: 10px;
	padding-bottom: 10px;
}

.cys-form .elementor-message {
	font-size: 14px;
	line-height: 1.6;
}

/* ------------------------------------------------------------------ */
/* Projects filter                                                     */
/* ------------------------------------------------------------------ */

.cys-filter .e-filter-item {
	cursor: pointer;
	transition: color 0.15s, background-color 0.15s;
}

/* Shown when a sector has no projects yet. */
.elementor-widget-loop-grid .e-loop-nothing-found-message__text {
	padding: 24px 0;
	color: var(--e-global-color-cys_caption);
	font-family: var(--e-global-typography-cys_body-font-family), sans-serif;
	font-size: 15px;
	line-height: 1.8;
}

.cys-filter .e-filter-item:focus-visible {
	outline: 2px solid var(--e-global-color-secondary);
	outline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 700px) {
	/* 16px text stops iPhones from zooming the page when a field is tapped. */
	.cys-form .elementor-field-group .elementor-field-textual,
	.cys-form .elementor-field-group .elementor-upload-field {
		font-size: 16px;
	}

	.e-con.cys-discipline-row > .cys-discipline-text {
		grid-area: 2 / 2;
	}

	.e-con.cys-flow-row {
		--padding-top: 11px;
		--padding-bottom: 11px;
	}

	.cys-flow .arfe-repeater-grid::before {
		left: 10px;
	}

	.cys-flow-icon svg {
		width: 21px;
		height: 21px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cys-project-photo img,
	.e-con.cys-discipline-row,
	.e-con.cys-flow-row,
	.e-con.cys-career-point,
	.cys-career-icon,
	:is(.elementor-widget-button, .cys-form) .elementor-button::before,
	:is(.elementor-widget-button, .cys-form) .elementor-button::after {
		transition: none;
	}
}
