/* 最新消息 */
.news {
    padding: 80px 0;
    background: var(--color-background-primary);
}

.news-carousel {
    padding: 24px 48px;
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(calc((100% - 4rem) / 3), 1fr);
    gap: 2rem;
    overflow-x: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    anchor-name: --carousel;
    position: relative;
    cursor: grab;
    user-select: none;
    touch-action: pan-y;
    margin: 0 auto;
}

.news-carousel:active {
    cursor: grabbing;
    scroll-behavior: auto;
}

/* Remove scroll button styles */
.news-carousel::scroll-button(right),
.news-carousel::scroll-button(left) {
    display: none;
}

.news-carousel > a {
    scroll-snap-align: center;
}

.news .new-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    position: relative;
    z-index: 1;
}

.news-card {
    background: var(--color-background-primary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 4px 4px 16px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
    flex: 1 1 100%;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-card:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.news-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-content {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1rem;
    height: 100%;
    min-height: 200px;
}

.news-date {
    font-size: 1rem;
    color: #666666;
}

.news-title {
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.2;
    text-wrap: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.news-description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    color: #666666;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制顯示行數 */
           line-clamp: 3;
    -webkit-box-orient: vertical;
    flex: 1;
}

.news-status {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #BDBDBD;
    font-size: 0.75rem;
    font-weight: 400;
    width: fit-content;
    min-width: 80px;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: auto;
    align-self: flex-start;
    transition: all 0.3s ease;
    color: #666666;
}

.news-status.active {
    color: #00796B;
    border-color: #00796B;
}

/* Indicator Navigation */
.news-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.news-dot {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background-color: #E0E0E0;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    padding: 0;
}

.news-dot:hover {
    background-color: #BDBDBD;
}

.news-dot.active {
    background-color: var(--color-primary);
    width: 60px;
}

/* Mobile indicator styles */
@media (max-width: 767px) {
    .news-dot {
        width: 30px;
        height: 3px;
        border-radius: 1.5px;
    }
    
    .news-dot.active {
        width: 30px;
    }
    
    .news-dots {
        gap: 0.25rem;
    }
}

/* Media Queries */
@media (max-width: 1025px) {
    .news {
        padding: 80px 40px;
    }
    
    .news-carousel {
        grid-auto-columns: minmax(calc((100% - 4rem) / 3), 1fr);
        padding: 24px 40px;
    }
}

@media (max-width: 1400px) {
    .news-carousel {
        grid-auto-columns: minmax(calc((100% - 4rem) / 3), 1fr);
    }
}

@media (max-width: 880px){
    .news {
        padding: 60px 40px;
    }
    
    .news-carousel {
        grid-auto-columns: minmax(calc((100% - 4rem) / 3), 1fr);
        padding: 24px 40px;
    }
}

@media (max-width: 767px) {
    .news {
        padding: 40px 16px;
    }
    
    .news-carousel {
        padding: 24px 16px;
        grid-auto-columns: minmax(calc(100% - 2rem), 1fr);
        gap: 1rem;
    }
}
