/* ----------------------------------------------------------
 * 基本レイアウト
 * ---------------------------------------------------------- */
/* グリッドレイアウト */
.car-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* カード本体 */
.car-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s;
    cursor: pointer;
}

.car-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* テキストエリア */
.car-card-body {
    padding: 15px;
}

.car-date {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 5px;
}

.car-nickname {
    font-size: 1.1em;
    font-weight: bold;
    margin: 5px 0;
    color: #333;
}

.car-model {
    font-size: 1em;
    color: #0056b3;
    margin-bottom: 5px;
    font-weight: bold;
}

.car-location {
    font-size: 0.9em;
    color: #555;
}


/* ----------------------------------------------------------
 * ★重要修正：画像とZoomボタンのスタイルをカード内に限定
 * ---------------------------------------------------------- */

/* 画像の親要素 */
.car-card .car-card-img {
    position: relative;
}

/* 画像（カード内のみ高さ固定） */
.car-card .car-card-img img {
    width: 100%;
    height: 280px; /* カード内の画像のみ高さ固定 */
    object-fit: cover;
    display: block;
}

/* Zoomボタン（デフォルトは非表示） */
.car-zoom-btn {
    display: none; /* ★ここ重要：基本は見えなくする */
}

/* カード内にあるZoomボタンだけを表示＆スタイル適用 */
.car-card .car-zoom-btn {
    display: flex; /* カード内なら表示する */
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.85em;
    font-weight: bold;
    pointer-events: none; 
    transition: background 0.3s;
    align-items: center;
}

/* アイコンの間隔 */
.icon-zoom {
    margin-right: 6px;
    font-size: 1.1em;
}

/* カードにマウスを乗せた時のボタンの変化 */
.car-card:hover .car-zoom-btn {
    background: rgba(0, 0, 0, 0.8);
}


/* ----------------------------------------------------------
 * ページネーション・フィルタボタン・モーダル
 * ---------------------------------------------------------- */

/* ページネーション */
.car-pagination {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 5px;
}
.car-pagination a, .car-pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #333;
    background: #fff;
    min-width: 40px;
}
.car-pagination span.current {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* カテゴリフィルターボタン */
.car-filter-btn {
    display: inline-block;
    padding: 10px 20px;
    margin: 5px;
    border: 1px solid #333;
    border-radius: 30px;
    text-decoration: none;
    color: #333;
    background: #fff;
    transition: all 0.3s;
    font-weight: bold;
}

.car-filter-btn:hover {
    background: #eee;
}

.car-filter-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* モーダル */
.car-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.car-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.car-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.car-modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border: 4px solid #fff;
    border-radius: 4px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

#car-modal-caption {
    color: #fff;
    margin-top: 10px;
    font-size: 1.1em;
    font-weight: bold;
}

.car-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.car-modal-close:hover {
    color: #ddd;
}

/* ----------------------------------------------------------
 * スマホ対応（2列表示）
 * ---------------------------------------------------------- */
@media screen and (max-width: 768px) {
    
    /* グリッドを強制的に2列にする */
    .car-photo-grid {
        grid-template-columns: repeat(2, 1fr); /* 1fr 1fr で均等2列 */
        gap: 10px; /* スマホでは隙間を少し狭くする */
    }

    /* 画像の高さをスマホ用に調整 */
    /* 幅が狭くなるので、高さも少し低くしないと縦長になりすぎます */
    .car-card .car-card-img img {
        height: 150px; /* お好みに合わせて調整してください（例: 140px〜180px） */
    }

    /* 文字サイズを少し小さくしてバランスを取る（任意） */
    .car-nickname {
        font-size: 0.95em;
    }
    .car-model, 
    .car-location {
        font-size: 0.8em;
    }
    
    /* カードの余白を少し詰める */
    .car-card-body {
        padding: 10px;
    }
}

