/* ニュース画面共通CSS */

/* ベーススタイル */
/* .sp-only-news {
    display: none;
} */

.header__message {
    background-color: #107ff5 !important;
}

.news-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}

/* ニュースブロック */
.news-block {
    margin: 32px 0;
    padding: 0;
}

.news-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #0982FE;
    max-width: 100%;
    overflow: hidden;
}

.news-title-with-icon {
    display: flex;
    align-items: center;
    gap: 8px;
}

.news-title-with-icon img {
    width: 25px;
    height: 25px;
}

.news-block-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
    color: #60615c;
}

.more-link {
    color: #0982FE;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
}

.more-link .arrow {
    margin-left: 4px;
    font-size: 12px;
}

/* ニューススライダー */
.news-slider {
    position: relative;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding-bottom: 20px;
    width: 100%;
    max-width: 100%;
    overflow: auto;
}

/* スライダーラッパー */
.news-slider-wrapper {
    display: flex;
    gap: 16px;
    scroll-snap-type: x mandatory;
    padding: 20px 0;
    transition: all 0.3s ease;
    width: 100%;
}

.news-slider-wrapper::before,
.news-slider-wrapper::after {
    content: '';
    flex-shrink: 0;
    width: 10px;
    transition: width 0.3s ease;
}

/* スライドアイテム */
.news-slide-item {
    flex: 0 0 200px;
    scroll-snap-align: center;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    transform-origin: center;
    margin: 0 8px;
    /* GPU最適化 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}

/* 中央のアイテム拡大 */
.news-slide-item.centered {
    transform: scale(1.2);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* ニュースサムネイル */
.news-thumbnail {
    aspect-ratio: 16/9;
    position: relative;
    width: 100%;
    background-color: #000;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 動画要素 */
.news-grid-video,
.news-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    background-color: #000;
    display: block;
    /* iOS最適化 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 動画コントロールを非表示 */
.news-video::-webkit-media-controls,
.news-video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* サムネイル画像 */
.news-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 動的サムネイル背景（iPhone用） */
.news-thumbnail-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    z-index: 1;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* 動画再生時は背景を非表示 */
.news-thumbnail.playing .news-thumbnail-bg {
    opacity: 0;
}

/* ローディング状態 */
.loading-skeleton {
    background: #000;
    border-radius: 8px;
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    text-align: center;
}

/* スピナー */
.skeleton-content {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    position: absolute;
    top: 35%;
    left: 35%;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* 空状態 */
.news-empty {
    text-align: center;
    padding: 40px 16px;
    color: #999;
}

/* 限定動画オーバーレイ */
.news-limited-overlay-blur {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
    box-sizing: border-box;
}

.limited-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.limited-message {
    position: relative;
    text-align: center;
    width: 100%;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
}

.limited-text {
    font-size: 11px;
    line-height: 1.2;
    font-weight: bold;
    color: white;
}

/* 限定動画のぼかし効果 */
.news-slide-item[data-limited="1"]:not([data-logged-in="true"]) .news-video,
.news-slide-item[data-limited="1"]:not([data-logged-in="true"]) .news-thumbnail-img,
.news-slide-item[data-limited="1"]:not([data-logged-in="true"]) .news-thumbnail-bg {
    filter: blur(7px);
    transition: filter 0.3s ease;
}

/* ログイン済みの場合はぼかしを解除 */
.news-slide-item[data-logged-in="true"][data-limited="1"] .news-video,
.news-slide-item[data-logged-in="true"][data-limited="1"] .news-thumbnail-img {
    filter: none;
}

.news-slide-item[data-logged-in="true"] .news-limited-overlay-blur {
    display: none;
}

/* スマートフォン対応 */
@media screen and (max-width: 767px) {
    .news-container {
        padding: 0 12px;
    }

    .news-slider-wrapper {
        padding: 16px 20px;
        gap: 12px;
    }

    .news-slide-item {
        flex: 0 0 120px;
        margin: 0 4px;
    }

    .news-thumbnail {
        height: 160px;
    }

    .loading-skeleton {
        height: 160px;
    }
}