﻿/* 投稿一覧ページのレイアウト */
.posts-app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 1.5rem;
}

/* メインコンテンツエリア */
.posts-main-content {
  animation: fadeIn 0.5s ease-out;
}

.post-card.mobile-active {
    display: none;
}

/* 投稿カードのスタイル */
.posts-list {
    /*display: grid;
  gap: 1rem;*/
    display: grid;
    grid-template-columns: 1fr 1fr; /* 基本は2列表示 */
    gap: 16px; /* カード間のスペース */
    width: 100%;
}

.post-item {
    background-color: white;
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s;
    cursor: pointer;
    padding: 1.25rem;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 0; /* グリッドのgapを使うため */
    height: 160px; /* 固定の高さを設定 */
}

.post-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--hover-shadow);
}

.post-content {
  margin-bottom: 1rem;
}

.post-text h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--secondary-color);
}

.post-text p {
  color: #555;
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* タグスタイル */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.tag {
  background-color: #e9f3ff;
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

.tag:hover {
  background-color: var(--primary-color);
  color: white;
}

.tag.active {
  background-color: var(--primary-color);
  color: white;
}

.tag-more {
  background-color: #f0f0f0;
  color: #666;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
}

/* 投稿ステータス */
.post-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: #666;
}

.stats-left {
  display: flex;
  gap: 1rem;
}

.likes, .comments, .user-count {
  display: inline-flex;
  align-items: center;
}

.post-date {
  font-weight: 500;
}

/* サイドナビゲーション */
.side-navigation {
  position: sticky;
  top: 90px;
  height: fit-content;
  animation: fadeIn 0.5s ease-out;
  animation-delay: 0.2s;
  opacity: 0;
  animation-fill-mode: forwards;
}

.create-post-section, .search-section,
.tags-section, .popular-section,
.active-chat-section {
    /*background-color: white;*/
    background: #0d223a;
    border-radius: var(--card-radius);
    padding: 1rem;
    margin-bottom: 0.5rem;
    box-shadow: var(--card-shadow);
}

.side-nav-header {
  margin-bottom: 1rem;
}

.create-post-btn {
  width: 100%;
  padding: 0.75rem;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: var(--btn-radius);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.create-post-btn:hover {
  background-color: #e5147a;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(247, 37, 133, 0.3);
}

.create-post-btn i {
  margin-right: 8px;
}

/****************/
.create-post-btn2 {
    width: 100%;
    padding: 0.75rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--btn-radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .create-post-btn2:hover {
        background-color: #e5147a;
        transform: translateY(-2px);
        box-shadow: 0 4px 8px rgba(247, 37, 133, 0.3);
    }

    .create-post-btn2 i {
        margin-right: 8px;
    }
/****************/

/* 検索ボックス */


.search-form {
  display: flex;
}

.search-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 2px solid #e9ecef;
  border-radius: var(--btn-radius) 0 0 var(--btn-radius);
  font-size: 0.95rem;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.search-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0 1rem;
  border-radius: 0 var(--btn-radius) var(--btn-radius) 0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.search-btn:hover {
  background-color: var(--secondary-color);
}

/* フィルタータグ */
.filter-status {
  margin-top: 0.75rem;
  background-color: #f8f9fa;
  padding: 0.75rem;
  border-radius: var(--btn-radius);
  font-size: 0.875rem;
}

.filter-tag {
  display: inline-block;
  background-color: #e9f3ff;
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
  margin-right: 0.5rem;
}

.clear-filters {
  display: block;
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  text-align: right;
}

.clear-filters:hover {
  text-decoration: underline;
}

/* タグクラウド */
.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-filter {
  background-color: #e9f3ff;
  color: var(--primary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  border: none;
}

.tag-filter:hover {
  background-color: var(--primary-color);
  color: white;
}

.tag-filter.active {
  background-color: var(--primary-color);
  color: white;
}

/* 人気投稿 */
.popular-posts, .active-chat-posts {
  display: grid;
  gap: 0.75rem;
}

.popular-post-item, .active-chat-post-item {
  background-color: #f8f9fa;
  padding: 0.75rem;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: all 0.2s;
}

.popular-post-item:hover, .active-chat-post-item:hover {
  background-color: #e9f3ff;
  transform: translateY(-2px);
}

.popular-post-content h5, .active-chat-post-content h5 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--dark-text);
}

.popular-post-meta, .active-chat-post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #666;
}

.chat-activity {
  color: var(--accent-color);
  font-weight: 500;
}

.live-user-count {
  color: var(--accent-color);
  font-weight: 500;
}

/* モバイル用要素 */
.mobile-create-post-fab {
  display: none;
  position: fixed;
  bottom: 130px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--accent-color);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.mobile-create-post-fab:hover {
  transform: scale(1.1);
  background-color: #e5147a;
}

.mobile-search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  animation: fadeIn 0.3s;
}

.mobile-search-content {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: white;
  border-radius: 20px 20px 0 0;
  padding: 1.5rem;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  max-height: 80vh;
  overflow-y: auto;
}

/* アコーディオン（モバイル用） */
.mobile-accordion {
  margin-bottom: 1rem;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.mobile-accordion-header {
  background-color: white;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
}

.mobile-accordion-content {
  background-color: #f8f9fa;
  padding: 1rem;
  display: none;
}

.mobile-accordion-content.active {
  display: block;
  animation: fadeIn 0.3s;
}

/* レスポンシブデザイン */
@media (max-width: 992px) {
  .posts-app {
    grid-template-columns: 1fr 300px;
  }

    
}

@media (max-width: 768px) {
  .posts-app {
    grid-template-columns: 1fr;
  }
  
  .side-navigation {
    display: none;
  }
  
  .mobile-create-post-fab {
    display: flex;
  }
  
  .post-item {
    padding: 1rem;
  }
  
  .post-text h3 {
    font-size: 1.1rem;
  }
  
  /* モバイル用アコーディオンを表示 */
  .mobile-filters {
    display: block;
    margin-bottom: 1rem;
  }
  
  .mobile-search-btn {
    display: flex;
    width: 100%;
    padding: 0.75rem;
    background-color: white;
    border: none;
    border-radius: var(--btn-radius);
    box-shadow: var(--card-shadow);
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    cursor: pointer;
  }
  
  .mobile-search-form {
    display: flex;
    margin-bottom: 1rem;
  }
  
  .mobile-search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: var(--btn-radius) 0 0 var(--btn-radius);
  }
  
  .mobile-search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1rem;
    border-radius: 0 var(--btn-radius) var(--btn-radius) 0;
  }
  
  .mobile-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
  }
  
  .mobile-tag-filter {
    background-color: #e9f3ff;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    text-decoration: none;
  }
  
  .mobile-tag-filter.active {
    background-color: var(--primary-color);
    color: white;
  }

    /* アクションボタンを中央に配置 */
    .post-card .action-buttons {
        gap: 30px !important;
    }

    

    
}

@media (min-width: 1024px) {
    .mobile-create-post-fab {
        display: none !important;
    }
}

@media (min-width: 769px) and (max-width: 1023px) {
    .mobile-create-post-fab {
        display: none !important;
    }
}

.search-help, .mobile-search-help {
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
    display: block;
}

@media (max-width: 768px) {
    /* 投稿カードのスタイル */
    .posts-list {
        display: grid;
        /*gap: 1rem;*/
        grid-template-columns: 1fr 1fr; /* 基本は2列表示 */
        gap: 16px; /* カード間のスペース */
        width: 100%;
    }

    .post-item {
        background-color: white;
        border-radius: var(--card-radius);
        overflow: hidden;
        box-shadow: var(--card-shadow);
        transition: all 0.3s;
        cursor: pointer;
        padding: 1.25rem;
        border-left: 4px solid var(--primary-color);
        margin-bottom: 0; /* グリッドのgapを使うため */
        height: 160px; /* 固定の高さを設定 */
        width:100%;
    }

    .post-card {
        flex-basis: 49% !important;
    }

    .mobile-search-help {
        text-align: center;
        margin-bottom: 12px;
    }

    .post-card.mobile-active {
        display:block !important;
    }

}

/* 背景画像付きカードデザイン - 修正版 */
/* 背景画像付きカードデザイン - 修正版 */
.post-card {
    background-color: #1e3346;
    position: relative;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-basis: 49%;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    z-index: 1;
    padding: 10px;
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

    /* 背景画像の上にオーバーレイを追加して文字を読みやすくする */
    .post-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0.7) 100%);
        z-index: -1;
    }

    /* 日付表示のスタイル - 更新 */
    .post-card .post-date {
        position: absolute;
        top: 5px;
        right: 5px;
        font-size: 0.8rem;
        color: #ffffff;
        opacity: 0.9;
        /*background-color: rgba(0, 0, 0, 0.3);*/
        padding: 2px 6px;
        border-radius: 4px;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }

    /* アクションボタンエリアのスタイル調整 */
    .post-card .post-actions {
        margin-top: auto;
        background-color: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(2px);
        padding: 8px;
        border-radius: 0 0 12px 12px;
        margin: 0 -10px -10px -10px;
        position: relative;
    }

    /* アクションボタンを中央に配置 */
    .post-card .action-buttons {
        display: flex;
        align-items: center;
        justify-content: center; /* 中央揃え */
        gap: 80px;
    }

    .post-card .action-btn {
        background: transparent;
        border: none;
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        padding: 5px;
    }

        .post-card .action-btn i {
            font-size: 1.3rem; /* アイコンサイズを大きく */
        }

        .post-card .action-btn span {
            font-size: 1.2rem; /* テキストサイズを大きく */
            font-weight: 600;
        }

    /* カテゴリタグを右側に配置 */
    .post-card .post-categories {
        position: absolute;
        right: 10px;
        bottom: 10px;
        display: flex;
        align-items: center;
    }

    .post-card .category-tag {
        background-color: rgba(255, 255, 255, 0.2);
        padding: 3px 8px;
        border-radius: 12px;
        font-size: 0.8rem;
        margin-right: 4px;
    }

    .post-card .category-more {
        font-size: 0.8rem;
        opacity: 0.8;
    }

    /* テキストコンテンツの調整 - 更新 */
    .post-card .post-text {
        font-size: 16px; /* タイトルに合わせてテキストサイズを調整 */
        line-height: 1.5;
        margin: 0;
        padding: 10px 5px;
        color: #ffffff;
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
        display: -webkit-box;
        -webkit-line-clamp: 5; /* タイトルのスペースを確保するため行数を減らす */
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        font-weight: 400;
        flex-grow: 1;
    }

    /* 投稿カードのコンテンツ調整 - 更新 */
    .post-card .post-content {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    /* 投稿カードのタイトルスタイル - 更新 */
    .post-card .post-title {
        text-align: center;
        font-size: 0.9rem;
        font-weight: 600;
        margin-bottom: 10px;
        margin-top: 5px;
        color: #ffffff;
        text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
        padding: 8px;
        background-color: rgba(0, 0, 0, 0.4);
        border-radius: 6px;
        border-radius: 12px 12px 0 0;
        margin: -10px -10px -10px;
        position: relative; /* 相対位置を設定 */
    }


.post-header {
    position: relative;
    padding-top: 25px; /* カテゴリタグ用のスペースを確保 */
}

/* タグ関連のスタイル */
.post-categories-header {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    z-index: 2;
}

.category-tag-header {
    font-size: 0.75rem;
    /*background-color: rgba(0, 0, 0, 0.5);*/
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    backdrop-filter: blur(2px);
}

    .category-tag-header:hover {
        background-color: rgba(255, 255, 255, 0.3);
        transform: translateY(-1px);
    }

.category-more-header {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    background-color: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
}

/* サイドバータグリスト強化 */
.active-filter-info {
    background: #f0f7ff;
    padding: 0.6rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid var(--primary-color);
}

.clear-category-filter {
    color: #666;
    font-size: 1.1rem;
}

    .clear-category-filter:hover {
        color: #ff4757;
    }

.show-all-tags-btn {
    width: 100%;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    padding: 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

    .show-all-tags-btn:hover {
        background: #e9ecef;
        color: #333;
    }

.all-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}

/* モバイルタグ関連 */
.mobile-active-filter {
    background: #f0f7ff;
    padding: 0.6rem;
    border-radius: 8px;
    margin-bottom: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mobile-clear-filter {
    background: #f8f9fa;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.mobile-show-more-tags {
    width: 100%;
    background: #f8f9fa;
    border: 1px dashed #ddd;
    padding: 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    cursor: pointer;
    color: #666;
}

.more-mobile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #eee;
}

/* モバイルタグの最適化 */
@media (max-width: 768px) {
    .post-categories-header {
        margin-bottom: 0.3rem;
    }

    .category-tag-header {
        font-size: 0.65rem;
        padding: 0.1rem 0.4rem;
    }
}

/* 3行で切り捨てるためのスタイル */
.truncate-text {
    white-space: pre-line;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5em;
    height: 4.5em; /* 1.5em × 3行 */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    padding: 0 10px;
    margin: 10px 0;
    position: relative;
}

/* Firefoxなど-webkit-line-clampをサポートしていないブラウザ用の互換対応 */
@supports not (-webkit-line-clamp: 3) {
    .truncate-text::after {
        content: "...";
        position: absolute;
        right: 0;
        bottom: 0;
        padding-left: 40px;
        background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.5) 50%);
    }
}

.section-title {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 15px;
    padding: 8px 15px;
    border-radius: 5px;
    display: inline-block;
}

.popular-section-title {
    background-color: rgba(255, 80, 80, 0.1);
    color: #ff4040;
    border-left: 4px solid #ff4040;
}

.recent-section-title {
    background-color: rgba(80, 130, 255, 0.1);
    color: #4080ff;
    border-left: 4px solid #4080ff;
}
/* モバイル表示時のセクション */
.mobile-active-section {
    margin-bottom: 1rem;
    width: 100%;
}

.active-posts-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

/* モバイル表示時のアクティブな投稿カード */
.post-card.mobile-active {
    display: none; /* デフォルトでは非表示 */
    border-left: 4px solid var(--accent-color);
    position: relative;
}

    /* アクティブな投稿のハイライト */
    .post-card.mobile-active::after {
        content: '🔥 活発な議論';
        position: absolute;
        top: 10px;
        right: 10px;
        background-color: rgba(233, 30, 99, 0.9);
        color: white;
        padding: 2px 8px;
        border-radius: 12px;
        font-size: 0.7rem;
        font-weight: bold;
        z-index: 10;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }


/* モバイル表示の調整 */
@media (max-width: 768px) {
    /* セクションタイトルを表示 */
    .section-title {
        display: block;
    }

    /* アクティブな投稿を表示 */
    .post-card.mobile-active {
        display: flex;
        width: 100%;
    }

    /* 新着投稿のレイアウト */
    .recent-posts-section .post-card {
        width: 100%;
    }

    /* アクティブな投稿がない場合はセクションを非表示 */
    .mobile-active-section:empty,
    .mobile-active-section:has(.active-posts-grid:empty) {
        display: none !important;
    }
}

/* セクション間のスペーサー */
.section-spacer {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 1.5rem 0;
    display: none;
}

.mobile-active-section{
    display:none;
}

@media (max-width: 768px) {
    .section-spacer {
        display: block;
    }
    .mobile-active-section {
        display: block !important;
    }
}

/* 投稿一覧のレイアウト修正 - グリッドベースの2列レイアウトに統一 */
.posts-list {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 基本は2列表示 */
    gap: 16px; /* カード間のスペース */
    width: 100%;
}

/* 投稿カードの基本スタイル - グリッドレイアウトに対応 */
.post-card {
    width: 100%; /* グリッドセル内で100%幅 */
    height: 220px; /* 高さは固定 */
    margin-bottom: 0; /* グリッドのgapを使うため */
}

/* 盛り上がっている投稿セクションも2列グリッドに */
.active-posts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

/* モバイル表示時の調整 */
@media (max-width: 768px) {
    /* 投稿リストの間隔調整 */
    .posts-list,
    .active-posts-grid {
        gap: 12px; /* モバイルでは間隔を少し狭める */
    }
    
    /* カードの高さをやや小さく */
    .post-card {
        height: 200px;
    }
    
    /* タイトルとテキストサイズ調整 */
    .post-card .post-title {
        font-size: 0.8rem;
        padding: 6px;
    }
    
    .post-card .post-text {
        font-size: 14px;
        -webkit-line-clamp: 3; /* 行数を少し減らす */
    }
    
    /* アクションボタンのスペース調整 */
    .post-card .action-buttons {
        gap: 40px !important; /* モバイル用に間隔を狭める */
    }
    
    .post-card .action-btn i {
        font-size: 1.1rem;
    }
    
    .post-card .action-btn span {
        font-size: 1rem;
    }
}

/* 極小画面では1列に切り替え */
@media (max-width: 480px) {
    .posts-list,
    .active-posts-grid {
        grid-template-columns: 1fr; /* 1列グリッド */
    }
    
    .post-card {
        height: 220px; /* 高さを元に戻す */
    }
}

/* カテゴリタグの調整 */
.post-categories-header {
    flex-wrap: wrap;
    max-width: 90%;
}

.category-tag-header {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

/* モバイルアクティブカードのバッジ位置調整 */
.post-card.mobile-active::after {
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    padding: 2px 6px;
}

/* セクション表示の改善 */
.mobile-active-section {
    width: 100%;
    display: block; /* すべての画面サイズで表示 */
}

@media (min-width: 769px) {
    /* PC・タブレット表示時のセクションタイトル表示 */
    .section-title {
        display: block;
    }
    
    /* PCでもセクション間のスペーサーを表示 */
    .section-spacer {
        display: block;
    }
}

/* 修正: セクションの表示順と構造を統一 */
.mobile-active-section {
    display: block !important; /* すべての画面サイズで常に表示 */
    width: 100%;
    margin-bottom: 1.5rem;
}

/* セクションタイトルを常に表示 */
.section-title {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 1rem;
    padding: 0.5rem 0.75rem;
    color: var(--dark-text);
    position: relative;
    letter-spacing: 0.5px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* セクション間のスペーサーを常に表示 */
.section-spacer {
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
    margin: 1.5rem 0;
    display: block;
}

/* 投稿グリッドの共通スタイル */
.posts-list, 
.active-posts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2列表示に統一 */
    gap: 16px;
    width: 100%;
}

/* モバイルでのアクティブな投稿カードの表示を有効化 */
.post-card.mobile-active {
    display: flex; /* すべての画面サイズで表示 */
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .posts-list,
    .active-posts-grid {
        gap: 12px; /* モバイルでは間隔を少し狭める */
    }
}

/* 極小画面では1列に切り替え */
@media (max-width: 480px) {
    .posts-list,
    .active-posts-grid {
        grid-template-columns: 1fr; /* 1列グリッド */
    }
}

/* 不要な条件付き表示の削除 */
@media (min-width: 769px) {
    /* すべての画面サイズでセクション表示を統一するため、
       特定画面サイズでの上書きを削除 */
}

/* ページヘッダー */
.page-header {
    /*background: linear-gradient(135deg, #6b7c93 0%, #8fa3bf 100%);*/
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 20px rgba(107, 124, 147, 0.2);
    background: var(--c-bg-base);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
}
.page-header h1 {
    text-align: center;
    width: 100%; /* 幅いっぱいに広げて中央配置を確実に */
}



/******************************************/

/* 無限スクロール関連のスタイル */
.posts-loading-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    width: 100%;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin: 20px 0;
}

.spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 3px solid #fff;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.end-of-posts-message {
    text-align: center;
    padding: 20px;
    color: #aaa;
    font-style: italic;
    margin: 20px 0;
}

.posts-loading-error {
    text-align: center;
    padding: 20px;
    color: #f44336;
    background-color: rgba(244, 67, 54, 0.1);
    border-radius: 8px;
    margin: 20px 0;
}

    .posts-loading-error button {
        background-color: #f44336;
        color: white;
        border: none;
        padding: 8px 16px;
        border-radius: 4px;
        margin-top: 10px;
        cursor: pointer;
    }

        .posts-loading-error button:hover {
            background-color: #d32f2f;
        }

/******************************************/

/* === ライブ人数バッジ（投稿カード右上） === */
.post-card .live-user-badge {
    position: absolute;
    top: 28px; /* .post-date の下に重ならないように配置 */
    right: 6px;
    display: none; /* デフォルト非表示（0人時） */
    background: rgba(247, 37, 133, 0.95); /* var(--accent-color)系 */
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    z-index: 3;
    line-height: 1.6;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
    align-items: center;
    gap: 6px;
}

    .post-card .live-user-badge i {
        margin-right: 4px;
    }

    .post-card .live-user-badge.active {
        display: inline-flex;
        animation: livePulse 1.2s ease-in-out infinite;
    }

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(247, 37, 133, 0.45);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(247, 37, 133, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(247, 37, 133, 0);
    }
}

/* 極小画面で少し小さく */
@media (max-width: 480px) {
    .post-card .live-user-badge {
        font-size: 0.7rem;
        padding: 2px 6px;
        right: 4px;
        top: 26px;
    }
}