/*!
Theme Name: Vantaan Pysäköintiratkaisut Oy
Theme URI: https://www.kadencewp.com/kadence-theme/
Template: kadence
Author: Kadence WP
Author URI: https://www.kadencewp.com/
Description: Custom 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-vproy
*/

/* Theme customization starts here
-------------------------------------------------------------- */

/* GLOBAL STYLES */
h1 {
    text-wrap: balance;
}

.is-style-h1 {
    font-style: normal;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    @media (min-width: 991px) {
            font-size: 32px;
    }
    @media (min-width: 1024px) {
            font-size: 40px;
    }
    :is(h1,h2,h3,h4,h5,h6) {font-size: inherit;}
}

.is-style-h2 {
    font-style: normal;
    font-weight: 700;
    font-size: 40px;
    line-height: 1.2;
    @media (min-width: 991px) {
            font-size: 32px;
    }
    @media (min-width: 1024px) {
            font-size: 40px;
    }
    :is(h1,h2,h3,h4,h5,h6) {font-size: inherit;}
}

.is-style-h3 {
    font-style: normal;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    @media (min-width: 991px) {
            font-size: 22px;
    }
    @media (min-width: 1024px) {
            font-size: 28px;
    }
    :is(h1,h2,h3,h4,h5,h6) {font-size: inherit;}
}

.is-style-h4 {
    font-style: normal;
    font-weight: 700;
    font-size: 20px;
    line-height: 1.2;
    @media (min-width: 991px) {
            font-size: 22px;
    }
    @media (min-width: 1024px) {
            font-size: 24px;
    }
    :is(h1,h2,h3,h4,h5,h6) {font-size: inherit;}
}

.hide-desktop {
    @media (min-width: 1024px) {
        display: none;
    }
}

.hide-tablet {
    @media (min-width: 767px) and (max-width: 1023.9px) {
        display: none;
    }
}

.hide-mobile {
    @media (max-width: 766.9px) {
        display: none;
    }
}

@media all and (max-width: 1024px) {
    .is-style-h1 {
        font-size:37px;
    }

    .is-style-h2 {
        font-size: 37px;
    }

    .is-style-h3 {
        font-size: 30px;
    }

    .is-style-h4 {
        font-size: 25px;
    }
}

@media all and (max-width: 767px) {
    .is-style-h1 {
        font-size:24px;
    }

    .is-style-h2 {
        font-size: 24px;
    }

    .is-style-h3 {
        font-size: 24px;
    }

    .is-style-h4 {
        font-size: 20px;
    }
}

/* BLOCK OVERRIDES */
#wrapper {
    .wp-block-list {
        list-style-type: none;
        list-style-image: none;
        padding-left: 20px;
        li {
            &:before {
                content: '> ';
                margin: 0 0 0 -15px;
                @media (min-width: 991px) {
                    margin: 0 0 0 -17px;
                }
                @media (min-width: 1024px) {
                    margin: 0 0 0 -18px;
                }
            }
        }
    }
}

/* HEADER */

#main-header {
    .site-header-row {
        align-items: center;
        .site-header-main-section-right {
            flex-direction: column-reverse;
            align-items: flex-end;
        }
    }
}

.single-post {
    #main-header {
        .site-main-header-inner-wrap {
            border-bottom: 2px solid var(--global-palette2, #ffb03f);
        }
    }
}

#primary-menu {
    .menu-item {
        &:is(.current-menu-item, .current_page_item) {
            a {
                text-decoration: underline;
                text-decoration-line: underline;
                text-decoration-thickness: 1px;
            }
        }
        &:last-child {
            &> a {
                padding-right: 0;
            }

        }
    }
}

body {
    &:not(.logged-in) {
        :is(#secondary-menu, #mobile-secondary-menu) {
            display: none !important; /* TEMPORARY */
        }
    }
}

:is(#secondary-menu, #mobile-secondary-menu) {
    margin: 12px 0;
    .lang-item {
        margin-right: 12px;    
        a {
            padding: 0;
            border-radius: 100%;
            overflow: hidden;
            position: relative;
            border: 2px solid transparent;
            &:hover {
                border: 2px solid orange !important;
            }
            span {
                border: 0;
                clip: rect(0 0 0 0);
                height: 1px;
                margin: -1px;
                overflow: hidden;
                padding: 0;
                position: absolute;
                width: 1px;
            }
            img {
                aspect-ratio: 1/1;
                object-fit: contain;
                object-position: center center;
                /* transition: all 0.3s ease;
                &:hover {
                    scale: 1.3;
                } */
                max-width: 32px;
                @media (min-width: 767px) and (max-width: 1023px) {
                    max-width: 24px;
                }
                @media (max-width: 767px) {
                    max-width: 24px;
                }
            }
        }
        &.current-lang {
            a {
                border: 2px solid black;
            }
        }

    }
}

#mobile-drawer {
    #mobile-secondary-menu {
        padding-left: 0.5em;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        .lang-item {
            margin: 0;
        }
    }
}

/* Breadcrumb */
.rank-math-breadcrumb {
    p {
        margin: 0;
    }
    a {
        text-decoration: none;
        font-weight: bold;
        &:hover {
            text-decoration: underline;
        }
    }
}

/* CONTENT */

.is-style-lead {
    font-weight: 500;
}

.entry-content {
    &> h1.wp-block-heading:first-child {
        padding-top: var( --global-kb-row-default-top, var(--global-kb-spacing-sm, 1.5rem) );
    }
}

/* Blog */

.single-post {
    .entry-header {
        padding-top: var( --global-kb-row-default-top, var(--global-kb-spacing-sm, 1.5rem) );
    }
}

/**
* SPACING
* var(--global-kb-spacing-xxs, 0.5rem)
* xxs = 0.5rem = 8px, 
* xs = 1rem = 16px, 
* sm = 1.5rem = 24px, 
* md = 2rem = 32px, 
* lg = 3rem = 48px, 
* xl = 4rem = 64px, 
* xxl = 5rem = 80px, 
* 3xl = 6.5rem = 104px, 
* 4xl = 8rem = 124px 
**/

.blog {
    .content-area {
        margin-top: var( --global-kb-row-default-top, var(--global-kb-spacing-sm, 1.5rem) );
    }
}

#archive-container {
    @media (min-width: 991px) {
            gap: var(--global-kb-spacing-lg, 3rem);
    }
    @media (min-width: 1024px) {
            gap: var(--global-kb-spacing-xxl, 5rem);
    }
    .custom-archive-loop-item {
        position: relative;
        &:after {
            content: '';
            position: absolute;
            @media (min-width: 576px) {
                right: calc((2.5rem / 2) * -1);   
                top: 0;
                bottom: 0;
                width: 2px;
                background-color: var(--global-palette2, #ffb03f) !important;
            }
            @media (max-width: 575.9px) {
                bottom:  calc((2.5rem / 2) * -1);
                left: 0;
                right: 0;
                height: 2px;
                background-color: var(--global-palette2, #ffb03f) !important;
            }
            @media (min-width: 991px) {
                right: calc((var(--global-kb-spacing-lg, 3rem) / 2) * -1);  
            }
            @media (min-width: 1024px) {
                right: calc((var(--global-kb-spacing-xxl, 5rem) / 2) * -1);  
            }
        }
        @media (min-width: 576px) and (max-width: 1023.9px) {
            &:nth-child(2n) {
                &:after {
                    display: none;
                }
            }
        }
        @media (min-width: 1024px) {
            &:nth-child(3n) {
                &:after {
                    display: none;
                }
            }
        }
        &:last-child {
            &:after {
                display: none;
            }
        }
    }
}

.custom-archive-loop-item {
    position: relative;
    .wp-block-kadence-image {
        overflow: hidden;
        img {
            scale: 1;
            transition: all 0.8s ease;
        }
    }
    .kb-advanced-heading-link {
        text-decoration: none;
        &:before {
            content: '';
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
        }
    }
    &:has(.kb-advanced-heading-link:hover) {
        .wp-block-kadence-image {
            img {
                scale: 1.1;
            }
        }
        .kb-advanced-heading-link {
            text-decoration: underline;
        }
    }
}


:is(.blog, .archive, .search) {
    .pagination {
        .nav-links {
            flex-wrap: wrap;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            .page-numbers {
                border: 2px solid var(--global-palette-highlight, #266c6b);
                color: var(--global-palette-highlight, #266c6b);
                border-radius: 100%;
                min-width: 30px;
                height: 30px;
                border-radius: 26px;
                font-weight: bold;
                font-size: 16px;
                line-height: 1;
                display: inline-flex;
                flex-direction: row;
                align-items: center;
                justify-content: center;
                @media (min-width: 991px) {
                    font-size: 24px;
                    min-width: 42px;
                    height: 42px;
                }
                &:is(.current, :hover) {
                    background: var(--global-palette-highlight-alt, #ffb03f);
                    border-color: var(--global-palette-highlight-alt, #ffb03f);
                }
                svg {
                    top: 0;
                }
            }
        }
    }
}

