/* index.php専用CSS */

/* 記事一覧セクション */
.posts-section {
    margin-bottom: 2rem;
}

.posts-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
}

.posts-title {
    font-size: 1.75rem;
    font-weight: bold;
    margin: 0;
}

.posts-subtitle {
    margin: 0.5rem 0 0 0;
    opacity: 0.9;
    font-size: 0.95rem;
}

.active-filters {
    margin-top: 1rem;
}

.active-filters .badge {
    margin: 0 0.25rem;
}

.debug-info {
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.25rem;
}

/* 検索結果なし */
.no-posts {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.no-posts-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.no-posts-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 記事一覧アイテム */
.post-item {
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.2s ease;
}

.post-item:hover {
    background-color: #f8f9fa;
}

.post-content {
    display: flex;
    align-items: flex-start;
    padding: 1.5rem;
    gap: 1rem;
}

.post-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.post-details {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
}

.post-link {
    color: #212529;
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-link:hover {
    color: #007bff;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.post-meta > span,
.post-meta > a {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* スレ作成日の特別スタイル */
.post-thread-date {
    background-color: #e7f3ff;
    color: #0066cc;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    border: 1px solid #b3d9ff;
    font-size: 0.8rem !important;
}

.category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

.post-category {
    text-decoration: none;
}

.post-category:hover .category-badge {
    opacity: 0.8;
}

.post-excerpt {
    color: #6c757d;
    line-height: 1.6;
}

/* ページネーション */
.pagination-nav {
    padding: 2rem;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

/* インライン広告 */
.post-ad .inline-ad {
    margin: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px dashed #856404;
    border-radius: 0.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.post-ad .inline-ad:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.inline-ad-label {
    margin-bottom: 1rem;
}

.inline-ad-card {
    text-decoration: none;
    color: inherit;
    display: block;
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.3s ease;
}

.inline-ad-card:hover {
    color: inherit;
    text-decoration: none;
    transform: scale(1.02);
}

.inline-ad-image {
    height: 120px;
    border-radius: 0.375rem;
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inline-ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.inline-ad-placeholder {
    color: #6c757d;
    font-size: 2rem;
}

.inline-ad-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #212529;
}

.inline-ad-desc {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.inline-ad-btn {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    border: none;
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.inline-ad-btn:hover {
    background: linear-gradient(45deg, #e55a2e, #e08618);
    transform: scale(1.05);
    color: white;
}

.inline-ad-raw {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    overflow: hidden; /* はみ出し防止 */
}

/* 広告画像のはみ出し防止 - 小さい画像は拡大せず、大きい画像のみ縮小 */
.post-item.post-ad .inline-ad-raw img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    margin: 0 auto;
}

/* 970px等の大きなバナー広告対応 */
.post-item.post-ad .inline-ad-raw a {
    display: block;
    max-width: 100%;
    overflow: hidden;
}

/* 外部リンクアイコンの調整 */
.post-item.post-ad .inline-ad-raw .external-link-icon {
    display: inline-block;
    margin-left: 0.25rem;
    vertical-align: middle;
}

/* thread_created_date フィルター時の特別表示 */
.posts-header[data-filter-type="thread_date"] {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.posts-header[data-filter-type="thread_date"]::before {
    content: '🧵';
    margin-right: 0.5rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .posts-header {
        padding: 1rem;
        text-align: center;
    }
    
    .posts-title {
        font-size: 1.5rem;
    }
    
    .posts-subtitle {
        font-size: 1rem;
    }
    
    .post-content {
        padding: 1rem;
        gap: 0.75rem;
    }
    
    .post-icon {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
    
    .post-title {
        font-size: 1.1rem;
    }
    
    .post-meta {
        font-size: 0.8rem;
        gap: 0.75rem;
        flex-direction: column;
        align-items: flex-start;
    }
    
    .post-meta > span,
    .post-meta > a {
        margin-bottom: 0.25rem;
    }
    
    .inline-ad-image {
        height: 100px;
    }

    .post-thread-date {
        font-size: 0.7rem !important;
        padding: 0.1rem 0.3rem;
    }
    
    .no-posts {
        padding: 2rem 1rem;
    }
    
    .post-item:hover {
        transform: none;
    }
}

/* アニメーション */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-item {
    animation: fadeInUp 0.4s ease;
}

.post-item:nth-child(1) { animation-delay: 0.1s; }
.post-item:nth-child(2) { animation-delay: 0.2s; }
.post-item:nth-child(3) { animation-delay: 0.3s; }
.post-item:nth-child(4) { animation-delay: 0.4s; }
.post-item:nth-child(5) { animation-delay: 0.5s; }