/* CSS変数 */
:root {
    --theme-color: rgb(178, 34, 34);
    --bg-light-blue: #f0f2f5;    
}

body {
    font-family: 'Noto Sans JP', sans-serif;
}

/* スムーズスクロールを全体に適用 */
html {
    scroll-behavior: smooth;
    /* 別の方法：最近のブラウザではこちら1行でも動作します */
    scroll-padding-top: 60px; 
}
/* スマホ版ではナビバーが高くなることがあるため、余白を広めに調整 */
@media (max-width: 991px) {
    html {
        scroll-padding-top: 230px; /* スマホ版のナビバーの高さ＋α */
    }
}

/* アニメーション：初期状態（透明で少し下に配置） */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
/* アニメーション：実行状態（不透明で元の位置へ） */
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* 標準の bg-light クラスを上書き */
.bg-light {
    background-color: var(--bg-light-blue) !important;
}
/* カスタムカラーの設定 */
.custom-navbar {
    background-color: var(--theme-color) !important; /* 指定のRGB色 */
}

/* 緊急お知らせエリアのリンク色調整 */
.bg-warning-subtle a {
    color: #0d6efd;
    text-decoration: underline;
}
.bg-warning-subtle a:hover {
    color: #0a58ca;
}

/* モバイルで文字が詰まらないように調整 */
@media (max-width: 768px) {
    .bg-warning-subtle {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* カルーセルの高さ設定と背景画像の調整 */
.carousel-item {
    height: 75vh; /* 画面高さの70%に設定（調整可能） */
    min-height: 400px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 文字に影をつけて読みやすくする */
.shadow-text {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
}

/* カルーセルのキャプション位置を中央に調整 */
.carousel-caption {
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.2); /* 全体に薄く敷くことで文字をより際立たせる */
    padding: 20px;
}

/* カルーセル内の文字のレスポンシブ対応（スマホで文字を小さく） */
@media (max-width: 768px) {
    .display-3 { font-size: 2.5rem; }
    .display-4 { font-size: 2rem; }
}
/* カルーセル再生・停止ボタンの配置 */
#carouselToggle {
    position: absolute;
    bottom: 25px;
    right: 80px; /* 矢印ボタンと重ならない位置 */
    z-index: 15;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    transition: all 0.3s ease;
}
#carouselToggle:hover {
    background-color: #fff;
    transform: scale(1.1);
}
@media (max-width: 768px) {
    #carouselToggle {
        bottom: 15px;
        right: 60px;
    }
}

/* 感謝動画 */
.whats-container {
    position: relative;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    pointer-events: none; /* リンクのクリックを邪魔しない */
}

/* 画像にマウスを乗せたときのアニメーション */
.hover-zoom:hover .play-overlay {
    color: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}
/* 感謝動画画像の角丸補完 */
.kansyamovie-images img {
    display: block;
}

/* 映画プロジェクト */
/* ベースのレイアウト：PC版 */
.eigapro-images {
    display: flex;
    justify-content: center;
    align-items: center; /* 高さを揃える（中央揃え） */
    gap: 20px;
}

.eigapro-images img {
    max-width: 32%;
    height: auto;
    object-fit: cover; /* 画像の歪みを防ぐ */
    border-radius: 8px; /* わずかに角を丸くして現代的に */
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* 中央画像のみ特定の最小幅を指定 */
.eigapro-images .eigapro-c {
    min-width: 571px; /* ご提示の数値を維持 */
    max-width: 50%;   /* 親要素からはみ出さないよう調整 */
}

/* 950px以下のレスポンシブ設定 */
@media screen and (max-width: 950px) {
    .eigapro-images {
        flex-wrap: wrap;
        gap: 10px;
    }

    /* 中央画像を上部に100%幅で配置 */
    .eigapro-images .eigapro-c {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        order: 1;
    }

    /* 左画像を下に配置（50%） */
    .eigapro-images .eigapro-l {
        width: calc(50% - 5px);
        max-width: calc(50% - 5px);
        order: 2;
    }

    /* 右画像を下に配置（50%） */
    .eigapro-images .eigapro-r {
        width: calc(50% - 5px);
        max-width: calc(50% - 5px);
        order: 3;
    }
}

/* ボタンのホバーアニメーション */
.hover-scale {
    transition: all 0.3s ease;
}
.hover-scale:hover {
    transform: scale(1.05);
    background-color: #f8f9fa;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3) !important;
}

/* 画像が重なる背景の暗さ調整 */
.bg-dark {
    background-color: #1a1a1a !important;
}

/* 背景画像の高さ維持 */
.object-fit-cover {
    object-fit: cover;
}

/* 画像の高さ統一とホバーエフェクト */
.item-image-wrapper {
    aspect-ratio: 4 / 3; /* 画像を4:3の比率で統一 */
    overflow: hidden;
    background-color: #f8f9fa;
}

.item-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像の歪みを防ぐ */
    transition: transform 0.5s ease;
}

.item-card:hover .item-image-wrapper img {
    transform: scale(1.1); /* マウスホバーで拡大 */
}

.item-card:hover .card {
    box-shadow: 0 10px 20px rgba(0,0,0,0.15) !important;
}

.card-title {
    font-size: 1rem;
    transition: color 0.3s ease;
}

.item-card:hover .card-title {
    color: var(--theme-color) !important; /* 町のカラーに変更 */
}

.border-theme {
border-color: var(--theme-color) !important; 
}

/* サイトリンクバナーの調整 */
.link-banner {
    display: inline-block;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    height: 40px; /* バナーの高さを揃える */
}

.link-banner img {
    height: 100%;
    width: auto;
    display: block;
}

.link-banner:hover {
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    border-color: #adb5bd;
    transform: translateY(-2px);
}

/* アコーディオンのボタンデザイン調整 */
.accordion-button:not(.collapsed) {
    background-color: var(--bg-light-blue);
    color: var(--theme-color);
    box-shadow: none;
}

.accordion-button::after {
    background-size: 1.25rem;
}

/* スマホ版でのみアコーディオンとして機能させ、PC版では常に表示するためのクラス指定 */
@media (min-width: 768px) {
    .accordion-collapse.collapse {
        display: block !important;
        height: auto !important;
    }
}

.item-description b {
    color: var(--theme-color); /* 強調テキストに町のカラーを使用 */
}

/* 寄付の使い道セクションのスタイル */
.usage-card {
    border: none;
    border-top: 4px solid var(--theme-color); /* 町のカラーをアクセントに */
    transition: all 0.3s ease;
    height: 100%;
}
.usage-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}
.usage-icon {
    font-size: 2.5rem;
    color: var(--theme-color);
    margin-bottom: 1rem;
}
.usage-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.8rem;
    color: #333;
}
.usage-text {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
}

/* 寄付者コメントタイル形式 */
.comment-tile {
    transition: all 0.3s ease;
    border-radius: 12px !important;
    border: 1px solid rgba(0,0,0,0.05) !important;
}

.comment-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.1) !important;
    background-color: #fff !important;
    border-color: var(--theme-color) !important;
}

#loadMoreBtn {
    transition: all 0.2s ease;
    font-weight: bold;
}

/* フェードインアニメーション */
.fade-in-up {
    animation: fadeInUp 0.5s ease forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* お知らせ・ガイドセクションのスタイル */
.guide-step-number {
    display: inline-block;
    width: 35px;
    height: 35px;
    background-color: var(--theme-color);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 35px;
    font-weight: bold;
    margin-right: 10px;
}
.guide-card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
}
/* ポータルサイトロゴのコンテナ */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    align-items: center;
}
.portal-item {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 8px;
    background: #fff;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
}
.portal-item:hover {
    border-color: var(--theme-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}
.portal-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.download-link {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    margin-right: 5px;
    border: 1px solid #dee2e6;
    color: #555;
    transition: all 0.2s;
}
.download-link:hover {
    background-color: #f8f9fa;
    border-color: var(--theme-color);
    color: var(--theme-color);
}

/* フッターのカスタマイズ */
footer {
    background-color: #2b2b2b; /* 深みのあるグレーで引き締める */
    color: #f8f9fa;
    padding: 60px 0 0 0;
    font-size: 0.95rem;
}
.footer-heading {
    color: #fff;
    font-weight: bold;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 10px;
}
.footer-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--theme-color);
}
.footer-link {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.3s ease;
}
.footer-link:hover {
    color: #fff;
    text-decoration: underline;
}
.footer-info-item {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
}
.footer-info-item i {
    color: var(--theme-color);
    margin-right: 12px;
    margin-top: 3px;
    width: 20px;
    text-align: center;
}
.copyright-bar {
    background-color: #1a1a1a;
    padding: 20px 0;
    margin-top: 50px;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    color: #777;
}
/* お問い合わせボタン（スマホ用） */
.footer-tel-btn {
    display: inline-block;
    background-color: rgba(255,255,255,0.1);
    color: #fff;
    padding: 8px 15px;
    border-radius: 5px;
    text-decoration: none;
    margin-top: 10px;
    transition: background 0.3s;
}
.footer-tel-btn:hover {
    background-color: var(--theme-color);
    color: #fff;
}

/* ページトップへ戻るボタン */
#pageTopBtn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background-color: var(--theme-color);
    color: white;
    border: none;
    border-radius: 50%;
    display: none; /* 最初は非表示 */
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1050; /* ナビバーより前面、モーダルより背面 */
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    opacity: 0.8;
    text-decoration: none;
}

#pageTopBtn:hover {
    transform: translateY(-5px);
    opacity: 1;
    color: white;
}

/* モバイルでの位置調整（指で押しやすいサイズ感） */
@media (max-width: 768px) {
    #pageTopBtn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}