/* ==========================================================================
   Glassify – glass engine
   Light source: top-left corner. Borders: dark outer 1px + white inner 1px.
   Shine: viewport-sized diagonal reflection, offset per element by JS so it
   slides across the glass when the window is resized (like Windows 7 Aero).
   ========================================================================== */

:root {
	/* Optional textures */
	--ek-tex-frosted: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1.4 0 0 0 -.35'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23f)'/%3E%3C/svg%3E");
	--ek-tex-ribbed: repeating-linear-gradient(90deg, rgba(255,255,255,.55) 0 1px, rgba(255,255,255,.08) 1px 3px, rgba(0,0,0,.10) 3px 4px);
	--ek-tex-reeded: repeating-linear-gradient(90deg, rgba(255,255,255,.5) 0, rgba(255,255,255,.05) 6px, rgba(0,0,0,.14) 11px, rgba(255,255,255,.28) 12px);
	--ek-tex-pebbled: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.3' cy='.3' r='.8'%3E%3Cstop offset='0' stop-color='white' stop-opacity='.7'/%3E%3Cstop offset='.55' stop-color='white' stop-opacity='0'/%3E%3Cstop offset='1' stop-color='black' stop-opacity='.22'/%3E%3C/radialGradient%3E%3C/defs%3E%3Crect width='26' height='26' fill='url(%23g)'/%3E%3C/svg%3E");
	--ek-tex-wired: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M0 16L16 0L32 16L16 32Z' fill='none' stroke='white' stroke-opacity='.55' stroke-width='1.2'/%3E%3Cpath d='M0 17L16 1L32 17L16 33Z' fill='none' stroke='black' stroke-opacity='.18' stroke-width='.8'/%3E%3C/svg%3E");
	--ek-tex-tempered: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14'%3E%3Ccircle cx='7' cy='7' r='1.3' fill='white' fill-opacity='.6'/%3E%3Ccircle cx='6.6' cy='6.6' r='.5' fill='black' fill-opacity='.15'/%3E%3C/svg%3E");

	/* Aero edge (inner highlight: bright top-left, softer bottom-right) and cast shadow (falls bottom-right) */
	--ek-edge:
		inset 1px 1px 0 rgba(255,255,255,var(--ek-bd-light)),
		inset -1px -1px 0 rgba(255,255,255,calc(var(--ek-bd-light) * .35)),
		inset 0 0 20px rgba(255,255,255,.14);
	--ek-cast:
		3px 5px 16px rgba(0,0,0,var(--ek-shadow)),
		1px 2px 3px rgba(0,0,0,calc(var(--ek-shadow) * .45));
}

/* Group tints --------------------------------------------------------------- */
.ek-glass,
[class*="is-style-ek-glass"] {
	--g-rgb: var(--ek-section-rgb);
	--g-a: var(--ek-section-a);
	--g-blur: var(--ek-section-blur);
	--g-tex: var(--ek-section-tex);
}
.ek-glass--section { --g-rgb: var(--ek-section-rgb); --g-a: var(--ek-section-a); --g-blur: var(--ek-section-blur); --g-tex: var(--ek-section-tex); }
.ek-glass--header  { --g-rgb: var(--ek-header-rgb);  --g-a: var(--ek-header-a);  --g-blur: var(--ek-header-blur);  --g-tex: var(--ek-header-tex); }
.ek-glass--footer  { --g-rgb: var(--ek-footer-rgb);  --g-a: var(--ek-footer-a);  --g-blur: var(--ek-footer-blur);  --g-tex: var(--ek-footer-tex); }
.ek-glass--card    { --g-rgb: var(--ek-card-rgb);    --g-a: var(--ek-card-a);    --g-blur: var(--ek-card-blur);    --g-tex: var(--ek-card-tex); }
.ek-glass--menu    { --g-rgb: var(--ek-menu-rgb);    --g-a: var(--ek-menu-a);    --g-blur: var(--ek-menu-blur);    --g-tex: var(--ek-menu-tex); }
.ek-glass--media   { --g-rgb: var(--ek-media-rgb);   --g-a: var(--ek-media-a);   --g-blur: var(--ek-media-blur);   --g-tex: var(--ek-media-tex); }
.ek-glass--slider  { --g-rgb: var(--ek-slider-rgb);  --g-a: var(--ek-slider-a);  --g-blur: var(--ek-slider-blur);  --g-tex: var(--ek-slider-tex); }
.ek-glass--button  { --g-rgb: var(--ek-button-rgb);  --g-a: var(--ek-button-a);  --g-blur: var(--ek-button-blur);  --g-tex: var(--ek-button-tex); }
.ek-glass--input   { --g-rgb: var(--ek-input-rgb);   --g-a: var(--ek-input-a);   --g-blur: var(--ek-input-blur);   --g-tex: var(--ek-input-tex); }

/* Fixed glass-colour variants (block styles) */
.is-style-ek-glass-clear { --g-rgb: 235,246,252; --g-a: .16; }
.is-style-ek-glass-green { --g-rgb: 46,150,96;  --g-a: .38; }
.is-style-ek-glass-blue  { --g-rgb: 30,120,205; --g-a: .38; }
.is-style-ek-glass-amber { --g-rgb: 224,160,48; --g-a: .38; }
.is-style-ek-glass-smoke { --g-rgb: 40,50,60;   --g-a: .55; }
.is-style-ek-glass-smoke :where(h1,h2,h3,h4,h5,h6,p,li,a,span,td,th,figcaption,cite),
.is-style-ek-glass-smoke:where(p,li,ul,ol,pre) { color: #f2faff; }

/* Textures (add class in Additional CSS class(es), or use the "Glassify glass" block panel) */
.ek-tex-frosted  { --g-tex: var(--ek-tex-frosted); --g-blur: 22px; }
.ek-tex-ribbed   { --g-tex: var(--ek-tex-ribbed); }
.ek-tex-reeded   { --g-tex: var(--ek-tex-reeded); }
.ek-tex-pebbled  { --g-tex: var(--ek-tex-pebbled); --g-blur: 18px; }
.ek-tex-wired    { --g-tex: var(--ek-tex-wired); }
.ek-tex-tempered { --g-tex: var(--ek-tex-tempered); }
.ek-tex-droplets { --g-tex: var(--ek-tex-droplets); --g-blur: 8px; }
.ek-tex-rain { --g-tex: var(--ek-tex-rain); --g-blur: 8px; }
.ek-tex-condensation { --g-tex: var(--ek-tex-condensation); --g-blur: 14px; }

/* Canvas glass: one fixed sheet of glass over the page background, under all content */
.ek-canvas {
	position: fixed; inset: 0; z-index: 0; pointer-events: none;
	background-color: rgba(var(--ek-canvas-rgb), var(--ek-canvas-a));
	background-image: radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,calc(var(--ek-hl) * .55)), rgba(255,255,255,0) 55%);
	-webkit-backdrop-filter: blur(var(--ek-canvas-blur)) saturate(var(--ek-sat));
	backdrop-filter: blur(var(--ek-canvas-blur)) saturate(var(--ek-sat));
}
.ek-canvas::before, .ek-canvas::after { content: ""; position: absolute; inset: 0; }
.ek-canvas::before {
	opacity: var(--ek-canvas-shine);
	background-image: linear-gradient(112deg,
		rgba(255,255,255,0) 18%, rgba(255,255,255,calc(var(--ek-shine) * .45)) 18.2%, rgba(255,255,255,calc(var(--ek-shine) * .12)) 34%, rgba(255,255,255,0) 34.2%,
		rgba(255,255,255,0) 44%, rgba(255,255,255,calc(var(--ek-shine) * .24)) 44.2%, rgba(255,255,255,calc(var(--ek-shine) * .06)) 58%, rgba(255,255,255,0) 58.2%);
	background-size: var(--ek-vw, 100vw) var(--ek-vh, 100vh);
	background-repeat: no-repeat;
}
.ek-canvas::after { background-image: var(--ek-canvas-tex); background-repeat: repeat; opacity: var(--ek-canvas-tex-op); }

/* The glass pane ------------------------------------------------------------ */
.ek-glass,
[class*="is-style-ek-glass"] {
	position: relative;
	isolation: isolate;
	background-color: rgba(var(--g-rgb), var(--g-a));
	background-image:
		radial-gradient(130% 90% at 0% 0%, rgba(255,255,255,calc(var(--ek-hl) * .9)) 0%, rgba(255,255,255,0) 55%),
		linear-gradient(135deg, rgba(255,255,255,calc(var(--ek-hl) * .35)) 0%, rgba(255,255,255,0) 42%, rgba(0,0,0,.07) 100%);
	-webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--ek-sat));
	backdrop-filter: blur(var(--g-blur)) saturate(var(--ek-sat));
	border: 1px solid rgba(0,0,0,var(--ek-bd-dark));
	border-radius: var(--ek-radius);
	box-shadow: var(--ek-edge), var(--ek-cast);
}

/* No backdrop-filter support: fall back to a more opaque pane */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.ek-glass, [class*="is-style-ek-glass"] { background-color: rgba(var(--g-rgb), calc(var(--g-a) + .38)); }
}

/* Shine (positioned by main.js with --ek-sx / --ek-sy; viewport size in --ek-vw / --ek-vh) */
.ek-glass::before,
[class*="is-style-ek-glass"]::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	pointer-events: none;
	background-image: linear-gradient(112deg,
		rgba(255,255,255,0) 18%,
		rgba(255,255,255,calc(var(--ek-shine) * .55)) 18.2%,
		rgba(255,255,255,calc(var(--ek-shine) * .16)) 34%,
		rgba(255,255,255,0) 34.2%,
		rgba(255,255,255,0) 44%,
		rgba(255,255,255,calc(var(--ek-shine) * .30)) 44.2%,
		rgba(255,255,255,calc(var(--ek-shine) * .07)) 58%,
		rgba(255,255,255,0) 58.2%);
	background-repeat: no-repeat;
	background-size: var(--ek-vw, 100vw) var(--ek-vh, 100vh);
	background-position: calc(var(--ek-sx, 0px) * -1) calc(var(--ek-sy, 0px) * -1);
}

/* Texture layer */
.ek-glass::after,
[class*="is-style-ek-glass"]::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	pointer-events: none;
	background-image: var(--g-tex);
	opacity: var(--ek-tex-op);
}

/* Legible text on glass: soft white glow (Aero title-bar style) */
.ek-glass :where(h1,h2,h3,h4,h5,h6),
[class*="is-style-ek-glass"] :where(h1,h2,h3,h4,h5,h6) { text-shadow: var(--ek-text-glow); }

/* Glass floating over glass: slightly deeper cast shadow */
.ek-glass .ek-glass,
.ek-glass [class*="is-style-ek-glass"],
[class*="is-style-ek-glass"] .ek-glass,
[class*="is-style-ek-glass"] [class*="is-style-ek-glass"] {
	box-shadow: var(--ek-edge), 4px 6px 14px rgba(0,0,0,calc(var(--ek-shadow) * .8)), 1px 2px 3px rgba(0,0,0,calc(var(--ek-shadow) * .45));
}

/* Padding defaults for block-style glass (zero specificity so editor spacing wins) */
:where(.wp-block-group, .wp-block-column, .wp-block-columns, .wp-block-media-text, .wp-block-quote, .wp-block-pullquote, .wp-block-table, .wp-block-details, .wp-block-file, .wp-block-search, .wp-block-latest-posts, .wp-block-latest-comments, .wp-block-categories, .wp-block-archives, .wp-block-code, .wp-block-verse, .wp-block-calendar, .wp-block-tag-cloud, p, pre)[class*="is-style-ek-glass"] { padding: 1.25rem 1.5rem; }
:where(ul, ol)[class*="is-style-ek-glass"] { padding: 1.25rem 1.5rem 1.25rem 2.8rem; }

/* ==========================================================================
   Glass buttons (Aero gloss: bright top half, tinted bottom half)
   ========================================================================== */
.ek-btn,
.wp-block-button__link,
.wp-element-button,
.wp-block-search__button,
.search-submit,
.more-link,
.page-numbers,
.comment-reply-link,
input[type="submit"],
input[type="button"],
input[type="reset"] {
	--g-rgb: var(--ek-button-rgb);
	--g-a: var(--ek-button-a);
	--g-blur: var(--ek-button-blur);
	position: relative;
	isolation: isolate;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	padding: var(--ek-btn-py) var(--ek-btn-px);
	font: var(--ek-btn-fw) var(--ek-btn-fs)/1.2 var(--ek-font-button);
	text-transform: var(--ek-btn-tt);
	text-decoration: none;
	text-shadow: 0 0 6px rgba(255,255,255,.6);
	color: var(--ek-btn-text);
	cursor: pointer;
	border: 1px solid rgba(0,0,0,var(--ek-bd-dark));
	border-radius: var(--ek-btn-radius);
	background-color: rgba(var(--g-rgb), var(--g-a));
	background-image:
		linear-gradient(180deg, rgba(255,255,255,.62) 0, rgba(255,255,255,.18) 49%, rgba(255,255,255,0) 50%, rgba(255,255,255,.14) 100%),
		radial-gradient(120% 140% at 0 0, rgba(255,255,255,.55), rgba(255,255,255,0) 60%);
	-webkit-backdrop-filter: blur(var(--g-blur)) saturate(var(--ek-sat));
	backdrop-filter: blur(var(--g-blur)) saturate(var(--ek-sat));
	box-shadow: var(--ek-edge), 2px 3px 8px rgba(0,0,0,calc(var(--ek-shadow) * .9));
	transition: background-color .18s, box-shadow .18s, color .18s, transform .08s;
	-webkit-appearance: none;
	appearance: none;
}
.ek-btn::before,
.wp-block-button__link::before,
.wp-element-button::before,
.wp-block-search__button::before,
.search-submit::before,
.more-link::before,
.page-numbers::before,
.comment-reply-link::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	border-radius: inherit;
	pointer-events: none;
	background-image: linear-gradient(112deg, rgba(255,255,255,0) 30%, rgba(255,255,255,calc(var(--ek-shine) * .5)) 30.2%, rgba(255,255,255,calc(var(--ek-shine) * .12)) 52%, rgba(255,255,255,0) 52.2%);
	background-repeat: no-repeat;
	background-size: var(--ek-vw, 100vw) var(--ek-vh, 100vh);
	background-position: calc(var(--ek-sx, 0px) * -1) calc(var(--ek-sy, 0px) * -1);
}
.ek-btn:hover, .ek-btn:focus-visible,
.wp-block-button__link:hover, .wp-block-button__link:focus-visible,
.wp-element-button:hover, .wp-element-button:focus-visible,
.wp-block-search__button:hover, .search-submit:hover, .more-link:hover, .page-numbers:hover, .comment-reply-link:hover,
input[type="submit"]:hover, input[type="button"]:hover, input[type="reset"]:hover {
	color: var(--ek-btn-text-hover);
	text-shadow: 0 1px 2px rgba(0,0,0,.45);
	background-color: rgba(var(--ek-btn-hover-rgb), .66);
	box-shadow: var(--ek-edge), 0 0 calc(var(--ek-btn-glow) * 14px) rgba(var(--ek-btn-hover-rgb), .9), 2px 3px 8px rgba(0,0,0,calc(var(--ek-shadow) * .9));
}
.ek-btn:active,
.wp-block-button__link:active,
.wp-element-button:active,
.wp-block-search__button:active, .search-submit:active, .more-link:active, .page-numbers:active, .comment-reply-link:active,
input[type="submit"]:active, input[type="button"]:active, input[type="reset"]:active,
.page-numbers.current {
	color: var(--ek-btn-text-hover);
	text-shadow: 0 1px 2px rgba(0,0,0,.45);
	background-color: rgba(var(--ek-btn-active-rgb), .72);
	box-shadow: inset 1px 2px 6px rgba(0,0,0,.45), inset 0 0 0 1px rgba(255,255,255,.28);
	transform: translateY(1px);
}
.ek-btn:focus-visible, .wp-block-button__link:focus-visible, .wp-element-button:focus-visible,
input[type="submit"]:focus-visible { outline: 2px solid rgb(var(--ek-accent-rgb)); outline-offset: 2px; }
.ek-btn[disabled], input[type="submit"][disabled] { opacity: .5; cursor: not-allowed; }

/* Button block styles */
.wp-block-button.is-style-ek-btn-clear .wp-block-button__link { --g-rgb: 235,246,252; --g-a: .14; }
.wp-block-button.is-style-ek-btn-green .wp-block-button__link { --g-rgb: 46,150,96; --g-a: .50; --ek-btn-hover-rgb: 40,175,105; }
.wp-block-button.is-style-ek-btn-amber .wp-block-button__link { --g-rgb: 224,160,48; --g-a: .52; --ek-btn-hover-rgb: 240,170,40; }
.wp-block-button.is-style-ek-btn-dark  .wp-block-button__link { --g-rgb: 40,50,60; --g-a: .62; color: #f2faff; text-shadow: 0 1px 2px rgba(0,0,0,.6); --ek-btn-hover-rgb: 70,90,110; }
.wp-block-button.is-style-outline .wp-block-button__link { --g-a: .12; }
.wp-block-button .wp-block-button__link { margin: 0; }

/* ==========================================================================
   Glass form fields
   ========================================================================== */
input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"],
input[type="tel"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"],
input[type="month"], input[type="week"], input[type="file"], textarea, select, .ek-input {
	width: 100%;
	max-width: 100%;
	min-height: var(--ek-in-h);
	padding: .5em .85em;
	font: inherit;
	color: var(--ek-in-text);
	background-color: rgba(var(--ek-input-rgb), var(--ek-input-a));
	background-image: linear-gradient(135deg, rgba(255,255,255,.38), rgba(255,255,255,0) 45%);
	-webkit-backdrop-filter: blur(var(--ek-input-blur)) saturate(var(--ek-sat));
	backdrop-filter: blur(var(--ek-input-blur)) saturate(var(--ek-sat));
	border: 1px solid rgba(0,0,0,calc(var(--ek-bd-dark) * .9));
	border-radius: var(--ek-in-radius);
	box-shadow: inset 1px 2px 4px rgba(0,0,0,.22), inset 0 0 0 1px rgba(255,255,255,.45), 0 1px 0 rgba(255,255,255,.45);
	transition: box-shadow .18s, border-color .18s, background-color .18s;
}
textarea { min-height: 140px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--ek-in-ph); opacity: 1; }
input[type="text"]:focus, input[type="email"]:focus, input[type="url"]:focus, input[type="password"]:focus,
input[type="search"]:focus, input[type="tel"]:focus, input[type="number"]:focus, input[type="date"]:focus,
input[type="time"]:focus, input[type="datetime-local"]:focus, input[type="month"]:focus, input[type="week"]:focus,
input[type="file"]:focus, textarea:focus, select:focus, .ek-input:focus {
	outline: 0;
	border-color: rgb(var(--ek-in-focus-rgb));
	background-color: rgba(var(--ek-input-rgb), calc(var(--ek-input-a) + .18));
	box-shadow: inset 1px 2px 4px rgba(0,0,0,.18), 0 0 0 2px rgba(var(--ek-in-focus-rgb), .30), 0 0 12px rgba(var(--ek-in-focus-rgb), .55);
}
input:disabled, textarea:disabled, select:disabled { opacity: .55; cursor: not-allowed; }
select {
	-webkit-appearance: none;
	appearance: none;
	padding-right: 2.2em;
	background-image:
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2306213a' stroke-width='2'/%3E%3C/svg%3E"),
		linear-gradient(135deg, rgba(255,255,255,.38), rgba(255,255,255,0) 45%);
	background-repeat: no-repeat, no-repeat;
	background-position: right .8em center, 0 0;
}
option { background: var(--ek-in-option-bg); color: var(--ek-in-text); }
option:checked { background: rgb(var(--ek-in-focus-rgb)); color: #fff; }
input[type="checkbox"], input[type="radio"], input[type="range"], progress { accent-color: var(--ek-in-check); }
input[type="checkbox"], input[type="radio"] { width: 1.15em; height: 1.15em; min-height: 0; vertical-align: -.2em; margin-right: .4em; }
label { cursor: pointer; }
::selection { background: var(--ek-sel-bg); color: var(--ek-sel-text); }

.ek-searchform { display: flex; gap: 8px; align-items: stretch; }
.ek-searchform input[type="search"] { flex: 1 1 auto; min-width: 0; }

/* Canvas glass in front of everything: looking at the site through a rainy / misty window */
body.ek-canvas-front .ek-canvas { z-index: 20; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media print { .ek-canvas { display: none; } }
