/*
Theme Name:   Clive (Hello Elementor Child)
Theme URI:    https://clive.local/
Description:  Child theme for the Clive website, based on the free Hello Elementor theme. Page layouts are built with Elementor widgets; keep custom theme-level styles here (not inside pages) so they survive parent theme updates.
Author:       App Mechanic
Template:     hello-elementor
Version:      2.0.0
Requires at least: 6.0
Requires PHP: 7.4
License:      GNU General Public License v3 or later
License URI:  https://www.gnu.org/licenses/gpl-3.0.html
Text Domain:  hello-elementor-child
*/

/* Add theme-level custom styles below this line only when an Elementor setting can't do the job. */

/* ------------------------------------------------------------------
   Hover panels (free Elementor has no hover/tooltip widget).
   In Elementor: give a container the CSS class `clive-hover-trigger`
   and put a child container with the class `clive-hover-panel` inside it.
   Position, size and colours of the panel are set in Elementor
   (Advanced > Position: Absolute). Used by:
     - the "CLiVE" logo hover box in the header
     - the "See CLiVE in pictures" photo slideshow in the hero
   ------------------------------------------------------------------ */
.clive-hover-trigger {
	position: relative;
}

/* The panel never takes the mouse: it is shown ONLY while the pointer is on the
   trigger itself (e.g. the word "CLiVE"), and hides as soon as the pointer leaves it. */
.clive-hover-trigger > .clive-hover-panel,
.clive-hover-trigger > .e-con-inner > .clive-hover-panel {
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	pointer-events: none !important;
	transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}

/* Mouse hover (only on devices that really hover: phones keep a "sticky" hover after a tap),
   or keyboard focus (focus-visible) so it stays accessible without sticking open after a click. */
@media (hover: hover) {
	.clive-hover-trigger:hover > .clive-hover-panel,
	.clive-hover-trigger:hover > .e-con-inner > .clive-hover-panel {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition: opacity .2s ease, transform .2s ease, visibility 0s;
	}
}

.clive-hover-trigger:has(:focus-visible) > .clive-hover-panel,
.clive-hover-trigger:has(:focus-visible) > .e-con-inner > .clive-hover-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

/* Touch screens have no hover: on triggers with `clive-tap-open` (the photo slideshow) a tap
   toggles the `is-open` class (assets/js/clive.js); tapping anywhere else closes it. */
.clive-tap-open.is-open > .clive-hover-panel,
.clive-tap-open.is-open > .e-con-inner > .clive-hover-panel {
	opacity: 1;
	visibility: visible;
	transform: none;
	transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

.clive-hover-trigger .clive-logo {
	cursor: help;
}

@media (prefers-reduced-motion: reduce) {
	.clive-hover-trigger > .clive-hover-panel,
	.clive-hover-trigger > .e-con-inner > .clive-hover-panel {
		transition: none;
		transform: none;
	}
}

/* ------------------------------------------------------------------
   Sticky header (Elementor's "Sticky" motion effect is Pro-only).
   #masthead is the wrapper Ultimate Addons (HFE) prints around the
   Elementor header template, so the header itself stays editable in Elementor.
   `body.ehf-header` is needed to beat HFE's own `.ehf-header #masthead { position: relative }`.
   ------------------------------------------------------------------ */
body.ehf-header #masthead {
	position: sticky;
	top: 0;
	z-index: 1000;
}

/* keep it below the WordPress admin bar when logged in */
body.admin-bar.ehf-header #masthead {
	top: 32px;
}

@media (max-width: 782px) {
	body.admin-bar.ehf-header #masthead {
		top: 46px;
	}
}

@media (max-width: 600px) {
	/* on small phones the admin bar scrolls away with the page */
	body.admin-bar.ehf-header #masthead {
		top: 0;
	}
}

/* Full-site header: the gold "Launching soon" bar (container class `clive-announce`, 38px tall)
   scrolls away and only the menu bar stays stuck: the sticky header sits 38px above the window top. */
body.ehf-header #masthead:has(.clive-announce) {
	top: -38px;
}

body.admin-bar.ehf-header #masthead:has(.clive-announce) {
	top: -6px; /* 32px admin bar - 38px */
}

@media (max-width: 782px) {
	body.admin-bar.ehf-header #masthead:has(.clive-announce) {
		top: 8px; /* 46px admin bar - 38px */
	}
}

@media (max-width: 600px) {
	body.admin-bar.ehf-header #masthead:has(.clive-announce) {
		top: -38px;
	}
}

.clive-announce {
	height: 38px;
	overflow: hidden;
	white-space: nowrap;
}

/* Bottom action bar: the ✕ (class `clive-dismiss`) hides it for the rest of the visit (assets/js/clive.js). */
.clive-dismissible.is-dismissed {
	display: none !important;
}

/* In-page links: the menu (HFE) and Elementor buttons already animate the scroll, so no CSS smooth-scroll
   here (it fights their animation). The offset for the sticky header comes from Elementor "Menu Anchor"
   widgets placed above each section (Advanced > Position: Absolute, Offset Y -96px / -80px mobile). */

/* ------------------------------------------------------------------
   Phone/tablet slide-out menu (Ultimate Addons nav menu, Layout: Flyout, Orientation: Right).
   The plugin shows the panel instantly; these keyframes make it slide in from the right
   and fade the links in one after another. Content and colours are set in Elementor.
   ------------------------------------------------------------------ */
.hfe-side.hfe-flyout-right.hfe-flyout-show {
	animation: clive-flyout-in-right .38s cubic-bezier(.22, .61, .36, 1) both;
	box-shadow: -18px 0 48px rgba(14, 26, 18, .22);
}

.hfe-side.hfe-flyout-left.hfe-flyout-show {
	animation: clive-flyout-in-left .38s cubic-bezier(.22, .61, .36, 1) both;
}

.hfe-flyout-show .hfe-flyout-content li {
	animation: clive-flyout-item-in .35s ease both;
}

.hfe-flyout-show .hfe-flyout-content li:nth-child(1) { animation-delay: .10s; }
.hfe-flyout-show .hfe-flyout-content li:nth-child(2) { animation-delay: .15s; }
.hfe-flyout-show .hfe-flyout-content li:nth-child(3) { animation-delay: .20s; }
.hfe-flyout-show .hfe-flyout-content li:nth-child(4) { animation-delay: .25s; }
.hfe-flyout-show .hfe-flyout-content li:nth-child(5) { animation-delay: .30s; }
.hfe-flyout-show .hfe-flyout-content li:nth-child(n+6) { animation-delay: .35s; }

/* dark-green backdrop behind the open panel */
.hfe-flyout-overlay {
	background-color: rgba(14, 26, 18, .55) !important;
}

@keyframes clive-flyout-in-right {
	from { transform: translateX(100%); }
	to   { transform: translateX(0); }
}

@keyframes clive-flyout-in-left {
	from { transform: translateX(-100%); }
	to   { transform: translateX(0); }
}

@keyframes clive-flyout-item-in {
	from { opacity: 0; transform: translateX(24px); }
	to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hfe-side.hfe-flyout-show,
	.hfe-flyout-show .hfe-flyout-content li {
		animation: none;
	}
}

/* ------------------------------------------------------------------
   Password-protected preview pages (WordPress's own password box, styled to match the site).
   ------------------------------------------------------------------ */
.post-password-form {
	max-width: 520px;
	margin: 96px auto;
	padding: 40px 36px;
	background: #fff;
	border: 1px solid #E6DFCF;
	border-radius: 24px;
	box-shadow: 0 18px 50px rgba(22, 36, 26, .08);
	font-family: "Work Sans", sans-serif;
	color: #4C5D51;
	text-align: center;
}

.post-password-form p:first-child::before {
	content: "Preview";
	display: block;
	margin-bottom: 12px;
	color: #B9842A;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 2.4px;
	text-transform: uppercase;
}

.post-password-form p {
	margin: 0 0 18px;
	line-height: 1.6;
}

.post-password-form label {
	display: block;
	font-weight: 600;
	color: #16241A;
}

.post-password-form input[type="password"] {
	display: block;
	width: 100%;
	margin-top: 8px;
	padding: 13px 18px;
	border: 1px solid #E6DFCF;
	border-radius: 999px;
	background: #FBF8F1;
	font: inherit;
}

.post-password-form input[type="submit"] {
	margin-top: 4px;
	padding: 13px 30px;
	border: 0;
	border-radius: 999px;
	background: #2F5D3A;
	color: #fff;
	font: 600 15px "Work Sans", sans-serif;
	cursor: pointer;
}

.post-password-form input[type="submit"]:hover {
	background: #16241A;
}

@media (max-width: 600px) {
	.post-password-form {
		margin: 48px 20px;
		padding: 30px 22px;
	}
}

/* ------------------------------------------------------------------
   Full site: light / dark mode (the client's own dark palette).
   Every Elementor colour on the site points at a Site Settings global colour, so dark mode simply swaps
   those globals. Only on pages that have the header toggle (.clive-theme-toggle), so the coming-soon
   page is never affected. Toggle + saved choice: functions.php (head) and assets/js/clive.js.
   ------------------------------------------------------------------ */
html[data-theme="dark"] body:has(.clive-theme-toggle) {
	--e-global-color-primary: #86B06A;   /* green */
	--e-global-color-secondary: #E0B355; /* gold */
	--e-global-color-text: #9AA08F;      /* muted text */
	--e-global-color-accent: #DCDED3;    /* main text / headings */
	--e-global-color-cream: #141814;     /* page background */
	--e-global-color-sand: #212A20;      /* alternate sections */
	--e-global-color-line: #2A3328;      /* dividers */
	--e-global-color-white: #1B211B;     /* cards */
	--e-global-color-border: #34402F;
	--e-global-color-greentint: #2A3328;
	--e-global-color-goldtint: #3A3322;
	--e-global-color-faint: #6B7160;
	--e-global-color-offset: #1E251E;    /* footer */
	--e-global-color-success: #86B06A;
	background-color: #141814;
	color-scheme: dark;
}

/* theme toggle: moon in light mode, sun in dark mode */
html:not([data-theme="dark"]) .clive-theme-toggle .clive-icon-sun,
html[data-theme="dark"] .clive-theme-toggle .clive-icon-moon {
	display: none;
}

.clive-theme-toggle {
	cursor: pointer;
}

.clive-theme-toggle:hover {
	border-color: var(--e-global-color-primary) !important;
}

/* Data tables built from Elementor containers: keep the columns readable and let phones scroll sideways. */
.clive-table {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.clive-table-inner {
	min-width: 720px;
}

/* Dark mode: gold buttons keep dark text (their text uses the "Ink" colour, which turns light in dark mode). */
html[data-theme="dark"] body:has(.clive-theme-toggle) .clive-btn-gold {
	--e-global-color-accent: #141814;
}

/* Dark mode: green form bands (class clive-band-green) stay deep green instead of the light dark-mode green. */
html[data-theme="dark"] body:has(.clive-theme-toggle) .clive-band-green {
	background-color: #1F3A27 !important;
}

/* ------------------------------------------------------------------
   Volunteer & skills sign-up form (MetForm 905, Get Involved page): the skill check boxes inside the
   accordion tabs are shown as a tidy grid of option cards instead of plain browser check boxes.
   The same option-card style is reused for the consent box on the Photo Submission form (MetForm 1093).
   Colours are the site's global colours, so light and dark mode both work.
   ------------------------------------------------------------------ */
.elementor-905 .mf-checkbox.multi-option-input-type {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 10px;
	padding: 4px 0 2px;
}

.elementor-905 .mf-checkbox-option,
.elementor-1093 .mf-checkbox-option {
	margin: 0;
	padding: 0;
}

.elementor-905 .mf-checkbox-option label,
.elementor-1093 .mf-checkbox-option label {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 100%;
	margin: 0;
	padding: 12px 14px;
	border: 1px solid var(--e-global-color-line);
	border-radius: 12px;
	background: var(--e-global-color-white);
	color: var(--e-global-color-accent);
	font-size: 15px;
	line-height: 1.35;
	cursor: pointer;
	transition: border-color .15s ease, background-color .15s ease;
}

.elementor-905 .mf-checkbox-option label:hover,
.elementor-1093 .mf-checkbox-option label:hover {
	border-color: var(--e-global-color-primary);
}

.elementor-905 .mf-checkbox-option label:has(input:checked),
.elementor-1093 .mf-checkbox-option label:has(input:checked) {
	border-color: var(--e-global-color-primary);
	background: var(--e-global-color-greentint);
}

.elementor-905 .mf-checkbox-option input[type="checkbox"] + span,
.elementor-1093 .mf-checkbox-option input[type="checkbox"] + span {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 0;
}

/* the box (MetForm hides the real check box and draws this one) */
.elementor-905 .mf-checkbox-option input[type="checkbox"] + span::before,
.elementor-1093 .mf-checkbox-option input[type="checkbox"] + span::before {
	content: "";
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin: 0;
	box-sizing: border-box;
	border: 2px solid var(--e-global-color-text);
	border-radius: 6px;
	background: var(--e-global-color-white);
	color: var(--e-global-color-white);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	transition: background-color .15s ease, border-color .15s ease;
}

.elementor-905 .mf-checkbox-option input[type="checkbox"]:checked + span::before,
.elementor-1093 .mf-checkbox-option input[type="checkbox"]:checked + span::before {
	content: "\2713" !important;
	color: var(--e-global-color-white) !important;
	font-family: "Work Sans", sans-serif;
	font-size: 13px !important;
	border-color: var(--e-global-color-primary);
	background: var(--e-global-color-primary);
}

.elementor-905 .mf-checkbox-option input[type="checkbox"]:focus-visible + span::before,
.elementor-1093 .mf-checkbox-option input[type="checkbox"]:focus-visible + span::before {
	outline: 2px solid var(--e-global-color-primary);
	outline-offset: 2px;
}

/* Photo Submission form (1093): same 18px gap under the "Consent" label as between the consent box and the
   button (MetForm forces margin-bottom: -5px !important on check box labels). */
.elementor-1093 .elementor-widget-mf-checkbox .mf-input-label {
	margin-bottom: 18px !important;
}

/* Photo Submission form (1093): the photo upload looks like the other inputs (one rounded box with the
   "Choose a file" button inside). A long file name stays on one line and is cut with "…", and the
   remove (×) button sits neatly at the end of the line instead of floating over the corner. */
.elementor-1093 .mf-file-upload-container {
	flex-wrap: nowrap;
	gap: 14px;
	padding: 8px;
	border: 1px solid var(--e-global-color-line);
	border-radius: 12px;
	background: var(--e-global-color-cream);
	box-sizing: border-box;
}

.elementor-1093 .mf-file-upload-container .mf-input-file-upload-label {
	flex: 0 0 auto;
	margin: 0;
	white-space: nowrap;
}

.elementor-1093 .mf-file-name {
	display: flex !important;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	flex-wrap: nowrap;
	padding: 0 !important;
	margin: 0 !important;
	color: var(--e-global-color-text);
}

.elementor-1093 .mf-file-name > span {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	font-size: 15px;
}

/* MetForm adds a 12px left margin to every span in the file name, which pushes the × outside the box */
.elementor-1093 .mf-file-name span {
	margin: 0 !important;
}

.elementor-1093 .mf-file-name .mf-file-name-item {
	position: static;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 0;
}

.elementor-1093 .mf-file-name .mf-file-name-item > span:first-child {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--e-global-color-accent);
}

.elementor-1093 .mf-file-name .mf-file-remove {
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	margin: 0;
	border: 1px solid var(--e-global-color-line);
	border-radius: 50%;
	background: var(--e-global-color-white);
	box-shadow: none;
	color: var(--e-global-color-text) !important;
	font-size: 18px;
	line-height: 1;
}

.elementor-1093 .mf-file-name .mf-file-remove:hover {
	border-color: #B3261E;
	background: #B3261E;
	color: #FFFFFF !important;
}

.elementor-1093 .mf-file-name .mf-file-remove .mf-file-cross {
	display: block;
	margin: 0 0 2px;
	color: inherit;
	line-height: 1;
	cursor: pointer;
}

/* phones: a slimmer button leaves more room for the file name */
@media (max-width: 480px) {
	.elementor-1093 .mf-file-upload-container {
		gap: 10px;
	}

	.elementor-1093 .mf-file-upload-container .mf-input-file-upload-label {
		padding: 10px 16px !important;
	}
}

/* logo: colour lockup in light mode, reversed white lockup in dark mode */
html:not([data-theme="dark"]) .clive-logo-dark,
html[data-theme="dark"] .clive-logo-light {
	display: none;
}
