/**
 * Theme Name:        Ascot Advisory Theme
 * Description:       Ascot Advisory Theme (Child of 2025)
 * Version:           1.0.2
 * 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: var(--wp--preset--color--custom-ascot-light-grey) !important;
	}

    /* Improve mobile menu styles */
    .wp-block-navigation__responsive-container {
	    background-color: #FCFADCf5 !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--x-large) !important;
		}
	}
}


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

/* Page links in footer */
.arrow-links {
    .wp-block-navigation-item__content {
        margin: 0 0.75em;
    }
    ul {
        gap: var(--wp--preset--spacing--30);
    }
    li {
        width: 100%;
        @media (min-width: 600px) {
            width: fit-content;
        }
    }
    li::before {
        display: block;
        width: 44px;
        height: 44px;
        background-image: url('/wp-content/uploads/2026/01/AA-Icons-Arrow-grey-44x44.png');
        background-repeat: no-repeat;
        content: '';
        transform: rotate(45deg);
    }
    li.current-menu-item::before {
        opacity: 0.2;
    }
}

/* 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;
        
        figure {
            margin-left: 0;
        }
        p {
            width: calc(100% - 2*var(--wp--preset--spacing--20) - 44px);
        }
        p:first-child {
            width: 100%;
        }
    }
}
.address-links {
    margin-left: auto !important;
}
.footer-a {
    max-width: 18vw;
}

.footer-logos-links {
    flex-wrap: nowrap;
}

/* Change alignment of address and links when wrapping for mobile */
@media (max-width: 781px) {
    .footer-logos-links {
        flex-wrap: wrap;    
    }
    .address-links {
        margin-left: 0 !important;
        
        div {
            align-items: flex-start;
        }
        p {
            text-align: left !important;
        }
    }
}
/* AAT logo in footer */ 
.aat-logo {
    width: 250px;
}


/* 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;
}
/* Once the columns wrap on hero section we don't want logo overlaying body copy */
@media (max-width: 782px) {
    header > div {
        min-height: 120px;
    }    
}



/* 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 {
	    min-height: 100vh;

        @media (min-width: 782px) {
    	    img {
    	        height: 100%;
                width: auto;
                max-height: unset;
    	    }
	    }
	    .wp-block-heading {
	        word-break: keep-all;
	    }
	}
}


/* Accountancy services page */
.services-grid {
    @media (max-width: 1024px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    @media (max-width: 600px) {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }

    > div {
        padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
        border: 2px solid /*var(--wp--preset--color--custom-ascot-mid-blue);*/ var(--wp--preset--color--custom-ascot-light-grey);
        border-radius: 1em;
    }
}


/* 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);
    }
}
.gfield_validation_message,
.gform-theme--framework .gform_validation_errors {
     background-color: #fcc !important;
     padding: 0.5em 1em !important;
     margin-top: 0 !important;
}



/* Accordions to show/hide forms */
.accordion-center {
    .wp-block-accordion-item {
        text-align: center;
    }
    .wp-block-accordion-panel {
        text-align: left;
    }
}
.wp-block-accordion-heading,
.wp-block-accordion-heading__toggle {
    button,
    button:focus,
    button:hover,
    button:active,
    button:visited {
        background-color: var(--wp--preset--color--custom-ascot-dark-blue) !important;
        border-radius: 2em;
    }
}



/* Hide contact us section on contact page (31) */
.page-id-31 {
    .footer-contact {
        display: none;
    }
}


/* Temporarily hide lead magnets until downloads are ready */
.display-none {
    display: none;
}
