/* ========================================
   Doctor List Embed Plugin - Front-end CSS v2
   ======================================== */

/* ---------- Grid ---------- */
.dle-doctor-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 1rem 0 1.5rem;
}

/* 桌機：少於4個時居中 */
.dle-doctor-grid.dle-cols-1 { grid-template-columns: repeat(1, minmax(0, 260px)); justify-content: center; }
.dle-doctor-grid.dle-cols-2 { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; }
.dle-doctor-grid.dle-cols-3 { grid-template-columns: repeat(3, minmax(0, 260px)); justify-content: center; }

/* 平板：2欄，1個時居中 */
@media (max-width: 1024px) {
    .dle-doctor-grid,
    .dle-doctor-grid.dle-cols-2,
    .dle-doctor-grid.dle-cols-3 {
        grid-template-columns: repeat(2, 1fr);
        justify-content: unset;
    }
    .dle-doctor-grid.dle-cols-1 {
        grid-template-columns: repeat(1, minmax(0, 300px));
        justify-content: center;
    }
}

/* 手機：1欄，置中並限制卡片最大寬度 */
@media (max-width: 600px) {
    .dle-doctor-grid,
    .dle-doctor-grid.dle-cols-1,
    .dle-doctor-grid.dle-cols-2,
    .dle-doctor-grid.dle-cols-3 {
        grid-template-columns: minmax(0, 340px);
        justify-content: center;
        gap: 0.75rem;
        padding: 0.75rem 0 1rem;
    }
}

/* ---------- Card ---------- */
.dle-doctor-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.dle-doctor-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0,0,0,0.13);
}

/* 正方形照片 */
.dle-card-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #e8edf2;
    flex-shrink: 0;
}

.dle-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform 0.35s ease;
}

.dle-doctor-card:hover .dle-card-photo img {
    transform: scale(1.04);
}

.dle-card-photo-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #cdd8e8, #a8bcce);
}

/* 文字區 */
.dle-card-body {
    padding: 1.1rem 1.2rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 科別標籤 */
.dle-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dle-tag {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    background: #e6f0fb;
    color: #1a5cbf;
    font-size: 0.73rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* 醫師姓名 */
.dle-card-name {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: #1a2b4a;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

/* 專長預覽 */
.dle-card-section {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1;
}

.dle-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.dle-card-spec-preview {
    margin: 0;
    font-size: 0.83rem;
    color: #555;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 本月看診（卡片簡要） */
.dle-card-schedule {
    flex: none;
}

.dle-card-sched-preview {
    margin: 0;
    font-size: 0.8rem;
    color: #1a5cbf;
    font-weight: 600;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片按鈕 */
.dle-card-btn {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    background: #1a5cbf;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    text-align: center;
    margin-top: auto;
}

.dle-card-btn:hover { background: #154ea3; }

/* ---------- Lightbox ---------- */
.dle-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dle-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dle-lightbox.dle-active .dle-lightbox-overlay { opacity: 1; }

.dle-lightbox-container {
    position: relative;
    background: #fff;
    border-radius: 18px;
    width: 92%;
    max-width: 680px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    opacity: 0;
    transform: scale(0.95) translateY(18px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.dle-lightbox.dle-active .dle-lightbox-container {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.dle-lightbox-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(0,0,0,0.07);
    border: none;
    font-size: 1.5rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    transition: background 0.2s;
    line-height: 1;
}

.dle-lightbox-close:hover { background: rgba(0,0,0,0.14); color: #111; }

/* ---------- Lightbox Content ---------- */
.dle-lightbox-content {
    display: flex;
    flex-direction: column;
}

/* ── 上方區塊：照片 + 標籤/姓名/按鈕 ── */
.dle-lb-top {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.75rem 2rem 1.5rem;
    border-bottom: 1px solid #eef0f4;
    flex-shrink: 0;
}

/* 正方形照片 */
.dle-lb-photo {
    flex: 0 0 150px;
    width: 150px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    background: #e8edf2;
}

.dle-lb-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

/* 照片右側：標籤、姓名、按鈕 */
.dle-lb-header {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.6rem;
    min-width: 0;
}

/* 標籤列 */
.dle-lb-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.dle-lb-tag {
    display: inline-block;
    padding: 0.18rem 0.6rem;
    background: #e6f0fb;
    color: #1a5cbf;
    font-size: 0.73rem;
    font-weight: 600;
    border-radius: 20px;
    white-space: nowrap;
}

/* 姓名 */
.dle-lb-name {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a2b4a;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* 按鈕區 */
.dle-lb-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

/* ── 下方區塊：專長/經歷/學歷 ── */
.dle-lb-info {
    padding: 1.5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* 各區塊 */
.dle-lb-section {
    margin-bottom: 1.1rem;
}

.dle-lb-section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: #1a5cbf;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.45rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #e6f0fb;
}

/* 條列清單 */
.dle-lb-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.dle-lb-list li {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.55;
    padding-left: 1rem;
    position: relative;
}

.dle-lb-list li::before {
    content: '·';
    position: absolute;
    left: 0;
    color: #1a5cbf;
    font-weight: 700;
    font-size: 1.1em;
}

.dle-lb-spec-list li {
    font-size: 0.85rem;
    color: #444;
}

/* 本月門診（彈窗完整） */
.dle-lb-sched-month {
    font-weight: 600;
    color: #888;
    font-size: 0.85em;
    text-transform: none;
    letter-spacing: 0;
}

.dle-lb-sched-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.4rem;
    padding-left: 0;
}

.dle-lb-sched-list li::before {
    content: none;
}

.dle-sched-date {
    font-weight: 700;
    color: #1a2b4a;
    min-width: 4.8em;
}

.dle-sched-session {
    display: inline-block;
    padding: 0.05rem 0.5rem;
    background: #e6f0fb;
    color: #1a5cbf;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
}

.dle-sched-meta {
    color: #777;
    font-size: 0.8rem;
}

/* ---------- LINE / Profile Buttons ---------- */
.dle-btn-line {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    background: #06c755;
    color: #fff !important;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.dle-btn-line:hover { background: #05a848; color: #fff !important; }
.dle-btn-line svg { flex-shrink: 0; }

.dle-btn-profile {
    display: inline-flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: #fff;
    color: #1a5cbf !important;
    border: 2px solid #1a5cbf;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.88rem;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.dle-btn-profile:hover { background: #1a5cbf; color: #fff !important; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
    .dle-lightbox-container {
        width: 96%;
        max-height: 94vh;
        border-radius: 14px;
    }

    .dle-lb-top {
        padding: 1.25rem 1.25rem 1.1rem;
        gap: 1rem;
    }

    .dle-lb-photo {
        flex: 0 0 110px;
        width: 110px;
        height: 110px;
        border-radius: 10px;
    }

    .dle-lb-name { font-size: 1.2rem; }

    .dle-lb-info {
        padding: 1.1rem 1.25rem 1.5rem;
    }

    .dle-lb-actions { flex-direction: column; }

    .dle-btn-line,
    .dle-btn-profile { text-align: center; justify-content: center; }
}

/* ---------- Closing animation ---------- */
.dle-lightbox.dle-closing .dle-lightbox-overlay { opacity: 0; }
.dle-lightbox.dle-closing .dle-lightbox-container {
    opacity: 0;
    transform: scale(0.95) translateY(18px);
}

/* ---------- Filter Bar ---------- */
.dle-doctor-wrap {
    max-width: 1400px;
    margin: 0 auto;
}

.dle-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0;
}

.dle-filter-btn {
    display: inline-block;
    padding: 0.45rem 1.1rem;
    background: #f0f4f8;
    color: #556;
    border: 1.5px solid #dde3ea;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
    line-height: 1.4;
}

.dle-filter-btn:hover {
    background: #e6f0fb;
    color: #1a5cbf;
    border-color: #1a5cbf;
}

.dle-filter-btn.dle-filter-active {
    background: #1a5cbf;
    color: #fff;
    border-color: #1a5cbf;
}

/* 桌機與平板的 Lightbox 隱藏 LINE 預約按鈕，僅手機顯示 */
@media (min-width: 601px) {
    #dle-lb-line {
        display: none !important;
    }
}
