/* Zenesis v2 — Organisation & Workplace Excellence page (zn-owi framed statement, zn-owc organisation-chart grid,
   zn-owx includes index). Banner and consultation button come from service.css. Content, colours, typography and
   spacing are set in Elementor / Site Settings; this file adds the frame, connector lines, table layout and the
   scroll reveal. States are set by service-ow.js; without JS everything is visible. */

:where(.zn-owi, .zn-owc, .zn-owx) { --zn-ease-out: cubic-bezier(.16, 1, .3, 1); position: relative; }
:is(.zn-owi, .zn-owc, .zn-owx) .elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* ════════ Statement in a drafting frame ════════ */
.zn-owi .zn-owi__frame { --c: 34px; position: relative; isolation: isolate; }
/* faint drafting grid, fading out towards the edges */
.zn-owi .zn-owi__frame > .zn-owi__grid {
	position: absolute; inset: 0; width: auto; height: auto; min-height: 0; margin: 0; z-index: -1; pointer-events: none;
	background-image:
		linear-gradient(var(--e-global-color-zn_line) 1px, transparent 1px),
		linear-gradient(90deg, var(--e-global-color-zn_line) 1px, transparent 1px);
	background-size: 48px 48px; background-position: -1px -1px; opacity: .55;
	-webkit-mask-image: radial-gradient(ellipse at 70% 50%, #000 0%, transparent 72%);
	mask-image: radial-gradient(ellipse at 70% 50%, #000 0%, transparent 72%);
}
/* gold corner brackets */
.zn-owi .zn-owi__frame::before, .zn-owi .zn-owi__frame::after {
	content: ""; position: absolute; width: var(--c); height: var(--c); opacity: 1; z-index: 1; pointer-events: none;
	border: 0 solid var(--e-global-color-primary); background: none;
}
.zn-owi .zn-owi__frame::before { left: 0; top: 0; border-width: 1px 0 0 1px; }
.zn-owi .zn-owi__frame::after { right: 0; bottom: 0; border-width: 0 1px 1px 0; }
.zn-owi .zn-owi__text { min-width: 0; }
.zn-owi .zn-owi__text .zn-m { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.zn-owi .zn-owi__text .zn-m > span { display: inline-block; }
@media (max-width: 767px) { .zn-owi .zn-owi__frame { --c: 22px; } }

/* ════════ Capabilities: organisation chart ════════ */
.zn-owc .zn-owc__chart {
	--drop: 56px; --pl: 40px; --ic: 64px;
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; padding: 1px;
	background: rgb(255 255 255 / .1); position: relative; margin-top: var(--drop);
}
/* horizontal connector joining the three icons, and the drop into each cell */
.zn-owc .zn-owc__chart::before {
	content: ""; position: absolute; z-index: 1; opacity: 1; border: 0; pointer-events: none;
	top: calc(var(--drop) * -1); left: calc(1px + var(--pl) + var(--ic) / 2); width: calc((100% - 4px) * 2 / 3 + 2px); height: 1px;
	background: var(--e-global-color-primary); transform-origin: 50% 50%;
}
.zn-owc .zn-owc__cell {
	position: relative; isolation: isolate; min-width: 0; width: auto;
	background-color: var(--e-global-color-secondary); transition: background-color .6s ease;
}
.zn-owc .zn-owc__cell::before {
	content: ""; position: absolute; z-index: 0; opacity: 1; border: 0; pointer-events: none;
	left: calc(var(--pl) + var(--ic) / 2); top: calc(var(--drop) * -1 - 1px); width: 1px; height: calc(var(--drop) + 1px + 44px);
	background: linear-gradient(var(--e-global-color-primary), var(--e-global-color-zn_gold_line)); transform-origin: 50% 0;
}
/* hover: gold wash from the top edge */
.zn-owc .zn-owc__cell::after {
	content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; border: 0; pointer-events: none;
	background: linear-gradient(180deg, rgb(200 164 93 / .18), rgb(200 164 93 / 0) 65%);
	box-shadow: inset 0 2px 0 var(--e-global-color-primary); transition: opacity .6s ease;
}
.zn-owc .zn-owc__icon {
	position: relative; z-index: 2; border: 1px solid var(--e-global-color-zn_gold_line);
	background-color: var(--e-global-color-secondary); transition: background-color .6s ease, border-color .6s ease, scale .8s var(--zn-ease-out);
}
.zn-owc .zn-owc__glyph, .zn-owc .zn-owc__glyph .elementor-widget-container { width: 50%; display: flex; justify-content: center; }
.zn-owc .zn-owc__glyph img { display: block; width: 100%; height: auto; filter: brightness(0) invert(1); transition: filter .6s ease, scale .8s var(--zn-ease-out); }
.zn-owc .zn-owc__num .elementor-heading-title { letter-spacing: .16em; }
.zn-owc .zn-owc__name .elementor-heading-title { transition: color .5s ease; }
.zn-owc .zn-owc__cell:hover::after { opacity: 1; }
.zn-owc .zn-owc__cell:hover .zn-owc__icon { background-color: var(--e-global-color-primary); border-color: var(--e-global-color-primary); scale: 1.06; }
.zn-owc .zn-owc__cell:hover .zn-owc__glyph img { filter: brightness(0); }
.zn-owc .zn-owc__cell:hover .zn-owc__name .elementor-heading-title { color: var(--e-global-color-accent); }

@media (max-width: 1024px) {
	/* tablet / mobile: cells stack; one trunk line runs down through the icons */
	.zn-owc .zn-owc__chart { --pl: 36px; --ic: 60px; grid-template-columns: minmax(0, 1fr); margin-top: 0; }
	.zn-owc .zn-owc__chart::before { top: 1px; bottom: 1px; height: auto; width: 1px; background: var(--e-global-color-zn_gold_line); transform-origin: 50% 0; }
	.zn-owc .zn-owc__cell { display: grid; grid-template-columns: var(--ic) minmax(0, 1fr); column-gap: 28px; row-gap: 10px; align-content: start; }
	.zn-owc .zn-owc__cell::before { display: none; }
	.zn-owc .zn-owc__cell > .zn-owc__icon { grid-row: 1 / span 3; align-self: start; height: var(--ic); }
	.zn-owc .zn-owc__cell > :not(.zn-owc__icon) { grid-column: 2; }
}
@media (max-width: 767px) {
	.zn-owc .zn-owc__chart { --pl: 22px; --ic: 52px; }
	.zn-owc .zn-owc__cell { column-gap: 18px; }
}

/* ════════ Includes: index table ════════ */
.zn-owx .zn-owx__row {
	position: relative; isolation: isolate; display: grid; align-items: baseline;
	grid-template-columns: 88px minmax(0, 5fr) minmax(0, 6fr) 56px; column-gap: 32px;
	border-top: 1px solid var(--e-global-color-zn_line); transition: opacity .5s ease;
}
.zn-owx .zn-owx__row:last-child { border-bottom: 1px solid var(--e-global-color-zn_line); }
/* gold line drawn along the top of each row as it arrives */
.zn-owx .zn-owx__row::after {
	content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 1px; z-index: 1; opacity: 1; border: 0;
	background: var(--e-global-color-primary); scale: 0 1; transform-origin: 0 50%; transition: scale .9s var(--zn-ease-out);
}
/* hover: cream sweep from the left */
.zn-owx .zn-owx__row::before {
	content: ""; position: absolute; inset: 0; z-index: -1; opacity: 1; border: 0;
	background: linear-gradient(90deg, var(--e-global-color-zn_cream), rgb(253 249 235 / 0)); scale: 0 1; transform-origin: 0 50%;
	transition: scale .8s var(--zn-ease-out);
}
.zn-owx .zn-owx__row > * { min-width: 0; }
.zn-owx .zn-owx__num { padding-left: 16px; transition: translate .6s var(--zn-ease-out); }
.zn-owx .zn-owx__num .elementor-heading-title { letter-spacing: .08em; }
.zn-owx .zn-owx__name { transition: translate .7s var(--zn-ease-out); }
.zn-owx .zn-owx__name .elementor-heading-title { transition: color .5s ease; }
.zn-owx .zn-owx__mark { align-self: center; justify-self: end; position: relative; width: 28px; height: 1px; min-height: 1px; background: var(--e-global-color-zn_line); transition: width .7s var(--zn-ease-out), background-color .5s ease; }
.zn-owx .zn-owx__mark::after {
	content: ""; position: absolute; right: 0; top: -4px; width: 9px; height: 9px; opacity: 1; border: 0 solid var(--e-global-color-zn_line);
	border-width: 1px 1px 0 0; rotate: 45deg; transform-origin: 100% 0; transition: border-color .5s ease; background: none;
}
.zn-owx .zn-owx__row:hover::before { scale: 1 1; }
.zn-owx .zn-owx__row:hover::after { scale: 1 1; }
.zn-owx .zn-owx__row:hover .zn-owx__num { translate: 6px 0; }
.zn-owx .zn-owx__row:hover .zn-owx__name { translate: 6px 0; }
.zn-owx .zn-owx__row:hover .zn-owx__mark { width: 48px; background-color: var(--e-global-color-primary); }
.zn-owx .zn-owx__row:hover .zn-owx__mark::after { border-color: var(--e-global-color-primary); }
@media (hover: hover) and (min-width: 1025px) {
	.zn-owx .zn-owx__table:hover .zn-owx__row:not(:hover) { opacity: .5; }
}
@media (max-width: 1024px) {
	.zn-owx .zn-owx__row { grid-template-columns: 64px minmax(0, 1fr); row-gap: 12px; }
	.zn-owx .zn-owx__num { grid-row: 1 / span 2; padding-left: 4px; }
	.zn-owx .zn-owx__name, .zn-owx .zn-owx__desc { grid-column: 2; }
	.zn-owx .zn-owx__mark { display: none; }
}
@media (max-width: 767px) {
	.zn-owx .zn-owx__row { grid-template-columns: 44px minmax(0, 1fr); row-gap: 10px; }
	.zn-owx .zn-owx__num { padding-left: 0; }
	.zn-owx .zn-owx__row:hover :is(.zn-owx__num, .zn-owx__name) { translate: none; }
}

/* ════════ Scroll reveal (armed by service-ow.js) ════════ */
.is-armed :is(.zn-owc__accent, .zn-owx__accent, .zn-owi__accent) { scale: 1 0; transform-origin: 50% 0; }
.is-armed :is(.zn-owc__rule, .zn-owx__rule) { scale: 0 1; transform-origin: 0 50%; }
.is-armed :is(.zn-owc-rv, .zn-owx-rv) { opacity: 0; translate: 0 28px; }
.zn-owi.is-armed .zn-owi__frame::before { translate: 18px 18px; opacity: 0; }
.zn-owi.is-armed .zn-owi__frame::after { translate: -18px -18px; opacity: 0; }
.zn-owi.is-armed .zn-owi__grid { opacity: 0; }
.zn-owi.is-armed .zn-owi__text .zn-m > span { translate: 0 105%; }
.zn-owc.is-armed .zn-owc__chart::before { scale: 0 1; }
.zn-owc.is-armed .zn-owc__cell::before { scale: 1 0; }
.zn-owc.is-armed .zn-owc__cell { opacity: 0; translate: 0 36px; }
.zn-owx.is-armed .zn-owx__row > * { opacity: 0; translate: 0 18px; }
@media (max-width: 1024px) { .zn-owc.is-armed .zn-owc__chart::before { scale: 1 0; } }

.is-in :is(.zn-owc__accent, .zn-owx__accent, .zn-owi__accent) { scale: 1 1; transition: scale 1s var(--zn-ease-out) .3s; }
.is-in :is(.zn-owc__rule, .zn-owx__rule) { scale: 1 1; transition: scale 1.6s var(--zn-ease-out) .4s; }
.is-in :is(.zn-owc-rv, .zn-owx-rv) { opacity: 1; translate: 0 0; transition: opacity 1s ease, translate 1.2s var(--zn-ease-out); transition-delay: var(--zn-d, 0s); }
.zn-owi.is-in .zn-owi__frame::before, .zn-owi.is-in .zn-owi__frame::after { translate: 0 0; opacity: 1; transition: translate 1.2s var(--zn-ease-out) .2s, opacity .8s ease .2s; }
.zn-owi.is-in .zn-owi__grid { opacity: .55; transition: opacity 1.6s ease .2s; }
.zn-owi.is-in .zn-owi__text .zn-m > span { translate: 0 0; transition: translate 1.1s var(--zn-ease-out) var(--zn-d, 0s); }
.zn-owc.is-in .zn-owc__chart::before { scale: 1 1; transition: scale 1.2s cubic-bezier(.65, 0, .35, 1) .5s; }
.zn-owc.is-in .zn-owc__cell::before { scale: 1 1; transition: scale .8s var(--zn-ease-out) 1.4s; }
.zn-owc.is-in .zn-owc__cell { opacity: 1; translate: 0 0; transition: opacity 1s ease var(--zn-d, 0s), translate 1.2s var(--zn-ease-out) var(--zn-d, 0s), background-color .6s ease; }
.zn-owx .zn-owx__row.is-in > * { opacity: 1; translate: 0 0; transition: opacity .9s ease var(--zn-d, 0s), translate 1.1s var(--zn-ease-out) var(--zn-d, 0s); }
.zn-owx .zn-owx__row.is-in.is-settled > * { transition: translate .6s var(--zn-ease-out), width .7s var(--zn-ease-out), background-color .5s ease; }
.zn-owx.is-armed .zn-owx__row.is-in:not(.is-settled)::after { animation: zn-owx-draw 1.4s var(--zn-ease-out) both; }
@keyframes zn-owx-draw { 0% { scale: 0 1; opacity: 1; } 60% { scale: 1 1; opacity: 1; } 100% { scale: 1 1; opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
	:where(.zn-owi, .zn-owc, .zn-owx) *, :where(.zn-owi, .zn-owc, .zn-owx) *::before, :where(.zn-owi, .zn-owc, .zn-owx) *::after {
		transition: none !important; animation: none !important;
	}
}
