main {
    overflow-x: hidden;
}
footer {
    margin-top: 0 !important;
}

.btn--external {
	a::after,
    .wp-block-navigation-item__content::after, 
    .wp-block-button__link::after{
        content: "";
        display: inline-block;
        width: 1.2em;
        height: 1.2em;
        margin-left: 0.3em;
        vertical-align: middle;
        background-color: currentColor;
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M19 13V19C19 19.5304 18.7893 20.0391 18.4142 20.4142C18.0391 20.7893 17.5304 21 17 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V7C3 6.46957 3.21071 5.96086 3.58579 5.58579C3.96086 5.21071 4.46957 5 5 5H11V7H5V19H17V13H19ZM13 3V5H17.586L9.793 12.793L11.207 14.207L19 6.414V11H21V3H13Z' fill='%23000'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M19 13V19C19 19.5304 18.7893 20.0391 18.4142 20.4142C18.0391 20.7893 17.5304 21 17 21H5C4.46957 21 3.96086 20.7893 3.58579 20.4142C3.21071 20.0391 3 19.5304 3 19V7C3 6.46957 3.21071 5.96086 3.58579 5.58579C3.96086 5.21071 4.46957 5 5 5H11V7H5V19H17V13H19ZM13 3V5H17.586L9.793 12.793L11.207 14.207L19 6.414V11H21V3H13Z' fill='%23000'/%3E%3C/svg%3E");
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-size: contain;
}
}

/* table */
.tableberg-table-wrapper,
.wp-block-table {
    overflow-x: auto;

    th,
    td {
        padding: var(--wp--preset--spacing--spacing-24) !important;
        border-color: var(--wp--preset--color--border) !important;
        border-left: none !important;
        border-right: none !important;
    }
    th {
        color: var(--wp--preset--color--primary);
        font-weight: 600;
        background: var(--wp--preset--color--accent);
    }
    td {
        background: transparent !important;
    }

    thead {
        border-width: 1px;
        text-align: left;
    }

    &:not(:has(th)) tr td:first-child {
        color: var(--wp--preset--color--primary) !important;
        font-weight: 600;
        background: var(--wp--preset--color--accent) !important;
    }
}
@media (max-width: 781px) {
    .tableberg-table-wrapper,
    .wp-block-table {
        th,
        td {
            padding: var(--wp--preset--spacing--spacing-16) !important;
        }
    }
}

/* local nav */
.nav--local-nav {
    gap: 0;
    border: 1px solid var(--wp--preset--color--primary);
    border-radius: var(--wp--preset--border-radius--round-md);
}
.nav--local-nav p {
    text-align: center;
    flex: 1;
}

.nav--local-nav p:not(:last-child) {
    border-right: 1px solid var(--wp--preset--color--primary);
}

.nav--local-nav a {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: var(--wp--preset--spacing--spacing-16) var(--wp--preset--spacing--spacing-32);
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--text-md);
    font-weight: 600;
    text-decoration: none;

    &::after {
        content: "";
        display: inline-block;
        width: 1.5rem;
        height: 1.5rem;
        margin-left: var(--wp--preset--spacing--spacing-16);
        vertical-align: middle;
        background-color: currentColor;
        /* 下向き矢印の SVG をマスクに指定 */
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 9L12 16L19 9' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 9L12 16L19 9' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-size: contain;
        flex-shrink: 0;
    }
}

@media (max-width: 781px) {
    .nav--local-nav {
        flex-direction: column;
        p {
            width: 100%;
            text-align: left;
        }
        a {
            justify-content: space-between;
            padding: var(--wp--preset--spacing--spacing-8) var(--wp--preset--spacing--spacing-16);
        }
    }
    .nav--local-nav p:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--wp--preset--color--primary);
    }
}

/* Lazy Block */
.history__list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--spacing-48);
    list-style: none;
    padding: 0;
    margin: 0;
    &::before {
        content: "";
        position: absolute;
        top: 50%;
        left: 6px;
        transform: translate(-50%, -50%);
        height: calc(100% - 16px);
        width: 1px;
        background: var(--wp--preset--color--primary);
    }
}
.history__item {
    display: grid;
    grid-template-columns: minmax(auto, 144px) minmax(auto, 144px) 1fr;
}
.history__year,
.history__month {
    position: relative;
    display: block;
    color: var(--wp--preset--color--primary);
}
.history__year:not(:has(span:empty))::before {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: var(--wp--preset--spacing--spacing-16);
    background: var(--wp--preset--color--primary);
    border-radius: var(--wp--preset--border-radius--round-full);
}
.history__text {
    margin: 0;
}
@media (max-width: 781px) {
    .history__list {
        gap: var(--wp--preset--spacing--spacing-24);
    }
    .history__item {
        display: grid;
        grid-template-columns: minmax(auto, 80px) minmax(auto, 40px) 1fr;
    }
}

.faq__list {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--spacing-32);
    list-style: none;
    padding: 0;
    margin: 0;
}
.faq__item {
    background: var(--wp--preset--color--white);
    padding: var(--wp--preset--spacing--spacing-24);
    border-radius: var(--wp--preset--border-radius--round-md);
}
.faq__question {
    display: flex;
    margin: 0 0 var(--wp--preset--spacing--spacing-24) 0;
    color: var(--wp--preset--color--primary);
    font-size: var(--wp--preset--font-size--text-lg);
    &::before {
        content: "Q.";
        display: inline-block;
        margin-right: var(--wp--preset--spacing--spacing-16);
        font-weight: 700;
    }
}
.faq__answer {
    display: flex;
    &::before {
        content: "A.";
        display: inline-block;
        font-size: var(--wp--preset--font-size--text-lg);
        margin-right: var(--wp--preset--spacing--spacing-16);
        font-weight: 700;
        color: var();
    }
}

/* header */
.header-inner {
    position: relative;
    z-index: 9999;

    .wp-block-navigation:not(.has-background) {
        .wp-block-navigation__submenu-container {
            top: calc(100% + 36px);
            border: none;
            filter: drop-shadow(0px 4px 8px rgba(185, 185, 185, 0.5));
            li {
                :hover {
                    color: var(--wp--preset--color--white);
                    background-color: var(--wp--preset--color--primary);
                }
            }
            .wp-block-navigation-item__content {
                padding: var(--wp--preset--spacing--spacing-16) var(--wp--preset--spacing--spacing-32);
                text-decoration: none;
            }
        }
    }
}

/* primary-nav */
@media (max-width: 1220px) {
    .primary-nav{
        display: none !important;
    }
}

/* btn-hamburger */
.btn--hamburger {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 64px;
    height: 64px;
    cursor: pointer;
    background: transparent;
    border: 2px solid var(--wp--preset--color--primary);
    border-radius: var(--wp--preset--border-radius--round-full);
}

/* mega-menu */
.mega-menu {
    visibility: hidden;
    position: absolute;
    top: 100%;
    width: 100%;
    background: var(--wp--preset--color--white);
    opacity: 0;
    transition: opacity 0.3s ease;

    &.is-open {
        display: block;
        visibility: visible;
        opacity: 1;
        max-height: calc(100vh - 96px); /* 100vhからヘッダー高さを引く */
        overflow-y: auto; /* 中身が溢れたらスクロール */
        -webkit-overflow-scrolling: touch; /* iOSでのスクロールを滑らかに */
    }
}

.mega-menu-custom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.6); /* 暗さ */
    z-index: 9998; /* メニュー(例:9999)のすぐ下の数値 */

    /* 初期状態は非表示 */
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
    pointer-events: none; /* 閉じている時はクリックを通す */
}

.mega-menu-custom-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* 開いている時はクリックを検知 */
}

/* Sub navigation */
.sub-navigation {
    a {
        text-decoration: none;
        &:hover {
            > div {
                border-color: var(--wp--preset--color--primary) !important;
            }
        }

        > div {
            transition: all 0.3s ease;
        }
    }
}
@media (max-width: 1024px) {
    .sub-navigation {
        .is-layout-grid{
            grid-template-columns: repeat(2,1fr);
        }
    }
}
@media (max-width: 781px) {
    .sub-navigation {
        .is-layout-grid{
            grid-template-columns: 1fr;
            row-gap: var(--wp--preset--spacing--spacing-8);
        }
    }
}

.footer-cta {
    position: relative;
    display: flex;
    flex-direction: column;

    > div:not(.footer-cta--bg) {
        width: 100%;
        z-index: 10;
    }
}
.footer-cta--bg {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: block;
    width: 100vw;
    max-width: none !important;
    margin-top: 0;
    height: 100%;
    overflow: hidden;
}

.split-item {
    position: absolute;
    top: 0;
    height: 100%;
    background-size: cover;
    background-position: center;
}

/* 左側の設定 */
.left {
    left: 0;
    width: 55%;
    clip-path: polygon(0 0, 100% 0, 90% 100%, 0 100%);
    background:
        linear-gradient(rgba(0, 72, 150, 0.9), rgba(0, 72, 150, 0.9)),
        url(../images/do_pic1.jpg) center / cover no-repeat;
    z-index: 2;
}

/* 右側の設定 */
.right {
    right: 0;
    width: 55%;
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
    background:
        linear-gradient(rgba(0, 17, 78, 0.8), rgba(0, 17, 78, 0.8)),
        url(../images/top_pic1.jpg) center 20% / cover no-repeat;
    z-index: 1;
}

/* コンテンツの配置調整 */
.split-content {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40%; /* 端に寄せる */
}
.left .split-content {
    left: 5%;
}
.right .split-content {
    right: 5%;
    text-align: right;
}

/* news-item article */
article.news-item {
    position: relative;
    display: flex;
    flex-direction: column;

    >div{
        z-index: 0;
    }
    >.wp-block-group{
        z-index: 1;
    }
    a {
        &::after {
            content: "";
            width: 100%;
            height: 100%;
            position: absolute;
            content: "";
            z-index: 2;
            inset: 0;
        }
        &::before {
            content: "";
            width: 100%;
            height: 100%;
            position: absolute;
            content: "";
            z-index: -1;
            inset: 0;
        }
        &:hover {
            text-decoration: none;
            &::before {
                background-color: var(--wp--preset--color--accent);
            }
        }
    }
    .wp-block-post-excerpt{
        z-index: 1;
		pointer-events:none;
    }
}

@media (max-width: 781px) {
    article.news-item {
        padding-top: 0 !important;
        padding-bottom: var(--wp--preset--spacing--spacing-16) !important;
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }
}


/* pagination */
.wp-block-query-pagination-numbers {
    display: flex;
    gap: var(--wp--preset--spacing--spacing-8);

    .page-numbers {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        color: var(--wp--preset--color--muted-foreground);
        border: 1px solid var(--wp--preset--color--border);
        border-radius: var(--wp--preset--border-radius--round-md);

        &.current {
            background: var(--wp--preset--color--primary);
            color: var(--wp--preset--color--white);
            font-weight: 600;
        }
    }
}

.wp-block-query-pagination-next,
.wp-block-query-pagination-previous {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--wp--preset--color--muted);
    border-radius: var(--wp--preset--border-radius--round-md);

    .is-arrow-arrow {
        margin: 0;
    }
}

/* breadcrumb */
.aioseo-breadcrumbs {
	opacity:0.6;
    .aioseo-breadcrumb a {
        color: var(--wp--preset--color--white);
    }
}

.text-foreground{
    .aioseo-breadcrumb a{
        color: var(--wp--preset--color--foreground)!important;
    }
}
/* Message */
.section__message-inner {
    position: relative;

    > * {
        position: relative;
        z-index: 1;
    }

    &::after {
        content: "";
        position: absolute;
        top: calc(-1 * var(--wp--preset--spacing--spacing-64));
        bottom: calc(-1 * var(--wp--preset--spacing--spacing-64));
        left: calc(-1 * var(--wp--preset--spacing--spacing-64));
        width: 150vw;
        background-color: var(--wp--preset--color--white);
        border-radius: var(--wp--preset--border-radius--round-lg) 0 0 var(--wp--preset--border-radius--round-lg);
        z-index: 0;
    }
}

.mvv__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 166px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}
@media (max-width: 781px) {
    .mvv__centered {
        text-align: center;
    }
}

/* contact form */
form.wpcf7-form {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--spacing-32);
    > p {
        margin: 0;
    }

    label {
        display: block;
    }

    fieldset{
        display: flex;
        flex-direction: column;
        border: 1px solid var(--wp--preset--color--border);
        border-radius: var(--wp--preset--border-radius--round-sm);
        min-width: 0;
        >p{
            margin: var(--wp--preset--spacing--spacing-8) 0;
        }
    }
    legend{
        padding: 0 var(--wp--preset--spacing--spacing-8);;
        font-weight: 600;
    }

    input,
    textarea {
        background: #f8fafc;
        border: 1px solid var(--wp--preset--color--border);
        border-radius: var(--wp--preset--border-radius--round-sm);
        padding: 1em;
        display: block;
        width: stretch;
		width: -moz-available; /* Firefox */
		width: -webkit-fill-available; /* Safari */
        font-size: var(--wp--preset--font-size--text-md);
    }
    input[size='10'] {
        display: inline-block;
        max-width: 120px;
    }

    textarea {
        min-width: stretch;
        max-width: stretch;
        min-height: 5em;
        max-height: 10em;
    }

    .wpcf7-select{
        -webkit-appearance: none;
        appearance: none;
        background: #f8fafc;
        border: 1px solid var(--wp--preset--color--border);
        border-radius: var(--wp--preset--border-radius--round-sm);
        padding: 1em;
        display: block;
        width: stretch;
        font-size: var(--wp--preset--font-size--text-md);
        
    }

    .wpcf7-radio {
        display: flex;
        flex-direction: column;
        gap: var(--wp--preset--spacing--spacing-8);
        margin-top: var(--wp--preset--spacing--spacing-8);
    }
    .wpcf7-list-item {
        margin: 0;
        label {
            display: flex;
            align-items: center;
            gap: var(--wp--preset--spacing--spacing-8);
            input {
                width: 20px;
                height: 20px;
            }
        }
    }

    input[type="submit"] {
        background: var(--wp--preset--color--primary);
        color: var(--wp--preset--color--white);
        border: none;
        border-radius: var(--wp--preset--border-radius--round-full);
        padding: 1em 2em;
        font-size: var(--wp--preset--font-size--text-md);
        font-weight: 600;
        max-width: 240px;
        margin: 0 auto;
        cursor: pointer;
    }
    .wpcf7-form-control.wpcf7-checkbox{
        display: flex;
        gap: var(--wp--preset--spacing--spacing-16);
        flex-wrap: wrap;
    }

    th,td{
        p{
            margin: var(--wp--preset--spacing--spacing-4);
        }
    }
    th{
        text-align: left;
        font-weight: 400;
    }
}

p:has(.wpcf7-validates-as-required) .input__label-text,
.input__label-text.required {
    &::after {
        content: "必須";
        display: inline-block;
        margin-left: var(--wp--preset--spacing--spacing-4);
        padding: 2px 8px;
        font-size: var(--wp--preset--font-size--text-xs);
        color: var(--wp--preset--color--white);
        background: var(--wp--preset--color--destructive);
        border-radius: var(--wp--preset--border-radius--round-xs);
    }
}

.input__label-text {
    display: inline-flex;
    align-items: center;
    margin-bottom: var(--wp--preset--spacing--spacing-8);
    font-weight: 500;
}

.input__description {
    font-size: var(--wp--preset--font-size--text-sm);
    color: var(--wp--preset--color--muted-foreground);
}

.douiArea{
    max-height: 16em;
    overflow-y: auto;
}

.list-style--parentheses{
    list-style: none;
    counter-reset: item;
    li {
        position: relative;
        counter-increment: item;
        &::before {
            position: absolute;
            right: calc(100% + 0.5rem);
            content: "(" counter(list-item) ")";
        }
    }
}
.list-style--parentheses-right{
    li {
        &::before {
            content: counter(list-item) ")";
        }
    }
}

@media (max-width: 781px) {
    form.wpcf7-form {
        fieldset{
            padding: var(--wp--preset--spacing--spacing-8);
        }
    }
}

/* customblock */
.wp-block-my-post-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--wp--preset--spacing--spacing-8);
    padding: var(--wp--preset--spacing--spacing-24) 0;
    border-top: 1px solid var(--wp--preset--color--border);
    border-bottom: 1px solid var(--wp--preset--color--border);

    .nav-link {
        display: flex;
        align-items: flex-end;
        width: 45%;
        text-decoration: none;
    }

    .nav-inner {
        display: flex;
        flex-direction: column;
        gap: var(--wp--preset--spacing--spacing-0);
    }

    .post-label {
        color: var(--wp--preset--color--muted-foreground);
        font-size: var(--wp--preset--font-size--text-sm);
        margin-bottom: var(--wp--preset--spacing--spacing-16);
    }

    .post-date {
        margin: 0;
        color: var(--wp--preset--color--muted-foreground);
        font-size: var(--wp--preset--font-size--text-sm);
        margin-bottom: var(--wp--preset--spacing--spacing-8);
    }

    .post-title {
        margin: 0;
        font-size: var(--wp--preset--font-size--text-lg);
        font-weight: 500;
        display: -webkit-box;
        margin-bottom: var(--wp--preset--spacing--spacing-8);
        line-clamp: 2;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .post-description {
        margin: 0;
        color: var(--wp--preset--color--muted-foreground);
    }

    .nav-prev::before {
        content: "";
        display: inline-block;
        flex-shrink: 0;
        width: 32px;
        height: 12px;
        margin-bottom: 24px;
        margin-right: var(--wp--preset--spacing--spacing-16);
        vertical-align: middle;
        background-color: currentColor;

        -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='32' height='12' viewBox='0 0 32 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.0001 11H1.00012L14.8463 1' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg width='32' height='12' viewBox='0 0 32 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M31.0001 11H1.00012L14.8463 1' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-size: contain;
    }
    .nav-next::after {
        content: "";
        display: inline-block;
        flex-shrink: 0;
        width: 32px;
        height: 12px;
        margin-bottom: 24px;
        margin-left: var(--wp--preset--spacing--spacing-16);
        vertical-align: middle;
        background-color: currentColor;

        -webkit-mask-image: url("data:image/svg+xml,%3Csvg width='32' height='12' viewBox='0 0 32 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 11H31L17.1538 1' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg width='32' height='12' viewBox='0 0 32 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 11H31L17.1538 1' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-size: contain;
        mask-size: contain;
    }
}
@media (max-width: 781px) {
    .wp-block-my-post-navigation {
        padding: 0;
        flex-direction: column;
        .nav-link {
            width: 100%;
            padding: var(--wp--preset--spacing--spacing-16) 0;
            &+.nav-link {
                border-top: 1px solid var(--wp--preset--color--border);
            }
        }
        .post-label{
            margin-bottom: var(--wp--preset--spacing--spacing-8);
        }
    }
}

/*Safari対応*/
