/* ========================================================= */
/* --- Footer Styles (フッター) --- */
/* ========================================================= */

/* ========================================================= */
/* --- 10. Page: フッター (Footer) --- */
/* ========================================================= */
footer {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 60px 0 20px;
    text-align: center;
    /* 4カラム化に伴い、全体を中央揃えに変更 */
}

/* ★ 4カラムグリッドの定義に変更 ★ */
.footer-grid {
    display: grid;
    /* PCでは4等分 */
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 40px;
    /* メニューリストのテキストを左寄せにする */
    text-align: left;
}

/* フッター各カラムのタイトルスタイル */
.footer-column h3 {
    color: var(--color-white);
    font-size: 1.1rem;
    /* アクセントカラーを用いた下線 */
    border-bottom: 1px solid var(--color-white);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-weight: bold;
    /* タイトルを中央揃えにする */
    text-align: center;
}

/* footer-nav のタイトルは、.footer-column h3 の中央揃えを適用するため、
   text-align: left; の上書きを削除します。 */
/* .footer-nav h3 {
    text-align: left;
} */

/* 病院概要テキスト */
.footer-description {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 15px;
    padding: 0 1em;
}

/* 縦型メニューリスト (診療案内などのリンク) */
.footer-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu-list a {
    color: var(--color-white);
    display: block;
    /* 左右のパディングを調整して、折り返しを防ぐための横幅を広げる */
    padding: 5px 2px;
    font-size: 0.95rem;
    opacity: 0.8;
}

.footer-menu-list a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* 連絡先/アイコン */
.footer-contact p {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 10px;
}

.footer-contact i {
    margin-right: 8px;
    color: var(--color-secondary);
    /* 電話や地図アイコンのカラー */
}

/* 著作権表示 */
.copyright {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
    /* 既存の0.8から0.7に変更（デザインに合わせる） */
    padding-top: 20px;
    /* グリッドとの区切り線 */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-hours-columns,
.footer-contact-columns {
    display: flex;
    flex-direction: column;
    /* align-items: center;  Globalでは指定せず、PC用MQで指定 */
}

/* globalでは削除し、PC用MQで指定 */
/* .footer-contact-columns .contact-tel {
    text-align: left;
}

.footer-contact-columns .contact-address {
    text-align: left;
} */

/* ========================================================= */
/* --- PC表示 (769px以上)での追加スタイル --- */
/* ========================================================= */
@media (min-width: 769px) {

    /* 診療案内 (footer-nav) のメニューを2カラムにする */
    .footer-nav-columns {
        display: grid;
        grid-template-columns: 1fr 1fr;
        /* 2等分 */
        gap: 0px;
        /* 2つのリスト間の隙間 */
    }

    /* 2カラム表示にするため、ulリスト間のデフォルトのマージンを削除 */
    .footer-nav-columns .footer-menu-list {
        margin-bottom: 0;
    }

    /* PC表示での診療時間・連絡先カラム調整 */
    .footer-nav-columns,
    .footer-contact-columns,
    .footer-hours-columns {
        align-items: center;
        /* 中央揃え */
    }

    ul.footer-menu-list-01 {
        text-align: right;
        padding-right: 1em;
    }

    .footer-contact-columns .contact-tel,
    .footer-contact-columns .contact-address {
        text-align: left;
        /* 子要素は左揃え */
        width: fit-content;
        /* コンテンツ幅に合わせる */
    }
}


/* ========================================================= */
/* --- Footer Media Queries (スマホ対応) --- */
/* ========================================================= */

/* 768px以下 (スマホ) */
@media (max-width: 768px) {

    /* Footer */
    footer {
        padding: 40px 0 15px;
    }

    /* フッター各カラムのタイトルスタイルを左寄せにする */
    .footer-column h3 {
        text-align: center;
    }

    span.schedule-detail {
        padding-bottom: 0.6em;
    }

    /* ★ 768px以下では2カラム表示 (病院情報と連絡先) ★ */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px 20px;
        margin-bottom: 30px;
        /* 既存の40pxから30pxに変更 */
    }

    /* 病院情報と連絡先を横幅いっぱい（2カラム分）に広げる */
    .footer-info,
    .footer-contact {
        grid-column: span 2;
    }

    /* 診療案内と診療時間は2カラムで並べる */
    .footer-nav,
    .footer-hours {
        grid-column: span 1;
    }

    /* スマホ表示でもメニューを2カラムにする */
    .footer-nav-columns {
        display: grid;
        grid-template-columns: 1fr 0.8fr;
        gap: 0px;
        /* 適切な隙間を設定 */
        text-align: left;
        /* テキスト左揃え（必要に応じて） */
    }

    /* 2つのリスト間のマージンはgrid gapで調整するため削除
    .footer-nav-columns .footer-menu-list:first-child {
        margin-bottom: 0;
    } */

    /* 2つのリスト間のマージンはgrid gapで調整するため削除 */
    .footer-nav-columns .footer-menu-list-01 {
        /* margin-bottom: 0; */
    }

    .footer-nav-columns .footer-menu-list-02 {
        text-align: left;
    }

    .footer-nav-columns .footer-menu-list-01 li,
    .footer-nav-columns .footer-menu-list-02 li {
        padding: 4px 0;
    }

    /* 既存の最後の要素マージンを上書きして削除 */
    .footer-grid>div:last-child {
        margin-bottom: 0;
    }

    .footer-nav-columns,
    .footer-hours-columns,
    .footer-contact-columns {
        text-align: center;
    }

    /* 画面幅がさらに狭い場合は全て1カラムにする */
    @media (max-width: 550px) {
        .footer-grid {
            grid-template-columns: 1fr;
            gap: 40px;
        }

        /* 診療案内で設定した下部のマージンをリセット ( ulが縦に並ぶため) */
        .footer-nav-columns .footer-menu-list:first-child {
            margin-bottom: 0;
        }

        /* 全てのカラムが1カラム分を占有するようにリセット */
        .footer-info,
        .footer-contact,
        .footer-nav,
        .footer-hours {
            grid-column: span 1;
        }
    }
}

/* ========================================================= */
/* --- Page Top Button --- */
/* ========================================================= */
.page-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--color-primary);
    color: #fff;
    width: 60px;
    height: 60px;
    text-decoration: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-top.is-active {
    opacity: 1;
    visibility: visible;
}

.page-top:hover {
    background: var(--color-secondary);
    transform: translateY(-5px);
    text-decoration: none;
    color: #fff;
}

/* モバイル調整 */
@media (max-width: 768px) {
    .page-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 0.8rem;
    }
}