@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+Antique&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Bayon&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+JP:wght@400;500;600;700&display=swap');

/* Font-face moved to import-css.php for dynamic path handling */

body {
    /* font-family: "Zen Kaku Gothic Antique", sans-serif;
    font-weight: 400;
    font-style: normal; */
    font-family: "Hiragino Kaku Gothic Pro W3", sans-serif;
    margin: 0;
    background-color: #3F3F3F;
    /* background: linear-gradient(to bottom, white 50%, #3F3F3F 50%); */
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@supports (min-height: 100dvh) {
    body {
        min-height: 100dvh;
    }
}

header {
    width: 100dvw;
    z-index: 50;
    display: flex;
    flex-direction: column;
    position: fixed;
    color: white;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.2);

    .header-container {
        padding: 0 20px;
        width: 100%;
        /* height: 100%; */
        height: 80px;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;

        .header-left {
            cursor: pointer;
            display: flex;
            flex-direction: row;

            .logo {
                margin-right: 15px;
                width: 60px;
                height: 60px;
            }

            .header-left-text {
                display: flex;
                flex-direction: column;
                justify-content: center;
                margin-top: 5px;
                gap: 5px;

                h1 {
                    font-size: 20px;
                    font-weight: 600;
                }

                a {
                    font-size: 14px;
                    font-weight: 200;
                }
            }
        }

        .header-right {
            display: flex;
            flex-direction: row;
            gap: 10px;
            align-items: center;

            a {
                margin: 10px 5px;
                color: white;
                /* font-family: 'Bayon', sans-serif; */
                text-decoration: none;
                transition: opacity 0.3s ease;
            }

            a:hover {
                opacity: 0.8;
            }

            .header-menu-item {
                position: relative;

                a {
                    display: block;
                    padding: 10px 5px;
                }

                &.has-submenu {
                    .dropdown-menu {
                        position: absolute;
                        top: 100%;
                        right: 0;
                        background-color: rgba(0, 0, 0, 0.8);
                        backdrop-filter: blur(10px);
                        min-width: 180px;
                        opacity: 0;
                        visibility: hidden;
                        transform: translateY(-10px);
                        transition: all 0.3s ease;
                        z-index: 100;
                        padding: 10px 0;
                        border-radius: 5px;
                        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);

                        a {
                            display: block;
                            padding: 10px 20px;
                            margin: 0;
                            color: white;
                            white-space: nowrap;
                            transition: background-color 0.2s ease;
                        }

                        a:hover {
                            background-color: rgba(255, 255, 255, 0.1);
                            opacity: 1;
                        }
                    }

                    &:hover .dropdown-menu {
                        opacity: 1;
                        visibility: visible;
                        transform: translateY(0);
                    }
                }
            }

            .menu-button {
                background-color: #000000;
                border-radius: 5px;
                border: none;
                /* color: #ffffff; */
                cursor: pointer;
                font-size: 10px;
                padding: 6px 30px;
                text-wrap: nowrap;
            }
        }

        .header-right-mobile {
            display: none;

            /* Mobile Hamburger Menu Styles */
            .mobile-menu-toggle {
                cursor: pointer;
                z-index: 20;
                display: flex;
                gap: 0.75rem;
                align-items: center;
                color: white;
            }

            .hamburger-container {
                display: flex;
                margin: 0.5rem;
            }

            .hamburger-lines {
                display: flex;
                flex-direction: column;
                gap: 0.375rem;
            }

            .hamburger-line {
                background-color: white;
                height: 3px;
                width: 24px;
                border-radius: 9999px;
                transition: all 0.3s ease;
            }

            .menu-text {
                font-size: 1rem;
                font-weight: 500;
                transition: opacity 0.3s ease;
                opacity: 0;
            }

            /* Menu open state */
            .mobile-menu-toggle.menu-open .line-1 {
                transform: translateY(9px) rotate(-45deg);
            }

            .mobile-menu-toggle.menu-open .line-2 {
                opacity: 0;
            }

            .mobile-menu-toggle.menu-open .line-3 {
                transform: translateY(-9px) rotate(45deg);
            }

            .mobile-menu-toggle.menu-open .menu-text {
                opacity: 1;
                transition-delay: 0.2s;
            }
        }
    }

    #pankuzu {
        padding: 10px 10px;
        border-top: 1px solid white;

        .wrap {
            display: flex;
        }

        * {
            color: #fff;
            font-size: 12px;
            padding: 0 2px 0 0;
        }
    }
}

/* Full Screen Mobile Menu Popup */
#mobileMenuPopup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    z-index: 45;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;

    &.menu-open {
        opacity: 1;
        visibility: visible;
    }

    .mobile-menu-content {
        text-align: center;
        transform: translateY(20px);
        transition: transform 0.3s ease;
        width: 100%;
        padding: 80px 20px 40px 20px;
        min-height: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
    }

    &.menu-open .mobile-menu-content {
        transform: translateY(0);
    }

    .mobile-nav {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .mobile-nav-link {
        color: white;
        font-size: 2rem;
        font-weight: 600;
        text-decoration: none;
        /* padding: 1rem 2rem; */
        border-radius: 8px;
        transition: all 0.3s ease;
        opacity: 0;
        /* transform: translateY(20px); */
        /* font-family: 'Bayon', sans-serif; */
    }

    .mobile-submenu {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
        margin-top: 0.75rem;
        /* padding-left: 1rem; */
    }

    .mobile-submenu-link {
        font-size: 1.25rem;
        /* padding: 0.75rem 1.5rem; */
        color: rgba(255, 255, 255, 0.8);
        opacity: 0;
        transform: translateY(20px);
        transition: all 0.3s ease;
    }

    &.menu-open .mobile-nav-link {
        opacity: 1;
        transform: translateY(0);
    }

    &.menu-open .mobile-submenu-link {
        opacity: 1;
        transform: translateY(0);
    }

    /* Dynamic transition delays are now set via JavaScript */

    .mobile-nav-link:hover {
        background-color: rgba(255, 255, 255, 0.1);
        transform: translateY(-2px);
    }
}

#pankuzu {
    width: 100dvw;
    z-index: 40;
    position: absolute;

    .wrap {
        padding: 0 10px;
        height: 32px;
        display: flex;
        align-items: center;
        color: white;
        border-top: 1px solid white;
        backdrop-filter: blur(10px);
        background: rgba(0, 0, 0, 0.2);
    }

    * {
        color: #fff;
        font-size: 12px;
        padding: 0 2px 0 0;
    }
}

@media (max-width: 1024px) {
    header {
        .header-container {
            .header-right {
                display: none;
            }

            .header-right-mobile {
                display: block;
            }
        }
    }
}

@media (max-width: 768px) {
    header {
        .header-container {
            height: 70px;
            padding: 0 15px;

            .header-left {
                .logo {
                    margin-right: 10px;
                    width: 40px;
                    height: 40px;
                }

                .header-left-text {
                    /* display: none; */
                    margin-top: 2px;

                    h1 {
                        font-size: 16px;
                    }

                    a {
                        font-size: 10px;
                    }
                }
            }
        }
    }
}

#fill-header {
    height: 80px;
    width: 100%;
}

@media (max-width: 768px) {
    #fill-header {
        height: 70px;
    }
}

#fill-breadcrumbs {
    height: 32px;
    width: 100%;
}

footer {
    width: 100%;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #3F3F3F;

    .footer-top {
        display: flex;
        flex-direction: column;
        justify-content: center;
        border-bottom: 1px solid #676767;
        padding: 25px 0;
        color: white;

        .footer-contact {
            display: flex;
            flex-direction: row;
            margin-bottom: 30px;

            .footer-social {
                width: 50%;
                display: flex;
                flex-direction: row;
                justify-content: right;
                align-items: center;
                padding-right: 20px;
                border-right: 1px solid white;
                gap: 5px;

                .icon {
                    display: flex;
                    align-items: center;

                    img {
                        width: 20px;
                        height: 20px;
                        cursor: pointer;
                        margin: auto 10px;
                    }
                }
            }

            .footer-email {
                width: 50%;
                padding: 10px 0px 10px 20px;
                color: white;
                font-weight: 200;
            }
        }

        .footer-links {
            display: flex;
            flex-direction: row;
            justify-content: center;
            align-items: flex-start;
            gap: 40px;

            .mobile-col {
                display: contents;
            }

            .pages {
                display: flex;
                flex-direction: column;

                h1 {
                    cursor: pointer;
                    font-size: 12px;
                    margin-bottom: 10px;
                    /* font-family: 'Bayon', sans-serif; */
                }

                h2 {
                    cursor: pointer;
                    font-size: 12px;
                    margin-left: 5px;
                    margin-bottom: 5px;
                }

                h2:before {
                    content: "-";
                    margin-right: 5px;
                }
            }
        }
    }

    .footer-bottom {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 5px 0;
        gap: 10px;

        img {
            /* margin: 10px; */
            width: 40px;
            height: 40px;
        }

        a {
            margin-top: 5px;
            color: white;
            font-weight: 600;
        }
    }
}

@media (max-width: 768px) {
    footer {
        .footer-top {
            padding: 20px 15px;
            padding-bottom: 10px;

            .footer-contact {
                flex-direction: column;
                padding-bottom: 15px;
                margin-bottom: 20px;
                border-bottom: 1px solid white;

                .footer-social {
                    width: 100%;
                    justify-content: center;
                    align-items: center;
                    padding-right: 0;
                    border-right: none;
                    margin-bottom: 15px;
                }

                .footer-email {
                    width: 100%;
                    padding: 0;
                    text-align: center;
                    font-size: 14px;
                }
            }

            .footer-links {
                flex-direction: row;
                margin: 0 15px;
                gap: 4%;

                .mobile-col {
                    display: flex;
                    flex-direction: column;
                    width: 48%;
                    /* gap: 20px; */
                }

                .pages {
                    margin-bottom: 10px;

                    h1 {
                        font-size: 14px;
                        /* margin-bottom: 8px; */
                    }

                    h2 {
                        font-size: 14px;
                        /* margin-bottom: 4px;
                        margin-left: 10px; */
                    }
                }
            }
        }

        .footer-bottom {
            padding: 10px 0;

            img {
                width: 35px;
                height: 35px;
            }

            a {
                font-size: 14px;
                margin-top: 5px;
            }
        }
    }
}

main {
    width: 100%;
    flex: 1;
    background-color: white;
}

#home {
    width: 100%;
    display: flex;
    flex-direction: column;

    #sec-title {
        position: relative;
        z-index: 1;
        width: 100%;
        height: 100dvh;
        max-height: 100dvw;
        display: flex;
        align-items: center;
        overflow: hidden;

        img {
            min-width: 100%;
            min-height: 100%;
            filter: brightness(0.6);
        }

        .title-text {
            position: absolute;
            margin-left: 40px;
            color: #ffffff;
            top: 30%;
            left: 0%;
            line-height: 1.25;

            h1 {
                font-family: 'Noto Serif JP', serif;
                font-size: clamp(35px, 5vw, 60px);
            }
        }

            .news-container {
                cursor: pointer;
                position: absolute;
                bottom: 30%;
                background-color: rgba(256, 256, 256, 0.65);
                padding: 12px 0px 12px 24px;
                display: flex;
                flex-direction: row;
                align-items: center;
                transition: background-color 0.3s ease-in-out;

                h2 {
                    font-size: 32px;
                    font-weight: 600;
                    padding: 10px 0;
                    border-right: 1px solid #000000;
                    padding-right: 24px;
                    font-family: 'Bayon', sans-serif;
                }

            .news-date {
                font-size: 16px;
                font-weight: 400;
                margin-left: 24px;
            }

            .news-title {
                font-size: 18px;
                font-weight: 400;
                margin-left: 24px;
            }

            svg {
                width: 48px;
                height: 48px;
                margin-left: 24px;
                margin-right: 14px;
            }
        }

        .news-container:hover {
            background-color: rgba(256, 256, 256, 0.8);
        }

        .spill-bottom {
            position: absolute;
            bottom: -5px;
            left: 0;
            width: 100%;
            height: 30dvh;
            max-height: 30dvw;
        }
    }

    #sec-about {
        position: relative;
        width: 100%;
        background: linear-gradient(to right, #FFC32C, #E58E27, #CC5823);
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #ffffff;

        h2 {
            font-size: 32px;
            padding-bottom: 12px;
            border-bottom: 1px dashed #ffffff;
            margin-top: 46px;
            font-family: 'Bayon', sans-serif;
        }

        img {
            margin-top: 32px;
            margin-bottom: 26px;
            width: 200px;
            height: 200px;
        }

        p {
            /* margin-bottom: 26px; */
            line-height: 2;
            font-size: 20px;
            text-align: center;
        }

        button {
            margin-top: 42px;
            margin-bottom: 12px;
            border: none;
            background-color: black;
            color: white;
            padding: 6px 32px;
            border-radius: 5px;
            cursor: pointer;
            z-index: 10;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
            transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
        }

        button:hover {
            box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.8);
            transform: translate(-1px, -1px);
        }
    }

    .overlap {
        position: relative;
        height: 25dvh;
        width: 100%;
        background: linear-gradient(to right, #FFC32C, #E58E27, #CC5823);

        .spill-bottom-1 {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 25dvh;
        }

        .spill-bottom-2 {
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 100%;
            height: 35dvh;
        }
    }

    #sec-glomac {
        position: relative;
        width: 100%;
        background: #EEECEC;
        display: flex;
        flex-direction: column;
        align-items: center;
        color: black;

        h2 {
            font-size: 32px;
            padding-bottom: 12px;
            border-bottom: 1px dashed black;
            margin-top: 46px;
            margin-bottom: 32px;
            font-family: 'Bayon', sans-serif;
        }

        p {
            margin-bottom: 20px;
            font-size: 20px;
            line-height: 2;
            text-align: center;
        }

        button {
            margin-top: 0;
            margin-bottom: 40px;
            border: none;
            background-color: black;
            color: white;
            padding: 6px 32px;
            border-radius: 5px;
            cursor: pointer;
            z-index: 10;
            box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.8);
            transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
        }

        button:hover {
            box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.8);
            transform: translate(-1px, -1px);
        }

        .youtube-wrapper {
            width: 75%;
            max-width: 100dvh;
            margin-top: 20px;
            margin-bottom: 80px;

            & .youtube-container {
                position: relative;
                overflow: hidden;
                height: 0;
                padding-bottom: 56.25%;
                border-radius: 5px;

                & iframe {
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    max-width: 100%;
                }
            }
        }
    }

    #sec-blog {
        position: relative;
        width: 100%;
        background: #FAF5F1;
        display: flex;
        flex-direction: column;
        align-items: center;
        color: black;
        padding-bottom: 40px;

        h2 {
            font-size: 32px;
            padding-bottom: 12px;
            border-bottom: 1px dashed black;
            margin-top: 46px;
            /* margin-bottom: 45px; */
            font-family: 'Bayon', sans-serif;
        }

        .card-containers {
            display: flex;
            flex-direction: row;
            justify-content: center;
            gap: 25px;
            overflow-x: auto;
            overflow-y: hidden;
            padding: 20px 60px;
            /* padding: 45px; */
            width: 100%;
            box-sizing: border-box;
        }

        .card-container {
            background-color: white;
            width: 30dvw;
            min-width: 300px;
            height: 35dvw;
            min-height: 350px;
            box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.2);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            cursor: pointer;
            transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;

            img {
                width: 100%;
                flex: 0 0 45%;
                overflow: hidden;
                object-fit: cover;
            }

            .card-text {
                padding: 0px 15px;
                display: flex;
                flex-direction: column;
                flex: 1;

                .card-title {
                    font-size: 16px;
                    font-weight: 600;
                    margin-bottom: 10px;
                    margin-top: 20px;
                    white-space: nowrap;
                    overflow: hidden;
                    text-overflow: ellipsis;
                }

                .card-content {
                    font-size: 14px;
                    margin-bottom: auto;
                    padding-bottom: 15px;
                    line-height: 1.25;
                    text-align: justify;
                }

                .card-footer {
                    display: flex;
                    justify-content: space-between;
                    align-items: center;
                    margin-bottom: 10px;

                    .card-tag {
                        /* background-color: #f0f0f0;
                    padding: 4px 8px;
                    border-radius: 4px; */
                        font-size: 14px;
                        color: #F79428;
                    }

                    .card-date {
                        font-size: 14px;
                        color: #666;
                    }
                }
            }
        }

        .card-container:hover {
            transform: translateY(-5px);
            box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.3);
        }
    }
}

@media (max-width: 768px) {
    #home {
        #sec-title {
            height: 50dvh;
            max-height: none;

            .title-text {
                margin-left: 20px;
            }

            .news-container {
                bottom: 20%;
                padding: 12px 0px 12px 12px;

                h2 {
                    font-size: 20px;
                    padding: 10px 0;
                    padding-right: 12px;
                }

                .news-date {
                    font-size: 16px;
                    margin-left: 12px;
                }

                .news-title {
                    font-size: 16px;
                    margin-left: 18px;
                }

                svg {
                    width: 28px;
                    height: 28px;
                    margin-left: 18px;
                    margin-right: 12px;
                }
            }

            .spill-bottom {
                position: absolute;
                bottom: -1px;
                left: 0;
                width: 100%;
                height: 5dvh;
                max-height: 30dvw;
            }
        }

        #sec-about {
            p {
                margin: 0 20px;
                font-size: 14px;
            }

            button {
                margin-top: 35px;
                margin-bottom: 45px;
            }
        }

        .overlap {
            height: 5dvh;

            .spill-bottom-1 {
                height: 5dvh;
            }

            .spill-bottom-2 {
                height: 10dvh;
            }
        }

        #sec-glomac {
            p {
                /* margin: 0 20px; */
                font-size: 14px;
            }

            .youtube-wrapper {
                margin-bottom: 45px;
            }
        }

        #sec-blog {
            .card-container {
                .card-text {
                    .card-content {
                        font-size: 14px;
                    }
                }
            }

        }
    }
}