/* 基本的なリセットとフォント設定 */
body {
    margin: 0;
    font-family: 'Noto Sans JP', sans-serif;
    color: #333;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column; /* ヘッダー、コンテナ、フッターを縦に並べる */
    min-height: 100vh; /* 画面全体の高さ */
}

header {
    background-color: #ac20ec; /* 神社をイメージした金赤色 */
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 2.2em;
}

header p {
    margin: 5px 0 0;
    font-size: 0.9em;
}
#top_title a {
    color: white;
    text-decoration: none;
}


.container {
    display: flex; /* サイドバーと地図を横並びにする */
    flex-grow: 1; /* 残りの高さを占める */
    width: 100%;
    max-width: 1200px; /* 最大幅を設定して中央に寄せる */
    margin: 20px auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden; /* 子要素がはみ出さないように */
}

.sidebar {
    width: 350px; /* サイドバーの固定幅 */
    background-color: #f9f9f9;
    padding: 20px;
    border-right: 1px solid #eee;
    overflow-y: auto; /* 内容が多い場合にスクロール可能に */
    flex-shrink: 0; /* 縮まないようにする */
}

.sidebar h2 {
    color: #4CAF50;
    margin-top: 0;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.search-box {
    display: flex;
    margin-bottom: 20px;
}

.search-box input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1em;
}

.search-box button {
    padding: 10px 15px;
    background-color: #E94709;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s ease;
}

.search-box button:hover {
    background-color: #a93406;
}

.shrine-list h3 {
    color: #4CAF50;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-top: 25px;
}

.shrine-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.shrine-list li {
    padding: 12px 10px;
    border-bottom: 1px dashed #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

.shrine-list li:last-child {
    border-bottom: none;
}

.shrine-list li:hover {
    background-color: #e6ffe6; /* ホバーで薄い緑 */
}

.shrine-list li.highlighted { /* 追加したハイライトスタイル */
    background-color: #dcf8dc; /* ハイライト時の背景色 */
    border-left: 5px solid #4CAF50; /* 左側に太いボーダー */
    padding-left: 15px; /* ボーダー分の余白 */
}

.shrine-list li .shrine-name {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
}

.shrine-list li .shrine-goriyaku {
    font-size: 0.9em;
    color: #666;
    margin-top: 4px;
}

.bbs #bbsButton {
	display: block;
	text-align: center;
	text-decoration: none;
    font-size: 1.25rem;
	margin: auto;
	padding: 1rem 4rem;
	font-weight: bold;
	border: 2px solid #ac20ec;
	color: #ac20ec;
	border-radius: 100vh;
	transition: 0.5s;
}
.bbs #bbsButton:hover {
	color: #fff;
	background: #ac20ec;
}





.map-container {
    flex-grow: 1; /* 残りのスペースを全て地図が占める */
    position: relative; /* モーダル配置のため */
}

#map {
    width: 100%;
    height: 100%; /* 親要素の高さに合わせる */
    min-height: 500px; /* 地図の最低の高さを確保 */
    background-color: #e0e0e0; /* 地図が読み込まれるまでの背景 */
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 15px 20px;
    margin-top: auto; /* フッターを常に下部に配置 */
    font-size: 0.85em;
}



/* モーダルウィンドウのスタイル */
.modal {
    display: none; /* 初期状態では非表示 */
    position: fixed; /* 画面に固定 */
    z-index: 1000; /* 他の要素より手前に表示 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* 内容がはみ出したらスクロール */
    background-color: rgba(0,0,0,0.6); /* 半透明の背景 */
    backdrop-filter: blur(5px); /* 背景をぼかす */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    max-height: 80vh; /* モーダルの最大高さ */
    overflow-y: auto; /* モーダル内容が多い場合にスクロール */
}

.modal-content h3 {
    color: #4CAF50;
    margin-top: 0;
    font-size: 1.8em;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.modal-content p {
    margin-bottom: 10px;
    line-height: 1.6;
}

.modal-content strong {
    color: #555;
}
/* モーダルの読み仮名 */
#modalShrineName .shrine-kana {
    font-size: 0.6em; /* 親要素の60%のサイズにする */
    color: #4CAF50;
}

#modalImageContainer {
    text-align: center;
    margin: 20px 0;
}

#modalImage {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#modalOfficialUrl {
    display: inline-block;
    margin-top: 20px;
    background-color: #007BFF;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

#modalOfficialUrl:hover {
    background-color: #0056b3;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.post-form, .no-post-msg {
    margin-left: 20px;
}

.list-square li {
    list-style-type: square;
}

.list-square li::marker {
    font-size: 2rem;
}

.list-square li span {
    vertical-align: 0.4rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .container {
        flex-direction: column; /* 画面が狭い場合は縦並びにする */
        margin: 10px auto;
    }

    .sidebar {
        width: auto; /* 幅を自動調整 */
        border-right: none;
        border-bottom: 1px solid #eee; /* 下に境界線 */
        max-height: 400px; /* スマホでのサイドバーの最大高さ */
    }

    #map {
        min-height: 350px; /* スマホでの地図の最低高さ */
    }

    .modal-content {
        width: 95%; /* スマホでのモーダルの幅 */
        padding: 20px;
    }
}