/* products_news.html専用のスタイル */

/* セクション全体の余白と背景 */
.products-news-section {
    background-color: var(--color-background);
    max-width: 1000px;
    margin: 0 auto;
    box-sizing: border-box;
    position: relative;
}

.archive_link {
    text-align: right;
    font-size: var(--font-size-caption);
}

/* 検索コンテナの基本デザイン */
#search-container {
    display: flex;
    gap: 10px;
    margin: 35px auto;
    max-width: 700px;
    padding: 15px;
    border: 1px solid var(--color-background-border);
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    align-items: center;
}

/* 検索入力フィールドのデザイン */
#search-input {
    flex-grow: 1;
    padding: 12px 18px;
    border: 1px solid #c0c0c0;
    border-radius: 8px;
    font-size: var(--font-size-body-text);
    color: var(--color-body-text);
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.05);
}

#search-input::placeholder {
    color: #999;
}

#search-input:focus {
    border-color: var(--color-submit-button-hovar);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

/* 検索ボタンのデザイン */
#search-button {
    padding: 12px 25px;
    background-color: var(--color-submit-button);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: var(--font-size-body-text);
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#search-button:hover {
    background-color: var(--color-submit-button-hovar);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

#search-button:active {
    background-color: var(--color-submit-button-hovar);
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* タブ全体を囲むコンテナ */
.tabs-wrapper {
    margin-bottom: 50px;
}

/* 各タブグループの共通スタイル */
.tabs-group {
    display: flex;
    justify-content: space-evenly;
    padding-top: 10px;
    background-color: var(--color-background);
    position: relative;
    padding-bottom: 12px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* tabs-group の下線を表現 */
.tabs-group::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-background-border);
    z-index: 0;
}

/* 1段目のタブ（NEWS_TYPE）専用スタイル */
.news-type-group {
    margin-bottom: 15px;
}
.news-type-group .tab-item {
    flex-grow: 1;
    min-width: unset;
}

/* 2段目のタブ（Brand）専用スタイル */
.brand-group {
    padding-top: 10px;
    margin-top: -15px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
}

.brand-group::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 113%;
    height: 2px;
    background-color: var(--color-background-border);
    z-index: 0;
}

.brand-group .tab-item {
    flex-shrink: 0;
    min-width: 80px;
}

/* 各タブアイテムのスタイル */
.tab-item {
    padding: 8px 10px;
    font-size: var(--font-size-body-text);
    cursor: pointer;
    background-color: transparent;
    color: var(--color-body-text);
    border: none;
    position: relative;
    text-decoration: none;
    transition: color 0.3s, font-weight 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* アクティブな（選択中の）タブのスタイル */
.tab-item.active {
    color: var(--color-body-text);
    font-weight: bold;
    position: relative;
}

/* アクティブなタブに赤の下線を重ねる */
.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: red;
    transition: background-color 0.3s ease, width 0.3s ease, transform 0.3s ease;
    z-index: 2;
}

/* 無効化されたタブのスタイル */
.tab-item.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    color: var(--color-background-border);
    pointer-events: none;
}

/* リスト全体のスタイル */
#products-list {
    display: flex;
    flex-direction: column;
    gap: 10px;

}

/* 各製品情報アイテムのスタイル */
.product-item {
    background-color: var(--color-background);
    border: 1px solid var(--color-background-border);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease-in-out;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ヘッダー: 日付とタイトル、ニュースタイプをまとめるコンテナ */
.product-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

/* タイトルコンテナ */
.product-title {
    flex-grow: 1;
    margin: 0 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: var(--font-size-body-text);
}
.product-names {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
    color: var(--color-body-text);
    font-weight: bold;
    font-size: var(--font-size-body-text);
}
.product-names li {
    margin-bottom: 0;
    line-height: 1.5;
}

/* NewバッジとNewsTypeをまとめるコンテナ */
.type-and-badge-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

/* 日付のスタイル */
.product-date {
    font-size: var(--font-size-caption);
    color: var(--color-body-text-2);
    background-color: var(--color-white-emphasis);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}


.product-info-body {
    display: flex; 
    border-top: 1px dotted var(--color-background-border);
    flex-direction: column;
}

.context-group {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap; 
}

.car-model-info-group {
    align-items: flex-start;
}

/* 個々のラベルの共通スタイル */
.products-news-label {
    display: inline-block;
    padding: 1px 6px;
    font-weight: bold;
    border-radius: 3px;
    line-height: 1.2;
    border: 2px solid;
    color: var(--color-body-text);
    white-space: nowrap;
    font-size: var(--font-size-caption);
    flex-shrink: 0;
    width: fit-content;
}

/* Brandラベルグループ */
.brand-labels-group {
    margin-top: 5px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 8px;
}

/* 対象車種のラベルのスタイル */
.car-model-info {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
    align-self: flex-start;
    flex-direction: column;
}
.car-model-label {
    font-size: var(--font-size-body-text);
    font-weight: bold;
    color: var(--color-accent-2);
    flex-shrink: 0;
}
.car-model {
    display: flex;
    flex-direction: column;
}
.plane-text,
.model-name {
    font-size: var(--font-size-body-text);
    color: var(--color-body-text);
    line-height: 1.1;
    flex-grow: 1;
}
.specification {
    margin-left: 20px;
    font-size: var(--font-size-caption);
    color: var(--color-accent-2);
}

/* Newバッジのスタイル */
.new-badge {
    font-size: var(--font-size-caption);
    background-color: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: normal;
    white-space: nowrap;
    animation: glowing-pulse 2s infinite;
}

/* 本文のスタイル */
.product-fulltext-body {
    font-size: var(--font-size-body-text);
    color: var(--color-body-text);
    line-height: 1.4;
    flex-grow: 1; 
    padding: 10px 0 0 0;
    margin-top: 10px;
    align-self: flex-end;
}
.product-fulltext-body div,
.product-fulltext-body ul {
    margin-bottom: 6px;
}
.product-fulltext-body ul {
    padding-left: 20px;
}

/* --- ページネーションのスタイル --- */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 30px;
    gap: 5px;
}
.page-info {
    display: block; 
    width: 100%; 
    text-align: center;   
    margin-top: 10px; 
    font-size: var(--font-size-caption);
}
.pagination-button {
    background-color: var(--color-white-emphasis);
    border: 1px solid var(--color-background-border);
    color: var(--color-body-text);
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: var(--font-size-caption);
    transition: background-color 0.2s ease, color 0.2s ease;
    min-width: 40px;
    text-align: center;
    text-decoration: none;
}
.pagination-button:hover:not(.active):not(.disabled) {
    background-color: #e0e0e0;
    color: #007bff;
}
.pagination-button.active {
    background-color: #3498db;
    color: var(--color-body-text-dark);
    border-color: #3498db;
    font-weight: bold;
    cursor: default;
}
.pagination-button.disabled {
    background-color: #f8f8f8;
    color: #aaa;
    cursor: not-allowed;
    border-color: #eee;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .products-news-section {
        padding-bottom: 40px;
    }
    .products-news-section h2.section-title {
        margin-bottom: 25px;
    }
    
    /* 検索コンテナのレイアウトを縦並びに変更 */
    #search-container {
        flex-direction: column;
        padding: 10px;
        margin: 20px auto;
    }
    /* 検索入力フィールドとボタンを100%幅にする */
    #search-input {
        width: 100%;
        margin-bottom: 10px;
        padding: 10px;
        box-sizing: border-box;
    }
    #search-button {
        width: 100%;
        padding: 10px 15px;
    }
    
    /* タブグループの横スクロール対応と余白調整 */
    .tabs-group {
        justify-content: flex-start;
        white-space: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
        padding-bottom: 10px;
    }
    .tabs-group::before {
        height: 1px;
    }
    .news-type-group {
        margin-bottom: 10px;
    }
    .news-type-group .tab-item {
        flex-grow: 1;
        min-width: unset;
    }
    .brand-group {
        margin-top: -10px;
    }
    .brand-group::before {
        width: 300%;
    }
    .brand-group .tab-item {
        flex-shrink: 0;
        min-width: 70px;
    }
    .tab-item {
        padding: 6px 8px;
    }
    .tab-item.active::after {
        bottom: -10px;
        height: 3px;
    }
    
    .product-item {
        padding: 15px;
    }
    
    /* 製品情報のヘッダーを縦並びに変更 */
    .product-info-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
    }
    .product-date {
        margin-right: auto;
        order: 1;
    }
    .product-title {
        width: 100%;
        order: 3;
        margin: 0;
    }
    .product-info-body {
        flex-direction: column;
    }
    .context-group {
        display: flex;
        flex-direction: column;
    }
    .type-and-badge-container {
        display: flex;
        align-items: flex-end;
        width: auto;
        order: 2;
        top: 0;
        right: 0;
    }
    
    .product-fulltext-body {
        padding-top: 10px;
        margin-top: 10px;
    }
    .product-fulltext-body ul {
        padding-left: 15px;
    }
    .product-fulltext-body img {
        height: auto;
        width: 100%;
        object-fit:contain;
    }
    
    /* ページネーションの調整 */
    .pagination-container {
        gap: 3px;
        margin-top: 20px;
    }
    .pagination-button {
        padding: 6px 8px;
        min-width: 30px;
    }
}

/* Newバッジに光るアニメーションを追加 */
@keyframes glowing-pulse {
    0% {
        box-shadow: 0 0 5px rgba(231, 76, 60, 0.4), 0 0 10px rgba(231, 76, 60, 0.2);
    }
    50% {
        box-shadow: 0 0 15px rgba(231, 76, 60, 0.8), 0 0 25px rgba(231, 76, 60, 0.5);
    }
    100% {
        box-shadow: 0 0 5px rgba(231, 76, 60, 0.4), 0 0 10px rgba(231, 76, 60, 0.2);
    }
}