/* Theme variables (from theme.json defaults + theme-specific tokens) */
:root {
	--aiscotland-color-text: var(--wp--preset--color--text);
	--aiscotland-color-background: var(--wp--preset--color--background);
	--aiscotland-color-accent: var(--wp--preset--color--accent);
	--aiscotland-color-muted: var(--wp--preset--color--muted);
	--aiscotland-color-brand: var(--wp--preset--color--brand);
	--aiscotland-color-primary: var(--wp--preset--color--primary);
	--aiscotland-color-neutral: var(--wp--preset--color--neutral);
	--aiscotland-color-primary-teal: var(--wp--preset--color--primary-teal);
	--aiscotland-color-teal-20: var(--wp--preset--color--teal-20);
	--aiscotland-color-dark-teal: var(--wp--preset--color--dark-teal);
	--aiscotland-color-teal-40: var(--wp--preset--color--teal-40);
	--aiscotland-color-light-grey: var(--wp--preset--color--light-grey);
	--aiscotland-color-background-grey: var(--wp--preset--color--background-grey);
	--aiscotland-font-heading: var(--wp--preset--font-family--heading);
	--aiscotland-font-body: var(--wp--preset--font-family--body);
	--aiscotland-font-size-sm: var(--wp--preset--font-size--small);
	--aiscotland-font-size-md: var(--wp--preset--font-size--medium);
	--aiscotland-font-size-lg: var(--wp--preset--font-size--large);
	--aiscotland-font-size-xl: var(--wp--preset--font-size--x-large);
	--aiscotland-font-size-xxl: var(--wp--preset--font-size--xx-large);
	--aiscotland-container-wide: 1440px;
	--aiscotland-container-content: 1240px;
	--aiscotland-container-padding-x: 4.5rem;
	--aiscotland-border-color: #e0ddd7;
	--aiscotland-footer-bg: #f1ede8;
	--aiscotland-gap-lg: 1.5rem;
	--aiscotland-gap-md: 1.25rem;
	--aiscotland-gap-sm: 0.75rem;
	--aiscotland-space-lg: 3rem;
	--aiscotland-space-md: 2rem;
	--aiscotland-space-sm: 0.5rem;
	--aiscotland-space-base: 1rem;
	--aiscotland-site-title-size: 2rem;
	--aiscotland-image-float-side: 1.5rem;
	--aiscotland-arrow-gap: 10px;
	--aiscotland-arrow-padding-right: 28px;
	--aiscotland-arrow-icon-size: 20px;
	--aiscotland-letter-spacing-lg: 0.08em;
    --container-width: 1440px;
    --side-ident: calc(((100vw - var(--container-width)) / 2) + 15px);

}

@media (max-width: 1440px) {
    :root {
        --container-width: 1236px;
        }
    }


@media (max-width: 1200px) {
    :root {
        --container-width: 990px;
    }
}


@media (max-width: 992px) {
    :root {
        --container-width: 720px;
    }
}

@media (max-width: 768px) {
    :root {
        --container-width: 540px;
    }
}

@media (max-width: 576px) {
    :root {
        --container-width: 360px;
    }
}


/* General Styles*/
* {
	box-sizing: border-box;
}

body {
	margin: 0;
}

.arrow-link {
	display: inline-flex;
	align-items: center;
	gap: var(--aiscotland-arrow-gap);
	padding-right: var(--aiscotland-arrow-padding-right);
	position: relative;
	text-decoration: none;
}

.arrow-link::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: var(--aiscotland-arrow-icon-size);
	height: var(--aiscotland-arrow-icon-size);
	transform: translateY(-50%);
	background-color: currentColor;
	-webkit-mask: url("../images/arrow-link.svg") no-repeat center / contain;
	mask: url("../images/arrow-link.svg") no-repeat center / contain;
	transition: transform 0.2s ease-in-out;
}

.arrow-link:hover::after {
	transform: translateY(-50%) translateX(3px);
}

/* Site Header */

.site-header {
    background-color: var(--aiscotland-color-primary);
    padding: 48px 0 84px 0 ;
    position: relative;
}

.site-header:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 102px;
    background-image: url('../images/Curve.svg');
    background-repeat: no-repeat;
    background-position: bottom center;
    background-size: 100% auto;
    z-index: 1;
}

.container {
	max-width: var(--aiscotland-container-wide);
    margin: 0 var(--side-ident);
}

.container--wide {
	max-width: var(--aiscotland-container-wide);
}

.container--content {
	max-width: var(--aiscotland-container-content);
}


.site-title {
	margin: 0;
	font-family: var(--aiscotland-font-heading);
    font-size: var(--aiscotland-site-title-size);
	text-transform: uppercase;
	letter-spacing: var(--aiscotland-letter-spacing-lg);
}

.site-description {
	margin: var(--aiscotland-space-sm) 0 0;
	color: var(--aiscotland-color-muted);
}

.primary-nav ul {

	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	gap: var(--aiscotland-gap-lg);
	flex-wrap: wrap;
}

.primary-menu li {
    position: relative;
}

.primary-menu a {
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
}


.primary-nav .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    border-radius: 8px;
    background: var(--aiscotland-color-teal-20);
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 0;

    min-width: 200px;
    z-index: 99;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.primary-nav .menu-item-has-children.open > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-nav .sub-menu li {
    width: 100%;
}

.primary-nav .sub-menu li a {
    padding: 16px 16px 12px 16px;
    display: block;
    color: var(--aiscotland-color-primary);
}

.primary-nav .sub-menu li:not(:last-child) a {
    border-bottom: 2px solid var(--aiscotland-color-teal-40);
}

.menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    vertical-align: middle;

    background-color: currentColor;

    mask: url('/wp-content/themes/aiscotland/assets/images/down-arrow.svg') no-repeat center;
    mask-size: contain;

    -webkit-mask: url('/wp-content/themes/aiscotland/assets/images/down-arrow.svg') no-repeat center;
    -webkit-mask-size: contain;

    transition: background-color 0.2s ease;

}

.menu-item-has-children > a::after {
    transition: transform 0.2s ease;
}

.menu-item-has-children.open > a::after {
    transform: rotate(180deg);

}

.primary-menu li:hover > a {
    color: var(--aiscotland-color-primary-teal);
}

.primary-nav a {
    font-family: var(--aiscotland-font-heading);
    color:var(--aiscotland-color-background) ;
}


.mobile-nav-toggle {
    display: none;
}

.mobile-nav-toggle button {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.mobile-nav-toggle button span {
    display: block;
    height: 3px;
    background-color: var(--aiscotland-color-background);
    border-radius: 2px;
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    .primary-nav {
        display: none;
        flex-direction: column;
        gap: 0;
        background: var(--aiscotland-color-primary);
        position: absolute;
        top: 120px;
        left: 0;
        width: 100%;
        padding: 1rem 0;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        z-index: 99;
        border-bottom: solid 1px #304153;
    }

    .primary-nav ul {
        gap: 0;
    }

    .primary-nav.open {
        display: flex;
    }


    .primary-menu li {
        width: 100%;
    }

    .primary-menu li a {
        padding: 1rem 2rem;
    }

    .primary-nav .sub-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        display: none;
        margin: 0 10px;
        gap: 0;
        z-index: 99;
    }

    .primary-nav .menu-item-has-children.active > .sub-menu {
        display: block;
    }

    .mobile-nav-toggle {
        display: block;
    }
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.hero-home .header-top {
    margin: 48px 0;
}

.hero-center {
    display: flex;
    align-items: center;
    max-width: 825px;
}

.hero-home .container.hero-center {
    margin: 0;
}


.hero-home {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;

    background-image: url('../images/header-img.png');
    background-size: cover;
    background-repeat: no-repeat;
}


.hero-home::after {

    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 150px;
    background-image: url('../images/Curve.svg');
    background-repeat: no-repeat;
    background-position: bottom center;
    background-size: 100% auto;
    z-index: 1;
}

.hero-home h1 {
    color: var(--aiscotland-color-background);
    font-family: var(--aiscotland-font-heading);
    margin-bottom: 15px;
}

.hero-home .hero-text {
    font-family: var(--aiscotland-font-heading);
    color: var(--aiscotland-color-background);
    margin-bottom: 30px;
}

.hero-home .hero-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 100px 0;

}

.hero-home .hero-cta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: fit-content;
    gap: 15px;

    color: var(--aiscotland-color-primary);
    background: var(--aiscotland-color-accent);

    padding: 16px 24px;
    border-radius: 32px;
    text-decoration: none;

    transition: background 0.2s ease, color 0.2s ease, padding 0.2s ease;;
}

.hero-home .hero-cta:hover,
.hero-home .hero-cta:focus-visible {
    color: var(--aiscotland-color-background);
    background: var(--aiscotland-color-dark-teal);
    padding: 16px 28px;
}

.hero-cta-icon {
    transition: transform 0.2s ease;
}

.hero-cta:hover .hero-cta-icon,
.hero-cta:focus-visible .hero-cta-icon {
    transform: translateX(4px);
}

.heading-green {
    color: var(--aiscotland-color-dark-teal);
}

.site-footer .footer-address {
    white-space: pre-line;

}

.site-footer h4 {
    color: var(--aiscotland-color-primary-teal);
    font-size: 20px;
    margin: 15px 0;
}

.site-footer a {
    color: var(--aiscotland-color-background);
}

.site-footer .footer-top{
    display: flex;
    justify-content: space-between
}

.site-footer .footer-left {
    display: flex;
    gap: 100px;
}

.site-footer .footer-right {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}

.footer-bottom {
    display: flex;
    border-top: var(--aiscotland-color-background) solid 1px;
    justify-content: space-between;

}


.footer-bottom .footer-menu li {
    list-style: none;
}


.footer-bottom .footer-menu {
    display: flex;
    gap: 40px;
}

.footer-social-links {
    display: flex;
    gap: 12px;
}


.entry-title {
	font-family: var(--aiscotland-font-heading);
}

.entry-meta {
	color: var(--aiscotland-color-muted);
}

.site-footer {
    font-family: var(--aiscotland-font-heading);
    display: flex;
    flex-direction: column;
    gap: 48px;
    padding: 96px 72px;
	border-top: 1px solid var(--aiscotland-border-color);
    background-color: var(--aiscotland-color-primary);
    color: var(--aiscotland-color-background);
}

@media (max-width: 992px) {
    .site-footer .footer-top {
        flex-direction: column;
        gap: 50px;
    }

    .site-footer .footer-left {
        justify-content: space-between;
    }
}

@media (max-width: 768px) {

	.primary-nav ul {
		flex-direction: column;
		gap: var(--aiscotland-gap-sm);
	}

    .site-footer .footer-right {
        grid-template-columns: 1fr 1fr;
    }


}

@media(max-width: 576px) {
    .header-top img {
        max-width: 200px;
    }

    .hero-home h1 {
        font-size: 48px;
    }

    .site-footer .footer-left {
        flex-direction: column;
        gap: 50px;
        }

    .site-footer .footer-right {
        grid-template-columns: 1fr;
    }

    .footer-bottom .footer-menu {
        flex-direction: column;
        gap: 15px;
        padding: 0;
    }

    .footer-bottom {
        flex-direction: column;
    }
    }

/* Core Blocks */
.wp-block-button.is-style-block-arrow-link .wp-block-button__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: var(--aiscotland-arrow-gap);
	padding-right: var(--aiscotland-arrow-padding-right);
	padding-left: 0;
	background-color: transparent;
	border-radius: 0;
	color: var(--aiscotland-color-accent);
	text-decoration: none;
}

.wp-block-button.is-style-block-arrow-link .wp-block-button__link::after {
	content: "";
	position: absolute;
	right: 0;
	top: 50%;
	width: var(--aiscotland-arrow-icon-size);
	height: var(--aiscotland-arrow-icon-size);
	transform: translateY(-50%);
	background-color: currentColor;
	-webkit-mask: url("../images/arrow-link.svg") no-repeat center / contain;
	mask: url("../images/arrow-link.svg") no-repeat center / contain;
	transition: transform 0.2s ease-in-out;
}

.wp-block-button.is-style-block-arrow-link .wp-block-button__link:hover::after {
	transform: translateY(-50%) translateX(3px);
}