/**
 * Give Directions フロントエンド用スタイル
 */

/* メインコンテナ */
.give-directions-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 地図エリア */
.give-directions-map {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 画像スライダーエリア */
.give-directions-slider {
    width: 100%;
    margin-top: 0;
    margin-bottom: 0!important;
}

.give-directions-slider .slick-slide {
    padding: 0 10px;
    transition: all 0.3s ease;
    opacity: 0.5;
    transform: scale(0.9);
}

.give-directions-slider .slick-slide.slick-center {
    opacity: 1;
    transform: scale(1);
}

.give-directions-slider .slide-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.give-directions-slider .slick-center .slide-item {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.give-directions-slider .slide-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.give-directions-slider .slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    padding: 20px 15px 15px;
}

.give-directions-slider .slide-caption h3 {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: bold;
}

.give-directions-slider .slide-caption p {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

/* Slickカスタマイズ */
.give-directions-slider .slick-prev,
.give-directions-slider .slick-next {
    width: 40px;
    height: 40px;
    z-index: 10;
}

.give-directions-slider .slick-prev {
    left: 10px;
}

.give-directions-slider .slick-next {
    right: 10px;
}

.give-directions-slider .slick-prev:before,
.give-directions-slider .slick-next:before {
    font-size: 40px;
}

.give-directions-slider .slick-dots li button:before {
    font-size: 12px;
    opacity: 0.5;
}

.give-directions-slider .slick-dots li.slick-active button:before {
    opacity: 1;
}

/* レスポンシブ対応 */
@media screen and (max-width: 768px) {
    .give-directions-container {
        padding: 15px;
    }
    
    .give-directions-map {
        height: 350px;
    }
    
    .give-directions-slider .slide-image {
        height: 100px;
    }
    
    .give-directions-slider .slide-caption h3 {
        font-size: 12px;
    }
    
    .give-directions-slider .slide-caption p {
        font-size: 10px;
    }
    
    /* モーダルのレスポンシブ調整 */
    .gd-modal-container {
        max-width: 100%;
        width: 90%;
        max-height: 95vh;
        padding: 15px;
        border-radius: 10px;
    }
    
    .gd-modal-title {
        font-size: 18px;
        margin: 0 0 8px;
    }
    
    .gd-modal-comment {
        font-size: 14px;
    }
    
    .gd-modal-close {
        top: 15px;
        right: 15px;
        font-size: 46px;
    }
}

@media screen and (max-width: 480px) {
    .give-directions-map {
        height: 300px;
    }
    
    .give-directions-slider .slide-image {
        height: 80px;
    }
    
    .give-directions-slider .slide-caption h3 {
        font-size: 11px;
    }
    
    .give-directions-slider .slide-caption p {
        font-size: 9px;
    }
    
    /* モーダルのモバイル調整 */
    .gd-modal-container {
        max-width: 100%;
        width: 95%;
        max-height: 98vh;
        padding: 10px;
        border-radius: 8px;
    }
    
    .gd-modal-caption {
        padding: 10px 0 0;
    }
    
    .gd-modal-title {
        font-size: 16px;
        margin: 0 0 6px;
    }
    
    .gd-modal-comment {
        font-size: 13px;
    }
    
    .gd-modal-close {
        top: 10px;
        right: 10px;
        font-size: 42px;
    }
}

/* ピンポップアップのカスタマイズ */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    max-width: 300px; /* 最大幅を少し広く */
    max-height: 320px; /* 最大高さも調整 */
}

.leaflet-popup-content {
    margin: 15px;
    max-width: 270px; /* コンテンツの最大幅 */
    max-height: 290px; /* コンテンツの最大高さ */
    overflow-y: auto; /* 縦スクロールバーを追加 */
    overflow-x: hidden; /* 横スクロールは非表示 */
    word-wrap: break-word; /* 長い単語を折り返す */
    font-size: 16px; /* ベースフォントサイズを設定 */
    line-height: 1.6; /* 行間を少し広く */
}

/* スクロールバーのカスタマイズ（Webkit系ブラウザ） */
.leaflet-popup-content::-webkit-scrollbar {
    width: 8px;
}

.leaflet-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.leaflet-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ポップアップ内のテキストスタイル（JavaScriptで生成される） */
.leaflet-popup-content strong {
    font-size: 18px; /* 太字のタイトルを大きく */
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
    line-height: 1.4;
}

.leaflet-popup-content br {
    margin-bottom: 5px;
}

/* Googleマップ InfoWindow のカスタマイズ */
.gm-style .gd-popup-content {
    max-width: 270px;
    max-height: 290px;
    overflow-y: auto;
    overflow-x: hidden;
    word-wrap: break-word;
    font-size: 16px;
    line-height: 1.6;
    padding: 5px;
}

/* スクロールバーのカスタマイズ（Webkit系ブラウザ） */
.gm-style .gd-popup-content::-webkit-scrollbar {
    width: 8px;
}

.gm-style .gd-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gm-style .gd-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.gm-style .gd-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Googleマップ InfoWindow の閉じるボタンをLeafletスタイルに合わせる */
.gm-style-iw-c button.gm-ui-hover-effect {
    width: 22px !important;
    height: 22px !important;
    top: 10px !important;
    right: 10px !important;
    opacity: 0.5;
    border-radius: 3px;
}

.gm-style-iw-c button.gm-ui-hover-effect:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.gm-style-iw-c button.gm-ui-hover-effect img {
    width: 14px !important;
    height: 14px !important;
    margin: 4px !important;
}

/* InfoWindow全体のスタイル調整 */
.gm-style .gm-style-iw-c {
    border-radius: 8px !important;
    padding: 0 !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: 320px !important;
}

.gd-popup-content h4 {
    margin: 0 0 10px;
    font-size: 18px; /* 16px → 18px */
    font-weight: bold;
    word-wrap: break-word; /* タイトルも折り返す */
}

.gd-popup-content p {
    margin: 0 0 10px;
    font-size: 16px; /* 14px → 16px */
    line-height: 1.6;
    word-wrap: break-word; /* テキストも折り返す */
}

.gd-popup-content img {
    width: 100%;
    max-width: 200px;
    height: auto;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* ルート情報 */
.give-directions-route-info {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.give-directions-route-info h3 {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: bold;
}

.give-directions-route-info .info-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.give-directions-route-info .info-item .label {
    font-weight: bold;
    margin-right: 10px;
    min-width: 80px;
}

.give-directions-route-info .info-item .value {
    color: #555;
}

/* 画像モーダル */
.gd-image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 0, 0, 0.9),
        rgba(0, 0, 0, 0.9) 3px,
        rgba(20, 20, 20, 0.9) 3px,
        rgba(20, 20, 20, 0.9) 6px
    );
    cursor: pointer;
}

.gd-image-modal.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.gd-modal-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90%;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
    overflow: auto;
}

.gd-modal-content {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.gd-modal-caption {
    padding: 15px 0 0;
    color: #333;
}

.gd-modal-title {
    margin: 0 0 10px;
    font-size: 20px;
    font-weight: bold;
    color: #2271b1;
}

.gd-modal-comment {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

.gd-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #ccc;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 10000;
}

.gd-modal-close:hover,
.gd-modal-close:focus {
    color: #999;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: translate(-50%, -50%) scale(0.8); }
    to { transform: translate(-50%, -50%) scale(1); }
}

/* レスポンシブ対応：小さい画面ではさらにサイズを調整 */
@media screen and (max-width: 768px) {
    .leaflet-popup-content-wrapper {
        max-width: 240px;
        max-height: 250px;
    }
    
    .leaflet-popup-content {
        max-width: 210px;
        max-height: 220px;
    }
    
    /* Googleマップ用のレスポンシブ調整も追加 */
    .gm-style .gd-popup-content {
        max-width: 210px;
        max-height: 220px;
    }
}

@media screen and (max-width: 480px) {
    .leaflet-popup-content-wrapper {
        max-width: 200px;
        max-height: 200px;
    }
    
    .leaflet-popup-content {
        max-width: 170px;
        max-height: 170px;
        font-size: 13px;
    }
    
    .gm-style .gd-popup-content {
        max-width: 170px;
        max-height: 170px;
        font-size: 13px;
    }
    
    .gd-popup-content h4 {
        font-size: 14px;
    }
    
    .gd-popup-content p {
        font-size: 12px;
    }
}



