/*
Theme Name: Metsa
Description: A custom blog theme for Metsa
Version: 2.7
Author: Your Name
Text Domain: metsa
*/

@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;600;700&display=swap');

/* Metsa Theme - Colors and Typography */
:root {
    /* Colors */
    --m-amber: #CC7E3D;
    --m-forest: #173132;
    --m-forest-80-t: #455A5B;
    --m-forest-10-t: #748384;
    --m-pine-80-t: #E3E1D3;
    --m-sand-80-t: #F2EEE9;
    --m-fog-80-t: #F2F2F2;
    --m-white: #FFFFFF;
}

* {
    box-sizing: border-box;
}

/* Typography */
body {
    font-family: Raleway;
    font-weight: 500;
    font-size: 16px;
    line-height: 180%;
    letter-spacing: 0.06em;
    color: var(--m-forest);
    margin-top: 16px;
}

p {
    color: var(--m-forest);
    font-family: Raleway;
    font-weight: 500;
    font-size: 16px;
    line-height: 180%;
    letter-spacing: 0.06em;
}

h1 {
    /* HEADING LARGE */
    font-weight: 600;
    font-size: 22px;
    line-height: 160%;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin-bottom: 40px;
}

h2 {
    /* HEADING MEDIUM */
    font-weight: 600;
    font-size: 17px;
    line-height: 160%;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

h3 {
    /* HEADING SMALL */
    font-weight: 600;
    font-size: 14px;
    line-height: 140%;
    letter-spacing: 0.3em;
    text-transform: uppercase;
}



.m-text-small {
    /* Body copy, small */
    font-weight: 500;
    font-size: 14px;
    line-height: 160%;
    letter-spacing: 0.06em;
}

.m-container {
    max-width: 1432px;
    margin: 0 auto;
    padding: 0 16px;
}

.m-container-left {
    max-width: 1432px;
    margin: 0 auto;
    padding: 0 16px 0 200px;
}

.m-container-left-m {
    max-width: 1432px;
    margin: 0 auto 0 200px;
    padding: 0 16px;
}

.m-color-bg-white {
    background-color: #ffffff;
}

/* Site Layout with Sidebar */
.site-wrapper {
    min-height: 100vh;
    position: relative;
}

/* Sidebar Navigation */
.sidebar-nav {
    width: 160px;
    padding: 16px 0;
    position: fixed;
    left: max(47px, calc((100vw - 1354px) / 2));
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 50px;
}

.sidebar-icon a {
    display: block;
    width: 100%;
    height: 100%;
}

.sidebar-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-image {
    width: 160px;
    height: 160px;
    margin-bottom: 60px;
    overflow: hidden;
}

.sidebar-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sidebar-menu-nav .sidebar-menu {
    padding-left: 0;
    list-style: none;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 20px;
}

.sidebar-menu a {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3em;
    line-height: 140%;
    text-transform: uppercase;
    color: #173132;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: block;
    padding-bottom: 4px;
    display: inline-block;
}

.sidebar-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: #173132;
    transition: width 0.3s ease;
}

.sidebar-menu a:hover::after {
    width: 100%;
}

.sidebar-menu a:hover {
    color: #173132;
}

.sidebar-menu .current-menu-item>a,
.sidebar-menu .current_page_item>a {
    color: #173132;
    border-bottom: 1px solid #173132;
}

.sidebar-menu .current-menu-item>a:before,
.sidebar-menu .current_page_item>a:before {
    display: none;
}

/* Hide Polylang language menu items */
.sidebar-menu .lang-item {
    display: none !important;
}

/* Language Switcher */
.sidebar-language-switcher {
    margin-top: 5px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3em;
    line-height: 140%;
    text-transform: uppercase;
}

.sidebar-language-switcher .lang-link {
    color: #173132;
    text-decoration: none;
    position: relative;
    padding-bottom: 4px;
}

.sidebar-language-switcher .lang-link.active {
    border-bottom: 1px solid #173132;
}

.sidebar-language-switcher .lang-separator {
    color: #173132;
    padding: 0 8px;
}

/* Language Switcher */
.language-switcher {
    margin-top: 40px;
}

.language-switcher ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 12px;
}

.language-switcher li {
    margin: 0;
}

.language-switcher a {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.3em;
    line-height: 140%;
    text-transform: uppercase;
    color: #173132;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
    padding-bottom: 4px;
    opacity: 0.5;
}

.language-switcher a:hover {
    opacity: 1;
}

.language-switcher .current-lang a,
.language-switcher .current-menu-item>a,
.language-switcher .current_page_item>a,
.sidebar-menu .current-lang>a,
.sidebar-menu .lang-item.current-lang>a,
li.current-lang>a {
    opacity: 1 !important;
    border-bottom: 1px solid #173132 !important;
}

/* Main Content Area */
.main-content {
    min-height: 100vh;
    padding-bottom: 100px;
}

.home.page-template-default .main-content {
    padding-bottom: 0;
}

.post-meta {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Footer Styles */
footer {
    color: var(--m-white);
    padding: 16px 0px;
    position: relative;
    width: 100%;
}

.footer-layout {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    height: 78px;
}

.footer-left {
    width: 160px;
    background: var(--m-forest);
}

.footer-right {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    background: var(--m-forest);
}

.footer-copyright {
    text-align: right;
}

.footer-copyright p {
    margin-bottom: 16px;
    margin-right: 32px;
    font-size: 14px;
    color: var(--m-sand-80-t);
    opacity: 0.8;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    z-index: 1001;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    outline: none;
    margin-right: -14px;
}

.mobile-menu-toggle:focus {
    outline: none;
    border: none;
}

.mobile-menu-toggle .hamburger-icon,
.mobile-menu-toggle .close-icon {
    display: block;
    width: 40px;
    height: 40px;
}

.mobile-menu-toggle .close-icon {
    display: none;
}

.mobile-menu-toggle.active .hamburger-icon {
    display: none;
}

.mobile-menu-toggle.active .close-icon {
    display: block;
}

/* Responsive Design */

@media (max-width: 900px) {
    body {
        margin: 0;
        font-size: 14px;
        padding-top: 90px;
    }

    body.home {
        padding-top: 0;
    }

    h1 {
        font-size: 18px;
        line-height: 150%;
        margin-bottom: 24px;
    }

    h2 {
        font-size: 15px;
    }

    h3 {
        font-size: 12px;
    }

    p {
        font-size: 14px;
        line-height: 170%;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .footer-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: 86px;
    }

    .footer-left {
        display: none;
    }

    .footer-right {
        justify-content: end;
        padding-right: 24px;
    }

    .footer-copyright {
        text-align: center;
    }

    .footer-copyright p {
        margin-right: 0;
    }

    .sidebar-nav {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100vh;
        background: var(--m-sand-80-t);
        z-index: 999;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        padding: 80px 16px 16px 16px;

    }

    .sidebar-nav.active {
        opacity: 1;
        visibility: visible;
        z-index: 999999;
        margin-left: 0 !important;
    }

    .sidebar-nav .sidebar-image,
    .sidebar-nav .sidebar-icon {
        display: none;
    }

    .sidebar-menu-nav {
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .sidebar-menu {
        list-style: none;
        padding: 0;
        margin: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        gap: 40px;
    }

    .sidebar-menu li {
        margin: 0;
    }

    .sidebar-menu a {
        font-weight: 600;
        font-size: 18px;
        line-height: 160%;
        letter-spacing: 0.3em;
        text-transform: uppercase;
        color: var(--m-forest);
        text-decoration: none;
        display: block;
        transition: opacity 0.3s;
    }

    .sidebar-menu a:hover {
        opacity: 0.7;
    }

    /* Hide Polylang language menu items on mobile */
    .sidebar-menu .lang-item {
        display: none !important;
    }

    /* Mobile Language Switcher */
    .sidebar-language-switcher {
        margin-top: 60px;
        font-size: 18px;
        text-align: center;
        display: block;
        margin-left: auto;
        margin-right: auto;
    }

    /* Current language in mobile menu */
    .sidebar-menu .lang-item.current-lang>a,
    .sidebar-menu .current-lang>a {
        opacity: 1 !important;
        border-bottom: 1px solid var(--m-forest);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .m-container,
    .m-container-left,
    .m-container-left-m {
        padding-left: 16px;
        padding-right: 16px;
        margin-left: 0;
    }
}