

/***************************************************************************
*  註解規則 :                                                              *
*  15顆星* --> 大區塊 (Container / left-part / right-part 等等)            *
*  5顆星* --> 小區塊 (大區塊內的各項小區塊功能)                            *
*  1顆星*  --> 功能註解                                                    *
*                                                                          *
*  File : Datasets_card_Re.css                                             *
*  Used in : Datasets_card.cshtml                                          *
*  Author: Eunha                                                           *
*  Creater : 2026 - 09 - 09                                                *
*  Description : GHD Datasets card page Layout Redesign                    *
***************************************************************************/

/***** Inter（自架，取代 Google Fonts CDN；沿用 Data_home_Re.css 同一套字型檔） *****/
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url(../fonts/font-style/Inter/Inter-latin.woff2) format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url(../fonts/font-style/Inter/Inter-latin.woff2) format('woff2');
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url(../fonts/font-style/Inter/Inter-latin.woff2) format('woff2');
}

body {
    background-color: #FFFFFF;
}

/* 全頁字型：Inter 只有拉丁字符，遇到中文字會自動 fallback 到 Noto Sans TC，不用額外判斷語系 */
.body.container {
    font-family: "Inter", "Noto Sans TC", sans-serif;
    max-width: 1920px;
    background-color: #FFFFFF;
    border-radius: 20px;
    padding-left: 0;
}

.body.container.lang-zh {
    padding-right: 0;
}

/*************** Container ***************/

:root {
    --datasets-card-header-height: 110px;
}

.datasets-card-row {
    flex-wrap: nowrap;
}

.datasets-card-row > .col-sm-1 {
    flex: 0 0 0;
    max-width: 0;
    width: 0;
    padding-left: 0;
    padding-right: 0;
}

.datasets-card-container {
    display: flex;
    align-items: flex-start;
    min-height: calc(100vh - var(--datasets-card-header-height) - 40px);
}

.col-sm-10.datasets-card-container {
    position: relative;
    background-color: #FFFFFF;
    flex: 0 0 1920px;
    max-width: none;
    padding: 20px 20px 20px 650px;
    border-radius: 20px;
    overflow: hidden;
    transition: flex-basis 0.9s ease, padding-left 0.9s ease;
}

.datasets-card-container.is-collapsed {
    flex-basis: 100%;
    padding-left: 20px;
}

.mt-4 {
    margin-top: 2rem !important;
}

/*************** left-part ***************/
.datasets-card-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: absolute;
    top: 20px;
    left: 20px;
    width: 600px;
    min-height: calc(100vh - var(--datasets-card-header-height) - 80px);
    overflow: hidden;
    padding: 20px;
    z-index: 1;
    visibility: visible;
    transition: visibility 0s linear 0s;
    background-color: #F5F5F5;
    background-image:
        linear-gradient(180deg, transparent 55%, #F5F5F5 100%),
        url(../img/datasets-card/left-part-bg.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: none;
    border-radius: 20px;
    box-shadow: 0px 0px 10px 2px #e5e5e5;
    mask-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 120'%3E%3Cpath fill='white' d='M0 0 L600 0 C600 40 560 25 560 60 C560 95 600 80 600 120 L0 120 Z'/%3E%3C/svg%3E"),
        linear-gradient(#000, #000),
        linear-gradient(#000, #000);
    mask-size:
        100% 120px,
        100% calc(var(--notch-top, calc(50% - 60px)) + 2px),
        100% calc(100% - var(--notch-top, calc(50% - 60px)) - 118px);
    mask-position:
        right var(--notch-top, calc(50% - 60px)),
        top left,
        bottom left;
    mask-repeat: no-repeat, no-repeat, no-repeat;
}

/* 收合時等 0.9s 的收合動畫完全跑完才真正隱藏 left-part；
   展開時則立刻顯現，不用等待。 */
.datasets-card-container.is-collapsed .datasets-card-left {
    visibility: hidden;
    transition: visibility 0s linear 0.9s;
}

/***** main-title-part *****/

.main-title-part {
    box-shadow: none;
}

.datasets-card-left-top.row {
    position: relative;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 16px;
    margin-left: 0;
    margin-right: 0;
    padding: 20px;
    width: 100%;
    background-color: transparent;
}

.datasets-card-left-top.row > * {
    padding-left: 0;
    padding-right: 0;
}

.datasets-card-title-row {
    width: 100%;
}

.datasets-card-title-row .data-title {
    font-size: 32px;
    font-weight: 600;
    line-height: 60px;
    color: #000;
}

.datasets-card-author-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.datasets-card-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.datasets-card-author-info .data-pic {
    display: block;
    flex: none;
    max-width: none;
    padding-left: 0;
}

.datasets-card-author-info .data-pic-bg {
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 4px;
}

.datasets-card-author-info .author {
    font-size: 18px;
    font-weight: 400;
    color: #000;
    line-height: 20px;
}

.datasets-card-author-info .bi-shield-fill-check {
    color: #22c55e;
    font-size: 18px;
}

.datasets-card-tag-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    width: 100%;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

/***** Tag 兩行截斷後的展開箭頭 *****/
.datasets-card-tag-expand-btn {
    display: none;
    width: 100%;
    margin: 4px 0 0;
    padding: 4px 0;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.datasets-card-tag-expand-btn.is-visible {
    display: flex;
}

.datasets-card-tag-expand-btn i {
    font-size: 14px;
    font-weight: 500;
    color: #000;
    -webkit-text-stroke: 1px currentColor;
    transition: transform 0.3s ease;
}

.datasets-card-tag-expand-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.datasets-card-tag-row .badge-tag {
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 18px;
    letter-spacing: 0.8px;
    color: #6D28D9;
    text-decoration: underline;
}

.lang-en .datasets-card-tag-row .badge-tag {
    line-height: 30px;
}

.datasets-card-button-row {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.datasets-card-button-row .request-btn {
    width: 100%;
}

/* 官方網站按鈕：白底、灰邊、黑字，取代原本的深藍底白字 */
.datasets-card-button-row .request-btn-css {
    position: relative;
    z-index: 0;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 101%;
    gap: 8px;
    height: 50px;
    padding: 0 20px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.4);
    border-radius: 999px;
    font-size: 18px;
    font-weight: 700;
    color: #000;
    transition: color 0.3s ease;
}

/* Hover 掃色：深色從左到右填滿，蓋在文字/圖示下面 */
.datasets-card-button-row .request-btn-css::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-color: #1c2b3a;
    clip-path: inset(0 100% 0 0);
    transition: clip-path 0.3s ease;
}

.datasets-card-button-row .request-btn-css:hover {
    color: #fff;
}

.datasets-card-button-row .request-btn-css:hover::before {
    clip-path: inset(0 0 0 0);
}

.datasets-card-button-row .request-btn-css::after {
    content: "\2197";
    display: inline-block;
    font-size: 16px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.datasets-card-button-row .request-btn-css:hover::after {
    transform: rotate(45deg);
    color: #fff;
}

.datasets-card-left-top .data-board {
    position: absolute;
    top: 16px;
    right: 16px;
    flex: none;
    max-width: none;
}

/***** datasets-card-nav *****/

/* 官方網站按鈕跟下面 Nav 之間至少保留 60px 間距，
   空間充足時不影響原本 space-between 的排版，空間不夠時會逼 left-part 長高 */
.datasets-card-nav {
    margin-top: 100px;
}

.datasets-card-nav .nav.page-btn {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 20px;
    margin-bottom: 0;
    padding: 20px;
    background: transparent;
    border-top: none;
    box-shadow: none;
    user-select: none;
}

.datasets-card-nav .page-btn-css {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 60px;
    padding: 0 40px;
    border-radius: 999px;
    text-align: left;
    cursor: pointer;
    background-color: transparent;
    color: #000;
    overflow: hidden;
    font-size: 18px;
    transition: background 0.4s ease, color 0.4s ease;
}

.datasets-card-nav .page-btn-css:hover {
    background-color: #EEFAFF;
    color: #1c2b3a;
}

.datasets-card-nav .page-btn-css:focus {
    outline: none;
}

.datasets-card-nav .page-btn-css:focus-visible {
    outline: 2px solid #9747FF;
    outline-offset: -3px;
}

.datasets-card-nav .page-btn-css:active {
    transform: scale(0.97);
}

.datasets-card-nav .page-btn-css.active {
    background: #FFF;
    border-bottom: none;
    color: #1c2b3a;
    font-weight: 700;
}

.datasets-card-nav .page-btn-css.active:hover {
    background: #FFF;
    color: #1c2b3a;
}

/* 圓形編號徽章，脫離文字排版、可在膠囊內自由滑動 */
.datasets-card-nav .page-btn-index {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0);
    text-align: center;
    font-weight: 500;
    transition: left 0.7s cubic-bezier(0.34, 1.25, 0.64, 1), background-color 0.7s cubic-bezier(0.34, 1.25, 0.64, 1);
    z-index: 1;
}

.datasets-card-nav .page-btn-css.active .page-btn-index {
    left: calc(100% - 50px);
    background-color: #1D2C3B;
    color: #fff;
}

.datasets-card-nav .page-btn-label {
    flex: 1;
    min-width: 0;
    padding-left: 80px;
    transition: padding-left 0.7s cubic-bezier(0.34, 1.25, 0.64, 1);
    letter-spacing: 3px;
    font-weight: 500;
}

.datasets-card-nav .page-btn-css.active .page-btn-label {
    padding-left: 0;
}

/***** 左右欄中間的收合分隔線 *****/

.datasets-card-collapse-divider {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    box-sizing: border-box;
    flex: 0 0 20px;
    width: 20px;
    background-color: #FFFFFF;
    transition: flex-basis 0.9s ease, width 0.9s ease;
}

/* 收合時 divider 加寬 20px，把右側內容往右多推 20px，
   跟停在左邊界的按鈕之間留出多一點距離，不會緊貼在一起 */
.datasets-card-container.is-collapsed .datasets-card-collapse-divider {
    flex-basis: 60px;
    width: 60px;
}

.datasets-card-collapse-line {
    display: none;
}

/* 收合/展開拆成兩顆各自獨立的按鈕（同一份 .datasets-card-collapse-btn
   共用外觀樣式），各自只有一個固定位置、一種狀態，不會有單一元素在
   兩個位置之間被拉扯、飄移的問題。用 display:none 切換顯示，
   哪顆按鈕在畫面上、可以被點到，跟目前是否收合狀態一致。 */
.datasets-card-collapse-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 45px;
    height: 45px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #FF9B00;
    border: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s ease, width 0.4s ease, height 0.4s ease;
}

/* 收合鈕：固定停在展開狀態下的凹槽位置。展開時(離開 is-collapsed)用
   transform:scale() 從 0 放大回現在的大小，delay 0.8s 等 divider 先
   滑回展開位置再出場，避免跟著移動中的 divider 被拖著跑。
   收合時(進入 is-collapsed)則是立刻縮小消失，不用等待。 */
.datasets-card-collapse-btn--collapse {
    left: -56px;
    top: calc(var(--notch-top, calc(50% - 60px)) + 60px);
    transform: translateY(-50%) scale(1);
    visibility: visible;
    transition: transform 0.4s ease-out 0.8s, visibility 0s linear 0.8s, width 0.4s ease, height 0.4s ease;
}

.datasets-card-container.is-collapsed .datasets-card-collapse-btn--collapse {
    transform: translateY(-50%) scale(0);
    visibility: hidden;
    transition: transform 0.15s ease-in, visibility 0s linear 0.15s;
}

/* 展開鈕：改成貼在畫面最左邊的純半圓（平的一側貼齊邊界，圓弧朝右凸出），
   取代原本的貝茲曲線凹槽，顏色沿用原本凹槽的深藍色。位置(left)固定在
   最終落點，離開 is-collapsed 時(展開動作)立刻往左縮回畫面外，退場途中
   維持可見，退到底才真正隱藏。進入 is-collapsed 時(收合動作)則 delay 0.8s
   等 divider 先滑到定位，才從畫面外滑入，避免被移動中的 divider 拖著跑。 */
.datasets-card-collapse-btn--expand {
    left: -20px;
    width: 45px;
    height: 90px;
    border-radius: 0 999px 999px 0;
    background-color: #FF9B00;
    transform: translateY(-50%) translateX(-500px);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.5s ease-out, visibility 0s linear 0.25s;
}

.datasets-card-container.is-collapsed .datasets-card-collapse-btn--expand {
    transform: translateY(-50%) translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.5s ease-out 0.4s, visibility 0s linear 0.4s, width 0.4s ease, height 0.4s ease;
}

.datasets-card-collapse-btn--collapse:hover {
    width: 50px;
    height: 50px;
}

.datasets-card-collapse-btn--expand:hover {
    width: 50px;
    height: 100px;
}

.datasets-card-collapse-btn i {
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    -webkit-text-stroke: 1px currentColor;
    margin-top: 2px;
    transition: color 0.2s ease, font-size 0.4s ease;
}

.datasets-card-collapse-btn:hover i {
    font-size: 17px;
}

/*************** right-part ***************/
.datasets-card-right {
    position: relative;
    z-index: 2;
    background-color: #fff;
    flex: 1;
    min-width: 0;
    height: calc(100vh - var(--datasets-card-header-height) - 80px);
    border-radius: 0 20px 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 20px;
}

.all-box-style {
    width: 100%;
    box-shadow: none;
    border-bottom: 1px solid #D7D7D7;
}

.datasets-card-right .font-size-14px {
    font-size: 20px;
}

.datasets-card-right .font-size-14px b {
    font-size: 24px;
    color: #0056B8;
}

.datasets-card-right .font-size-14px u {
    font-size: 20px;
    color: #0056B8;
} 

/***** Article字體 *****/

.article-title{
    font-size: 32px !important;
}

.abstract-para {
    margin: 0;
}

/* 資料串連 - 問號icon垂直置中 */
.data-access-request-title.width-25 + .question-icon {
    align-self: center;
}

/*************** RWD ***************/

.col-sm-10.datasets-card-container {
    flex: 1 1 auto;
    width: 100%;
}

/* 900px 以上不用下拉選單觸發按鈕 */
.datasets-card-nav-dropdown-toggle {
    display: none;
}

/* 寬度 <= 1615px 改成上下堆疊：left-part 放上面、Article 放下面。
   left-part 原本是 position:absolute 疊在 right-part 上，container 靠
   padding-left:650px 讓出空間；堆疊版面不需要這個 hack，讓 left-part
   回到一般文件流、寬度改滿版。收合按鈕/凹槽是設計給左右並排時用的，
   堆疊後沒有側邊可以收，一併隱藏。對應的高度同步 JS(syncContainerHeight)
   在這個寬度以下會直接跳過，把 min-height / height 的 inline style 清掉，
   改吃這裡的 CSS。 */
@media (max-width: 1615px) {
    .datasets-card-container {
        flex-direction: column;
        align-items: stretch;
        min-height: 0;
    }

    .col-sm-10.datasets-card-container {
        padding: 20px;
        overflow: visible;
    }

    .datasets-card-left {
        position: relative;
        top: 0;
        left: 0;
        width: 100%;
        min-height: 0;
        mask-image: none;
    }

    .datasets-card-collapse-divider {
        display: none;
    }

    .datasets-card-right {
        width: 100%;
        height: auto;
        padding-right: 0;
        border-radius: 20px;
    }

    /* Nav 選中狀態改成純 CSS：背景色跟著 Bootstrap 自己切換的 .active
       class 走，不用 JS 量座標，第一次載入就一定是對的 */
    .datasets-card-nav {
        margin-top: 20px;
    }

    .datasets-card-nav .nav.page-btn {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 40px;
        padding: 16px 20px;
    }

    .datasets-card-nav .page-btn-index {
        display: none;
    }

    .datasets-card-nav .page-btn-css {
        width: auto;
        height: auto;
        padding: 10px;
        background-color: transparent;
        border: none;
        border-radius: 15px;
        box-shadow: none;
        appearance: none;
        -webkit-appearance: none;
        color: #000;
        text-align: center;
        justify-content: center;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .datasets-card-nav .page-btn-css:hover {
        background-color: transparent;
        color: #000;
    }

    .datasets-card-nav .page-btn-css.active,
    .datasets-card-nav .page-btn-css.active:hover {
        background-color: #9747FF;
        color: #fff;
        font-weight: 700;
    }

    .datasets-card-nav .page-btn-css:active {
        transform: none;
    }

    .datasets-card-nav .page-btn-label {
        flex: none;
        padding-left: 0;
        letter-spacing: normal;
        transition: none;
    }
}

/* 900px 以下：官方網站按鈕拿掉 hover 掃色動畫，直接固定成 hover 後的深色 */
@media (max-width: 900px) {
    .datasets-card-button-row .request-btn-css {
        background-color: #1c2b3a;
        color: #fff;
    }

    .datasets-card-button-row .request-btn-css::before {
        display: none;
    }

    .datasets-card-button-row .request-btn-css::after {
        color: #fff;
    }

    .datasets-card-button-row .request-btn-css:hover::after {
        transform: none;
    }

    /* Nav 改成下拉式選單：平常收起來只顯示觸發按鈕跟目前選中的分頁名稱，
       點擊後 #nav-tab 那排按鈕變成蓋在上面的清單，選完自動收合 */
    .datasets-card-nav {
        position: relative;
    }

    .datasets-card-nav-dropdown-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 14px 20px;
        background-color: #fff;
        border: 1px solid #D7D7D7;
        border-radius: 15px;
        color: #000;
        font-size: 16px;
        font-weight: 700;
        cursor: pointer;
    }

    .datasets-card-nav-dropdown-toggle i {
        transition: transform 0.2s ease;
    }

    .datasets-card-nav-dropdown-toggle[aria-expanded="true"] i {
        transform: rotate(180deg);
    }

    .datasets-card-nav .nav.page-btn {
        display: none;
        flex-direction: column;
        flex-wrap: nowrap;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 10;
        margin-top: 8px;
        padding: 10px;
        gap: 4px;
        background-color: #fff;
        border: 1px solid #D7D7D7;
        border-radius: 15px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

    .datasets-card-nav.is-open .nav.page-btn {
        display: flex;
    }

    .datasets-card-nav .page-btn-css {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
    }
}

/* 600px 以下：所有字體都縮小 4px */
@media (max-width: 600px) {
    .datasets-card-title-row .data-title {
        font-size: 28px;
    }

    .datasets-card-author-info .author {
        font-size: 14px;
    }

    .datasets-card-tag-row .badge-tag {
        font-size: 14px;
    }

    .datasets-card-button-row .request-btn-css {
        font-size: 14px;
    }

    .datasets-card-nav .page-btn-css {
        font-size: 14px;
    }

    .datasets-card-nav-dropdown-toggle {
        font-size: 12px;
    }

    .datasets-card-right .font-size-14px {
        font-size: 16px;
    }

    .datasets-card-right .font-size-14px b {
        font-size: 20px;
    }

    .datasets-card-right .font-size-14px u {
        font-size: 16px;
    }

    .article-title {
        font-size: 28px !important;
    }
}

/* 800px 以下：title/icon(.DisplayFlex) + 值(.width-65) 這種欄位改回
   上下排：標題一整行在上面，值換到下一行、靠左並留 20px padding
   跟標題錯開，取代 legacy 在更窄寬度才會套用的上下堆疊規則 */
@media (max-width: 800px) {
    .flex-and-margin-top-20px {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .DisplayFlex {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 5px;
        width: 100%;
    }

    /* legacy 在 <=767px 另外對 question-icon 加了 padding-left，
       會跟上面的 gap 疊加、兩段永遠對不齊，這裡統一歸零 */
    .question-icon {
        padding-left: 0;
        padding-top: 0;
    }

    .width-65 {
        width: 100%;
        margin-left: 0;
        padding-left: 20px;
        text-align: left;
    }
}

