/* Responsive layer for the legacy 960px theme.
 * Breakpoints follow Bootstrap 5: sm 576px, md 768px, lg 992px.
 * Desktop rules remain in global.css.
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    overflow-x: clip;
}

body {
    min-width: 0;
}

img,
video,
object,
embed {
    max-width: 100%;
    height: auto;
}

iframe {
    max-width: 100%;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.menu-toggle,
.submenu-toggle {
    display: none;
}

.mobile-footer {
    display: none;
}

a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 3px solid #1c6e8c;
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    html,
    body {
        width: 100%;
        overflow-x: hidden;
        overflow-x: clip;
    }

    html {
        height: auto;
        min-height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body {
        height: auto;
        min-height: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-y: visible;
        display: flex;
        flex-direction: column;
    }

    body > .background_bottom {
        flex: 1 0 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    body > .background_bottom > .background_sky {
        flex: 1 0 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    body > .background_bottom > .background_sky > .body {
        flex: 1 0 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    body > .background_bottom > .background_sky > .body > .body_contn {
        flex: 1 0 auto;
    }

    body > .mobile-footer {
        flex: 0 0 auto;
    }

    .section {
        width: 100%;
        max-width: 820px;
        margin-right: auto;
        margin-left: auto;
        padding-right: 24px;
        padding-left: 24px;
        overflow: visible;
    }

    .background_sky {
        background-position: center top;
    }

    .background_bottom,
    .body,
    .body.is_page,
    .body.is_single,
    .archive_page,
    .body.is_index .middle_bottom_contn {
        background-image: none;
    }

    .is_index .background_body,
    .background_body {
        background-image: none;
    }

    .body_section,
    .is_index .body_section {
        padding-bottom: 48px;
    }

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

    #header .header_contn {
        width: calc(100% + 48px);
        max-width: none;
        margin-right: -24px;
        margin-left: -24px;
        min-height: 132px;
        padding: 0 0 12px;
    }

    .logo {
        position: static;
        width: 100%;
        max-width: none;
        margin: 0;
    }

    .logo a {
        width: 100%;
        height: auto;
        aspect-ratio: 1920 / 766;
        background-image: url("../images/logo-h5.jpg");
        background-size: contain;
    }

    .menu-toggle {
        position: absolute;
        top: 24px;
        right: 0;
        z-index: 120;
        display: grid;
        width: 46px;
        height: 46px;
        min-height: 46px;
        padding: 10px;
        border: 1px solid #6d8962;
        border-radius: 4px;
        background: rgba(255, 255, 255, 0.96);
        place-items: center;
    }

    .menu-toggle-lines,
    .menu-toggle-lines span {
        display: block;
        width: 24px;
    }

    .menu-toggle-lines {
        position: relative;
        height: 24px;
    }

    .menu-toggle-lines span {
        position: absolute;
        left: 0;
        height: 2px;
        background: #315c70;
        transition: transform 180ms ease, opacity 180ms ease;
    }

    .menu-toggle-lines span:nth-child(1) {
        top: 4px;
    }

    .menu-toggle-lines span:nth-child(2) {
        top: 11px;
    }

    .menu-toggle-lines span:nth-child(3) {
        top: 18px;
    }

    .mobile-nav-open .menu-toggle-lines span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-nav-open .menu-toggle-lines span:nth-child(2) {
        opacity: 0;
    }

    .mobile-nav-open .menu-toggle-lines span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    #header .menu_navi {
        float: none;
        position: static;
        width: 100%;
        height: auto;
        padding: 0;
    }

    .nav-top {
        width: 100%;
    }

    #menu-nav_top {
        display: flex;
        width: 100%;
        max-height: calc(100vh - 132px);
        max-height: calc(100vh - 132px - env(safe-area-inset-bottom));
        max-height: calc(100dvh - 132px - env(safe-area-inset-bottom));
        margin: 8px 0 16px;
        padding: 8px 0;
        overflow-x: hidden;
        overflow-y: auto;
        border-top: 1px solid rgba(98, 126, 160, 0.3);
        border-bottom: 1px solid rgba(98, 126, 160, 0.3);
        background: rgba(255, 255, 255, 0.96);
        flex-direction: column;
        flex-wrap: nowrap;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-nav-ready #menu-nav_top {
        display: none;
    }

    .mobile-nav-open #menu-nav_top {
        display: flex;
    }

    #menu-nav_top > li.menu-item,
    #menu-nav_top > li.menu-item:not(:last-child),
    #menu-nav_top > li.menu-item ul li {
        position: relative;
        top: auto;
        left: auto;
        display: block;
        float: none !important;
        clear: both;
        width: 100%;
        height: auto;
        min-height: 0;
        padding: 0;
        border: 0;
        text-align: left;
        flex: 0 0 auto;
    }

    #menu-nav_top > li.menu-item ul.sub-menu {
        position: static;
        top: auto;
        left: auto;
        float: none !important;
        clear: both;
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
        border: 0;
        box-sizing: border-box;
    }

    #menu-nav_top > li.menu-item > a,
    #menu-nav_top > li.menu-item li a {
        min-height: 44px;
        padding: 11px 52px 11px 16px;
        border-radius: 0;
        background: none;
        color: #315c70;
        font-size: 16px;
        line-height: 22px;
        text-align: left;
    }

    #menu-nav_top > li.menu-item + li.menu-item {
        border-top: 1px solid #e3ebef;
    }

    #menu-nav_top ul.sub-menu,
    #menu-nav_top li.menu-item:hover > ul.sub-menu {
        position: static;
        display: none !important;
        background: #eef6f8;
    }

    #menu-nav_top li.menu-item.submenu-open > ul.sub-menu {
        display: block !important;
    }

    #menu-nav_top > li.menu-item li a {
        padding-left: 32px;
        font-size: 15px;
    }

    #menu-nav_top > li.menu-item li:hover > a {
        background-position: left center;
    }

    .submenu-toggle {
        position: absolute;
        top: 0;
        right: 4px;
        z-index: 2;
        display: grid;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        place-items: center;
    }

    .submenu-toggle span {
        width: 10px;
        height: 10px;
        border-right: 2px solid #315c70;
        border-bottom: 2px solid #315c70;
        transform: rotate(45deg);
        transition: transform 180ms ease;
    }

    .submenu-toggle[aria-expanded="true"] span {
        transform: rotate(225deg);
    }

    #top-cloud,
    #left-child-new,
    #left-child,
    #center-cloud,
    #right-leaf,
    #right-child,
    #right-child-cloud,
    #muban {
        display: none;
    }

    #top-slider-container {
        display: none;
        position: static;
        width: 100%;
        height: auto;
        margin-top: 0;
        order: 3;
    }

    #top-slider-container .n2-section-smartslider,
    #top-slider-container .n2-ss-align,
    #top-slider-container .n2-ss-slider,
    #slideshow .n2-section-smartslider,
    #slideshow .n2-ss-align,
    #left-slider-container .n2-section-smartslider {
        max-width: 100% !important;
    }

    #slideshow #n2-ss-3-align,
    #slideshow #n2-ss-3-align > .n2-padding,
    #slideshow #n2-ss-3 {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .is_index .body_section {
        display: flex;
        flex-direction: column;
    }

    .is_index .middle_contn {
        display: none;
        min-height: 0;
    }

    #muban-left,
    #motto,
    #slideshow,
    #recent {
        position: static;
        right: auto;
        left: auto;
        top: auto;
        width: 100%;
        height: auto;
    }

    #muban-left {
        order: 3;
        max-width: none;
        margin: 24px 0 0;
        padding: 0;
        background: rgba(255, 255, 255, 0.5);
    }

    #left-slider-container {
        position: static;
        width: 100%;
        max-width: none;
        height: auto;
        margin: 0;
    }

    #left-slider-container .n2-section-smartslider,
    #left-slider-container .n2-ss-align,
    #left-slider-container .n2-ss-slider,
    #left-slider-container .n2-ss-slider-1,
    #left-slider-container .n2-ss-slider-2,
    #left-slider-container .n2-ss-slider-3,
    #left-slider-container .n2-ss-slider-4 {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
    }

    #left-slider-container svg.n2-ss-preserve-size {
        display: none !important;
    }

    /* Let the background image determine the mobile slider height. */
    #left-slider-container .n2-ss-slide-background,
    #left-slider-container .n2-ss-slide-background-image,
    #left-slider-container .n2-ss-slide-background-image picture,
    #left-slider-container .n2-ss-slide-background-image img {
        position: relative;
        display: block;
        width: 100% !important;
        height: auto !important;
    }

    #left-slider-container .n2-ss-slider-4 {
        height: 100% !important;
    }

    #motto {
        display: none;
        order: 1;
        margin: 0;
        padding: 12px 16px;
        border-top: 2px solid #c49a6c;
        border-bottom: 1px solid rgba(196, 154, 108, 0.55);
        background: rgba(255, 245, 222, 0.88);
    }

    #motto .motto_contn {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: 12px;
        min-width: 0;
        overflow: hidden;
    }

    #motto .div_title {
        float: none;
        width: auto;
        height: auto;
        margin: 0;
        background: none;
        color: #7b5b3c;
        font-size: 18px;
        line-height: 1.4;
        text-align: left;
        text-indent: 0;
        white-space: nowrap;
    }

    #motto .motto_content,
    #motto .motto_content * {
        float: none;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        color: #534741;
        line-height: 1.6;
        white-space: normal;
    }

    #motto .motto_content,
    #motto .dowebok {
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    #motto .dowebok,
    #motto .motto-text {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* Keep the marquee track inside the motto viewport on small screens. */
    #motto .dowebok.str_wrap {
        position: relative;
        width: 100%;
        overflow: hidden;
        white-space: nowrap;
    }

    #motto .dowebok.str_wrap .str_move,
    #motto .dowebok.str_wrap .str_move_clone {
        position: absolute;
        top: 0;
        width: auto;
        max-width: none;
        white-space: nowrap;
    }

    #motto .dowebok.str_wrap .motto-text {
        display: inline-block;
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }

    #slideshow {
        order: 2;
        max-width: 470px;
        margin: 24px auto 0;
        aspect-ratio: 470 / 280;
    }

    #slideshow .n2-section-smartslider,
    #slideshow .n2-ss-align,
    #slideshow .n2-padding,
    #slideshow .n2-ss-slider,
    #slideshow .n2-ss-slider-1,
    #slideshow .n2-ss-slider-2,
    #slideshow .n2-ss-slider-3,
    #slideshow .n2-ss-slider-4 {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
    }

    #slideshow svg.n2-ss-preserve-size {
        width: 100% !important;
        height: auto !important;
    }

    #recent {
        order: 1;
        margin: 0 auto;
    }

    #recent .ui-tabs-nav {
        width: 100%;
        height: auto;
        margin: 0 0 8px;
        border-bottom: 2px solid #6d8962;
        background: none;
    }

    #recent .ui-tabs-nav li {
        float: none;
        padding: 0;
    }

    #recent .recent_nav_news a,
    #recent .ui-tabs-nav a {
        width: auto;
        height: auto;
        min-height: 44px;
        padding: 9px 4px;
        background: none;
        color: #4f7045;
        font-size: 20px;
        font-weight: 700;
        line-height: 26px;
        text-indent: 0;
    }

    #links .ui-tabs-nav {
        display: block;
        width: 100%;
        height: auto;
        margin: 0 0 8px;
        border-bottom: 2px solid #6d8962;
        background: none;
    }

    #links .ui-tabs-nav li {
        float: none;
        padding: 0;
    }

    #links .links_nav_useful a,
    #links .ui-tabs-nav a {
        width: auto;
        height: auto;
        min-height: 44px;
        padding: 9px 4px;
        background: none;
        color: #4f7045;
        font-size: 20px;
        font-weight: 700;
        line-height: 26px;
        text-indent: 0;
    }

    #recent_news_pane,
    #recent_news_pane .jspContainer,
    #recent_news_pane .jspPane {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    #recent .list li {
        padding: 0;
    }

    #recent .list li a {
        display: grid;
        min-height: 48px;
        padding: 10px 0;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 12px;
    }

    #recent .news_title {
        max-width: none;
        overflow: visible;
        line-height: 1.5;
        white-space: normal;
        text-overflow: clip;
    }

    #recent .date {
        color: #6d5d49;
        font-size: 13px;
        white-space: nowrap;
    }

    .body.is_index .middle_bottom_contn {
        position: static;
        width: 100%;
        min-height: 0;
        padding: 28px 0;
        background-position: center top;
    }

    #links_useful,
    #links_useful_pane {
        height: auto;
        margin: 0;
        overflow: visible;
    }

    #links .links_items {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
        overflow: visible;
    }

    #links .links_items a {
        float: none;
        display: flex;
        min-width: 0;
        min-height: 70px;
        margin: 0;
        align-items: center;
        justify-content: center;
    }

    #links_useful .links_items img,
    #links_recommend .links_items img {
        display: block;
        width: 100%;
        height: auto;
        max-width: 100%;
        max-height: none;
    }

    .body.is_page,
    .body.is_single,
    .archive_page {
        min-height: 0;
        background-position: center bottom;
    }

    .is_page .middle_contn,
    .is_single .middle_contn,
    .archive_page .middle_contn,
    .middle_contn {
        width: 100%;
        margin: 0;
        overflow: visible;
    }

    .breadcrumbs-bg {
        width: 100%;
        height: 52px;
        padding: 0;
        background-position: left center;
        background-size: auto 42px;
    }

    .breadcrumbs {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 11;
        width: 100%;
        height: 52px;
        padding: 15px 12px 0;
        overflow-x: auto;
        overflow-y: hidden;
        line-height: 24px;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .post-title,
    .post-content,
    .notice_list {
        width: 100%;
        padding-right: 16px;
        padding-left: 16px;
    }

    .post-title h1 {
        font-size: 28px;
        line-height: 1.35;
        overflow-wrap: anywhere;
    }

    .post-content {
        overflow-wrap: anywhere;
        line-height: 1.75;
    }

    .post-content img,
    .post-content figure,
    .post-content .wp-caption,
    .post-content .vc_single_image-wrapper {
        display: block;
        max-width: 100% !important;
        height: auto !important;
    }

    /* Long infographic images must remain scrollable vertically on mobile.
     * Reset editor-injected dimensions on the image and its common wrappers. */
    .post-content p,
    .post-content figure,
    .post-content .wp-caption,
    .post-content .vc_single_image-wrapper,
    .post-content a {
        max-width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }

    .post-content figure > a,
    .post-content a.fancybox.image {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .post-content figure > a > img,
    .post-content a.fancybox.image > img {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }

    .post-content iframe,
    .post-content video,
    .post-content embed,
    .post-content object {
        max-width: 100% !important;
    }

    .post-content .vc_row,
    .post-content .wpb_row,
    .post-content .wpb_wrapper,
    .post-content .vc_column_container,
    .post-content .vc_column-inner {
        max-width: 100% !important;
    }

    .post-content .vc_row,
    .post-content .wpb_row {
        margin-right: 0 !important;
        margin-left: 0 !important;
    }

    .post-content table {
        display: block;
        width: 100% !important;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .month_navi {
        width: 100%;
        height: auto;
        min-height: 48px;
        margin-top: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        background-position: center;
        -webkit-overflow-scrolling: touch;
    }

    .month_navi form {
        width: max-content;
        min-width: 100%;
    }

    .month_navi ul.nav {
        display: flex;
        width: max-content;
        min-width: 100%;
        min-height: 48px;
        padding: 0 8px;
        align-items: center;
        justify-content: center;
    }

    .month_navi ul.nav li {
        display: block;
        flex: 0 0 auto;
        overflow: visible;
    }

    .month_navi a {
        display: inline-flex;
        min-height: 44px;
        padding: 0 10px;
        align-items: center;
        line-height: 1.3;
        white-space: nowrap;
    }

    .month_navi select {
        min-height: 40px;
        max-width: 220px;
        padding: 6px 28px 6px 8px;
        border-color: #aab8a4;
        background: #fff;
        font-family: inherit;
    }

    body.category-notice .month_navi {
        overflow: visible;
    }

    body.category-notice .month_navi form,
    body.category-notice .month_navi ul.nav {
        width: 100%;
    }

    body.category-notice .month_navi ul.nav {
        padding: 8px;
        flex-wrap: wrap;
        gap: 4px 6px;
        justify-content: flex-start;
    }

    body.category-notice .month_navi ul.nav li {
        margin-left: 0 !important;
    }

    .notice_list {
        margin-top: 16px;
    }

    .notice_list li {
        margin-bottom: 0;
    }

    .notice_list ul.list li > a {
        display: grid;
        min-height: 48px;
        grid-template-columns: 120px minmax(0, 1fr);
        align-items: stretch;
    }

    .notice_list .date {
        display: flex;
        width: auto;
        min-height: 48px;
        padding: 8px;
        align-items: center;
        justify-content: center;
    }

    .notice_list .description {
        display: block;
        width: auto;
        min-width: 0;
        padding: 12px 14px;
        overflow: visible;
        line-height: 1.5;
        white-space: normal;
        text-overflow: clip;
        overflow-wrap: anywhere;
    }

    .wp-pagenavi {
        display: flex;
        padding: 20px 12px;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: center;
    }

    .wp-pagenavi a,
    .wp-pagenavi span {
        display: inline-flex;
        min-width: 40px;
        min-height: 40px;
        margin: 0;
        align-items: center;
        justify-content: center;
    }

    #footer {
        display: none;
    }

    .mobile-footer {
        display: block;
        padding: 20px 0 24px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
        border-top: 1px solid #c9ddd3;
        background: #e8f2ed;
        color: #31554d;
    }

    .mobile-footer__inner {
        width: 100%;
        max-width: 820px;
        padding: 0 24px;
        margin: 0 auto;
    }

    .mobile-footer__logo {
        display: block;
        width: min(100%, 280px);
        margin: 0 0 18px;
    }

    .mobile-footer__logo img {
        display: block;
        width: 100%;
        height: auto;
    }

    .mobile-footer__contact {
        max-width: 430px;
        margin: 0 auto;
        color: inherit;
        font-size: 14px;
        font-style: normal;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }

    .mobile-footer__contact p {
        margin: 0;
    }

    .mobile-footer__contact p:nth-child(2) {
        margin-bottom: 10px;
    }

    .mobile-footer__contact a {
        color: inherit;
        text-decoration: none;
    }

    .ays-pb-modal.ays-popup-box-main-box {
        top: 5dvh !important;
        right: 12px !important;
        bottom: auto !important;
        left: 12px !important;
        width: auto !important;
        max-width: 720px !important;
        height: 90dvh !important;
        max-height: 90dvh !important;
        margin: 0 auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        box-sizing: border-box !important;
    }

    .ays-pb-modal .ays_content_box,
    .ays-pb-modal .ays_pb_description {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .ays-pb-modal .ays_content_box img,
    .ays-pb-modal .ays_pb_description img {
        max-width: 100% !important;
        height: auto !important;
    }

    .ays-pb-modal .ays-pb-modal-close {
        position: fixed !important;
        top: calc(5dvh + 8px) !important;
        right: 20px !important;
        z-index: 1000 !important;
        float: right;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-width: 44px;
        min-height: 44px;
        background-color: rgba(255, 255, 255, 0.94) !important;
    }
}

/* Keep the legacy desktop breadcrumb dimensions used by bg-bcn.png. */
@media (min-width: 992px) {
    .breadcrumbs,
    .breadcrumbs-bg {
        box-sizing: content-box;
    }
}

@media (max-width: 767.98px) {
    .section {
        padding-right: 16px;
        padding-left: 16px;
    }

    .mobile-footer__inner {
        padding-right: 16px;
        padding-left: 16px;
    }

    #header .header_contn {
        width: calc(100% + 32px);
        margin-right: -16px;
        margin-left: -16px;
        min-height: 118px;
        padding-top: 0;
    }

    .logo {
        width: 100%;
    }

    .menu-toggle {
        top: 20px;
    }

    #motto .motto_contn {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    #recent .list li a {
        grid-template-columns: 1fr;
        gap: 3px;
    }

    #recent .date {
        justify-self: start;
    }

    #links .links_items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 12px;
    }

    .post-title,
    .post-content,
    .notice_list {
        padding-right: 0;
        padding-left: 0;
    }

    .post-title h1 {
        font-size: 24px;
    }

    .notice_list ul.list li > a {
        grid-template-columns: 96px minmax(0, 1fr);
    }

    .notice_list .date {
        padding: 8px 4px;
        font-size: 12px;
    }

    .notice_list .description {
        padding: 10px;
        font-size: 14px;
    }

}

@media (max-width: 575.98px) {
    .logo {
        width: 100%;
    }

    .notice_list ul.list li > a {
        grid-template-columns: 1fr;
    }

    .notice_list .date {
        justify-content: flex-start;
        padding-left: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
