/**
 * Theme Name:        RTS Accessible Theme
 * Description:       RTS Accessible Theme 2026 (Child of 2025)
 * Version:           1.0.1
 * Author:            Egret Digital
 * Author URI:        https://egret.digital/
 * Text Domain:       rts-accessible-2025
 * Domain Path:       /assets/lang
 * Tested up to:      6.8
 * License:           GNU General Public License v2.0 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Template:          twentytwentyfive
 */


/* Calculated margin for elements that have full width background or border but constrained width content 
 * Constrain using margin rather than content width as this is fluid within % columns with padding */
body {
    --calculated-padding: max(var(--wp--preset--spacing--50), calc(100vw - 1340px) / 2); 
}
.limit-width {
	margin-right: var(--calculated-padding) !important;
}
.limit-width-l {
	margin-left: var(--calculated-padding) !important;
}


/* Hero section */
.hero-full-height {
    figure {
        height: 100%;
    }
    img {
        height: 100%;
        object-fit: cover;
    }
}



/* Unset underline on links */
a:not([class]) {
	text-decoration: none;
}

/* Button hover styles */
.wp-element-button:hover, 
.wp-block-button__link:hover {
    background-color: #fff;
    color: var(--wp--preset--color--contrast);
}

.buttons-purple {
    .wp-element-button {
        background-color: var(--wp--preset--color--custom-rts-purple);
        white-space: nowrap;
    }
    .wp-element-button:hover, 
    .wp-block-button__link:hover {
        color: #fff;
        background-color: var(--wp--preset--color--contrast);
    }
}

/* Menu Styles */
nav {
    /* Highlight current menu item */
	.current-menu-item > a,
	a:hover,
	a:active {
		color: var(--wp--preset--color--custom-rts-purple) !important;
	}
	
	 /* Home link not needed on desktop */
	@media (min-width: 600px) {
	    .nav-home {
	        display: none !important;
	    }
	}

    /* Improve mobile menu styles */
    @media (max-width: 599px) {
	    .wp-block-navigation__responsive-container {
		background-color: #fffffff5 !important;
	    }
	    .wp-block-navigation__responsive-container-content {
		justify-content: center !important;
		align-items: center !important;

		ul {
		    justify-content: center !important;
		    align-items: center !important;
		}
		li {
		    font-size: var(--wp--preset--font-size--large) !important;
		}
	}
    }
}


/* Remove default margin above Footer */
footer {
    margin-block-start: 0;
}


/* Archive pages - core fix for loop images sometimes being wider than containers */
.archive .wp-block-post-featured-image {
	max-width: 100% !important;
	img {
		border-radius: 0 40px;
	}
}
/* Core fix for list items displayed as flex */
.archive .entry-content li {
	display: list-item;
}


/* Gravityforms styles */
#gform_1 {
	label,
	legend {
    	--gf-local-font-size: var(--wp--preset--font-size--medium);
    }
    
    .gform_button {
    	--gf-local-font-size: var(--wp--preset--font-size--medium);
    	--gf-local-padding-y: 0.2rem;
    	padding-top: 0.4rem; /* Override due to weird unbalanced font */
    	--gf-ctrl-btn-bg-color-primary: var(--wp--preset--color--vivid-cyan-blue);
    	--gf-ctrl-btn-border-color-primary: var(--wp--preset--color--vivid-cyan-blue);
    	--gf-ctrl-btn-border-color-hover-primary: var(--wp--preset--color--luminous-vivid-amber);
    	--gf-ctrl-btn-bg-color-hover-primary: var(--wp--preset--color--luminous-vivid-amber);
    	--gf-ctrl-btn-border-width-primary: 2px;
    	--gf-ctrl-btn-font-weight: bold;
    	margin: auto;
    }
}


/* search */
.wp-block-search__button {
    padding: 0.5em;
    border-radius: 1px;
    svg {
        height: 1.75em;
        width: 1.75em;
    }
}


/* Map block */
#wpgmza_map_1 {
    height: 100% !important;
}



/* Research section - make dashed border */
.research-impact {
    border-top-style: dashed;
    border-bottom-style: dashed;
}



/* Scroling grid - TODO Just make it look like a scroll area for now */
.grid-scroll {
    margin-right: -50px !important;
    overflow-x: hidden;
    
    .limit-width-l {
       width: calc(100% + 40px);
    }
}

/* Alternate the border radius on odd/even cards */
.alt-border-radius {
    > div {
        overflow: hidden;
    }
    > div:nth-child(odd) {
        border-radius: 0 2rem 0 2rem;
    }
    > div:nth-child(even) {
        border-radius: 2rem 0 2rem 0;
    }

    > div:first-child {
        border-radius: 0;
    }
}



/* Mask images */
.mask-blob-cloud {
    background-image: url(/wp-content/uploads/2026/04/blob-mask-cloud.svg);
    background-repeat: no-repeat;
    background-size: 110%;
    
    img {
        -webkit-mask-image: url(/wp-content/uploads/2026/04/blob-mask-cloud.svg);
        mask-image: url(/wp-content/uploads/2026/04/blob-mask-cloud.svg);
        mask-repeat: no-repeat;
        mask-size: cover;
        -webkit-mask-size: cover;
    }
}

.blob-square-bg {
    background-image: url(/wp-content/uploads/2026/04/blob-mask-cloud.svg);
    background-repeat: no-repeat;
    background-position: left;
    background-size: contain;
}