/* assets/css/dealer-posts.css - HTML構造変更対応版 */

/* ==================================================
 * 1. ベースコンテナとグリッド設定
 * ================================================== */
.dr-dealer-posts-list {
    margin: 20px 0;
}

.dr-dealer-posts-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
    /* 応答性の高いグリッドレイアウト */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px; 
}

/* ==================================================
 * 2. 個別投稿アイテム (カードデザイン)
 * ================================================== */
.dr-post-item {
    border: none; 
    border-radius: 12px;
    overflow: hidden; 
    /* 影をつけてカードらしさを出す */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); 
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    background-color: #ffffff;
}

/* ホバーエフェクト */
.dr-post-item:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15); /* 影を強調 */
    transform: translateY(-3px); /* 少し上に持ち上げる */
}

/* ⭐ 新しいリンク要素 (.dr-card-link) をブロック要素としてカードいっぱいに広げる */
.dr-card-link {
    text-decoration: none; /* リンクの下線を削除 */
    color: #333; /* 文字色を濃いグレーに設定 */
    display: block; /* リンクをブロック要素にし、カード全体をリンクにする */
    height: 100%; /* 親要素(li)の高さ全体を使う */
    display: flex; /* flexboxを使って内部要素を縦に配置 */
    flex-direction: column; 
}

/* ==================================================
 * 3. サムネイル (アイキャッチ/外部画像)
 * ================================================== */
.dr-post-thumbnail {
    width: 100%;
    height: 0;
    padding-bottom: 60%; /* アスペクト比 16:10 を維持 */
    position: relative;
    overflow: hidden;
}

.dr-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 画像をトリミングして領域全体をカバー */
    transition: transform 0.5s ease;
}

/* 画像にズームインエフェクト */
.dr-post-item:hover .dr-post-thumbnail img {
    transform: scale(1.08); /* ホバー時に画像を少し拡大 */
}

.dr-no-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f0f0f0;
    color: #a0a0a0;
    font-size: 14px;
    font-weight: bold;
}

/* ==================================================
 * 4. コンテンツラッパー
 * ================================================== */
.dr-post-content-wrap {
    padding: 15px; 
    flex-grow: 1; /* 残りのスペースを埋める */
    display: flex;
    flex-direction: column;
}

/* ==================================================
 * 5. タイトルと概要のスタイル
 * ================================================== */
.dr-post-title {
    font-size: 1.15em; 
    font-weight: 700;
    margin: 0 0 8px 0;
    line-height: 1.4;
    color: #0073aa; /* タイトルを目立たせる色 */
    /* 2行で省略 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dr-post-excerpt {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    flex-grow: 1; /* 概要が残りの高さを埋める */
    /* 3行で省略 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.dr-post-date {
    font-size: 0.8em;
    color: #999;
    margin: 0;
    padding-top: 10px;
    border-top: 1px solid #eee;
    text-align: right;
}

/* ==================================================
 * 6. 添付ファイルリストのスタイル
 * ================================================== */
.dr-attached-files-header {
    font-weight: bold;
    font-size: 0.9em;
    margin-top: 10px;
    color: #444;
}

.dr-attached-files-list {
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.dr-attached-files-list li {
    font-size: 0.85em;
    margin-bottom: 3px;
}

.dr-attached-files-list a {
    color: #0073aa;
    text-decoration: underline;
}

/* ==================================================
 * 7. ページネーションのスタイル
 * ================================================== */
.dr-post-pagination {
    margin-top: 30px;
    text-align: center;
}

.dr-post-pagination ul {
    display: inline-flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.dr-post-pagination li {
    margin: 0;
    padding: 0;
}

.dr-post-pagination .page-numbers {
    display: block;
    padding: 8px 12px;
    margin: 0;
    border-left: 1px solid #ddd;
    text-decoration: none;
    color: #0073aa;
}

.dr-post-pagination li:first-child .page-numbers {
    border-left: none;
}

.dr-post-pagination .page-numbers.current,
.dr-post-pagination a:hover {
    background-color: #0073aa;
    color: white;
    border-color: #0073aa;
}