/* Editor Common Styles - 編輯器共用樣式 */

/* 輪播圖片使用 16:9 */
#editor .carousel-gallery-v3 .carousel-frame {
    aspect-ratio: 16 / 9 !important;
}

#editor .carousel-gallery-v3 .carousel-slide img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* 輪播指示器重構：改為撐滿寬度的長條狀 */
#editor .carousel-gallery-v3 .carousel-dots {
    width: 100%;
    max-width: 990px;
    /* 與舞台對齊 */
    margin: 15px auto 0;
    gap: 0;
    /* 長條狀通常不留間隙或極小間隙 */
}

#editor .carousel-gallery-v3 .carousel-dot {
    flex: 1;
    /* 撐滿寬度 */
    height: 4px;
    /* 條狀高度 */
    border-radius: 0;
    /* 移除圓角 */
    background: #E0E0E0;
    /* 淺灰色底 */
    box-shadow: none;
    /* 移除陰影 */
    transition: background 0.3s ease;
}

#editor .carousel-gallery-v3 .carousel-dot.is-active {
    background: var(--color-primary, #000);
    /* 使用主色調 */
}

/* Related Reports Grid Layout - 相關文章區塊 Grid 布局 */
.related_reports_grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    /* var(--spacing-lg) */
    margin-top: 0;
}

@media (max-width: 900px) {
    .related_reports_grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

@media (max-width: 576px) {
    .related_reports_grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* 圖文標籤樣式 - Image Text Tags */
.image_text_tags {
    background-color: #EBEBEB;
    padding: 40px;
    border-radius: 0;
    margin: 40px 0;
}

.image_text_tags_grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.image_text_tag {
    display: flex;
    flex-direction: row;
    background-color: var(--color-bg-white);
    overflow: hidden;
    gap: 20px;
    align-items: flex-start;
}

.image_text_tag .tag_image {
    flex: 0 0 40%;
    width: 40%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.image_text_tag .tag_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image_text_tag .tag_content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: center;
}

/* 上：標題固定一行 */
.image_text_tag .tag_content h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 !important;
    line-height: 1.4;
    color: var(--color-text-primary);
    order: 1;
    /* Title: 1 line with ellipsis */
    /* 溢出修正：取消截斷 → display: -webkit-box; */
    /* 溢出修正：取消截斷 → -webkit-line-clamp: 1; */
    /* 溢出修正：取消截斷 → -webkit-box-orient: vertical; */
    /* 溢出修正：取消截斷 → overflow: hidden; */
    /* 溢出修正：取消截斷 → text-overflow: ellipsis; */
}

/* 中：內文固定兩行 */
.image_text_tag .tag_content p {
    font-size: 0.9375rem;
    line-height: 1.7;
    margin: 0 !important;
    color: #666;
    order: 2;
    /* Description: 2 lines with ellipsis */
    /* 溢出修正：取消截斷 → display: -webkit-box; */
    /* 溢出修正：取消截斷 → -webkit-line-clamp: 2; */
    /* 溢出修正：取消截斷 → -webkit-box-orient: vertical; */
    /* 溢出修正：取消截斷 → overflow: hidden; */
    /* 溢出修正：取消截斷 → text-overflow: ellipsis; */
}

/* 下：日期固定一行 */
.image_text_tag .tag_content .tag_date {
    font-size: 0.875rem;
    color: #999;
    margin: 0 !important;
    order: 3;
    /* Date: 1 line with ellipsis */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 響應式設計 */
@media (max-width: 900px) {
    .image_text_tags {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .image_text_tag {
        flex-direction: column;
        display: block;
        /* 改為 block 確保高度自動撐開 */
        gap: 0;
    }

    .image_text_tag .tag_image {
        width: 100%;
        aspect-ratio: 16 / 9;
        display: block;
    }

    .image_text_tag .tag_content {
        width: 100%;
        padding: 24px 20px;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .image_text_tag .tag_content h4 {
        font-size: 1.25rem;
        -webkit-line-clamp: 2;
        order: 1;
        /* 重申順序確保正確 */
    }

    .image_text_tag .tag_content p {
        -webkit-line-clamp: 3;
        order: 2;
    }

    .image_text_tag .tag_content .tag_date {
        order: 3;
    }
}