@charset "utf-8";

:root {
    --index-content: 1.4;
}

.entry-content {
    > section {
        padding-block: calc((3rem + 1rem) * var(--index-content));

        &.has-bg {
            padding-bottom: calc((3rem + 2rem) * var(--index-content));
        }

        &:has(+ .has-bg) {
            padding-bottom: calc(5rem * var(--index-content));
        }

        &.has-bg + section {
            padding-top: calc((4.5rem + 0.5em) * var(--index-content));
        }
    }
}

h2:not([class]) {
    padding-bottom: 1em;
    letter-spacing: 1em;
    text-indent: 1em;
    text-align: center;
}

/* -------------------------------------------- */
/* メインビジュアル */
/* -------------------------------------------- */

.type-page .entry-content .has-bg.main-visual {
    background: url("../images/mv-cosmos.webp") no-repeat center center / cover;
    > .mv-message {
        position: relative;
        display: grid;
        grid-template-rows: 1fr auto 2fr;
        align-items: center;
        height: auto;
        min-height: 34vw;

        @media screen and (min-width: 500px) {
            aspect-ratio: 1260 / 454;
            height: auto;
            min-height: 0;
        }
        @media screen and (min-width: 768px) {
            padding-inline: 2em;
        }

        > p {
            container-type: inline-size;
            grid-row: 1 / 4;
            padding-inline: 0.5em;
            font-family: var(--ff-serif);
            font-feature-settings: "palt";
            font-weight: 700;
            font-size: clamp(var(--fz-h5), 3.8cqi, var(--fz-h3));
            line-height: var(--lh-tight);
            color: var(--bg);
            text-shadow:
                0.05em 0.05em 0px rgba(var(--txt-rgb), 0.8),
                0px 0px 8px rgba(var(--bg-rgb), 0.5);

            > span:nth-child(1) {
                display: block;
                margin-bottom: 0.5em;
                font-size: 150%;
            }
            > span:nth-child(2) {
                display: block;
                transform: translateX(-0.6em);
            }

            @media screen and (min-width: 500px) {
                grid-row: 2 / 3;
                padding-inline: 1em;
            }
            @media screen and (min-width: 768px) {
                padding-inline: 2em;
            }
        }
    }
}

/* -------------------------------------------- */
/* 新着情報 */
/* -------------------------------------------- */

.top-information {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;

    h2.top-info-title {
        font-family: var(--ff-serif);
        font-feature-settings: "palt";
        font-size: calc(var(--fz-base) * 2.5);
        font-weight: 700;
    }

    h3 {
        width: 100%;
        text-align: center;
        transform: translateY(2.5rem);

        img {
            display: inline-block;
            width: 100%;
            max-width: 350px;
            height: auto;
            vertical-align: bottom;
        }
    }

    > section {
        .card-link {
            display: flex;
            flex-direction: column;
            align-items: center;
            height: 100%;
            padding: 1rem;
            text-decoration: none;
            color: var(--txt);
            background: var(--bg);
            border-radius: var(--radius-m);

            &.no-link {
                justify-content: center;
                text-align: center;
                font-weight: var(--ff-base-b);
                color: color-mix(in srgb, var(--txt), var(--bg) 70%);
                background: rgba(var(--bg-rgb), 0.6);
            }

            .card-body {
                width: 100%;
                max-width: 300px;
                padding-inline: 0.5em;
                text-align: left;

                .card-date {
                    font-size: 85%;
                    font-weight: var(--ff-base-b);
                    letter-spacing: 0.1em;
                    color: color-mix(in srgb, var(--txt), var(--bg) 70%);
                }
            }

            .card-thumbnail {
                width: 100%;
                max-width: 300px;
                aspect-ratio: 3 / 2;
                flex-shrink: 0;

                img {
                    width: 100%;
                    height: 100%;
                    object-fit: cover;
                    border-radius: var(--radius-m);
                }
            }
        }
    }

    @media screen and (min-width: 500px) {
        > section {
            .card-link {
                flex-direction: row;
                align-items: flex-start;
                gap: 1.2em;

                .card-body {
                    max-width: none;
                }

                .card-thumbnail {
                    width: 38%;
                    max-width: none;
                }
            }
        }
    }

    @media screen and (min-width: 768px) {
        grid-template-columns: 1fr 2vw 1fr 4vw 1fr;
        gap: 0;

        h2.top-info-title {
            grid-area: 1 / 1 / 2 / 4;
            transform: translateY(-0.8em);
        }

        h3 {
            grid-area: 1 / 5 / 2 / 6;
            transform: none;
        }

        > section {
            &:nth-child(2) {
                grid-area: 2 / 1 / 3 / 2;
            }
            &:nth-child(3) {
                grid-area: 2 / 3 / 3 / 4;
            }
            &:nth-child(5) {
                grid-area: 2 / 5 / 3 / 6;
            }

            .card-link {
                flex-direction: column;
                align-items: center;
                gap: 1em;

                .card-thumbnail {
                    width: 100%;
                }
            }
        }
    }
    @media screen and (min-width: 1024px) {
        grid-template-columns: 1fr 3vw 1fr 6vw 1fr;
    }
    @media screen and (min-width: 1400px) {
        grid-template-columns: 1fr 70px 1fr 140px 1fr;
    }
}

/* -------------------------------------------- */
/* 法人紹介 */
/* -------------------------------------------- */

.about-org {
    > div {
        position: relative;
        display: grid;
        grid-template-columns: 1fr;
        align-items: center;
        gap: 2.5rem 0;
        width: 100%;

        > div {
            .about-org-h {
                container-type: inline-size;
                padding-bottom: 1.5rem;
                font-size: clamp(var(--fz-h4), 7cqi, var(--fz-h3));
                font-weight: 800;
                color: var(--pri-d);
                span {
                    font-size: 70%;
                    color: var(--txt);
                }
            }
        }
        > img {
            width: 100%;
            aspect-ratio: 3 / 2;
            border-radius: var(--radius-m);
            object-fit: cover;
            object-position: center top;
        }

        @media screen and (min-width: 768px) {
            grid-template-columns: 1fr 4fr 1fr;
            > img {
                grid-area: 1 / 1 / 2 / 3;
            }
            > div {
                grid-area: 2 / 2 / 3 / 4;
            }
        }
        @media screen and (min-width: 1024px) {
            grid-template-columns: 533fr 70fr 657fr;
            > img {
                grid-area: 1 / 1 / 2 / 2;
            }
            > div {
                grid-area: 1 / 3 / 2 / 4;
            }
        }
    }
}

/* -------------------------------------------- */
/* 事業/目的 */
/* -------------------------------------------- */

ol.w-mid {
    font-size: var(--fz-base);

    @media screen and (min-width: 768px) {
        font-size: clamp(calc(var(--fz-base) * 1.2), calc(1rem + 0.3vw), calc(var(--fz-base) * 1.5));
    }

    @media screen and (min-width: 1400px) {
        font-size: calc(var(--fz-base) * 1.5);
    }
}

.bg-flower {
    position: relative;
    &::before {
        position: absolute;
        top: 2rem;
        right: -8vw;
        display: block;
        content: "";
        aspect-ratio: 430 / 470;
        width: 30vw;
        min-width: 160px;
        max-width: 380px;
        background: url("../images/cosmos.png") no-repeat center center / contain;
        z-index: -1;
    }
}

/* -------------------------------------------- */
/* 組織 */
/* -------------------------------------------- */

.organization {
    ul {
        container-type: inline-size;
        display: grid;
        grid-template-columns: repeat(2, minmax(auto, 280px));
        align-items: start;
        justify-content: center;
        gap: 3.1cqi;

        @media screen and (min-width: 1200px) {
            grid-template-columns: repeat(4, minmax(auto, 280px));
        }

        > li {
            container-type: inline-size;
            width: 100%;
            height: 100%;
            min-height: 39vw;
            padding-inline: 6cqi;
            border-radius: var(--radius-l);
            background: var(--bg);

            @media screen and (min-width: 500px) {
                aspect-ratio: 280 / 240;
                height: auto;
                min-height: 0;
            }
            @media screen and (min-width: 1200px) {
                aspect-ratio: 280 / 240;
                padding-inline: 3cqi;
            }
            @media screen and (min-width: 1400px) {
                padding-inline: 3.6cqi;
            }

            h3 {
                container-type: inline-size;
                padding-block: 1em 0.6em;
                font-size: clamp(var(--fz-h5), 18cqi, var(--fz-h3));
                font-weight: 700;
                text-align: center;

                @media screen and (min-width: 500px) {
                    padding-block: 1.3em 1em;
                }
            }
            p {
                padding-bottom: 0.5em;
                line-height: var(--lh-base);
                text-align: justify;
                text-justify: inter-ideograph;
            }

            &:nth-child(n + 3):nth-child(-n + 4) {
                p {
                    font-size: 150%;
                    text-align: center;
                }
            }
        }
    }
}
