/**
 * ニュース・ブログマネージャー用スタイル
 *
 * 設計方針：
 * - 各ページは .news-list-container / .blog-list-container / .post-detail-container
 *   をルートラッパーとして詳細度を確保。
 * - テーマCSSが !important で指定しているレイアウト系プロパティについては、
 *   こちらも !important で対抗する（v1.2.2 〜）。
 *   これは美しくないが、不特定多数のテーマで安定動作させるための妥協。
 */

/* ============================================================
 * 一覧ページ共通：幅制限
 * ============================================================ */
body .news-list-container,
body .blog-list-container {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
}

/* ============================================================
 * ページネーション
 * ============================================================ */
.news-list-container .pagination,
.blog-list-container .pagination,
.pagination {
    text-align: center;
    margin: 30px auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
}

.pagination a,
.pagination span {
    padding: 5px 10px;
    margin: 0 2px;
    border: 1px solid #ddd;
    text-decoration: none;
    border-radius: 3px;
    color: #333;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination .current {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

.pagination .dots {
    border: none;
    padding: 5px;
}

.pagination .disabled {
    color: #ccc;
    border-color: #eee;
}

/* ============================================================
 * お知らせリスト
 * ============================================================ */
.news-list-container .news-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.news-list-container .news-item {
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.news-list-container .news-date {
    display: inline-block;
    margin-right: 15px;
    color: #666;
}

.news-list-container .news-title {
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

.news-list-container .news-title:hover {
    text-decoration: underline;
}

/* ============================================================
 * ブログリスト
 * ============================================================ */
.blog-list-container .blog-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.blog-list-container .blog-item {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.blog-list-container .blog-item:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.blog-list-container .blog-thumbnail {
    height: 200px;
    overflow: hidden;
}

.blog-list-container .blog-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-list-container .blog-thumbnail img:hover {
    transform: scale(1.05);
}

.blog-list-container .blog-content {
    padding: 15px;
}

.blog-list-container .blog-date {
    color: #666;
    font-size: 0.9em;
    display: block;
    margin-bottom: 5px;
}

.blog-list-container .blog-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    text-align: left !important;
}

.blog-list-container .blog-excerpt {
    color: #555;
    font-size: 0.95em;
    line-height: 1.5;
}

.blog-list-container .read-more {
    display: inline-block;
    margin-top: 10px;
    color: #007bff;
    text-decoration: none;
}

.blog-list-container .read-more:hover {
    text-decoration: underline;
}

.blog-list-container article.blog-item .blog-content h2,
.blog-list-container article.blog-item .blog-content h3 {
    text-align: left !important;
}

/* ============================================================
 * 投稿詳細ページ ★ レイアウト強制ブロック ★
 * テーマCSSと衝突するため !important で確実に上書き
 * ============================================================ */

/* ラッパー：本文幅を 800px に固定して中央寄せ */
body .post-detail-container,
body.single .post-detail-container,
body.single-post .post-detail-container {
    max-width: 800px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    box-sizing: border-box !important;
    width: auto !important;
    float: none !important;
}

/* 詳細ページ内のすべての見出しと本文を左寄せに強制 */
body .post-detail-container .entry-title,
body .post-detail-container .entry-content h1,
body .post-detail-container .entry-content h2,
body .post-detail-container .entry-content h3,
body .post-detail-container .entry-content h4,
body .post-detail-container .entry-content h5,
body .post-detail-container .entry-content h6,
body .post-detail-container .entry-content p,
body .post-detail-container .entry-content ul,
body .post-detail-container .entry-content ol {
    text-align: left !important;
}

/* 念のためカテゴリー別ルールも残す（互換性） */
article.category-news .entry-content h2,
article.category-news .entry-content h3,
article.category-blog .entry-content h2,
article.category-blog .entry-content h3 {
    text-align: left !important;
}

.post-detail-container .entry-title {
    margin-bottom: 10px;
}

.post-detail-container .entry-meta {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9em;
}

.post-detail-container .featured-image {
    margin-bottom: 20px;
}

.post-detail-container .featured-image img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.post-detail-container .entry-content {
    line-height: 1.8;
    margin-bottom: 30px;
}

.post-detail-container .post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.post-detail-container .post-navigation a {
    text-decoration: none;
    color: #007bff;
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.post-detail-container .post-navigation a:hover {
    background-color: #f5f5f5;
}

.post-detail-container footer.entry-footer {
    background: none;
    padding: 0;
    clear: both;
    border-bottom: 0;
}

/* ============================================================
 * レスポンシブ
 * ============================================================ */
@media (max-width: 768px) {
    .blog-list-container .blog-list {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
    }

    body .post-detail-container,
    body .news-list-container,
    body .blog-list-container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}
