/*==================================
  共通スタイル
==================================*/
.section-title {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.section-title-jp {
    display: block;
    text-align: left;
    font-size: var(--font-size-h3);
    font-weight: 700;
    position: relative;
    padding-bottom: 10px;
    color: var(--color-accent);
}

.section-title-jp::after {
    content: '';
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background-color: var(--color-accent-3);
}

/*==================================
  ヒーローセクション
==================================*/
.hero {
    position: relative;
    color: var(--color-background);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-slider, .hero-slider-mobile {
    position: relative;
    align-self: center;
    width: 100%;
    overflow: hidden;
}

.slider-item, .slider-item-mobile {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slider-item a, .slider-item-mobile a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 10;
}

/* 💡 JavaScriptで付与される.activeクラスでスライドを表示する */
.slider-item.active, .slider-item-mobile.active {
    opacity: 1;
}

.hero-pagination {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 25px;
    z-index: 20;
    padding: 6px 10px;
}

.pagination-dot {
    width: 10px;
    height: 10px;
    background-color: #000;
    cursor: pointer;
    transition: background-color 0.3s ease, width 0.3s ease;
    z-index: 21;
}

.pagination-dot.active {
    background-color: #e74c3c;
}

/*==================================
  ヒーローコンテンツ以下のセクション共通コンテナ
==================================*/
.main-content {
    margin: 0 auto;
    max-width: 1200px;
}

/*==================================
  お知らせ・製品新着共通
==================================*/
.news-section {
    margin-top: 20px;
}

.news-button-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 20px;
    width: 100%;
    align-self: flex-end;
}

.news-button {
    display: inline-block;
    padding: 5px 10px;
    color: var(--color-header-text);
    font-weight: 600;
    border-bottom: 1px solid var(--color-accent);
    text-decoration: none;
}

.news-button:hover {
    color: var(--color-link-text);
    transform: translateY(-2px);
}

/*==================================
  お知らせセクション(announcements)
==================================*/
.announcements-section {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.announcements-section .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.announcements-list {
    width: 100%;
    list-style: none;
    box-sizing: border-box;
    /* 💡 clamp()による左右の余白調整 */
    padding: 0 clamp(10px, 5vw, 50px);
}

.announcements-list li {
    padding: 12px 0;
    /* 下線（ボーダー）をアイテムに直接適用 */
    border-bottom: 1px solid var(--color-background-border);
}

.announcements-list li a {
    /* Flexboxで日付とタイトルを横並びにする */
    display: flex;
    align-items: center;
    color: var(--color-body-text);
    text-decoration: none;
    font-size: var(--font-size-body-text);
    transition: color 0.3s ease;
}

.announcements-list li a:hover {
    color: var(--color-link-text);
}

/* 日付とタイトルを視覚的に分けるスタイル */
/* JavaScriptで新しく追加された<span>要素にスタイルを適用 */
.announcements-list .announcement-date {
    display: inline-block;
    min-width: 110px; /* 日付の表示幅を確保 */
    margin-right: 30px; /* 空白を広げる */
    color: var(--color-accent-2);
    font-size: var(--font-size-body-text);
    font-weight: bold;
    flex-shrink: 0; /* タイトルが長くなっても幅を保持 */
}

/*==================================
  製品新着情報セクション(products-news)
==================================*/
.products-news-section {
    padding: 60px 0;
    background-color: var(--color-background);
}

.products-news-section .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

.top-products-news-container {
    max-height: 800px;
    overflow-y: auto;
    list-style: none;
    border: none;
}

#products-list{
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 各製品情報アイテムのスタイル */
.product-item {
    background-color: var(--color-background);
    border: 1px solid var(--color-background-border);
    border-radius: 8px;
    padding: 10px;
    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;
    flex-wrap: wrap; 
}

/* タイトルコンテナ */
.product-title {
    flex-grow: 1;
    margin: 0 10px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: var(--font-size-h2);
}
.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-accent);
    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;
}

/* 対象車種のラベルのスタイル */
.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-caption);;
    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;
    align-self: flex-end;
}
.product-fulltext-body p,
.product-fulltext-body div,
.product-fulltext-body ul {
    margin-bottom: 6px;
}
.product-fulltext-body ul {
    padding-left: 20px;
}

/*==================================
  製品一覧セクション(products)
==================================*/
.products-section {
    padding: 60px 0;
}

.products-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 30px;
    align-items: start;
    justify-content: center;
}

.products-item {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    border-radius: 0;
    padding-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    text-decoration: none;
    color: var(--color-body-text);
    transition: all 0.3s ease;
    align-items: center;
}

.products-item:hover {
    transform: none;
    opacity: 0.8;
}

.products-item .products-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    overflow: hidden;
}

.products-item .products-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.products-item .products-text-content {
    font-weight: 700;
    font-size: var(--font-size-body-text);
    flex-wrap: nowrap; 
}

.button-container {
    text-align: center;
    margin-top: 80px;
}

.access-counter {
    text-align: end;
}

.access-counter img {
    height: 100%;
    width: auto;
}

/*==================================
  レスポンシブ対応
==================================*/

/* PC表示 (600px以上) */
@media (min-width: 600px) {
    .hero-slider {
        display: block;
        padding-top: 25.52%; /* 1920:490 = 3.918... -> 100:25.52 */
    }
    .hero-slider-mobile {
        display: none;
    }
}

/* モバイル表示 (600px以下) */
@media (max-width: 600px) {
    .container {
        margin-top: 40px; /*topページだけデザイン調整のためContainer marginを上書き*/
    }
    .hero-slider {
        display: none;
    }
    .hero-slider-mobile {
        padding-top: 50.66%;
    }
    .hero-pagination {
        bottom: -20px;
        gap: 15px;
    }
    .pagination-dot {
        width: 10px;
        height: 10px;
    }
    .products-news-section {
        padding: 0;
    }
    .products-showcase {
        grid-template-columns: repeat(2, 1fr);
    }
    .products-item .products-text-content {
        font-weight: 700;
    }
    .product-item {
        padding: 10px;
        margin-bottom: 10px;
    }
    .product-info-header {
        flex-direction: row;
        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 {
        width: auto;
        order: 2;
        position: absolute;
        align-items: flex-end;
        top: 0;
        right: 0;
        margin-top: 10px;
        margin-right: 10px;
    }
    .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;
    }
}

/* 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);
    }
}
