/*!
Theme Name: Juoksuaika.fi
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
-------------------------------------------------------------- */
:root {
    --highlight-color: #52b9a0;
    --highlight-alt: #ffffff;
    --icon-date:  url('/wp-content/themes/kadence-child/assets/images/icon-date.svg') no-repeat 50% 50%; 
    --icon-time:  url('/wp-content/themes/kadence-child/assets/images/icon-time.svg') no-repeat 50% 50%; 
    --icon-location: url('/wp-content/themes/kadence-child/assets/images/icon-location.svg') no-repeat 50% 50%; 
    --icon-arrow: url('/wp-content/themes/kadence-child/assets/images/icon-arrow.svg') no-repeat 50% 50%; 
    --border-radius: 14px;
}

.is-style-h1 {
    font-size: 30px;
    @media (min-width: 767px) and (max-width: 1024px) {
        font-size: 40px;
    }
    @media (min-width: 1024px) {
        font-size: 45px;
    }
}

.is-style-h2 {
    font-size: 24px;
    @media (min-width: 767px) and (max-width: 1024px) {
        font-size: 26px;
    }
    @media (min-width: 1024px) {
        font-size: 30px;
    }
}


/* Language switch */
#secondary-navigation {
    & .current-lang {
        & a {
            font-weight: bold;
            color: var(--global-palette2, #52b9a0);    
        }
    }
}

#wrapper .header-navigation[class*="header-navigation-style-underline"] .header-menu-container>ul>li>a:after {
    transition: color .0s ease-in-out, -webkit-transform .0s ease-in-out;
    transition: transform .0s ease-in-out, color .0s ease-in-out;
    transition: transform .0s ease-in-out, color .0s ease-in-out, -webkit-transform .0s ease-in-out;
}

#wrapper .header-navigation[class*="header-navigation-style-underline"] .header-menu-container>ul>li>a {
    transition: all .0s ease-in-out;
}

.header-navigation[class*="header-navigation-style-underline"] .header-menu-container>ul>li:is(.current-page-ancestor, .current-menu-ancestor, .current-menu-parent, .current-page-parent)>a:after, 
.header-navigation[class*="header-navigation-style-underline"] .header-menu-container>ul>li:is(.current-page-ancestor, .current-menu-ancestor, .current-menu-parent, .current-page-parent)>a:after {
    transform: scale(1, 1) translate(50%, 0);
    width: calc(100% - 40px);    
}

#primary-menu {
    & > li {
        & > .sub-menu {
            &:nth-of-type(1) {
                margin-top: -2px;
            }
        }
    }
}

#primary-menu .juoksuaika {
    --highlight-color: #52b9a0;
}

#primary-menu .paavo-nurmi-marathon,
.theme-paavo-nurmi-marathon {
    --highlight-color: #EF7D00;
}

#primary-menu .aurajoen-yojuoksu,
.theme-aurajoen-yojuoksu {
    --highlight-color: #F8E800;
    --highlight-alt: #14133B;
}

#primary-menu .ruissalojuoksut,
.theme-ruissalojuoksut {
    --highlight-color: #CBA25B;
}

#primary-menu .tampere-juoksee,
.theme-tampere-juoksee {
    --highlight-color: #ed1c24;
}

.rank-math-breadcrumb {
    font-family: var(--global-heading-font-family);
    font-style: italic;
    font-weight: 500;
    a {
        color: var(--global-palette3, #14133b);
        text-decoration: none;
        &:hover {
            text-decoration: underline;
            color: var(--global-palette3, #14133b)
        }
    }
    .last {
        color:var(--highlight-color, #52b9a0);
    }
}

.kt-blocks-accordion-icon-trigger {
    background: var(--highlight-color);
    border-radius: 14px;
    border: 5px solid var(--highlight-color);
}

.theme-aurajoen-yojuoksu {
    .rank-math-breadcrumb {
        .last {
            color: var(--global-palette3, #14133b);
        }
    }
}

.wp-block-kadence-advancedbtn .kb-button:not(.specificity):not(.extra-specificity) {
    border-color: var(--highlight-color, #52b9a0);
    &:hover {
        border-color: var(--global-palette3, #14133b);
    }
}

.theme-aurajoen-yojuoksu {
    .wp-block-kadence-advancedbtn .kb-button:not(.specificity):not(.extra-specificity) {
        border-color: var(--highlight-color, #52b9a0);
        background: var(--highlight-color, #52b9a0);
        color: var(--highlight-alt);
        &:hover {
            border-color: var(--global-palette3, #14133b);
            background: transparent;
        }
    }
}

.theme-aurajoen-yojuoksu {
    button, 
    .button, 
    .wp-block-button__link, 
    input[type="button"], 
    input[type="reset"], 
    input[type="submit"], 
    .fl-button, 
    .elementor-button-wrapper .elementor-button, 
    .wc-block-components-checkout-place-order-button, 
    .wc-block-cart__submit {
        border-color: var(--highlight-color, #52b9a0);
        background: var(--highlight-color, #52b9a0);
        color: var(--highlight-alt);
    }
    .kt-blocks-accordion-icon-trigger {
        background: var(--highlight-color, #52b9a0) !important;
        &:after,
        &:before {
            background: var(--highlight-alt) !important;
        }
    }
}

#primary-menu {
    & li {
        & > a {
            color: var(--global-palette3, #14133b);
            &:hover {
                color: var(--highlight-color);
            }
            &:after {
                color: var(--highlight-color);
            }
            &:not(:hover) {
                & .kadence-svg-icon {
                    fill: var(--highlight-color);
                }    
            }        }
        &:has(:hover) {
            & > a {
                color: var(--highlight-color) !important;
            }
        }
        &:first-child {
            margin-top: 0;
            & > a {
                &:after {
                    background: transparent !important;
                }
            }
        }
    }
    & > li {
        & > .sub-menu {
            li {
                &:not(:first-child) {
                    margin-top: -1px;
                }
                & a {
                    &:after {
                        content: '';
                        position: absolute;
                        height: 1px;
                        top: 0px;
                        left: 1em;
                        right: 1em;
                        background: var(--highlight-color)
                    }
                }
                
                /* &:hover {
                    & + li {
                        & a {
                            &:after {
                                left: 0;
                                right: 0;
                            }        
                        }
                    }
                } */
                &:is(.current-menu-item, .current-page-ancestor, .current-menu-ancestor, .current-menu-parent, .current-page-parent) {
                    & > a {
                        color: var(--highlight-color);
                        background: var(--highlight-alt);
                        &:hover {
                            color: var(--highlight-alt);
                            background: var(--highlight-color);    
                        }
                    }
                }
                &:has(:hover) {
                    & > a {
                        background: var(--highlight-color) !important;
                        color: var(--highlight-alt) !important;
                        & .kadence-svg-icon {
                            fill: white;
                        }    
                    }
                } 
            }
        }
    }
}

#primary-menu {
    & > li.aurajoen-yojuoksu {
        &:has(:hover) {
            & > a {
                .kadence-svg-icon {
                    fill: #14133b;
                }
            }   
        }
        & > .sub-menu {
            li {
                &:has(:hover) {
                    & > a {
                        background: var(--highlight-color) !important;
                        color: var(--highlight-alt) !important;
                        & .kadence-svg-icon {
                            fill: #14133b;
                        }    
                    }
                } 
            }
        }
    }
}

#primary-menu {
    & li.aurajoen-yojuoksu {
        & > a {
            &:hover {
                color: #14133b;
            }
        }
    }
    & > li.aurajoen-yojuoksu {
        &:has(:hover) {
            & > a {
                color: #14133b !important;
            }
        }
    }
}

/* Mobile secondary menu */
#mobile-secondary-menu {
    display: flex;
    text-transform: uppercase;
    .current-lang {
        a {
            font-weight: bold;
            color: var(--global-palette2, #52b9a0);
        }
    }
}

/* Mobile third menu */

.mobile-third-navigation {
    padding: 0;
    margin: 0;
    display: flex;
    gap: 5px 20px;
    font-size: 14px;
    flex-wrap: wrap;
    padding: 0 20px;
    justify-content: center;
}

#hero-tampere-juoksee {
    & .kt-row-layout-overlay {
        &:after {
            content: '';
            position: absolute;
            width: 584px;
            background: url('assets/images/p-overlay.webp') no-repeat center center transparent;
            background-size: contain;
            top: 0;
            bottom: 0;
            left: 50%;
            transform: translate(-50%, 0);
            @media (min-width: 767px) {
                transform: translate(calc(-50% - 256px), 0);
            }
        }
    }
}

/* Blog */
.category #archive-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    .entry {
        box-shadow: 0 0 0 0 rgba(0,0,0,0);
        background: transparent;
    }
    &:has(.entry:hover) .entry:not(:hover) {
        img {
            filter: grayscale(1);
        }
    }
    
    .entry:hover {
        img {
            filter: grayscale(0);
        }
    }
    .post {
        padding: 0;
        a {
            text-decoration: none;
            color: var(--global-palette3, #14133b);
            .image-wrapper {
                position: relative;
                overflow: hidden;
                aspect-ratio: 400/222;
                border-radius: var(--border-radius, 14px);
                img {
                    position: absolute;
                    inset: 0;
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    scale: 1;
                    transition: all 0.8s ease;
                }
            }
            .title {
                margin: 28px 0 14px 0;
                line-height: 1.3;
            }
            .details {
                .read-more {
                    height: 23px;
                    width: 23px;
                    background: var(--icon-arrow);
                    overflow: hidden;
                    text-indent: -999px;
                    transition: all .2s ease-in;
                }
            }
            &:hover {
                .title {
                    /* color: var(--highlight-color, #52b9a0); */
                }
                img {
                    scale: 1.2;
                }
                .read-more {
                    transform: rotate(45deg);
                }
            }
        }
        
    }
}


/* Footer */

#footer-juoksuaika {
    position: relative;
    &:after {
        content: '';
        position: absolute;
        inset: 0;
        height: 100%;
        width: 100%;
        background: url(assets/images/pattern-map.png) no-repeat center center;
        background-size: cover;
        pointer-events: none;
        opacity: 0.06;
        z-index: 999;
    }
}

/* TEMPORARELY HIDE MENU ITEMS */
.hide_lang_switch:not(.logged-in) {
        #secondary-menu {
            display: none;
        }
        #mobile-secondary-menu {
            display: none;
        }
    }
html[lang="en-US"] {
    .hide_top_nav:not(.logged-in) {
        #tertiary-navigation {
            display: none;
        }
        #menu-top-navigation-en {
            display: none;
        }
    }

    .hide_menu_pnm:not(.logged-in) {
        :is(#mobile-menu, #site-navigation) {
            .paavo-nurmi-marathon {
                display: none;
            }
        }
    }

    .hide_menu_tampere:not(.logged-in) {
        :is(#mobile-menu, #site-navigation) {
            .tampere-juoksee {
                display: none;
            }
        }
    }

    .hide_menu_aurajoen:not(.logged-in) {
        :is(#mobile-menu, #site-navigation) {
            .aurajoen-yojuoksu {
                display: none;
            }
        }
    }

    .hide_menu_ruissalo:not(.logged-in) {
        :is(#mobile-menu, #site-navigation) {
            .ruissalojuoksut {
                display: none;
            }
        }
    }

}
