/*
Theme Name: PUX
Description: PUX用の必要最小限のWordPressテーマ
Version: 1.0
Author: PUX Team
*/

/* ニュースカードのリンクスタイル */
.news-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.news-cat, .news-tag {
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.news-cat:hover, .news-tag:hover {
    opacity: 0.8;
}

/* カテゴリとタグのリンクがクリック可能であることを示す */
.news-cat, .news-tag {
    position: relative;
    z-index: 2; /* カード全体のクリックより優先 */
}

/* カテゴリタブのレスポンシブ対応 */
.category-tab-list {
    display: flex;
    flex-wrap: wrap;
}

.category-tab-item {
    list-style: none;
}

.category-tab-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 12px 40px;
    background: #f4f4f4;
    text-decoration: none;
    color: #222;
    font-weight: 700;
    transition: all 0.2s ease;
    min-width: 120px;
}

.category-tab-link.is-active {
    background: #0087ff;
    color: #fff;
}

.category-tab-link:hover {
    opacity: 0.8;
}

.tab-text {
    flex: 1;
    text-align: center;
    white-space: nowrap;
}

.tab-arrow {
    display: none; /* PC版では矢印を非表示 */
    margin-left: 8px;
}

/* SP版のアコーディオンスタイル */
@media (max-width: 850px) {
    .category-tab-list {
        flex-direction: column;
        gap: 0;
        background: #f4f4f4;
        border-radius: 8px;
        overflow: hidden;
    }

    .category-tab-item {
        order: 1; /* デフォルトは後ろに */
    }

    .category-tab-item:has(.is-active) {
        order: 0; /* アクティブな項目を最初に */
    }

    .category-tab-link {
        width: 100%;
        background: transparent;
        border-radius: 0;
        border-bottom: 1px solid #e0e0e0;
        min-width: auto;
        justify-content: space-between;
    }

    .category-tab-link:last-child {
        border-bottom: none;
    }

    .category-tab-link.is-active {
        background: #0087ff;
        color: #fff;
        border-bottom-color: #0087ff;
    }

    .tab-arrow {
        display: block; /* SP版では矢印を表示 */
    }

    /* アコーディオンの開閉 */
    .category-tab-list:not(.is-open) .category-tab-item:not(:has(.is-active)) {
        display: none;
    }

    .category-tab-list.is-open .category-tab-item:has(.is-active) .tab-arrow {
        transform: rotate(180deg);
    }

    .category-tab-list.is-open .category-tab-item:not(:has(.is-active)) .tab-arrow {
        visibility: hidden;
    }
}
