﻿/* ===== レイアウト（ページ全体） ===== */
.blog-page {
    padding: 0.3rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.blog-container {
    display: flex;
    flex-direction: row;
    gap: 1.5rem;
    width: 100%;
}

.blog-main {
    flex: 3;
    min-width: 0;
}

.blog-sidebar {
    flex: 1;
    max-width: 320px;
    min-width: 250px;
}

/* ===== ヘッダー（タイトル/ぼやき） ===== */
.page-header-compact {
    text-align: center;
    margin-bottom: 2rem;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

    .page-header-compact h1 {
        font-size: 2.2rem;
        font-weight: 600;
        text-shadow: 0 2px 10px rgba(0,0,0,0.5);
        margin: 0;
    }

.boya-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .boya-box i {
        font-size: 0.75rem;
        color: rgba(255, 255, 255, 0.6);
    }

    .boya-box:hover {
        background: rgba(255, 255, 255, 0.08);
    }

/* ===== 記事カード（一覧グリッド） ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: rgba(25, 25, 35, 0.85);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    border-top: 4px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

    .post-card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, rgba(30, 20, 10, 0.05) 0%, rgba(50, 40, 30, 0.1) 100%);
        z-index: 0;
        pointer-events: none;
    }

    /* ランダムなボーダーカラー */
    .post-card:nth-child(6n+1) {
        border-top-color: #ff7e5f;
    }

    .post-card:nth-child(6n+2) {
        border-top-color: #7b68ee;
    }

    .post-card:nth-child(6n+3) {
        border-top-color: #4ecdc4;
    }

    .post-card:nth-child(6n+4) {
        border-top-color: #6a82fb;
    }

    .post-card:nth-child(6n+5) {
        border-top-color: #ff5a5f;
    }

    .post-card:nth-child(6n) {
        border-top-color: #ffbe0b;
    }

    .post-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
        background: rgba(35, 35, 45, 0.9);
    }

/* 記事カード: ヘッダー/メタ/本文/フッター */
.post-header {
    padding: 1.5rem 1.5rem 0.8rem 1.5rem;
    position: relative;
    z-index: 1;
}

    .post-header h2 {
        margin-bottom: 0.5rem;
    }

        .post-header h2 a {
            color: white;
            text-decoration: none;
            font-size: 1rem;
            font-weight: 600;
            line-height: 1.4;
            display: block;
            transition: color 0.3s ease;
        }

            .post-header h2 a:hover {
                color: rgba(255, 255, 255, 0.8);
            }

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

    .post-meta span {
        display: flex;
        align-items: center;
        gap: 0.4rem;
    }

    .post-meta i {
        color: rgba(255, 255, 255, 0.9);
    }

.post-content {
    padding: 0 1.5rem;
    margin: 0.8rem 0;
    flex: 1;
    position: relative;
    z-index: 1;
}

.post-summary {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
    margin: 0;
    font-size: 0.8rem;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

/* 記事カード: タグ/ボタン */
.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

    .post-tags .tag {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.9);
        padding: 0.25rem 0.7rem;
        border-radius: 12px;
        text-decoration: none;
        font-size: 0.75rem;
        transition: all 0.3s ease;
        border: none;
        cursor: pointer;
    }

        .post-tags .tag:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
        }

        .post-tags .tag.selected {
            background: rgba(255, 120, 95, 0.4);
            color: white;
        }

.read-more {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 0.9rem;
}

    .read-more:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateX(3px);
    }

/* ===== サイドバー（共通） ===== */
.sidebar-section {
    background: rgba(25, 25, 35, 0.85);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.3s ease;
    position: relative;
    color: rgba(255, 255, 255, 0.9);
}

    .sidebar-section::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 4px;
        background: linear-gradient(90deg, #ff7e5f, #feb47b);
        border-radius: 16px 16px 0 0;
    }

    .sidebar-section:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    }

    .sidebar-section h3 {
        color: white;
        margin-bottom: 1rem;
        font-size: 1.1rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }

/* サイドバー: 投稿リスト */
.sidebar-post-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.sidebar-post-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.8rem;
}

    .sidebar-post-item:last-child {
        border-bottom: none;
    }

.sidebar-post-link {
    display: block;
    text-decoration: none;
    color: white !important;
    transition: all 0.2s ease;
}

    .sidebar-post-link:hover {
        transform: translateX(5px);
    }

.sidebar-post-title {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: rgba(255, 255, 255, 0.9) !important;
}

.sidebar-post-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6) !important;
}

.post-date, .post-views {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: rgba(255, 255, 255, 0.6) !important;
}

    .post-date i, .post-views i {
        color: #ff7e5f !important;
    }

.no-posts-message {
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 0.8rem 0;
    font-style: italic;
}

/* サイドバー: シリーズ一覧 */
.series-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.series-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

    .series-item:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-3px);
    }

    .series-item.active {
        background: rgba(255, 120, 95, 0.4);
        border-left: 3px solid #ff7e5f;
    }

.series-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.series-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* サイドバー: シリーズナビゲーション */
.series-accordion {
    margin-bottom: 0.8rem;
}

.series-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .series-header:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    .series-header.active {
        background: rgba(255, 120, 95, 0.4);
        border-radius: 12px 12px 0 0;
    }

.series-title {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.series-posts {
    display: none;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

    .series-posts.open {
        display: block;
    }

.series-post-item {
    padding: 0.7rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
}

    .series-post-item:hover {
        background: rgba(255, 255, 255, 0.05);
        padding-left: 1.2rem;
    }

    .series-post-item.current {
        background: rgba(255, 120, 95, 0.2);
        border-left: 3px solid #ff7e5f;
    }

.series-post-number {
    background: rgba(0, 0, 0, 0.3);
    color: rgba(255, 255, 255, 0.8);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* サイドバー: 単発記事 */
.standalone-posts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.standalone-post-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

    .standalone-post-item:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-2px);
    }

.standalone-post-title {
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.standalone-post-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6) !important;
}

    .standalone-post-meta i {
        color: #ff7e5f !important;
    }

/* サイドバー: カテゴリー切り替えタブ */
.content-tabs {
    display: flex;
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
}

.content-tab {
    flex: 1;
    text-align: center;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.2);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

    .content-tab:first-child {
        border-radius: 10px 0 0 10px;
    }

    .content-tab:last-child {
        border-radius: 0 10px 10px 0;
    }

    .content-tab.active {
        background: rgba(255, 120, 95, 0.4);
        color: white;
    }

.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }

.all-series-link, .all-posts-link {
    display: block;
    text-align: center;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

    .all-series-link:hover, .all-posts-link:hover {
        color: white;
        text-decoration: underline;
    }

/* ===== フィルタ（記事タイプ/モバイル状態） ===== */
.post-type-filters {
    display: flex;
    gap: 0.8rem;
}

.post-type-filter {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

    .post-type-filter:hover {
        background: rgba(255, 255, 255, 0.15);
        transform: translateY(-3px);
    }

    .post-type-filter.active {
        background: rgba(255, 120, 95, 0.4);
        box-shadow: 0 5px 15px rgba(255, 120, 95, 0.2);
    }

    .post-type-filter i {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }

.filter-label {
    font-size: 0.85rem;
}

.filter-count {
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

/* モバイル用フィルタ状態表示 */
.mobile-filter-status {
    background: rgba(255, 120, 95, 0.3);
    border-radius: 16px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 120, 95, 0.5);
}

.active-filter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.8rem;
}

.filter-icon {
    font-size: 1.2rem;
}

.filter-label {
    color: white;
    font-weight: 600;
}

.clear-filter-btn {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 0.4rem 0.8rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

    .clear-filter-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

.active-tags-mobile {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.active-tag-mobile {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
}

.remove-tag-mobile-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

    .remove-tag-mobile-btn:hover {
        opacity: 1;
    }

/* クリア系（共通） */
.clear-filter-section {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.clear-all-filters {
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

    .clear-all-filters:hover {
        background: rgba(255, 255, 255, 0.2);
    }

/* ===== タグ（クラウド/カテゴリ） ===== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tag-link {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

    .tag-link:hover {
        background: rgba(255, 255, 255, 0.2);
        transform: translateY(-3px);
    }

    .tag-link.active {
        background: rgba(255, 120, 95, 0.4);
    }

/* タグカテゴリ（アコーディオン） */
.tag-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.tag-category {
    border-radius: 12px;
    overflow: hidden;
}

.tag-category-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.7rem 1rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    border-radius: 10px;
    position: relative;
}

    .tag-category-header:hover {
        background: rgba(255, 255, 255, 0.15);
    }

    .tag-category-header::after {
        content: '\f107';
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        position: absolute;
        right: 10px;
        transition: transform 0.3s ease;
    }

    .tag-category-header.active::after {
        transform: rotate(180deg);
    }

.tag-category-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tag-category-count {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.3rem 0.6rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-right: 20px;
}

.tag-category-content {
    display: block;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0;
}

    .tag-category-content.collapsed {
        max-height: 0;
    }

.tag-category.open .tag-category-content {
    max-height: 500px;
    padding: 0.7rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 0 0 10px 10px;
}

/* タグカテゴリ内のタグクラウド */
.tag-category-content .tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

/* タグ検索フィールド */
.tag-search-field {
    margin-bottom: 1rem;
    position: relative;
}

    .tag-search-field input {
        width: 100%;
        padding: 0.7rem 1rem 0.7rem 2.5rem;
        border-radius: 20px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.2);
        color: white;
    }

    .tag-search-field i {
        position: absolute;
        left: 1rem;
        top: 50%;
        transform: translateY(-50%);
        color: rgba(255, 255, 255, 0.6);
    }

/* ===== タグセレクターモーダル ===== */
.tag-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .tag-selector-modal.active {
        opacity: 1;
    }

.tag-selector-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(25, 25, 35, 0.95);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    max-height: 80vh;
    overflow-y: auto;
    border-top: 4px solid #ff7e5f;
}

.tag-selector-modal.active .tag-selector-content {
    transform: translateY(0);
}

.tag-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

    .tag-selector-header h3 {
        color: white;
        margin: 0;
        font-size: 1.2rem;
    }

    .tag-selector-header .close-btn {
        background: rgba(255, 255, 255, 0.15);
        color: white;
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.3s ease;
    }

        .tag-selector-header .close-btn:hover {
            background: rgba(255, 255, 255, 0.25);
        }

.tag-selector-body h4 {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.8rem;
    font-size: 1rem;
}

.modal-selected-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-selected-tag {
    background: rgba(255, 120, 95, 0.4);
    color: white;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .modal-selected-tag:hover {
        background: rgba(255, 120, 95, 0.6);
    }

.all-tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.8rem;
}

.tag-selector-item {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 0.6rem 0.8rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .tag-selector-item:hover {
        background: rgba(255, 255, 255, 0.2);
    }

    .tag-selector-item.active {
        background: rgba(255, 120, 95, 0.4);
    }

    .tag-selector-item i {
        font-size: 0.8rem;
    }

/* 選択中タグ表示（共通） */
.selected-tags-info {
    background: rgba(255, 120, 95, 0.2);
    border-radius: 12px;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 120, 95, 0.3);
}

.selected-tags-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.selected-count {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.clear-all-tags {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s ease;
}

    .clear-all-tags:hover {
        color: white;
    }

.selected-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-tag {
    background: rgba(255, 120, 95, 0.4);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.remove-tag-btn {
    background: none;
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
    transition: opacity 0.2s;
}

    .remove-tag-btn:hover {
        opacity: 1;
    }

/* ===== 汎用ボタン ===== */
.btn-primary {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    white-space: nowrap;
    width: 100%;
    justify-content: center;
}

    .btn-primary:hover {
        background: rgba(255, 255, 255, 0.25);
        transform: translateY(-3px);
        border-color: rgba(255, 255, 255, 0.4);
    }

/* ===== 空表示/新規作成（モバイル表示制御のみ） ===== */
.no-posts {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(25, 25, 35, 0.85);
    color: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

    .no-posts i {
        font-size: 3rem;
        margin-bottom: 1.5rem;
        opacity: 0.8;
    }

    .no-posts h3 {
        color: white;
        margin-bottom: 1rem;
        font-size: 1.6rem;
    }

    .no-posts p {
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 1.5rem;
        font-size: 1.1rem;
    }

.mobile-create-section {
    display: none;
}

/* ===== 目次（TOC） ===== */
.table-of-contents {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px 20px;
    margin: 20px 0;
}

.toc-title {
    font-size: 1.2rem;
    margin-top: 0;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
}

.toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-item {
    margin-bottom: 10px;
    font-weight: 500;
}

.toc-sublist {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
}

.toc-subitem {
    margin-bottom: 5px;
    font-weight: normal;
    font-size: 0.95em;
}

.toc-list a {
    color: #0d6efd;
    text-decoration: none;
    display: inline-block;
    padding: 3px 0;
}

    .toc-list a:hover {
        text-decoration: underline;
        color: #0a58ca;
    }

.toc-empty {
    color: #6c757d;
    font-style: italic;
}

.highlight-heading {
    animation: highlight-fade 2s ease-out;
}

@keyframes highlight-fade {
    0% {
        background-color: #ffeb3b;
    }

    100% {
        background-color: transparent;
    }
}

/* ===== 記事リンクカード ===== */
.blog-card {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

    .blog-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

.blog-card-link {
    display: flex;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.blog-card-content {
    flex: 1;
    padding: 15px;
}

.blog-card-title {
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
}

.blog-card-excerpt {
    color: #666;
    font-size: 14px;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-meta {
    display: flex;
    font-size: 12px;
    color: #888;
}

.blog-card-date {
    margin-right: 15px;
}

.blog-card-image {
    width: 120px;
    min-width: 120px;
    background-color: #f5f5f5;
}

    .blog-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* ===== HTMLデモブロック ===== */
.html-demo-block {
    margin: 25px 0;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

    .html-demo-block .demo-tabs {
        display: flex;
        background: #f5f5f5;
        border-bottom: 1px solid #e0e0e0;
    }

    .html-demo-block .demo-tab {
        padding: 10px 15px;
        cursor: pointer;
        font-size: 14px;
        color: #666;
        border-bottom: 2px solid transparent;
    }

        .html-demo-block .demo-tab.active {
            border-bottom-color: #0078d7;
            color: #0078d7;
        }

    .html-demo-block .demo-content {
        position: relative;
    }

    .html-demo-block .demo-preview,
    .html-demo-block .demo-code {
        display: none;
    }

        .html-demo-block .demo-preview.active,
        .html-demo-block .demo-code.active {
            display: block;
        }

    .html-demo-block .demo-render {
        padding: 20px;
        min-height: 100px;
        background: white;
    }

    .html-demo-block .demo-code pre {
        margin: 0;
        padding: 15px;
        background: #f8f8f8;
        max-height: 300px;
        overflow: auto;
    }

    .html-demo-block .demo-code code {
        font-family: monospace;
        font-size: 14px;
        white-space: pre;
        tab-size: 2;
    }

/* ===== ユーティリティ ===== */
.text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

.text-red {
    color: red;
}

.text-blue {
    color: blue;
}

.text-green {
    color: green;
}

.bg-yellow {
    background-color: #ffff00;
}

.bg-gray {
    background-color: #f0f0f0;
}

/* ===== レスポンシブ ===== */
@media (max-width: 1024px) {
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-container {
        flex-direction: column;
    }

    .blog-sidebar {
        max-width: 100%;
        width: 100%;
    }

    .mobile-create-section {
        display: block;
    }
}

@media (max-width: 768px) {
    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .read-more {
        width: 100%;
        justify-content: center;
    }

    /* モバイルモーダル内のタグカテゴリ */
    .tag-selector-modal .tag-categories {
        margin-top: 1rem;
    }

    .tag-selector-modal .tag-category-header {
        background: rgba(255, 255, 255, 0.07);
    }

    .tag-selector-modal .tag-category.open .tag-category-content {
        background: rgba(0, 0, 0, 0.15);
        padding: 0.8rem;
    }
}

/* ===== ダークモード ===== */
.dark-mode .blog-card {
    border-color: #444;
    background-color: #333;
}

.dark-mode .blog-card-title {
    color: #e0e0e0;
}

.dark-mode .blog-card-excerpt {
    color: #bbb;
}

.dark-mode .blog-card-meta {
    color: #999;
}

@media (prefers-color-scheme: dark) {
    .table-of-contents {
        background-color: #2b2c2f;
        border-color: #3c3c3c;
    }

    .toc-title {
        color: #e0e0e0;
    }

    .toc-list a {
        color: #79b8ff;
    }

        .toc-list a:hover {
            color: #9cc2ff;
        }

    .toc-empty {
        color: #a0a0a0;
    }

    @keyframes highlight-fade {
        0% {
            background-color: rgba(255, 235, 59, 0.3);
        }

        100% {
            background-color: transparent;
        }
    }
}
