/* ======================================= */
/* ファイル名: main-content-t-guide.css */
/* ======================================= */

/* 2. ページタイトル (H2) */
.sub-ttl {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    color: #007bff; 
    padding: 15px 0;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 3px solid #007bff;
}

/* 3. 各画像 (スポットアイテムコンテナ) */
.spot-item {
    /* Flexboxを追加: モバイルでは縦並び */
    display: flex; 
    flex-direction: column; 
    
    max-width: 800px; /* 最大幅を設定 */
    height: auto;
    margin: 0 auto 20px; /* 中央揃え */
    border: 1px solid #ddd;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);

    /* width: auto; と display: block; は flexboxによって不要になるため削除 */
}

/* 観光スポット全体も中央揃え */
.sightseeing-section {
    max-width: 800px;
    margin: 0 auto;
    
}

/* map-wrapper-link: リンクとテキストをまとめて中央に配置するコンテナ */
.map-wrapper-link {
    max-width: 800px; /* 画像などと同じ最大幅 */
    margin: 0 auto 0; /* 画像の下側の余白 */
    text-align: center; /* 内部のテキストリンクを中央に */
}

/* マップのテキストリンクのスタイル */
.map-text-link {
    /* マップ画像との間隔を調整 */
    margin-top: 10px; 
    font-size: 1rem;
    padding-bottom: 20px; /* 必要なら下側にもう少し余白 */
}

/* .spot-item は以前のままでOKですが、
   もし margin: 0 auto 50px; が残っていたら margin: 0 auto 0; に戻して、
   余白の制御を .map-wrapper-link に任せるのがおすすめです。 */


/* 4. セクション大見出し (H3) の修正 */
.content-ttl {
    font-size: 1.8rem;
    font-weight: 600;
    border-left: 8px solid #ffcc00;  
    padding: 5px 0 5px 15px;
    
    /* ★★★ ここを画像の実際の幅に設定します (540pxと仮定) ★★★ */
    max-width: 540px; 
    
    /* 見出しブロック全体を中央揃えにする */
    margin-top: 20px;
    margin-bottom: 15px;
    margin-left: auto;   
    margin-right: auto;  
    
    color: #333;
    text-align: left; /* 左揃えを維持 */
}

/* 6. 小見出し H4 */
.inner-ttl {
    width: 100%;
    order: 1;

    font-size: 1.5rem;
    font-weight: 700;
    color: #4a90e2; 
    margin-bottom: 15px;
    border-bottom: 1px dotted #ccc;
    padding-bottom: 5px;
}

/* 7. 画像コンテナ */
figure {
    order: 2;
    margin: 0 0 15px 0; 
    text-align: center;
}

figure img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

figcaption {
    font-size: 0.9rem;
    color: #666;
    margin-top: 5px;
    padding: 5px;
    background-color: #f0f0f0;
    border-radius: 4px;
}

/* 8. 説明文 */
.spot-item p {
    order: 3;
    width: 100%;
}

/* --- PCレイアウト（768px〜） --- */
@media (min-width: 768px) {

    .spot-item {
        flex-direction: row; /* 横並びに変更 */
        flex-wrap: wrap; /* 子要素が折り返せるように */
        gap: 20px;
        align-items: flex-start;
    }

    .inner-ttl {
        width: 100%; /* H4は見出しなので横幅いっぱいを維持 */
        margin-bottom: 20px;
    }

    figure {
        flex-basis: 300px; /* 左側の画像幅 */
        flex-grow: 0;
        flex-shrink: 0;
        margin: 0;
        text-align: left;
    }

    .spot-item p {
        flex-basis: 0; /* 残りのスペースを使用 */
        flex-grow: 1;
        flex-shrink: 1;
        min-width: 250px;
    }
}

/* --- モーダル拡大表示用：決定版CSS --- */

/* aタグのクリック範囲を画像サイズに限定 */
a.zoom-img {
    display: block;
    margin: 0 auto 20px;
    width: fit-content;
    line-height: 0;
    cursor: zoom-in;
}

/* モーダル背景 */
.zoom-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 3000; /* ヘッダーより上に表示 */
}

/* 画像コンテナ：透明部分はクリックを透過 */
.zoom-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    pointer-events: none;
}

/* 拡大画像 */
.zoom-container img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    cursor: default;
}

/* 閉じるボタン（CSS描画：絶対にズレない） */
.zoom-close {
    position: absolute;
    top: -45px;
    right: -45px;
    width: 44px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 3100;
    transition: transform 0.2s;
    filter: drop-shadow(0 0 6px rgba(0,0,0,0.8));
    pointer-events: auto;
}

.zoom-close span {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    width: 34px;
    height: 4px;
    background-color: #ffffff;
    border-radius: 2px;
}

.zoom-close span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.zoom-close span:nth-child(2) { transform: translate(-50%, -50%) rotate(-45deg); }

.zoom-close:hover { transform: scale(1.1); }

/* スマホ対応 */
@media (max-width: 480px) {
    .zoom-close {
        top: 10px;
        right: 10px;
        transform: scale(0.8);
    }
}