/**
 * RS Two-Column Table - Frontend Styles
 *
 * @package RS_Two_Column_Table
 * @version 1.0.4
 * @author  rs
 *
 * 布局技術：Flexbox（100% 符合 Figma 設計）
 */

/* ========================================
   容器 (Container)
   ======================================== */

.rs-two-column-table {
    display: flex;
    flex-direction: column;
    width: 732px;
    max-width: 100%;
    margin: 2rem auto;
    overflow: hidden;
    border-radius: 0; /* 已取消圓角 */
    outline: 1px solid #AEAEAE;
    gap: 0; /* Figma 原設計是 2px，但實際邊框處理不需要 gap */
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
}

/* ========================================
   列 (Row)
   ======================================== */

.rs-two-column-table__row {
    display: flex;
    align-self: stretch;
    border-bottom: 1px solid #AEAEAE;
}

.rs-two-column-table__row:last-child {
    border-bottom: none;
}

/* ========================================
   儲存格 (Cell)
   ======================================== */

.rs-two-column-table__cell {
    display: flex;
    padding: 22px 25px;
    align-items: center;
    gap: 10px;
}

/* 左欄 (Left Column) */
.rs-two-column-table__cell--left {
    width: 200px;
    background: #F7F7F7;
    border-bottom: 1px solid #AEAEAE;
    justify-content: flex-start; /* 靠左對齊 */
}

/* 移除最後一列的左欄邊框 */
.rs-two-column-table__row:last-child .rs-two-column-table__cell--left {
    border-bottom: none;
}

/* 右欄 (Right Column) */
.rs-two-column-table__cell--right {
    flex: 1 1 0; /* 自動填充剩餘空間 */
    justify-content: center; /* 水平置中 */
    background: #FFFFFF;
}

/* ========================================
   WYSIWYG 內容樣式
   ======================================== */

/* 基礎文字樣式 */
.rs-two-column-table__cell h1,
.rs-two-column-table__cell h2,
.rs-two-column-table__cell h3,
.rs-two-column-table__cell h4,
.rs-two-column-table__cell h5,
.rs-two-column-table__cell h6,
.rs-two-column-table__cell p {
    margin: 0;
    color: #222222;
    font-size: 16px;
    font-weight: 400;
    line-height: 25.6px;
    text-align: justify; /* Figma 原設計 */
    word-wrap: break-word;
}

/* 右欄文字有額外的 letter-spacing */
.rs-two-column-table__cell--right h1,
.rs-two-column-table__cell--right h2,
.rs-two-column-table__cell--right h3,
.rs-two-column-table__cell--right h4,
.rs-two-column-table__cell--right h5,
.rs-two-column-table__cell--right h6,
.rs-two-column-table__cell--right p {
    letter-spacing: 1.6px;
}

/* 列表 */
.rs-two-column-table__cell ul,
.rs-two-column-table__cell ol {
    margin: 0;
    padding-left: 1.5rem;
}

.rs-two-column-table__cell li {
    margin-bottom: 0.25rem;
}

/* 連結 */
.rs-two-column-table__cell a {
    color: #0073aa;
    text-decoration: underline;
}

.rs-two-column-table__cell a:hover {
    color: #005177;
}

/* 粗體 / 斜體 */
.rs-two-column-table__cell strong {
    font-weight: 700;
}

.rs-two-column-table__cell em {
    font-style: italic;
}

/* ========================================
   PDF 連結樣式
   ======================================== */

.rs-two-column-table__pdf-link {
    display: inline-block;
    color: #0073aa;
    font-size: 16px;
    font-weight: 400;
    line-height: 25.6px;
    text-align: justify;
    letter-spacing: 1.6px;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.rs-two-column-table__pdf-link:hover {
    color: #005177;
    text-decoration: underline;
}

/* ========================================
   RWD: 平板 (< 768px)
   ======================================== */

@media screen and (max-width: 767px) {
    .rs-two-column-table {
        width: 100%;
        margin: 1rem 0;
        border-radius: 0; /* 已取消圓角 */
    }

    .rs-two-column-table__cell {
        padding: 18px 20px;
    }

    .rs-two-column-table__cell--left {
        width: 150px; /* 縮小左欄 */
    }

    .rs-two-column-table__cell h1,
    .rs-two-column-table__cell h2,
    .rs-two-column-table__cell h3,
    .rs-two-column-table__cell h4,
    .rs-two-column-table__cell h5,
    .rs-two-column-table__cell h6,
    .rs-two-column-table__cell p {
        font-size: 14px;
        line-height: 22px;
    }

    .rs-two-column-table__cell--right h1,
    .rs-two-column-table__cell--right h2,
    .rs-two-column-table__cell--right h3,
    .rs-two-column-table__cell--right h4,
    .rs-two-column-table__cell--right h5,
    .rs-two-column-table__cell--right h6,
    .rs-two-column-table__cell--right p {
        letter-spacing: 1.2px;
    }

    /* PDF 連結 */
    .rs-two-column-table__pdf-link {
        font-size: 14px;
        line-height: 22px;
        letter-spacing: 1.2px;
    }
}

/* ========================================
   RWD: 手機 (< 480px)
   ======================================== */

@media screen and (max-width: 479px) {
    .rs-two-column-table {
        border-radius: 0; /* 已取消圓角 */
    }

    .rs-two-column-table__cell {
        padding: 15px;
    }

    .rs-two-column-table__cell--left {
        width: 120px;
    }

    .rs-two-column-table__cell h1,
    .rs-two-column-table__cell h2,
    .rs-two-column-table__cell h3,
    .rs-two-column-table__cell h4,
    .rs-two-column-table__cell h5,
    .rs-two-column-table__cell h6,
    .rs-two-column-table__cell p {
        font-size: 12px;
        line-height: 19px;
    }

    .rs-two-column-table__cell--right h1,
    .rs-two-column-table__cell--right h2,
    .rs-two-column-table__cell--right h3,
    .rs-two-column-table__cell--right h4,
    .rs-two-column-table__cell--right h5,
    .rs-two-column-table__cell--right h6,
    .rs-two-column-table__cell--right p {
        letter-spacing: 0.8px;
    }

    /* PDF 連結 */
    .rs-two-column-table__pdf-link {
        font-size: 12px;
        line-height: 19px;
        letter-spacing: 0.8px;
    }
}

/* ========================================
   列印樣式
   ======================================== */

@media print {
    .rs-two-column-table {
        width: 100%;
        margin: 1rem 0;
        outline: 1px solid #000;
        border-radius: 0;
    }

    .rs-two-column-table__row {
        page-break-inside: avoid;
        border-bottom: 1px solid #000;
    }

    .rs-two-column-table__cell {
        padding: 15px 20px;
    }

    .rs-two-column-table__cell--left {
        background: #F7F7F7 !important;
        border-bottom: 1px solid #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .rs-two-column-table__cell h1,
    .rs-two-column-table__cell h2,
    .rs-two-column-table__cell h3,
    .rs-two-column-table__cell h4,
    .rs-two-column-table__cell h5,
    .rs-two-column-table__cell h6,
    .rs-two-column-table__cell p {
        font-size: 10pt;
        line-height: 14pt;
    }

    .rs-two-column-table__cell a {
        color: #000;
        text-decoration: none;
    }

    .rs-two-column-table__cell a::after {
        content: " (" attr(href) ")";
        font-size: 8pt;
        color: #666;
    }
}

/* ========================================
   深色模式支援 (可選)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .rs-two-column-table {
        outline-color: #555;
        background-color: #1E1E1E;
    }

    .rs-two-column-table__row {
        border-color: #555;
    }

    .rs-two-column-table__cell--left {
        background: #2A2A2A;
        border-color: #555;
    }

    .rs-two-column-table__cell--right {
        background: #1E1E1E;
    }

    .rs-two-column-table__cell h1,
    .rs-two-column-table__cell h2,
    .rs-two-column-table__cell h3,
    .rs-two-column-table__cell h4,
    .rs-two-column-table__cell h5,
    .rs-two-column-table__cell h6,
    .rs-two-column-table__cell p {
        color: #E0E0E0;
    }

    .rs-two-column-table__cell a {
        color: #4A9EFF;
    }

    .rs-two-column-table__cell a:hover {
        color: #78B4FF;
    }
}
