/* =========================================
   SCL Plugin Main Styles (Clean & Modular)
   ========================================= */

/* --- 0. 全域變數與基礎設定 --- */
:root {
    /* 主色調 (後台可覆寫此變數) */
    --scl-gold: #c59d5f; 
    
    /* 其他輔助色 */
    --scl-primary: #2c3e50; /* 深藍標題色 */
    --scl-accent: var(--scl-gold); /* 讓強調色連動主色 */
    --scl-dark: #333333;
    --scl-gray: #666666;
    --scl-border: #e9ecef;
    --scl-bg-light: #f8f9fa;
}

.scl-container, 
.scl-list-container,
.scl-single-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #444;
}

/* =========================================
   1. 列表頁面 (課程與講師共用)
   ========================================= */

/* --- 篩選器 (膠囊樣式) --- */
.scl-filter-pills {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.scl-pill {
    padding: 8px 25px;
    border-radius: 50px;
    text-decoration: none !important;
    border: 1px solid #ddd;
    color: #888;
    background: #fff;
    transition: 0.3s;
    font-size: 15px;
}

.scl-pill:hover, 
.scl-pill.active {
    background: var(--scl-gold) !important;
    color: #fff !important;
    border-color: var(--scl-gold) !important;
}

/* --- Grid 佈局 --- */
.scl-lecturer-grid-clean,
.scl-course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* --- 通用潔淨卡片 (Clean Card) --- */
.scl-clean-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: 0.3s;
    border: 1px solid var(--scl-border);
    display: flex;
    flex-direction: column;
}

.scl-clean-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.12);
}

/* 圖片區域 (強制 4:3 比例滿版) */
.scl-card-photo {
    width: 100%;
    height: 0;
    padding-bottom: 75%;
    position: relative;
    overflow: hidden;
    background: #f4f4f4;
}

.scl-card-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    margin: 0 !important;
}

/* 內容區域 */
.scl-clean-body {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
}

/* 標題與職稱 */
.scl-clean-name {
    margin: 0 0 5px 0 !important;
    font-size: 1.4rem !important;
    color: var(--scl-dark);
    font-weight: 700;
}
.scl-clean-name a {
    color: inherit;
    text-decoration: none;
    transition: 0.3s;
}
.scl-clean-name a:hover {
    color: var(--scl-gold);
}

.scl-name-suffix {
    font-size: 0.9rem;
    font-weight: normal;
    color: #777;
    margin-left: 5px;
}

.scl-clean-job {
    color: var(--scl-gold);
    font-size: 0.95rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.scl-clean-desc {
    color: var(--scl-gray);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    flex-grow: 1; /* 讓描述區塊填滿空間，將按鈕推到底部(若有需要) */
}

/* 通用按鈕樣式 (Toggle & Link) */
button.scl-btn-toggle,
a.scl-btn-toggle {
    background: transparent !important;
    border: 1px solid var(--scl-gold) !important;
    color: var(--scl-gold) !important;
    width: 100%;
    padding: 12px 0 !important;
    font-size: 1rem !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: none !important;
    margin: 0 !important;
    display: block;
    text-align: center;
    text-decoration: none !important;
    font-weight: normal !important;
    line-height: 1.5 !important;
}

button.scl-btn-toggle:hover,
a.scl-btn-toggle:hover {
    background: var(--scl-gold) !important;
    color: #fff !important;
}

/* 課程專屬：分類標籤 */
.scl-course-cat-label {
    font-size: 0.85rem;
    color: var(--scl-gold);
    margin-bottom: 5px;
    font-weight: 600;
}
.scl-course-cat-label a { color: inherit; text-decoration: none; }

/* 課程專屬：資訊列 */
.scl-course-meta-row {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 10px;
}
.scl-course-meta-row span { display: flex; align-items: center; gap: 5px; }
.scl-course-meta-row .dashicons { color: var(--scl-gold); }


/* =========================================
   2. 列表隱藏內容區塊 (Accordion for List)
   ========================================= */
.scl-hidden-wrapper {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.scl-hidden-inner {
    padding: 0 25px 25px 25px;
}

hr.scl-divider {
    border: 0;
    border-top: 1px solid #eee;
    margin: 10px 0 20px 0 !important;
}

.scl-info-block h4 {
    font-size: 1rem !important;
    color: var(--scl-dark) !important;
    margin: 0 0 10px 0 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold !important;
    line-height: 1.2;
}
.scl-info-block h4 .dashicons {
    color: var(--scl-gold);
    font-size: 1.2rem;
    width: 1.2rem;
    height: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* =========================================
   3. 編輯器內容樣式 (Editor Content Reset)
   ========================================= */
.scl-editor-content {
    color: #666;
    font-size: 0.95rem; /* 稍微加大一點易讀性，原 12px 偏小 */
    line-height: 1.6;
}

.scl-editor-content p { margin-bottom: 10px; }

/* ul 列表 */
.scl-editor-content ul {
    margin: 0 0 20px 0 !important;
    padding: 0 0 0 20px !important;
    list-style: none !important;
}
.scl-editor-content li {
    position: relative;
    margin-bottom: 5px !important;
    padding-left: 5px;
}
/* 自訂 Bullet */
.scl-editor-content ul li::before {
    content: "•";
    color: var(--scl-gold);
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-left: -1em;
}

/* ol 列表 */
.scl-editor-content ol {
    margin: 0 0 20px 0 !important;
    padding-left: 20px !important;
    color: var(--scl-gold);
}
.scl-editor-content ol li {
    color: #666;
    padding-left: 5px;
}


/* =========================================
   4. 課程單一內頁 (Hero + Sticky Sidebar)
   ========================================= */

/* --- Hero Section --- */
.scl-hero-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 40px;
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 1px solid #eee;
}
.scl-hero-content { flex: 1; min-width: 300px; }
.scl-hero-image { 
    flex: 1; min-width: 300px; 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
}
.scl-hero-image img { width: 100%; height: auto; display: block; }
.scl-placeholder-img { background: #2c3e50; color: #fff; height: 300px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.scl-hero-content .scl-hero-tags a { text-decoration: none; }
.scl-hero-tags a {
    display: inline-block;
    background: #f0f4f8;
    color: var(--scl-gold);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    text-decoration: none;
    margin-right: 5px;
    margin-bottom: 10px;
    font-weight: 600;
}
.scl-hero-title { font-size: 2.2rem; margin: 10px 0 20px 0; line-height: 1.3; color: #333; }
.scl-hero-desc { font-size: 1.05rem; line-height: 1.6; color: #666; margin-bottom: 25px; }
.scl-hero-meta { display: flex; gap: 20px; color: #888; font-size: 0.95rem; }
.scl-hero-meta span { display: flex; align-items: center; gap: 6px; }

/* --- Layout Grid --- */
.scl-main-grid { display: flex; gap: 40px; align-items: flex-start; }
.scl-col-left { flex: 2; min-width: 0; }
.scl-col-right { flex: 1; min-width: 300px; }

/* --- Accordion (內頁手風琴) --- */
details.scl-accordion {
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: 0.3s;
}
details.scl-accordion[open] {
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    border-color: #ddd;
}
summary.scl-acc-title {
    padding: 20px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #333;
}
summary.scl-acc-title::after {
    content: "+";
    font-size: 1.5rem;
    color: var(--scl-gold);
    font-weight: normal;
}
details[open] summary.scl-acc-title::after { content: "−"; }
summary.scl-acc-title::-webkit-details-marker { display: none; }

.scl-acc-content {
    padding: 0 20px 20px 20px;
    border-top: 1px solid #f5f5f5;
    margin-top: 0;
}

/* --- Sticky Sidebar Card --- */
.scl-sticky-card {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06);
    position: sticky;
    top: 30px;
    border: 1px solid #eee;
}

.scl-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}
.scl-price-val {
    font-size: 2em;
    font-weight: bold;
    color: var(--scl-gold);
}

.scl-info-list { list-style: none; padding: 0; margin: 0 0 25px 0; }
.scl-info-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: flex-start;
}
.scl-info-list i { font-size: 1.2rem; color: #bbb; margin-top: 3px; }
.scl-info-list small { display: block; color: #999; font-size: 0.8rem; margin-bottom: 2px; }
.scl-info-list strong { display: block; color: #333; font-size: 1rem; }

.scl-btn-register {
    display: block;
    width: 100%;
    background: var(--scl-gold);
    color: #fff;
    text-align: center;
    padding: 15px;
    border-radius: 6px;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.1rem;
    transition: 0.3s;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(197, 157, 95, 0.3); /* 使用半透明金色陰影，若無法動態，建議用通用色 */
}
.scl-btn-register:hover {
    filter: brightness(0.9); /* 自動變暗一點 */
    color: #fff;
    transform: translateY(-2px);
}
.scl-btn-register.disabled {
    background: #ddd;
    cursor: not-allowed;
    box-shadow: none;
}

.scl-organizer-info {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: #999;
}
.scl-organizer-info p { margin: 3px 0; }

/* --- Bottom Lecturer --- */
.scl-bottom-lecturer {
    margin-top: 50px;
    background: #fff;
    border: 1px solid #e9e9e9;
    border-radius: 12px;
    padding: 30px;
}
.scl-sec-header {
    margin-top: 0;
    margin-bottom: 20px;
    border-left: 4px solid var(--scl-gold);
    padding-left: 10px;
    color: #333;
}
.scl-lecturer-row {
    display: flex;
    gap: 25px;
    align-items: center;
}
.scl-l-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
}
.scl-l-info h4 { margin: 0 0 10px 0; font-size: 1.2rem; }
.scl-l-info small { font-weight: normal; color: var(--scl-gold); margin-left: 10px; }
.scl-l-bio { color: #666; font-size: 0.95rem; margin-bottom: 10px; line-height: 1.5; }
.scl-read-more { font-size: 0.9rem; color: #888; text-decoration: none; border-bottom: 1px dashed #ccc; }

/* =========================================
   RWD
   ========================================= */
@media (max-width: 850px) {
    .scl-hero-section { flex-direction: column-reverse; gap: 20px; }
    .scl-hero-content, .scl-hero-image { min-width: 100%; }
    .scl-main-grid { flex-direction: column; }
    .scl-col-right { order: -1; width: 100%; }
    .scl-sticky-card { position: static; }
}

@media (max-width: 768px) {
    .scl-lecturer-grid-clean, 
    .scl-course-grid {
        grid-template-columns: 1fr;
    }
    .scl-card-photo {
        padding-bottom: 60%;
    }
}