/*!
Theme Name: Kadence Child
Theme URI: https://www.kadencewp.com/kadence-theme/
Template: kadence
Author: Kadence WP
Author URI: https://www.kadencewp.com/
Description: A child theme for the Kadence Theme.
Version: 1.0.0
License: GNU General Public License v3.0 (or later)
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: kadence-child
*/

/* Theme customization starts here
-------------------------------------------------------------- 
00. CORE
01. SITEWIDE
02. FOOTER
10. PAGE > HERO
11. SEARCH RESULTS
12. BLOG
30. SPECIFIC PAGES
	31. Homepage
	32. Single Event Page
	33. Our People
	34. Real Life Stories
50. BLOCK CUSTOMISATIONS
99. HOTFIXES & BUGS & TEMP FIXES

/* ---------------------------------------------------
* 00. CORE 
* ---------------------------------------------------*/
:root body {
	--global-kb-font-size-xxxl: clamp(1.8rem, 1.4842rem + 1.2632vw, 3rem);
    --global-kb-font-size-xxl: clamp(1.8rem, 1.5368rem + 1.0526vw, 2.8rem); /* H1 */
    --global-kb-font-size-xl: clamp(1.8rem, 1.6947rem + 0.4211vw, 2.2rem); /* H2 */
    --global-kb-font-size-lg: clamp(1.6rem, 1.5474rem + 0.2105vw, 1.8rem); /* H3 */
    --global-kb-font-size-md: 1.4rem; /* H4 */
    --global-kb-font-size-sm: 1rem;
    --global-kb-font-size-xsm: 0.8rem;
	--global-xxs-spacing: 0.5rem;
	 
}

body h1 { font-size: var(--global-kb-font-size-xxl); }
body h2 { font-size: var(--global-kb-font-size-xl);  }
body h3 { font-size: var(--global-kb-font-size-md); }
body h4 { font-size: var(--global-kb-font-size-md); }
body h5 { font-size: var(--global-kb-font-size-sm); }
body h6 { font-size: var(--global-kb-font-size-xsm); }

/*Text balance */
.balance {
    text-wrap: balance;
}

/* ---------------------------------------------------
* 01. SITEWIDE
* ---------------------------------------------------*/

/* FLUENT FORMS */
.kt-inside-inner-col:has( .fluentform ) {
	background-color: var( --global-palette7 );
	padding: var( --global-sm-spacing );
	border-radius: 10px;
}

/* White icons with green background dashed outline - needed on some icon wraps so it doesn't stretch
 * Example can be seen on the homepage */
.wellspring-icon-wrap {
	width: fit-content;
}

/* Remove margin on bottom */
.wellspring-icon-wrap.bring-up {
	margin: 0 auto -40px auto;
}

/* Breadcrumbs */
.nos-breadcrumbs a {
	text-decoration: none;
}

.nos-breadcrumbs .nos-current-page {
	color: var( --global-palette9 );
}

/* Overflow */
.wellspring-overflow-hidden .wp-block-kadence-column {
	overflow: hidden;
}

/* Advanced slider with overflow on right - can be found on pages e.g. Housing Support */
.wellspring-services-carousel .kb-splide,
.wellspring-services-carousel-section .kt-inside-inner-col {
	position: unset;
}

.wellspring-services-carousel .kb-splide.kb-slider-arrow-position-bottom-left .splide__arrows {
	bottom: -20px;
	left: 0;
	width: 100%;
	justify-content: center;
}

@media screen and ( width > 767px ) {
	.wellspring-services-carousel .kb-splide.kb-slider-arrow-position-bottom-left .splide__arrows {
		width: unset;
		left: 1rem;
	}
	
	.wellspring-services-carousel-section .wp-block-kadence-slide.kb-advanced-slide-item {
		width: 350px !important;
	}
}

@media screen and ( width > 1023px ) {
	.wellspring-services-carousel .kb-splide.kb-slider-arrow-position-bottom-left .splide__arrows {
		bottom: 50px;
	}
}

.wellspring-services-carousel .kb-splide .splide__arrow {
	width: 3em;
	border-radius: 50%;
}

/* Get help pattern */
.wellspring-info-with-icons .wellspring-info-with-icon .kt-inside-inner-col {
	display: flex;
}

.wellspring-info-with-icons .wellspring-info-with-icon .wellspring-info-text,
.wellspring-info-with-icons .wellspring-info-with-icon .wellspring-info-text .kt-inside-inner-col {
	flex-grow: 1;
}

/* ---------------------------------------------------*/

/* Text highlights
 * Usage: add extra class to the <mark> element
 * E.g highlight-green-white adds green background with white text
 * To rotate add either rotate-left or rotate-right
 * */
.wp-block-kadence-advancedheading:has( span ),
.wp-block-heading:has( span ) {
    line-height: 1.4;
}

/* Highlight set in editor is relative */
.wp-block-kadence-advancedheading span.highlight,
.wp-block-heading span.highlight {
    position: relative;
	display: inline-flex;
    height: fit-content;
    width: fit-content;
}

/* Create pseudo elements */
.wp-block-kadence-advancedheading span.highlight::before,
.wp-block-heading span.highlight::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -7.5px;
    width: calc( 100% + 15px );
    height: calc( 100% + 10px );
    z-index: -1;
}

/* On H1 alter height */
h1.wp-block-kadence-advancedheading span.highlight::before,
h1.wp-block-heading span.highlight::before {
	top: 0;
	height: 90%;
}

/* Else make width slightly wider and centre */
:not(h1).wp-block-kadence-advancedheading span.highlight::before,
:not(h1).wp-block-heading span.highlight::before {
    left: -5px;
    width: calc( 100% + 10px );
}

/* Rotation effects */
.wp-block-kadence-advancedheading span.rotate-left::before,
.wp-block-heading span.rotate-left::before {
    transform: rotate( -1deg );
}

.wp-block-kadence-advancedheading span.rotate-right::before,
.wp-block-heading span.rotate-right::before {
    transform: rotate( 1deg );
}

/* Colour variations */
.wp-block-kadence-advancedheading span {
    &.highlight.white-text {
		color: var( --global-palette9 );
	}
    &.highlight.purple-text {
        color: var( --global-palette2 );
    }

    &.highlight.green-back::before {
        background: var( --global-palette1 );
    }
    &.highlight.white-back::before {
        background: var( --global-palette9 );
    }
    &.highlight.purple-back::before {
        background: var( --global-palette2 );
    }
}

/* ---------------------------------------------------*/

/* Post grid/carousel */

/* Place category on top */
.wellspring-news-carousel .kt-blocks-post-grid-item header {
	position: unset;
}

.wellspring-news-carousel .kt-blocks-post-grid-item {
	position: relative;
}

.wellspring-news-carousel .blog-category {
	position: absolute;
	top: 0;
	right: 20px;
	background: var( --global-palette2 );
	padding: var( --global-xxs-spacing ) 0;
	width: 150px;
	text-align: center;
	color: var( --global-palette9 );
	font-weight: bold;
	border-radius: 0 0 10px 10px;
}

.wellspring-news-carousel .blog-category a {
	color: var( --global-palette9 );
}

/* Hover on post carousel */
div.wp-block-kadence-postgrid .kt-blocks-post-grid-item,
body.blog .post-thumbnail,
.wellspring-news-and-events-query .kb-query-item {
	overflow: hidden;
}

.kt-blocks-post-grid-item .kadence-post-image,
body.blog .post-thumbnail-inner,
.wellspring-news-and-events-query .kb-query-item figure {
	transition: transform 0.2s ease;
	
	&:hover {
		transform: scale( 1.05 );
	}
}

/* ---------------------------------------------------*/

/* Search input */
.kb-search-form input.kb-search-input {
	border-radius: 20px;
}

/* Even spacing on widget menus where section has > 1 */
@media screen and ( width < 1025px ) {
	footer .footer-widget-area .footer-widget-area-inner:has( .widget_nav_menu ) {
		display: grid;
		gap: 20px;
	}
}

/* Subscribe form */
footer .wp-block-kadence-advanced-form .wp-block-button__link {
	word-break: unset;
}

/* Fix news archive and search results */
#archive-container .custom-archive-loop-item > .wp-block-kadence-column,
#archive-container .custom-archive-loop-item > .wp-block-kadence-column {
	height: 100%;
}

#archive-container .custom-archive-loop-item > .wp-block-kadence-column .kt-inside-inner-col > .wp-block-kadence-column,
#archive-container .custom-archive-loop-item > .wp-block-kadence-column .kt-inside-inner-col > .wp-block-kadence-column .kt-inside-inner-col {
	height: 100%;
}

.wp-block-kadence-query .kb-query-grid-wrap li {
	display: flex;
	flex-direction: column;
}

/* Toolkit */
.wellspring-toolkits .wellspring-toolkit:nth-of-type( even ) {
	background: var( --global-palette7 );
}

.wellspring-toolkits .wellspring-toolkit {
	display: grid;
	grid-template-columns: minmax( 0, 200px ) 1fr auto;
	gap: var( --global-md-spacing );
	margin-block: var( --global-lg-spacing );
	padding: var( --global-sm-spacing );
}

@media screen and (width < 769px) {
	.wellspring-toolkits .wellspring-toolkit {
		grid-template-columns: minmax(0, 200px) 1fr;
	}

	& .wellspring-file-download {
		display: flex;
		justify-content: center;
		grid-area: 2 / 1 / 2 / 2;
	}
}

.wellspring-toolkits .wellspring-toolkit .toolkit-description {
	margin-bottom: 1rem;
}

.wellspring-toolkits .wellspring-toolkit .wellspring-file .wellspring-file-details {
	font-size: 0.85rem;
	font-style: italic;
	margin: 0;
}

/* Services grid pattern */
@media screen and (max-width: 1024px) {
	.wellspring-services-grid > .kt-row-column-wrap > .wp-block-kadence-column > .kt-inside-inner-col .wp-block-kadence-column:has(h3) {
		flex: 1;
	}
}

/* Ally fixes */
body:has(#ea11y-root) #wrapper .wellspring-services-grid > div.kt-row-column-wrap a:not(.button),
body:has(#ea11y-root) #wrapper .wellspring-services-carousel-row .wellspring-services-carousel a:not(.button),
body:has(#ea11y-root) #wrapper .wellspring-subpages-with-icons .wellspring-subpage-with-icon a:not(.button),
body:has(#ea11y-root) #wrapper #archive-container .post .wp-block-kadence-column a:not(.button),
body:has(#ea11y-root) #wrapper .wp-block-kadence-query > .wp-block-kadence-query-card > ul.kb-query-grid-wrap li.kb-query-item div.wp-block-kadence-column a:not(.button) {
	background-color: unset !important;
}

/* Mega Menu */
.menu li.menu-item.menu-item-has-children:hover button {
	transform: rotate(180deg);
}

.menu .sub-menu.mega-menu nav ul li.menu-item.kb-menu-has-icon * {
	transition: all 0.3s ease;
}

.menu .sub-menu.mega-menu nav ul li.menu-item.kb-menu-has-icon:hover span {
	font-weight: bold;
}

.menu .sub-menu.mega-menu nav ul li.menu-item.kb-menu-has-icon:hover span .link-media-container {
	transform: translateX(5px);
}

.menu .sub-menu.mega-menu {
	box-shadow: 0 1000px 0 1000px rgba(0, 0, 0, .35);
}

/* Sidebar on posts */
.single-post #wrapper aside.primary-sidebar {
	
	border-radius: 10px;
	
	& ul {
		margin: 0;
	}
	
	& li {
		margin-block: var( --global-xxs-spacing );
		position: relative;
		font-weight: normal;
		transition: all 0.3s ease;
		line-height: 1.4;

		& a {
			display: flex;
			align-items: center;
			padding: 5px;
		}

		& a:hover {
			text-decoration: none;
			font-weight: bold;
			background: var( --global-palette9 );
			border-radius: 10px;
		}

		& a::before {
			content: "";
			display: inline-block;
			width: 1em;
			height: 1em;
			padding-right: var( --global-sm-spacing );
			background-color: var(--global-palette2);
			-webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") no-repeat center;
			mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E") no-repeat center;
			-webkit-mask-size: contain;
			mask-size: contain;
			transition: all 0.3s ease;
		}

		& a:hover::before {
			transform: translateX(5px);
		}
	}
}

/* Related posts on posts */
.single-post .entry-related-carousel {
	
	& .entry {
		border: solid 1px var( --global-palette6 );
		border-radius: 10px;
	}
	
	& img {
		border-radius: 10px 10px 0 0;
	}
}

/* ---------------------------------------------------
 * 02. FOOTER
 * ---------------------------------------------------*/

/* Widget found in the bottom left - includes copyright */
footer .footer-html {
	margin: 0;
}

footer .footer-html .footer-html-inner p:first-of-type {
	border-bottom: solid 1px var( --global-gray-500 );
	padding-bottom: var( --global-xs-spacing );
}

footer .site-bottom-footer-inner-wrap {
	gap: 30px;
}

footer#colophon nav.footer-navigation ul.menu {
	gap: 20px;
}

footer#colophon nav.footer-navigation ul.menu > li > a {
	padding: 0;
}

@media screen and (max-width: 1025px) {
	footer div.footer-widget-area div.footer-widget-area-inner:has( .widget_nav_menu ) {
		gap: 0;
	}
}

/* ---------------------------------------------------
 * 11. SEARCH RESULTS
 * ---------------------------------------------------*/

/* ---------------------------------------------------
 * 12. BLOG
 * ---------------------------------------------------*/
.wellspring-filter {
	margin-block: 1rem;
	
	& p {
		font-size: var( --global-kb-font-size-lg );
		font-weight: bold;
	}
	
	& .category-links {
		display: flex;
		gap: var( --global-md-spacing );
	}
	
	& a.active {
		background-color: var( --global-palette2 );
	}
}

/* ---------------------------------------------------
 * 31. HOME
 * ---------------------------------------------------*/

/* Hero */
.wellspring-home-hero {
	overflow: hidden;
}

.wellspring-make-a-difference-title {
	word-break: initial;
}

/* Row with housing support, 1:1 etc */
.wellspring-services-grid .wp-block-kadence-column .kt-inside-inner-col {
	overflow: hidden;
}

.wellspring-services-grid .wp-block-kadence-column figure {
	transition: transform ease-in-out 0.3s;
}

.wellspring-services-grid .wp-block-kadence-column:hover figure {
	transform: scale( 1.05 );
}

/* Real life stories */
.wellspring-real-stories .kt-blocks-post-grid-item,
.wellspring-latest-news .kt-blocks-post-grid-item {
	border-radius: 10px;
	border: solid 0.5px var( --global-palette6 );
}

.wellspring-real-stories .kt-blocks-post-grid-item-inner,
.wellspring-latest-news .kt-blocks-post-grid-item-inner {
	background: var( --global-palette9 );
	padding: var( --global-sm-spacing );
}

.wellspring-real-stories .kt-blocks-post-readmore-wrap,
.wellspring-latest-news .kt-blocks-post-readmore-wrap {
	border-top: solid 2px var( --global-palette7 );
	margin-top: 10px;
}

/* Rotating circle */
.wellspring-rotating-circle {
	position: absolute;
	top: -60px;
	left: 50px;
}

.wellspring-rotating-circle .kt-inside-inner-col {
	width: 135px;
	height: 135px;
}

.wellspring-rotating-circle .kt-inside-inner-col > * {
	position: absolute;
}

.wellspring-rotating-circle .kt-inside-inner-col figure {
	transform-origin: center center;
	will-change: transform;
	transform-style: preserve-3d;
	transform: translate3d( 0px, 0px, 0px ) rotateZ( 180deg ); /* This is overwritten in js */
	inset: 10px;
}

/* ---------------------------------------------------
 * 32. Single Event Page
 * ---------------------------------------------------*/

/* Add spacing to map */
.tribe-block.tribe-block__venue.tribe-clearfix.tribe-block__venue--has-map {
	margin-bottom: var( --tec-spacer-6 );
}

/* If no price but there is a description then remove the margin on description */
.tribe-block.tribe-block__event-price:not( :has( .tribe-block__event-price__cost ) ) .tribe-block__event-price__description {
	margin: 0;
}

/* Price and description spacing */
@media screen and (max-width: 425px) {
	.tribe-block.tribe-block__event-price {
		flex-direction: column;
		align-items: unset;
	}
	
	.tribe-block__event-price .tribe-block__event-price__description {
		margin: 0;
	}
}

.tribe-block__event-price__cost {
	min-width: 125px;
}

/* ---------------------------------------------------
 * 33. Our People
 * ---------------------------------------------------*/

/* ---------------------------------------------------
 * 34. Real Life Stories
 * ---------------------------------------------------*/

.wellspring-real-life-stories .kb-query-grid-wrap li {
	display: flex;
	flex-direction: column;
}

.wellspring-real-life-stories .kb-query-grid-wrap li .wp-block-kadence-column,
.wellspring-real-life-stories .kb-query-grid-wrap li .wp-block-kadence-column .kt-inside-inner-col {
	height: 100%;
}