/**
 * Theme Name:        Ascot Advisory Theme
 * Description:       Ascot Advisory Theme (Child of 2025)
 * Version:           1.0.1
 * Author:            The Digital Doctor
 * Author URI:        https://thedigitaldoctor.co.uk/
 * Text Domain:       ascot-advisory-theme
 * Domain Path:       /assets/lang
 * Tested up to:      6.9
 * License:           GNU General Public License v2.0 or later
 * License URI:       https://www.gnu.org/licenses/gpl-2.0.html
 * Template:          twentytwentyfive
 */


/* Padding calculations */
body {
    --calculated-padding: max(var(--wp--preset--spacing--50), calc(100vw - 1340px) / 2); 
}


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

/* Button hover styles */
.wp-element-button:hover, 
.wp-block-button__link:hover {
    background-color: var(--wp--preset--color--custom-ascot-mid-blue);
}


/* Menu Styles */
nav {
    /* Highlight current menu item */
	.current-menu-item > a,
	a:hover,
	a:active {
		color: #fff !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;
}

/* Contact links in footer */
.contact-links {
    display: flex !important;
    justify-content: center;

    figure {
        width: 44px;
        text-align: right;
        margin-left: var(--wp--preset--spacing--50);
    }
    img {
        width: 44px;
        border-radius: 50%;
    }
    img:hover {
        background-color: #fcf9da70; /*var(--wp--preset--color--custom-ascot-cream);*/
    }
    p {
        margin: auto 0;
        width: fit-content;
    }
    p:first-child {
        margin-left: 0;
    }
    
    @media (max-width: 781px) {
        flex-wrap: wrap;
        
        p {
            width: calc(100% - 60px);
        }
        p:first-child {
            width: 100%;
        }
    }
}
.address-links {
    margin-left: auto !important;
}
.footer-a {
    max-width: 18vw;
}


/* Sticky Header */
.sticky-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 500;
    background: linear-gradient(0deg, #02303c00 0%, #02303c 100%);
    transition: top 0.3s ease;
}
.sticky-header.hide {
    top: -150px;
}


/* Homepage two columns of text */
@media (min-width: 782px) {
    .responsive-cols {
        column-count: 2;
        column-gap: var(--wp--preset--spacing--50);
        max-width: 72ch;
        margin-right: var(--calculated-padding) !important;
        margin-left: auto !important;
    }
}

@media (max-width: 781px) {
    .col-reverse {
        order: 1;
    }
}



/* About - people section */
.people-cols {
    figure {
        border-radius: 50%;
        aspect-ratio: 1/1;
        border: 1px solid var(--wp--preset--color--custom-ascot-light-grey);
        overflow: hidden;
        height: fit-content;
        width: fit-content;
        margin: 0 auto 1em;
    }
}


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



@media (min-width: 782px) {
   
    /* Image on right */
	.full-width-columns {
		.wp-block-column:first-child {
			padding-left: var(--calculated-padding) !important;
			.wp-block-group {
				margin-right: 0;	
			}
		}
	}
	
    /* Mirror image where image on left */
	.full-width-columns-left {
		.wp-block-column:last-child {
			padding-right: var(--calculated-padding) !important;
			.wp-block-group {
				margin-left: 0;	
			}
		}
	}
	
	.full-width-columns,
	.full-width-columns-left {
	    figure {
	        height: 100%;
	    }
    	img {
		    max-height: 650px;
            aspect-ratio: 4 / 3;
            object-fit: cover;
            height: 100%;
		}	    
	}
	.hero-columns img {
	    aspect-ratio: 1 / 1;
	    height: auto;
        width: 100%;
	}
}




/* 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;
    }
}
