/* ============================================================
医生移动端补丁
   ============================================================ */

/* ---- <picture> 橫豎圖切換：讓它撐滿照片位 ---- */
.doc-img picture {
    display: block;
}

/* ---- 非移動端：所有新增節點不顯示 ---- */
.doc-mobile,
.doc-dots,
.doc-more,
.doc-good {
    display: none;
}

@media screen and (max-width: 425px) {

    /* ---- 降級保護：若 JS 沒跑，舊輪播在窄屏會取到豎圖，用裁切避免壓扁 ---- */
    #doctor-swiper .doc-img img {
        object-fit: cover;
        object-position: center 12%;
    }

    /* ---- 移動端啟用後，隱藏原本的 Swiper 與左右箭頭 ---- */
    .doctor.doc-enhanced #doctor-swiper,
    .doctor.doc-enhanced .doc-navigation {
        display: none;
    }

    /* ---------- 滑動容器（一頁 = 5 張卡） ---------- */
    .doctor.doc-enhanced .doc-mobile {
        display: flex;
        align-items: flex-start;
        margin-top: 7%;
        transition: height .35s ease;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .doctor.doc-enhanced .doc-mobile::-webkit-scrollbar {
        display: none;
    }

    .doctor.doc-enhanced .doc-page {
        display: flex;
        flex: 0 0 100%;
        flex-direction: column;
        gap: 10px;
        padding: 0 10px 1px;
        box-sizing: border-box;
        scroll-snap-align: start;
    }

    /* ---------- 卡片：左圖右文 ---------- */
    .doctor.doc-enhanced .doc-card {
        display: flex;
        align-items: flex-start;
        min-height: 277px;
        padding: 15px 10px 14px;
        box-sizing: border-box;
        background: #fff;
        border: 1px solid #B1C8D3;
        border-radius: 0 0 35px 0;
    }

    /* 照片 */
    .doctor.doc-enhanced .doc-img {
        flex: 0 0 135px;
        width: 135px;
        margin-right: 9px;
        text-align: left;
    }

    .doctor.doc-enhanced .doc-img img {
        display: block;
        width: 135px;
        height: auto;
        /* 移動端用 277×311 豎圖，圓角已烘焙在圖裡 */
        aspect-ratio: 277 / 311;
        border-radius: 0;
    }

    /* 文字欄 */
    .doctor.doc-enhanced .doc-main {
        flex: 1 1 auto;
        min-width: 0;
    }

    .doctor.doc-enhanced .doc-name {
        margin-top: 0;
    }

    .doctor.doc-enhanced .doc-name p {
        font-size: 18px;
        font-weight: 700;
        line-height: 1.15;
        text-align: left;
        letter-spacing: 0;
    }

    .doctor.doc-enhanced .doc-name p:nth-of-type(2) {
        margin-top: 2px;
        font-size: 14px;
        font-weight: 400;
        letter-spacing: 0;
    }

    /* 資歷清單 */
    .doctor.doc-enhanced .doc-intro {
        margin-top: 7px;
        text-align: left;
    }

    .doctor.doc-enhanced .doc-intro-content {
        display: block;
        font-size: 12px;
        line-height: 1.5;
        color: #2D3748;
        text-align: left;
    }

    .doctor.doc-enhanced .doc-intro-content p {
        position: relative;
        margin-top: 1px;
        padding-left: 8px;
    }

    .doctor.doc-enhanced .doc-intro-content p::before {
        content: "";
        position: absolute;
        left: 1px;
        top: 7px;
        width: 3px;
        height: 3px;
        background: #2D3748;
        border-radius: 50%;
    }

    /* PC 用來撐高卡片的隱形段落，移動端不需要 */
    .doctor.doc-enhanced .doc-intro-content p[style*="hidden"] {
        display: none;
    }

    /* 擅長項目 */
    .doctor.doc-enhanced .doc-good {
        display: block;
        margin-top: 9px;
    }

    .doctor.doc-enhanced .doc-good > span {
        display: inline-block;
        box-sizing: border-box;
        min-width: 118px;
        padding: 0 10px;
        font-size: 12px;
        line-height: 20px;
        letter-spacing: 0.5px;
        white-space: nowrap;
        color: #fff;
        background: linear-gradient(90deg, #00ACFF 0%, #00ACFF 45%, rgba(0, 172, 255, 0) 100%);
    }

    .doctor.doc-enhanced .doc-good p {
        margin-top: 6px;
        font-size: 12px;
        line-height: 1.7;
        color: #2D3748;
        text-align: justify;
    }

    /* ---------- 分頁圓點 ---------- */
    .doctor.doc-enhanced .doc-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 9px;
        margin-top: 16px;
    }

    .doctor.doc-enhanced .doc-dots button {
        width: 7px;
        height: 7px;
        padding: 0;
        border: 0;
        background: #C7D7DF;
        border-radius: 50%;
        cursor: pointer;
        transition: background .3s, transform .3s;
        -webkit-tap-highlight-color: transparent;
    }

    .doctor.doc-enhanced .doc-dots button.is-active {
        background: #00ACFF;
        transform: scale(1.18);
    }

    /* ---------- 「點擊獲取更多醫生資料」按鈕 ---------- */
    .doctor .doc-more {
        display: block;
        width: 180px;
        height: 34px;
        margin: 16px auto 0;
        font-size: 14px;
        line-height: 34px;
        letter-spacing: 0.5px;
        color: #fff;
        text-align: center;
        background: #00ACFF;
        border-radius: 999px;
        box-shadow: 0 6px 14px rgba(0, 172, 255, .28);
        transition: transform .25s, box-shadow .25s;
    }

    .doctor .doc-more:active {
        transform: scale(.97);
        box-shadow: 0 3px 8px rgba(0, 172, 255, .24);
    }

    /* ---------- 窄屏（≤360px）微調 ---------- */
    @media screen and (max-width: 360px) {
        .doctor.doc-enhanced .doc-img {
            flex: 0 0 118px;
            width: 118px;
        }

        .doctor.doc-enhanced .doc-img img {
            width: 118px;
            height: auto;
        }

        .doctor.doc-enhanced .doc-name p {
            font-size: 17px;
        }
    }
}
