/* ==========================================================================
   category.css - カテゴリーページ専用スタイル
   ========================================================================== */

/* ==========================================================================
   Category Header
   ========================================================================== */
.category-header {
    background: var(--white);
    padding: 3rem 0;
    border-bottom: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.category-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(45, 164, 167, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.category-icon {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
}

.category-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.category-description {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 600px;
}

.category-stats {
    display: flex;
    gap: 2rem;
    margin-top: 1.5rem;
}

.category-stat {
    text-align: center;
}

.category-stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
}

.category-stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Category Hero Image */
.category-hero-image-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.category-hero-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    object-fit: cover;
    aspect-ratio: 16 / 9;
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb-nav {
    padding: 1rem 0;
    background: var(--bg-light);
}

.breadcrumb {
    margin-bottom: 0;
    font-size: 0.875rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item a:hover {
    color: var(--primary-color);
}

.breadcrumb-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

/* ==========================================================================
   Filter & Sort Bar
   ========================================================================== */
.filter-bar {
    background: var(--white);
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.filter-bar .form-select {
    border-radius: 8px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    font-size: 0.875rem;
    min-width: 140px;
    background-color: var(--white);
}

.filter-bar .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 164, 167, 0.1);
}

.view-toggle {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: visible;
    display: flex;
    flex-shrink: 0;
}

.view-toggle .btn {
    width: 40px;
    height: 38px;
    padding: 0;
    border: none;
    background: var(--white);
    color: var(--text-muted);
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle .btn:first-child {
    border-radius: 7px 0 0 7px;
}

.view-toggle .btn:last-child {
    border-radius: 0 7px 7px 0;
}

.view-toggle .btn:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.view-toggle .btn.active {
    background: var(--primary-color);
    color: var(--white);
}

.view-toggle .btn + .btn {
    border-left: 1px solid #e0e0e0;
}

.results-count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.results-count strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* ==========================================================================
   Article Grid
   ========================================================================== */
.article-grid {
    padding: 2rem 0;
}

.article-card {
    height: 100%;
}

.article-card .card-body .category-tag {
    align-self: flex-start;
}

/* ==========================================================================
   List View
   ========================================================================== */
.list-view .col-md-6.col-lg-4,
.list-view .col-md-6.col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
}

.list-view .article-card {
    display: flex;
    flex-direction: row;
    height: auto;
}

.list-view .article-card .card-img-wrapper {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
}

.list-view .article-card .card-img-wrapper img {
    border-radius: 16px 0 0 16px;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 741 / 461;
}

.list-view .article-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 1.25rem 1.5rem;
    flex: 1;
}

.list-view .article-card .card-body .card-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.list-view .article-card .card-body .card-text {
    margin-bottom: 0;
}

/* リストビュー: card-footerを非表示にしてcard-body内にメタ情報を配置 */
.list-view .article-card .card-footer {
    display: none;
}

/* リストビュー用のメタ情報（card-body内に表示） */
.list-view .article-card .card-body .list-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.list-view .article-card .card-body .list-meta .author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.list-view .article-card .card-body .list-meta .author img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.list-view .article-card .card-body .list-meta .views {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* グリッドビュー時はlist-metaを非表示 */
.article-card .card-body .list-meta {
    display: none;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination-wrapper {
    padding: 2rem 0 3rem;
}

.pagination {
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.pagination .page-link {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid #e0e0e0;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
    padding: 0;
}

.pagination .page-link:hover {
    background: rgba(45, 164, 167, 0.08);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--white);
}

.pagination .page-item.disabled .page-link {
    background: var(--bg-light);
    color: var(--text-muted);
    border-color: #e0e0e0;
}

.pagination .page-link.page-arrow {
    width: auto;
    padding: 0 1.25rem;
    border-radius: 50px;
}

/* 省略記号 */
.pagination .page-ellipsis .page-link {
    border: none;
    background: none;
    color: var(--text-muted);
    pointer-events: none;
    width: 24px;
    min-width: 24px;
}

.pagination .page-ellipsis .page-link:hover {
    background: none;
}

/* スマートフォン対応 */
@media (max-width: 575.98px) {
    .pagination {
        gap: 0.125rem;
    }

    .pagination .page-link {
        width: 34px;
        height: 34px;
        font-size: 0.8125rem;
    }

    .pagination .page-link.page-arrow {
        padding: 0 0.5rem;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .pagination .page-ellipsis .page-link {
        width: 20px;
        min-width: 20px;
    }
}

/* ==========================================================================
   Subcategory Tabs
   ========================================================================== */
.subcategory-tabs {
    background: var(--white);
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.subcategory-tabs .nav-pills {
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.subcategory-tabs .nav-pills::-webkit-scrollbar {
    display: none;
}

.subcategory-tabs .nav-link {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    white-space: nowrap;
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

.subcategory-tabs .nav-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.subcategory-tabs .nav-link.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--white);
}

/* ==========================================================================
   No Results
   ========================================================================== */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.no-results-icon {
    font-size: 4rem;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 1.5rem;
}

.no-results h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.no-results p {
    color: var(--text-muted);
}

/* ==========================================================================
   Related Categories
   ========================================================================== */
.related-categories {
    background: var(--bg-light);
    padding: 3rem 0;
}

.related-category-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    height: 100%;
}

.related-category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.related-category-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
    margin: 0 auto 1rem;
}

.related-category-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.related-category-card span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ==========================================================================
   Responsive - Category Page
   ========================================================================== */
@media (max-width: 991.98px) {
    .category-title {
        font-size: 1.625rem;
    }

    .category-stats {
        gap: 1.5rem;
    }

    .list-view .article-card .card-img-wrapper {
        width: 220px;
        min-width: 220px;
    }
}

@media (max-width: 767.98px) {
    .category-header {
        padding: 2rem 0;
    }

    .category-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .category-title {
        font-size: 1.375rem;
    }

    .category-stats {
        gap: 1rem;
    }

    .category-stat-number {
        font-size: 1.25rem;
    }

    .filter-bar {
        position: static;
    }

    .filter-bar .form-select {
        min-width: auto;
        flex: 1;
    }

    .list-view .article-card {
        flex-direction: column;
    }

    .list-view .article-card .card-img-wrapper {
        width: 100%;
        min-width: 100%;
    }

    .list-view .article-card .card-img-wrapper img {
        border-radius: 16px 16px 0 0;
    }

    .list-view .article-card .card-footer {
        display: block;
    }

    .list-view .article-card .card-body .list-meta {
        display: none;
    }
}

/* ==========================================================================
   スマホ・タブレット用レスポンシブ
   ========================================================================== */
@media (max-width: 991.98px) {
    .category-header {
        padding: 1.5rem 0;
    }
    
    .category-hero-image-wrapper {
        margin-bottom: 1.5rem;
    }
    
    .category-title {
        font-size: 1.625rem;
    }
}

/* モバイル用画像オーバーレイ */
.category-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    border-radius: 0 0 16px 16px;
}

.category-overlay-stats {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 500;
}

.category-overlay-stats i {
    color: #fff;
}

@media (max-width: 575.98px) {
    .category-header {
        padding: 1rem 0;
    }
    
    .category-title {
        font-size: 1.375rem;
    }
    
    .category-icon {
        width: 60px;
        height: 60px;
    }
    
    .category-icon i {
        font-size: 1.5rem;
    }
}