/* --- 基本リセット --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    /* フォント設定: Adobe Fonts名 -> Zen Maru Gothic -> sans-serif */
    font-family: "tsukushi-a-round-gothic", "Zen Maru Gothic", sans-serif;
    background: #fdfcfb; 
    min-height: 100vh;
    color: #333;
    display: flex;
    flex-direction: column;
    /* 固定ヘッダーの分だけ余白を確保 (PC: 110px + アプリヘッダー分) */
    padding-top: 110px; 
}

/* --- 1. 公式サイト再現ヘッダー --- */
.official-header {
    background: #FFFFFF;
    /* 公式サイトのheight設定 (PC: 110px) */
    height: 110px;
    padding: 0 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* 公式サイトのbox-shadow再現 */
    box-shadow: 0px 2px 0px rgba(0,0,0,0.2);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    width: 100%;
}

.brand-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    height: 100%;
}

.brand-logo img {
    /* ロゴサイズ調整 */
    height: auto;
    max-height: 60px;
    width: auto;
}

.menu-btn {
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn .material-icons {
    font-size: 36px;
}

/* --- 2. マップ用コントロールヘッダー --- */
.app-header {
    background: #ffffff;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    z-index: 900;
    border-top: 4px solid #9D76E8; /* ブランドカラーのライン */
}

.app-title {
    color: #333333;
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.4rem;
    font-weight: 700;
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.filter-group label {
    font-weight: 600;
    color: #555;
}

select, input[type="range"] {
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 14px;
    background-color: #fafafa;
    font-family: inherit;
}

select {
    padding: 6px 10px;
}

input[type="range"] {
    padding: 0; 
    height: 35px; 
    width: 120px;
    accent-color: #9D76E8;
    cursor: pointer;
}

.slider-value {
    background: #9D76E8;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    min-width: 30px;
    text-align: center;
}

/* --- 3. メインコンテンツ (マップ) --- */
.main-content {
    flex: 1;
}

.map-container {
    height: 60vh;
    min-height: 400px;
    margin: 0;
    position: relative;
    border-bottom: 1px solid #ddd;
}

@media (min-width: 768px) {
    .map-container {
        margin: 20px;
        border-radius: 15px;
        border: 1px solid #ddd;
        height: 70vh;
    }
}

#map {
    height: 100%;
    width: 100%;
}

/* --- 4. 相談バナー --- */
.consultation-banner {
    background-color: #ffcc99; /* 公式サイトに近い色 */
    padding: 40px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.consultation-text {
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.consultation-btn {
    background: #fff;
    color: #ff9800; /* オレンジ */
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.consultation-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 8px rgba(0,0,0,0.15); }

/* --- 5. アクションエリア --- */
.action-area {
    display: flex;
    flex-wrap: wrap;
}

.action-box {
    flex: 1;
    padding: 50px 20px;
    text-align: center;
    color: white;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.action-volunteer {
    background-color: #7fbfff; /* 公式サイトの水色 */
}

.action-donate {
    background-color: #bf7fff; /* 公式サイトの紫 */
}

.action-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 15px;
    letter-spacing: 0.05em;
}

.action-desc {
    font-size: 0.95rem;
    margin-bottom: 25px;
    line-height: 1.8;
    opacity: 0.95;
    max-width: 400px;
}

.action-btn {
    background: #fff;
    padding: 12px 35px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    transition: opacity 0.2s;
}
.action-volunteer .action-btn { color: #5d9bc9; }
.action-donate .action-btn { color: #9d6cdb; }
.action-btn:hover { opacity: 0.9; }

/* --- 6. メインフッター --- */
.main-footer {
    background: #faf9f3; /* 公式サイトのフッター背景色 */
    padding: 60px 20px 30px;
    font-size: 0.9rem;
    color: #333;
}

.footer-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.footer-logo img {
    height: 40px;
    margin-bottom: 5px;
}

.footer-org-name {
    font-weight: 700;
    font-size: 1rem;
}

.footer-address {
    line-height: 1.8;
    color: #555;
}

.social-icons {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.social-icons a {
    color: #333;
    font-size: 24px;
    text-decoration: none;
    transition: color 0.3s;
}
.social-icons a:hover { color: #9D76E8; }

.footer-links {
    display: flex;
    flex-direction: column;
}

.footer-link-item {
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
    color: #333;
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s, padding-left 0.2s;
    font-weight: 500;
}

.footer-link-item:hover {
    color: #9D76E8;
    padding-left: 5px;
}

.copyright {
    text-align: center;
    margin-top: 60px;
    color: #888;
    font-size: 0.8rem;
}

/* --- レスポンシブ調整 (公式サイト準拠) --- */
@media screen and (max-width: 990px){
    body { padding-top: 100px; }
    .official-header { height: 100px; }
}
@media screen and (max-width: 480px){
    body { padding-top: 70px; }
    .official-header { height: 70px; padding: 0 20px; }
    .brand-logo img { max-height: 40px; }
    .menu-btn .material-icons { font-size: 32px; }
}

/* --- Google Maps & Popup スタイル (ヘッダー一体型・完全版) --- */

/* 1. InfoWindowの枠組み */
.gm-style .gm-style-iw-c {
    padding: 0 !important;
    border-radius: 12px !important;
    font-family: "Zen Maru Gothic", sans-serif !important;
    box-shadow: 0 4px 30px rgba(0,0,0,0.15) !important;
    max-width: 320px !important;
}

.gm-style .gm-style-iw-d {
    overflow: hidden !important;
    max-height: none !important;
}

/* 2. 標準の×ボタンを非表示にする（自作ボタンを使うため） */
.gm-ui-hover-effect {
    display: none !important;
}

/* 3. ポップアップ全体 */
.school-popup {
    display: flex;
    flex-direction: column;
    padding: 0;
    background: #fff;
    width: 100%;
}

/* 4. ヘッダー（学校名 + ×ボタンを横並び） */
.popup-header {
    display: flex;
    justify-content: space-between; /* 左右に配置 */
    align-items: flex-start; /* 上揃え */
    padding: 15px 15px 5px 20px; /* 余白を調整 */
    gap: 10px;
}

.school-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
    line-height: 1.4;
    margin: 0;
}

/* 自作の閉じるボタン */
.close-btn-custom {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 0;
    margin-top: -2px; /* 位置微調整 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.close-btn-custom:hover {
    color: #333;
}

/* 5. コンテンツエリア */
.popup-body {
    padding: 5px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* タグと住所 */
.popup-meta { margin-bottom: 0; }
.tags-row {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}
.school-type-tag {
    display: inline-block;
    background: #f0ebfa;
    color: #5b3fa8;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
}
.address-row {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 0.8rem;
}

/* スコアバー */
.score-container {
    position: relative;
    height: 44px; /* さらにコンパクトに */
    background: #d9ccf6;
    border-radius: 6px;
    overflow: hidden;
}
.score-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #9D76E8, #7b5ac2);
    border-radius: 6px 0 0 6px;
}
.score-text-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 15px; color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    z-index: 2;
}
.score-label { font-size: 11px; font-weight: 700; }
.score-value { font-size: 1.3rem; font-weight: 700; }
.score-max { font-size: 0.8rem; opacity: 0.9; }

/* 詳細グリッド */
.freedom-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.freedom-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 5px 8px; background: #fff;
    border: 1px solid #eee; border-radius: 6px;
    font-size: 10px;
}
.freedom-item-label { color: #666; }
.freedom-item-value { color: #9D76E8; font-weight: 700; }

/* ボタン */
.website-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 8px; /* スリムに */
    background-color: transparent; border: 1px solid #9D76E8;
    color: #9D76E8; border-radius: 50px;
    text-decoration: none; font-weight: 700; font-size: 0.8rem;
    transition: all 0.2s;
}
.website-btn:hover { background-color: #f4efff; }

/* --- 凡例（自由度レベル） --- */
.legend {
    position: absolute;
    bottom: 30px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 500;
    font-family: "Zen Maru Gothic", sans-serif;
    min-width: 160px;
}
.legend h3 { margin: 0 0 12px 0; font-size: 14px; font-weight: 700; color: #333; }
.legend-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; color: #555; font-weight: 500; }
.legend-item:last-child { margin-bottom: 0; }
.legend-color { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); }