/* ========================================
   内部ページ（お知らせ以外の下層コンテンツページ）共通スタイル
   index.html の雰囲気（明るい・じゅくチュー・ブランドカラー）を
   読み物ページ向けに再構成したもの。
   ======================================== */

body:has(.page-hero) {
    background-color: var(--backgroundColor);
}

/* ---- ヘッダー（内部ページはスクロール追従の固定ナビ） ---- */
nav.header {
    position: sticky;
    top: 0;
    left: 0;
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    background-color: #ffffffe6;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: .5rem 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);

    & img {
        width: auto;
        height: 56px;
    }

    & .navigation {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: .5rem 1rem;
        list-style: none;
        margin: 0;

        & li {
            line-height: 2rem;
            text-align: center;
            border-radius: .5rem;
            transition: .3s;

            & a {
                color: var(--symbol-red);
                display: block;
                text-decoration: none;
                font-size: clamp(.75rem, 1.6vw, .95rem);
                white-space: nowrap;
            }

            &:hover a {
                color: var(--school-image-color);
                font-weight: bold;
            }
        }
    }
}

/* ---- ページヒーロー（タイトルバナー） ---- */
.page-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    /* 100dvw は縦スクロールバーの幅を含むので、PC で横スクロールが出ていた（2026-12-03） */
    width: 100%;
    min-height: 34vh;
    padding: 3rem 1.5rem 4rem;
    overflow: hidden;
    text-align: center;
    background: linear-gradient(120deg, var(--symbol-yellow) 0%, var(--symbol-orange) 45%, var(--jukuchu-pink) 100%);

    & .page-hero-photo {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 0;
        opacity: .55;
        /* ↑ 下のグラデーションが透けて見える濃さ。文字の可読性優先なら数値を下げる */
        filter: blur(1.5px) saturate(1.15);
        /* ↑ 写真の解像度が高くないため、わずかにぼかして粗を目立たなくしつつ彩度を補正 */
        animation: page-hero-ken-burns 14s linear infinite alternate;
    }

    /* 写真を敷く場合はブランドカラーのグラデーションを少し濃いめの色被せに切り替える */
    &.has-photo {
        background: linear-gradient(120deg, rgba(255, 216, 20, .75) 0%, rgba(255, 172, 75, .75) 45%, rgba(237, 133, 153, .8) 100%);
    }

    & h1 {
        position: relative;
        z-index: 1;
        margin: 0;
        color: #fff;
        font-weight: 700;
        font-size: clamp(1.6rem, 4vw, 2.6rem);
        text-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    }

    & .page-hero-sub {
        position: relative;
        z-index: 1;
        color: #ffffffe6;
        letter-spacing: .16em;
        font-size: clamp(.75rem, 1.6vw, .95rem);
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    }

    & .page-hero-mascot {
        position: absolute;
        z-index: 1;
        right: clamp(.5rem, 4vw, 3rem);
        bottom: 1rem;
        width: clamp(70px, 12vw, 130px);
        height: auto;
        animation: jukuchu-bounce 2.2s ease-in-out infinite;
    }

    /* ヒーローの下端をふわっと波打たせて本文へ繋げる */
    &::after {
        content: '';
        position: absolute;
        z-index: 1;
        left: 0;
        right: 0;
        bottom: -1px;
        height: 3rem;
        background: var(--backgroundColor);
        border-radius: 50% 50% 0 0 / 100% 100% 0 0;
        transform: scaleX(1.2);
    }
}

/* #loading の裏で再生が終わって静止して見えないよう、
   読み込み完了（<html class="is-loaded">）まではズームを一時停止しておく */
html:not(.is-loaded) .page-hero .page-hero-photo {
    animation-play-state: paused !important;
}

@keyframes page-hero-ken-burns {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.18) translate(-1.5%, -1.5%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .page-hero .page-hero-photo {
        animation: none;
    }
}

/* ---- パンくず・戻るリンク ---- */
.page-breadcrumb {
    display: flex;
    justify-content: center;
    margin: 1.5rem auto 0;

    & a {
        display: inline-flex;
        align-items: center;
        gap: .35rem;
        padding: .4rem 1.1rem;
        border-radius: 9999px;
        background-color: #fff;
        color: var(--school-image-color);
        font-size: .8rem;
        font-weight: bold;
        text-decoration: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
        transition: transform .2s, box-shadow .2s;

        &:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
        }
    }
}

/* ---- 本文コンテンツ ---- */
.page-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.25rem 5rem;

    & .content-card {
        background-color: #fff;
        border-radius: 1.25rem;
        padding: clamp(1.25rem, 4vw, 2.5rem);
        margin-bottom: 2rem;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);

        & h2 {
            display: inline-flex;
            align-items: center;
            gap: .6rem;
            margin: 0 0 1.25rem;
            padding-bottom: .6rem;
            font-size: clamp(1.15rem, 2.6vw, 1.5rem);
            color: var(--school-image-color);
            border-bottom: 3px solid var(--symbol-yellow);

            &::before {
                content: '';
                display: inline-block;
                width: .55rem;
                height: .55rem;
                border-radius: 50%;
                background: var(--jukuchu-pink);
            }
        }

        & p {
            line-height: 2;
            margin-bottom: 1.1rem;
            color: #333;
        }

        & p:last-of-type {
            margin-bottom: 0;
        }

        & .signature {
            margin-top: 1.5rem;
            padding-top: 1rem;
            border-top: 1px dashed var(--backgroundColor-dark);
            font-weight: bold;
            line-height: 1.8;
            color: var(--school-image-color);
        }

        & .signature small {
            display: block;
            font-weight: normal;
            color: #777;
            margin-bottom: .5rem;
        }

        & strong {
            color: var(--symbol-orange);
        }

        /* 顔写真付きの署名（理事長・創立者など） */
        & .person-signature {
            display: flex;
            align-items: center;
            gap: 1.25rem;
            margin-top: 1.5rem;
            padding-top: 1.25rem;
            border-top: 1px dashed var(--backgroundColor-dark);

            & img {
                flex: none;
                width: clamp(64px, 12vw, 84px);
                height: clamp(64px, 12vw, 84px);
                border-radius: 50%;
                object-fit: cover;
                box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--symbol-yellow);
            }

            & .signature {
                margin: 0;
                padding: 0;
                border-top: none;
            }
        }

        /* リード文（強調イントロ） */
        & .lead-text {
            font-weight: bold;
            font-size: clamp(1rem, 2.2vw, 1.1rem);
            color: var(--symbol-blue);
        }

        /* カード内の中見出し */
        & h3 {
            display: flex;
            align-items: center;
            gap: .5rem;
            margin: 2rem 0 1.1rem;
            font-size: clamp(1rem, 2.2vw, 1.2rem);
            color: var(--symbol-blue);

            &::before {
                content: '';
                width: 1.1rem;
                height: 1.1rem;
                background: var(--symbol-yellow);
                border-radius: .35rem;
                transform: rotate(45deg);
                flex: none;
            }
        }

        /* 区切り線 */
        & .section-divider {
            border: none;
            height: 3px;
            margin: 2rem 0;
            background: linear-gradient(90deg, var(--symbol-yellow), var(--symbol-orange), var(--jukuchu-pink));
            border-radius: 9999px;
            opacity: .5;
        }

        /* 画像 + テキストの横並びブロック */
        & .media-row {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 1.5rem;
            margin-bottom: 1.25rem;

            & .media-figure {
                flex: 1 1 260px;
                margin: 0;

                & img {
                    display: block;
                    width: 100%;
                    height: auto;
                    border-radius: 1rem;
                    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
                }

                & figcaption {
                    margin-top: .5rem;
                    text-align: center;
                    font-size: .8rem;
                    color: #777;
                }

                &.is-logo img {
                    padding: 1rem;
                    background: #fff;
                    border: 1px solid var(--backgroundColor-dark);
                    object-fit: contain;
                }
            }

            & .media-text {
                flex: 2 1 320px;

                & p {
                    margin-bottom: 0;
                }
            }

            &.reverse {
                flex-direction: row-reverse;
            }
        }

        /* 画像フルワイド表示 */
        & .full-image {
            margin: 1.5rem 0;

            & img {
                display: block;
                width: 100%;
                height: auto;
                border-radius: 1rem;
                box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
            }
        }

        /* 写真グリッド（活用例など） */
        & .photo-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: .75rem;
            margin-bottom: 1.5rem;

            & img {
                width: 100%;
                height: 100%;
                aspect-ratio: 4 / 3;
                object-fit: cover;
                border-radius: .75rem;
                box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
                cursor: pointer;
                transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s;

                &:hover {
                    transform: translateY(-4px) scale(1.03);
                    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.16);
                }
            }
        }

        /* 証明書名などのバッジ一覧 */
        & .tag-list {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: .6rem;
            margin: 1.25rem 0;
            padding: 0;
            list-style: none;

            & li {
                padding: .5rem 1.2rem;
                border-radius: 9999px;
                background: var(--backgroundColor);
                color: var(--school-image-color);
                font-weight: bold;
                font-size: clamp(.85rem, 2vw, 1rem);
                border: 2px solid var(--symbol-yellow);
                transition: transform .3s cubic-bezier(.34, 1.56, .64, 1), background .3s, color .3s;

                &:hover {
                    transform: translateY(-3px) scale(1.05);
                    background: var(--symbol-yellow);
                    color: #fff;
                }
            }
        }

        /* 注意書き・重要事項の囲み */
        & .note-box {
            margin: 1.25rem 0;
            padding: 1.1rem 1.35rem;
            border-radius: 1rem;
            background: color-mix(in srgb, var(--symbol-yellow) 12%, #fff);
            border-left: 5px solid var(--symbol-yellow);

            & b, & strong {
                display: block;
                margin-bottom: .5rem;
                color: var(--school-image-color);
            }

            & p {
                margin-bottom: 0;
            }
        }

        /* 外部リンク・PDF等のボタン（<a> にも <button> にも使う） */
        & .link-button {
            display: inline-flex;
            align-items: center;
            gap: .4rem;
            margin: .5rem 0 1rem;
            padding: .65rem 1.4rem;
            border: none;
            border-radius: 9999px;
            background: linear-gradient(120deg, var(--symbol-orange), var(--jukuchu-pink));
            color: #fff;
            font-family: inherit;
            font-size: 1rem;
            font-weight: bold;
            text-decoration: none;
            cursor: pointer;
            box-shadow: 0 4px 14px rgba(255, 113, 113, .35);
            transition: transform .2s, box-shadow .2s;

            &:hover {
                transform: translateY(-2px);
                box-shadow: 0 6px 18px rgba(255, 113, 113, .45);
            }
        }

        & .text-center {
            text-align: center;
        }

        & .text-right {
            text-align: right;
        }

        /* 募集要項・振込先などの表 */
        & .info-table {
            width: 100%;
            margin: 1.25rem 0;
            border-collapse: collapse;

            & th,
            & td {
                padding: .85rem 1.1rem;
                border: 1px solid var(--backgroundColor-dark);
                text-align: left;
                line-height: 1.7;
            }

            & th {
                width: 9rem;
                background: var(--backgroundColor);
                color: var(--school-image-color);
                font-weight: bold;
                white-space: nowrap;
            }

            & td {
                background: #fff;

                &.center {
                    text-align: center;
                }

                & p {
                    margin: 0;
                    line-height: 1.7;
                }

                & p+p {
                    margin-top: .3rem;
                    font-size: .8rem;
                    color: #777;
                }
            }

            @media screen and (max-width: 600px) {
                & tr {
                    display: grid;
                }

                & th {
                    width: auto;
                    text-align: center;
                }
            }
        }

        /* 控除額などの計算式表示 */
        & .calc-row {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            align-items: center;
            gap: .5rem;
            margin: 1.5rem 0;
            font-weight: bold;

            & .box {
                display: flex;
                align-items: center;
                padding: .5rem .9rem;
                border-radius: .6rem;
                background: var(--symbol-blue);
                color: #fff;
                font-size: .9rem;
                text-align: center;
            }

            & .op {
                color: var(--school-image-color);
                font-size: 1.1rem;
            }

            & .fraction {
                display: flex;
                flex-direction: column;
                align-items: center;
                padding: .35rem .9rem;
                border-radius: .6rem;
                background: var(--symbol-blue);
                color: #fff;
                font-size: .9rem;

                & span {
                    padding: 0 .2rem;
                }

                & span:first-child {
                    border-bottom: 1px solid #fff;
                }
            }

            @media screen and (max-width: 600px) {
                gap: .3rem;

                & .box,
                & .fraction {
                    padding: .35rem .5rem;
                    font-size: .75rem;
                }
            }
        }

        /* 画像を拡大表示するライトボックスのトリガー */
        & .lightbox-trigger {
            display: block;
            margin: 1.5rem auto;
            padding: 0;
            border: none;
            background: none;
            cursor: pointer;
            max-width: 320px;

            & img {
                width: 100%;
                display: block;
                border-radius: 1rem;
                box-shadow: 0 6px 18px rgba(0, 0, 0, .12);
                transition: transform .3s cubic-bezier(.16, 1, .3, 1);
            }

            &:hover img {
                transform: translateY(-4px) scale(1.02);
            }
        }

        /* 入試日程・募集要項PDFなどの一覧 */
        & .schedule-list {
            display: flex;
            flex-direction: column;
            gap: 1rem;
            margin: 1.25rem 0;
            padding: 0;
            list-style: none;

            & .schedule-item {
                padding: 1.1rem 1.4rem;
                border-radius: 1rem;
                background: var(--backgroundColor);
                border-left: 5px solid var(--symbol-yellow);

                & h3 {
                    margin: 0 0 .4rem;
                }

                & .schedule-date {
                    font-weight: bold;
                    color: var(--symbol-orange);
                    margin-bottom: .5rem;
                }

                & .schedule-links {
                    display: flex;
                    flex-wrap: wrap;
                    gap: .4rem 1.2rem;

                    & a {
                        color: var(--symbol-blue);
                        font-weight: bold;
                        text-decoration: underline;
                        text-underline-offset: .2em;

                        &:hover {
                            color: var(--school-image-color);
                        }
                    }
                }

                & p {
                    margin: .4rem 0 0;
                    font-size: .85rem;
                    color: #777;
                }
            }
        }

        /* 連絡先など2カラムの案内ブロック */
        & .contact-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1rem;
            margin: 1.25rem 0;

            & .contact-block {
                padding: 1.25rem 1.5rem;
                border-radius: 1rem;
                background: var(--backgroundColor);
                text-align: center;

                & h3 {
                    margin: 0 0 .6rem;
                    justify-content: center;

                    &::before {
                        display: none;
                    }
                }

                & p {
                    margin: 0;
                    line-height: 1.9;
                }
            }
        }

        /* Google マップなどの埋め込み（レスポンシブ） */
        & .map-embed {
            position: relative;
            width: 100%;
            aspect-ratio: 16 / 10;
            margin: 1.25rem 0;
            border-radius: 1rem;
            overflow: hidden;
            box-shadow: 0 6px 18px rgba(0, 0, 0, .08);

            & iframe {
                position: absolute;
                inset: 0;
                width: 100%;
                height: 100%;
                border: 0;
            }
        }

        /* カード内に収める図版（.full-image はブレイクアウト用なので別途カード幅版） */
        & .inline-image {
            margin: 1.5rem 0;

            & img {
                display: block;
                width: 100%;
                height: auto;
                border-radius: 1rem;
                box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
            }

            & figcaption {
                margin-top: .5rem;
                text-align: center;
                font-size: .8rem;
                color: #777;
            }
        }

        /* ● 付き箇条書きなどの汎用リスト */
        & .bullet-list {
            margin: 1rem 0;
            padding: 0;
            list-style: none;

            & li {
                position: relative;
                padding-left: 1.4rem;
                line-height: 1.9;
                margin-bottom: .4rem;

                &::before {
                    content: '●';
                    position: absolute;
                    left: 0;
                    color: var(--jukuchu-pink);
                    font-size: .7em;
                    top: .5em;
                }
            }
        }

        /* キャプション付き写真ギャラリー（施設紹介など） */
        & .gallery-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.25rem;
            margin: 1.5rem 0;

            & figure {
                margin: 0;

                & img {
                    width: 100%;
                    aspect-ratio: 4 / 3;
                    object-fit: cover;
                    border-radius: 1rem;
                    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
                    transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s;

                    &:hover {
                        transform: translateY(-4px) scale(1.03);
                        box-shadow: 0 12px 26px rgba(0, 0, 0, .16);
                    }
                }

                & figcaption {
                    margin-top: .5rem;
                    text-align: center;
                    font-size: .85rem;
                    color: #555;
                }
            }
        }

        /* 大きめの丸バッジ + 説明文（防災対策など） */
        & .stat-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1.5rem;
            margin: 1.5rem 0;

            & .stat-item {
                text-align: center;

                & .stat-circle {
                    width: 110px;
                    height: 110px;
                    margin: 0 auto .9rem;
                    border-radius: 50%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    padding: .5rem;
                    background: linear-gradient(135deg, var(--symbol-yellow), var(--symbol-orange));
                    color: #fff;
                    font-weight: 800;
                    font-size: 1.05rem;
                    box-shadow: 0 10px 22px rgba(255, 172, 75, .35);
                }

                & p {
                    margin: 0;
                    line-height: 1.85;
                }
            }
        }

        /* 卒業生の声などの体験談カード */
        & .testimonial {
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            margin-bottom: 1.5rem;

            & img {
                width: 130px;
                height: 130px;
                border-radius: 50%;
                object-fit: cover;
                box-shadow: 0 0 0 4px #fff, 0 8px 20px rgba(0, 0, 0, .12);
                margin-bottom: .75rem;
            }

            & .grad-info {
                font-size: .8rem;
                color: #777;
            }

            & .grad-name {
                font-weight: bold;
                font-size: 1.1rem;
                color: var(--school-image-color);
                margin: .15rem 0 .75rem;
            }

            & .quote {
                font-weight: bold;
                font-size: clamp(1rem, 2.4vw, 1.2rem);
                color: var(--symbol-blue);
                margin-bottom: 1rem;
                max-width: 640px;
            }

            & .testimonial-body {
                text-align: left;
                line-height: 2;
                max-width: 100%;
            }
        }

        /* メリット紹介などの色付きカード列 */
        & .merit-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1rem;
            margin: 1.5rem 0;

            & .merit-item {
                background: var(--symbol-blue);
                color: #fff;
                padding: 1.4rem 1.6rem;
                border-radius: 1rem;
                line-height: 1.8;
                text-align: center;
            }
        }

        /* 費用一覧（入学金・授業料・寮費など） */
        & .fee-list {
            display: flex;
            flex-direction: column;
            gap: .6rem;
            margin: 1.25rem 0;

            & .fee-row {
                display: flex;
                flex-wrap: wrap;
                justify-content: space-between;
                align-items: center;
                gap: .5rem 1rem;
                padding: .85rem 1.25rem;
                border-radius: .75rem;
                background: var(--symbol-blue);
                color: #fff;
                font-weight: bold;

                & .label small {
                    display: block;
                    font-weight: normal;
                    opacity: .85;
                    font-size: .75rem;
                }

                & .amount {
                    font-size: 1.15rem;
                    white-space: nowrap;
                }

                &.total {
                    background: var(--school-image-color);
                }
            }
        }
    }
}

/* ---- 関連ページ（本文カードの外・フッター直前に置く導線） ---- */
.related-pages {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;

    & h2 {
        text-align: center;
        font-size: clamp(1.05rem, 2.4vw, 1.3rem);
        color: var(--school-image-color);
        margin-bottom: 1.5rem;

        &::before {
            content: '関連ページ　';
            display: block;
            font-size: .7rem;
            letter-spacing: .2em;
            color: var(--symbol-orange);
            font-weight: bold;
            margin-bottom: .35rem;
        }
    }

    & .related-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 1.25rem;
    }

    & .related-card {
        display: flex;
        flex-direction: column;
        gap: .5rem;
        background: #fff;
        border-radius: 1.25rem;
        padding: 1.4rem 1.6rem;
        text-decoration: none;
        color: inherit;
        box-shadow: 0 6px 20px rgba(0, 0, 0, .06);
        transition: transform .3s cubic-bezier(.16, 1, .3, 1), box-shadow .3s;

        &:hover {
            transform: translateY(-6px);
            box-shadow: 0 14px 30px rgba(0, 0, 0, .12);

            & .related-arrow {
                transform: translateX(4px);
            }
        }

        & .related-tag {
            align-self: flex-start;
            padding: .25rem .75rem;
            border-radius: 9999px;
            background: var(--backgroundColor);
            color: var(--school-image-color);
            font-size: .72rem;
            font-weight: bold;
        }

        & .related-title {
            font-weight: bold;
            font-size: 1.02rem;
            color: var(--school-image-color);
        }

        & .related-desc {
            font-size: .82rem;
            line-height: 1.7;
            color: #666;
            flex: 1;
        }

        & .related-arrow {
            align-self: flex-end;
            color: var(--symbol-orange);
            font-weight: bold;
            transition: transform .3s cubic-bezier(.16, 1, .3, 1);
        }
    }
}

/* ---- ライトボックス（main_js/lightbox.js が開閉する共通 dialog） ---- */
#lightbox-dialog {
    & .lightbox-body img {
        display: block;
        width: 100%;
        border-radius: .5rem;
    }
}

@media screen and (max-width: 600px) {
    nav.header {
        padding: .5rem .75rem;

        & img {
            height: 42px;
        }

        & .navigation {
            justify-content: center;
        }
    }

    .page-hero {
        min-height: 28vh;
        padding: 2.25rem 1rem 3rem;
    }
}
