/**
 * Pickleball page design: what Elementor's style options cannot do. Layout, type and colour are set in Elementor.
 *
 * - section decoration: 12-column rules, corner ticks and the hero's grid lines
 * - button icons (hook classes ds-pbd-ico-*)
 * - the animated drawings printed by [decospaa_art]: hero court, flooring stacks, space check
 * - the running client names, the selected state of the build-step tabs, and the 3D court skin
 *
 * Every animation stops for visitors whose device asks for less motion.
 *
 * @package decospaa
 */

/* ---------- section decoration ---------- */
.ds-pbd-dark {
	--decospaa-rule: rgba(255, 255, 255, 0.055);
	--decospaa-tick: rgba(255, 255, 255, 0.4);
}

.ds-pbd-light {
	--decospaa-rule: color-mix(in srgb, var(--ds-pb-secondary) 7%, transparent);
	--decospaa-tick: color-mix(in srgb, var(--ds-pb-secondary) 40%, transparent);
}

/* Doubled class names: Elementor's .e-con::before loads after this file and would otherwise reset these to nothing. */
.ds-pbd-sec.ds-pbd-sec::before,
.ds-pbd-sec.ds-pbd-sec::after {
	content: "";
	display: block;
	position: absolute;
	inset: 0;
	opacity: 1;
	pointer-events: none;
}

.ds-pbd-sec.ds-pbd-sec::before {
	z-index: 0;
	background-color: transparent;
	background-image: repeating-linear-gradient(90deg, var(--decospaa-rule) 0 1px, transparent 1px calc(100% / 12));
}

.ds-pbd-sec.ds-pbd-sec::after {
	z-index: 1;
	background:
		linear-gradient(var(--decospaa-tick), var(--decospaa-tick)) left 24px top 30px / 13px 1px no-repeat,
		linear-gradient(var(--decospaa-tick), var(--decospaa-tick)) left 30px top 24px / 1px 13px no-repeat,
		linear-gradient(var(--decospaa-tick), var(--decospaa-tick)) right 24px top 30px / 13px 1px no-repeat,
		linear-gradient(var(--decospaa-tick), var(--decospaa-tick)) right 30px top 24px / 1px 13px no-repeat;
}

.ds-pbd-hero.ds-pbd-hero.ds-pbd-hero::before {
	background-image:
		linear-gradient(rgba(255, 255, 255, 0.075) 1px, transparent 1px),
		repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.075) 0 1px, transparent 1px calc(100% / 12));
	background-size: 100% 96px, 100% 100%;
}

/* ---------- button icons ---------- */
.ds-pbd-ico-arrow::after,
.ds-pbd-ico-chat::before,
.ds-pbd-ico-phone::before {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	background-color: currentColor;
	-webkit-mask: var(--decospaa-icon) center / contain no-repeat;
	mask: var(--decospaa-icon) center / contain no-repeat;
}

.ds-pbd-ico-arrow {
	--decospaa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
}

.ds-pbd-ico-chat {
	--decospaa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7.9 20A9 9 0 1 0 4 16.1L2 22Z'/%3E%3C/svg%3E");
}

.ds-pbd-ico-phone {
	--decospaa-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z'/%3E%3C/svg%3E");
}

/* ---------- inline drawings ---------- */
.ds-pbd-art svg,
.ds-pbd-ico svg {
	display: block;
	width: 100%;
	height: auto;
}

.ds-pbd-ico svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* the design's outline icons are drawn on 44–72px grids; the 24px icons are drawn thinner in their own file */
.ds-pbd-ico svg[viewBox="0 0 24 24"] {
	stroke-width: 1.75;
}

.ds-pbd-ico svg[fill="currentColor"] {
	fill: currentColor;
	stroke: none;
}

/* ---------- hero court: rally ball and rings run inside the SVG; hover or focus a label to isolate that part ---------- */
.sv-acc {
	fill: var(--ds-pbd-accent);
}

.sv-ring {
	fill: none;
	stroke: var(--ds-pbd-accent);
	stroke-width: 1.2;
}

.sv-accs {
	fill: none;
	stroke: var(--ds-pbd-accent);
}

.sv-lab {
	fill: var(--ds-white);
	font: 600 14px var(--ds-font-body);
	transition: fill 0.2s;
}

.hit {
	fill: transparent;
}

.co {
	cursor: pointer;
	outline: none;
}

svg :is(.t-surf, .t-encl, .t-net, .t-lights) {
	transition: opacity 0.25s, filter 0.25s;
}

svg .beams {
	opacity: 0;
	transition: opacity 0.35s;
}

svg .heads {
	animation: decospaa-lamp 3s ease-in-out infinite;
}

@keyframes decospaa-lamp {
	0%, 100% { stroke-opacity: 0.72; }
	50% { stroke-opacity: 1; }
}

svg:has(.co:is(:hover, :focus-visible)) :is(.t-surf, .t-encl, .t-net, .t-lights) {
	opacity: 0.28;
}

svg:has(.co--lights:is(:hover, :focus-visible)) .t-lights,
svg:has(.co--encl:is(:hover, :focus-visible)) .t-encl,
svg:has(.co--net:is(:hover, :focus-visible)) .t-net,
svg:has(.co--surf:is(:hover, :focus-visible)) .t-surf {
	opacity: 1;
	filter: brightness(1.3);
}

svg:has(.co--lights:is(:hover, :focus-visible)) .beams {
	opacity: 1;
}

.co:is(:hover, :focus-visible) .sv-lab {
	fill: var(--ds-pbd-accent);
}

.co:focus-visible .hit {
	stroke: var(--ds-pbd-accent);
	stroke-width: 1.5;
}

/* ---------- flooring stacks: a ripple runs through the layers; hover lifts one ---------- */
.lay {
	animation: decospaa-ripple 4.8s ease-in-out infinite;
	animation-delay: calc(var(--i) * 0.28s);
	transition: opacity 0.2s;
}

@keyframes decospaa-ripple {
	0%, 38%, 100% { transform: translateY(0); }
	19% { transform: translateY(-12px); }
}

svg:has(use.lay:hover) .lay:not(:hover) {
	opacity: 0.45;
}

use.lay {
	cursor: pointer;
}

use.lay:hover {
	animation: none;
	transform: translateY(-24px);
	transition: transform 0.2s, opacity 0.2s;
}

.stk {
	font: 600 14px/1 var(--ds-font-body);
	fill: currentColor;
}

.stk-n {
	font: 700 14px/1 var(--ds-font-body);
	fill: var(--ds-pbd-blue-600);
}

.ds-pbd-dark .stk-n,
.ds-pbd-art--dark .stk-n {
	fill: var(--ds-pbd-accent);
}

.stk-l {
	fill: none;
	stroke: currentColor;
	stroke-opacity: 0.5;
	stroke-width: 1;
}

/* ---------- court plan labels ---------- */
.pl,
.pl-m,
.pl-a {
	font: 600 12px/1 var(--ds-font-body);
}

.pl {
	fill: var(--ds-white);
}

.pl-m {
	fill: var(--ds-pbd-mist-300);
}

.pl-a {
	font-weight: 700;
	fill: var(--ds-pbd-accent);
}

/* ---------- space check: the dashed run-off line marches ---------- */
.space-dash {
	animation: decospaa-march 1.6s linear infinite;
}

@keyframes decospaa-march {
	to { stroke-dashoffset: -22; }
}

/* ---------- running client names ---------- */
@keyframes decospaa-names-scroll {
	to { transform: translateX(-50%); }
}

#decospaa-names-track {
	animation: decospaa-names-scroll 60s linear infinite;
}

#decospaa-names-track:hover {
	animation-play-state: paused;
}

/* ---------- build steps: native tabs; Elementor styles the selected tab itself, its text follows here ---------- */
.ds-pbd-tab.e--selected p {
	color: var(--ds-white);
}

/* ---------- FAQ: the chevron is inline, so Elementor's own rotate-when-open rule still applies ---------- */
.e-accordion-item-icon-base .elementor-widget-shortcode {
	width: 20px;
}

.e-accordion-item-icon-base .elementor-shortcode svg {
	display: block;
	width: 20px !important; /* Elementor forces width: auto on the icon. */
	height: 20px;
}

/* ---------- form ---------- */
#get-estimate input::placeholder,
#get-estimate textarea::placeholder {
	color: var(--ds-pbd-mist-500);
}

/* ---------- 3D court: same real viewer, laid out and coloured like the design's console ---------- */
#decospaa-court3d .dc3d {
	--dc-gold: var(--ds-pbd-accent);
	--dc-ink: var(--ds-pbd-ink);
	--dc-edge: var(--ds-pbd-navy-500);
	grid-template-columns: minmax(0, 1fr) 392px;
	grid-template-rows: auto 1fr;
	gap: 8px 16px;
}

#decospaa-court3d .stagewrap {
	display: contents;
}

#decospaa-court3d .viewer {
	grid-column: 1;
	grid-row: 1 / span 2;
	height: auto;
	min-height: 560px;
	border: 1px solid var(--ds-pbd-navy-600);
	border-radius: 8px;
	background-image: linear-gradient(180deg, #bdd4e8 0%, #f4f8fb 100%);
}

/* before the viewer starts (phones, or while loading) the poster takes the full width */
#decospaa-court3d .dc3d:not(.on):not(.loading) .viewer {
	grid-column: 1 / -1;
}

/* the toolbar floats over the viewer: modes top left, views and zoom bottom left, as in the design */
#decospaa-court3d .bar {
	grid-column: 1;
	grid-row: 1 / span 2;
	z-index: 2;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	padding: 10px;
	pointer-events: none;
}

#decospaa-court3d .bar .grp {
	pointer-events: auto;
}

#decospaa-court3d .hint {
	top: 60px;
	left: 12px;
}

/* compact option rows: label on the left, choices on the right, as in the design's panel */
#decospaa-court3d .panel {
	gap: 10px;
}

#decospaa-court3d .psec {
	grid-template-columns: 96px minmax(0, 1fr);
	align-items: center;
	gap: 6px 12px;
}

#decospaa-court3d .psec > .pnote,
#decospaa-court3d .psec > .opts {
	grid-column: 1 / -1;
}

#decospaa-court3d .opts {
	grid-template-columns: 1fr 1fr;
	gap: 6px 10px;
}

#decospaa-court3d .opt {
	font: 400 13px/18px var(--ds-font-body);
}

#decospaa-court3d .psec > :first-child:has(+ .opts) {
	grid-column: 1 / -1;
}

#decospaa-court3d .systems {
	grid-column: 2;
	grid-row: 1;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 14px 16px 12px;
	border: 1px solid var(--ds-pbd-navy-600);
	border-bottom: 0;
	border-radius: 8px 8px 0 0;
	background-color: var(--ds-pb-secondary);
}

#decospaa-court3d .tier {
	gap: 4px;
	padding: 10px 12px;
	border: 1px solid var(--ds-pbd-navy-500);
	border-radius: 6px;
	background: var(--ds-pbd-navy-700);
}

#decospaa-court3d .tier[aria-pressed="true"] {
	background: var(--ds-pb-primary);
	border-color: var(--ds-white);
}

#decospaa-court3d .tier[aria-pressed="true"]::before {
	display: none;
}

#decospaa-court3d .tier .n {
	font: 700 15px/19px var(--ds-font-body);
}

#decospaa-court3d .tier .d,
#decospaa-court3d .tier .s {
	font: 400 12px/17px var(--ds-font-body);
	letter-spacing: 0;
	color: var(--ds-pbd-mist-100);
	opacity: 1;
}

#decospaa-court3d .panel {
	grid-column: 2;
	grid-row: 2;
	margin-top: -8px;
	padding: 14px 16px;
	align-content: start;
	border: 1px solid var(--ds-pbd-navy-600);
	border-top: 0;
	border-radius: 0 0 8px 8px;
	background: var(--ds-pb-secondary);
}

#decospaa-court3d .btn {
	min-height: 38px;
	padding: 0 14px;
	border: 1px solid var(--ds-pbd-navy-500);
	border-radius: 6px;
	background: var(--ds-pbd-navy-700);
	color: var(--ds-white);
	font: 600 14px/20px var(--ds-font-body);
	letter-spacing: 0;
	text-transform: none;
}

#decospaa-court3d .btn[aria-pressed="true"] {
	background: var(--ds-pb-primary);
	border-color: var(--ds-white);
	color: var(--ds-white);
}

#decospaa-court3d .bar .seg {
	padding: 3px;
	border: 0;
	border-radius: 999px;
	background: #475565;
}

#decospaa-court3d .bar .seg .btn {
	min-height: 28px;
	padding: 0 15px;
	border-radius: 999px;
	background: transparent;
}

#decospaa-court3d .bar .seg .btn[aria-pressed="true"] {
	background: var(--ds-white);
	color: var(--ds-pbd-ink);
}

#decospaa-court3d .bar .grp-label {
	color: var(--ds-pbd-ink);
}

#decospaa-court3d .save {
	background: var(--ds-pbd-navy-900);
	border-color: var(--ds-pbd-navy-600);
	color: var(--ds-white);
}

#decospaa-court3d .panel .seg {
	border: 0;
	padding: 0;
	gap: 6px;
}

#decospaa-court3d .panel .seg .btn {
	padding: 0 6px;
	border: 1px solid var(--ds-pbd-navy-500);
}

#decospaa-court3d .pk {
	font: 700 11px/16px var(--ds-font-body);
	letter-spacing: 0.1em;
	color: var(--ds-pbd-mist-300);
	opacity: 1;
}

#decospaa-court3d .psec + .psec {
	padding-top: 10px;
	border-top: 1px solid var(--ds-pbd-navy-600);
}

#decospaa-court3d .pnote {
	font: 400 13px/19px var(--ds-font-body);
	color: var(--ds-pbd-mist-300);
	opacity: 1;
}

@media (max-width: 1100px) {
	#decospaa-court3d .dc3d {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
	}

	#decospaa-court3d .viewer,
	#decospaa-court3d .bar,
	#decospaa-court3d .systems,
	#decospaa-court3d .panel {
		grid-column: 1;
		grid-row: auto;
	}

	#decospaa-court3d .hint {
		top: 12px;
	}

	#decospaa-court3d .viewer {
		order: 1;
		height: clamp(320px, 60vw, 560px);
		min-height: 0;
	}

	#decospaa-court3d .bar {
		order: 2;
		flex-direction: row;
		padding: 0;
	}

	#decospaa-court3d .systems {
		order: 3;
		border-bottom: 1px solid var(--ds-pbd-navy-600);
		border-radius: 8px;
	}

	#decospaa-court3d .panel {
		order: 4;
		margin-top: 0;
		border-top: 1px solid var(--ds-pbd-navy-600);
		border-radius: 8px;
	}

	#decospaa-court3d .bar .grp-label {
		color: var(--ds-white);
	}
}

/* phones: option rows stack, so the three-word choices fit */
@media (max-width: 767px) {
	#decospaa-court3d .psec {
		grid-template-columns: minmax(0, 1fr);
	}

	#decospaa-court3d .panel .seg .btn {
		padding: 0 4px;
	}
}

/* ---------- less motion ---------- */
@media (prefers-reduced-motion: reduce) {
	svg .heads,
	.lay,
	.space-dash,
	#decospaa-names-track {
		animation: none;
	}

	.ball,
	.sv-ring,
	.space-anim {
		display: none;
	}

	#decospaa-names-track {
		flex-wrap: wrap;
		width: auto;
		row-gap: 12px;
	}
}
