/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* ------------------------------------------------------------------
 * Hero heading underline (Elite Smiles only — not a One Foundation patch)
 *
 * A squiggly underline in this site's --secondary under the highlighted
 * (em) words of the hero H1 on interior pages (the page's opening section;
 * the homepage hero styles its own em).
 *
 * js/heading-underline.js draws each word's underline as one SVG of the
 * word's exact width, with round ends, into the em's ::after (.sq-drawn,
 * image in --sq-img), and has it follow the word's intro animation
 * (--sq-o, --sq-t). The first rule is the fallback (no JS, or a word
 * wrapping across lines): a true sine tile, one 1.1em wave, drawn past its
 * edges so repeats join without a seam, at a fixed size so it never
 * stretches; its ends are cut flat. Colour baked in there: #db6027.
 * ------------------------------------------------------------------ */
:is(
	body:not(.home) #brx-content > section:first-of-type:not(.brxe-post-content ~ *),
	body:not(.home) #brx-content > .brxe-post-content:first-child > section:first-child
) h1 em {
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 20'%3E%3Cpath d='M-4.58 11.42C-3.06 10.97 -1.53 10.47 0.00 10.00C1.53 9.53 3.06 9.03 4.58 8.58C6.11 8.12 7.64 7.66 9.17 7.25C10.69 6.84 12.22 6.45 13.75 6.11C15.28 5.78 16.81 5.47 18.33 5.24C19.86 5.00 21.39 4.81 22.92 4.69C24.44 4.56 25.97 4.50 27.50 4.50C29.03 4.50 30.56 4.56 32.08 4.69C33.61 4.81 35.14 5.00 36.67 5.24C38.19 5.47 39.72 5.78 41.25 6.11C42.78 6.45 44.31 6.84 45.83 7.25C47.36 7.66 48.89 8.12 50.42 8.58C51.94 9.03 53.47 9.53 55.00 10.00C56.53 10.47 58.06 10.97 59.58 11.42C61.11 11.88 62.64 12.34 64.17 12.75C65.69 13.16 67.22 13.55 68.75 13.89C70.28 14.22 71.81 14.53 73.33 14.76C74.86 15.00 76.39 15.19 77.92 15.31C79.44 15.44 80.97 15.50 82.50 15.50C84.03 15.50 85.56 15.44 87.08 15.31C88.61 15.19 90.14 15.00 91.67 14.76C93.19 14.53 94.72 14.22 96.25 13.89C97.78 13.55 99.31 13.16 100.83 12.75C102.36 12.34 103.89 11.88 105.42 11.42C106.94 10.97 108.47 10.47 110.00 10.00C111.53 9.53 113.06 9.03 114.58 8.58' fill='none' stroke='%23db6027' stroke-width='6.5' stroke-linecap='round'/%3E%3C/svg%3E") left 0 bottom .06em / 1.1em .2em repeat-x;
	-webkit-box-decoration-break: clone;
	box-decoration-break: clone;
}

:is(
	body:not(.home) #brx-content > section:first-of-type:not(.brxe-post-content ~ *),
	body:not(.home) #brx-content > .brxe-post-content:first-child > section:first-child
) h1 em.sq-drawn {
	position: relative;
	background: none;
}

:is(
	body:not(.home) #brx-content > section:first-of-type:not(.brxe-post-content ~ *),
	body:not(.home) #brx-content > .brxe-post-content:first-child > section:first-child
) h1 em.sq-drawn::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: .06em;
	height: .2em;
	pointer-events: none;
	background: var(--sq-img) center / 100% 100% no-repeat;
	opacity: var(--sq-o, 1);
	transform: var(--sq-t, none);
}

/* ------------------------------------------------------------------
 * Section textures (Elite Smiles only — not a One Foundation patch)
 *
 * js/section-textures.js tags each tinted section below the hero with
 * data-sdb-texture (drift, rings, bubbles or ribbon), rotating so no two
 * on a page match. Same family as One Foundation's hero texture: lines
 * from an SVG mask over a --primary fill (--secondary on peach-tinted
 * sections) in ::after, a fine grain in ::before, behind the content.
 * Each texture sits in its own corner and fades out toward the content.
 * Add ?v= to the SVG URLs when a drawing changes.
 * ------------------------------------------------------------------ */
[data-sdb-texture] {
	--tx-colour: var(--primary);
	isolation: isolate;
}

[data-sdb-texture]:not([style*="position"]) {
	position: relative;
}

[data-sdb-texture-tone="secondary"] {
	--tx-colour: var(--secondary);
}

[data-sdb-texture]::before,
[data-sdb-texture]::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-color: var(--tx-colour);
}

/* Grain */
[data-sdb-texture]::before {
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .16 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 200px 200px repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .16 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 200px 200px repeat;
}

[data-sdb-texture]::after {
	opacity: .15;
}

/* Drift: long currents, strongest on the left */
[data-sdb-texture="drift"]::after {
	-webkit-mask:
		url("assets/textures/drift.svg?v=1") center / cover no-repeat,
		linear-gradient(90deg, #000 0%, transparent 65%);
	mask:
		url("assets/textures/drift.svg?v=1") center / cover no-repeat,
		linear-gradient(90deg, #000 0%, transparent 65%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
}

/* Rings: ripples from off the bottom-left corner */
[data-sdb-texture="rings"]::after {
	-webkit-mask:
		url("assets/textures/rings.svg?v=1") left bottom / max(1400px, 100%) auto no-repeat,
		radial-gradient(ellipse 80% 110% at 0% 100%, #000 20%, transparent 85%);
	mask:
		url("assets/textures/rings.svg?v=1") left bottom / max(1400px, 100%) auto no-repeat,
		radial-gradient(ellipse 80% 110% at 0% 100%, #000 20%, transparent 85%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
}

/* Bubbles: sparse circles rising from the top right */
[data-sdb-texture="bubbles"]::after {
	opacity: .13;
	-webkit-mask: url("assets/textures/bubbles.svg?v=1") right top / max(1400px, 100%) auto no-repeat;
	mask: url("assets/textures/bubbles.svg?v=1") right top / max(1400px, 100%) auto no-repeat;
}

/* Ribbon: a band of lines sweeping corner to corner */
[data-sdb-texture="ribbon"]::after {
	-webkit-mask:
		url("assets/textures/ribbon.svg?v=1") center / cover no-repeat,
		linear-gradient(110deg, transparent 15%, #000 60%);
	mask:
		url("assets/textures/ribbon.svg?v=1") center / cover no-repeat,
		linear-gradient(110deg, transparent 15%, #000 60%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
}

/* ------------------------------------------------------------------
 * Header CTA border (Elite Smiles only — not a One Foundation patch)
 *
 * The header's secondary (orange) button gets a white border, at rest and
 * on hover, through ACSS's own button variables. The colour itself comes
 * from One Foundation's CTA Colors setting (header: secondary).
 * ------------------------------------------------------------------ */
header .brxe-button.btn--secondary {
	--btn-border-color: var(--white);
	--btn-border-color-hover: var(--white);
}

/* ------------------------------------------------------------------
 * Hero edge grain (Elite Smiles only — not a One Foundation patch)
 *
 * The Orbit and Arch heros draw their wave / arc bottom edge (::after)
 * in the next section's tint, flat. When that section is textured, the
 * edge read as a lighter strip above its grain. js/section-textures.js
 * flags the hero (data-sdb-edge-grain = primary | secondary) and this
 * lays the same grain over the edge's fill; the edge's own mask keeps
 * the wave shape. The grain colour is baked in (the mask is taken):
 * --primary #0063a6, --secondary #db6027.
 * ------------------------------------------------------------------ */
:is(.sdb-orbit-hero, .sdb-arch-hero)[data-sdb-edge-grain="primary"]::after {
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 .388  0 0 0 0 .651  0 0 0 .16 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 200px 200px repeat, var(--sdb-hero-edge);
}

:is(.sdb-orbit-hero, .sdb-arch-hero)[data-sdb-edge-grain="secondary"]::after {
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n' color-interpolation-filters='sRGB'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .859  0 0 0 0 .376  0 0 0 0 .153  0 0 0 .16 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 200px 200px repeat, var(--sdb-hero-edge);
}

/* ------------------------------------------------------------------
 * Footer panel contrast (Elite Smiles only — not a One Foundation patch)
 *
 * The footer's panel was a 10% grey wash over the section's own
 * --primary-dark, so the two blues sat about 1.2:1 apart and read as one.
 * The section goes a touch darker (88% --primary-dark, 12%
 * --primary-ultra-dark, about #004777) and the panel is frosted glass
 * (a --primary tint and --white-trans-10, with a 7px backdrop blur over the section's
 * gradient, rings and grain). The section gets 15% more OKLCH chroma (the
 * plain colour-mix line is the fallback for browsers without relative
 * colour syntax); the extra shows fully on P3 screens, and sRGB screens
 * get the nearest in-gamut blue.
 * ------------------------------------------------------------------ */
.fr-footer-echo.bg--dark {
	background-color: color-mix(in srgb, var(--primary-dark) 88%, var(--primary-ultra-dark));
	background-color: oklch(from color-mix(in srgb, var(--primary-dark) 88%, var(--primary-ultra-dark)) l calc(c * 1.15) h);
}

.fr-footer-echo .fr-footer-echo__inner {
	/* Frosted blue glass: a 30% --primary tint under ACSS's 10% white (the last
	 * background-image layer), blurred just enough to soften the gradient, rings
	 * and grain behind it without hiding them. */
	background-color: color-mix(in srgb, var(--primary) 30%, transparent);
	-webkit-backdrop-filter: blur(7px);
	backdrop-filter: blur(7px);
	/* A soft light sheen from the top left, so the gradient carries onto the panel. */
	background-image:
		linear-gradient(150deg, color-mix(in srgb, var(--white) 9%, transparent) 0%, transparent 55%),
		linear-gradient(330deg, color-mix(in srgb, var(--primary-ultra-dark) 18%, transparent) 0%, transparent 50%),
		linear-gradient(var(--white-trans-10), var(--white-trans-10));
	/* ACSS's XL radius: the cards' --radius (16px) looks pinched on a panel this size. */
	border-radius: var(--radius-xl);

	/* A soft, wide lift off the section, in the brand's darkest blue rather than black. */
	box-shadow:
		0 12px 40px 0 color-mix(in srgb, var(--primary-ultra-dark) 15%, transparent),
		0 40px 140px 16px color-mix(in srgb, var(--primary-ultra-dark) 25%, transparent);
}

/* Footer background: gradient, rings and grain (Elite Smiles only).
 * Same family as the section textures above (that grain, the rings
 * drawing), set here because the footer sits outside #brx-content, where
 * js/section-textures.js doesn't look. On the dark blue the grain is
 * white and the rings --primary-light, both faint. The gradient is a
 * lighter glow from the top left and a deeper shade toward the bottom
 * right, over the section's own colour. */
.fr-footer-echo.bg--dark {
	position: relative;
	isolation: isolate;
	background-image:
		radial-gradient(ellipse 70% 60% at 10% 0%, color-mix(in srgb, var(--primary) 45%, transparent), transparent 70%),
		radial-gradient(ellipse 80% 70% at 100% 100%, color-mix(in srgb, var(--primary-ultra-dark) 40%, transparent), transparent 70%);
}

.fr-footer-echo.bg--dark::before,
.fr-footer-echo.bg--dark::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
}

/* Grain */
.fr-footer-echo.bg--dark::before {
	background-color: var(--white);
	opacity: .35;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .16 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 200px 200px repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .16 -.02'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0 / 200px 200px repeat;
}

/* Rings from off the top-right corner, fading out toward the bottom left so they run behind the glass panel.
 * Sized to cover: the drawing is 2:1, so at full width alone it ended above the
 * attribution on wide screens, cutting the lines off in a straight edge. */
.fr-footer-echo.bg--dark::after {
	background-color: var(--primary-light);
	opacity: .22;
	-webkit-mask:
		url("assets/textures/rings.svg?v=1") right top / cover no-repeat,
		radial-gradient(ellipse 130% 150% at 100% 0%, #000 35%, transparent 100%);
	mask:
		url("assets/textures/rings.svg?v=1") right top / cover no-repeat,
		radial-gradient(ellipse 130% 150% at 100% 0%, #000 35%, transparent 100%);
	-webkit-mask-composite: source-in;
	mask-composite: intersect;
}

/* Footer logo a bit bigger than the template's 180px (max-width 100% keeps it in its column). */
.fr-footer-echo .fr-footer-echo__logo {
	width: 230px;
}
