/* ============================================================
   樣式選擇（at_special_style）的九個樣式
   class 統一 .at-ed-*，後台編輯器與前台共用；清單在 js/custom-buttons.js。
   顏色、字型吃佈景的 --at-* 變數，沒有時用後面的備用值；
   各站要微調外觀，在佈景 style.css 覆寫同名 class 即可，不要改這裡。
   ============================================================ */

/* 文字類樣式（焦點、章節內重點、金句、備註）字型、粗細、顏色都跟內文一樣，只差字級；
   要上色由編輯者用工具列的 A 文字顏色加、要粗用 B。行高縮到 1.5 是因為內文的 2 倍行高在大字上會空得太開 */

/* 焦點大字：全篇最醒目 */
.at-ed-focus {
    font-size: 2.6rem;
    line-height: 1.5;
}

/* 章節內重點：章節標題內的重點（H3 大小） */
.at-ed-point {
    font-size: 1.6rem;
    line-height: 1.6;
}

/* 金句大字：章節內凸顯的大字（SP 20px / PC 26px，比頁面標題 24px 大一點） */
.at-ed-quote {
    font-size: 2rem;
    line-height: 1.5;
}

/* 打勾清單：class 加在 <ul> 上，圓點換成主色實心小方塊（8px，對齊第一行文字中線）。
   自己帶完整的清單排版，不依賴佈景的 .at-default-style；class 寫三次是要蓋過佈景畫小圓點的規則 */
.at-ed-check.at-ed-check {
    margin: 10px 0 10px 26px;   /* 清單一律比段落內縮 26px */
    padding-left: 0;
    list-style: none;
}

.at-ed-check.at-ed-check.at-ed-check > li {
    position: relative;
    padding-left: 1.5em;   /* 清單對齊通則：項目清單文字從 1.5em 開始 */
    list-style: none;
}

.at-ed-check.at-ed-check.at-ed-check > li + li {
    margin-top: 5px;
}

.at-ed-check.at-ed-check.at-ed-check > li::before {
    content: "";
    position: absolute;
    top: calc(1lh / 2);
    left: calc(.4em - 4px);   /* 記號中心在 .4em */
    width: 8px;
    height: 8px;
    border-radius: 0;
    background: var(--at-primary, #13AA5E);
    transform: translateY(-50%);
}

/* 圖示標題：底色橫帶＋左側圖示。圖示用工具列的圖示按鈕插在文字最前面（.fa-icon-wrapper）。
   橫帶底色畫在 ::before，佈景要換成花紋圖就覆寫 .at-ed-icon-title::before 的 background；
   class 寫兩次是要蓋過編輯器 h4::before 的短金線與前台段落外距 */
.at-ed-icon-title.at-ed-icon-title {
    position: relative;
    z-index: 0;
    display: flex;
    align-items: center;
    min-height: 66px;
    margin: 1em 0 22px;
    padding: 0 20px;
    font-size: inherit;
    font-weight: 700;
    line-height: 1.72;
}

.at-ed-icon-title.at-ed-icon-title::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    width: auto;
    height: auto;
    background: var(--at-beige, #F9F6ED);
    transform: none;
}

.at-ed-icon-title .fa-icon-wrapper {
    flex: none;
    width: 27px;
    margin-right: 10px;
    color: var(--at-primary, #BEA567);
    font-size: 2.4rem;
    line-height: 1;
    text-align: center;
}

/* 重點底色：帶底色的文字段落，外觀同佈景的 .at-box.is-beige（米色底、SP 25px / PC 40px 50px 內距）
   底色與邊框兩個的 class 寫兩次，外距才蓋得過前台 .at-content-body p 的 1em */
.at-ed-bg.at-ed-bg {
    margin: 40px 0;
    padding: 25px;
    background: var(--at-beige, #F9F6ED);
}

/* 重點邊框：用外框框住的獨立段落，外觀同佈景的 .at-box.is-line（白底、金色細框、12px 圓角） */
.at-ed-border.at-ed-border {
    margin: 40px 0;
    padding: 25px;
    border: 1px solid var(--at-primary, #BEA567);
    border-radius: 12px;
    background: #fff;
}

/* 框是 <div> 容器，裡面的段落／清單照內文規則走；只把第一個與最後一個的外距歸零，免得跟框的內距疊在一起 */
.at-ed-bg.at-ed-bg > :first-child,
.at-ed-border.at-ed-border > :first-child {
    margin-top: 0;
}

.at-ed-bg.at-ed-bg > :last-child,
.at-ed-border.at-ed-border > :last-child {
    margin-bottom: 0;
}

/* 實心按鈕 / 空心按鈕：段落裡放一個連結，套用後整段置中、連結變成按鈕
   連結的 class 寫兩次是為了拉高權重，蓋過編輯器 .mce-content-body a 與前台 .at-content-body a 的顏色底線 */
.at-ed-btn,
.at-ed-btn-outline {
    padding: 10px 0;
    text-align: center;
}

.at-ed-btn.at-ed-btn > a,
.at-ed-btn-outline.at-ed-btn-outline > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 240px;
    min-height: 56px;
    padding: 12px 40px;
    border-radius: 5px;   /* 大型按鈕規格：高 56px、16px 粗體、圓角 5px */
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: .1em;
    text-decoration: none;
    transition: background .3s ease, color .3s ease;
}

.at-ed-btn.at-ed-btn > a {
    background: var(--at-primary, #BEA567);
    color: #fff;
}

.at-ed-btn.at-ed-btn > a:hover,
.at-ed-btn.at-ed-btn > a:focus {
    background: var(--at-primary-deep, #AE9F7A);
    color: #fff;
    text-decoration: none;
}

.at-ed-btn-outline.at-ed-btn-outline > a {
    border: 1px solid var(--at-primary, #BEA567);
    background: #fff;
    color: var(--at-primary, #BEA567);
}

.at-ed-btn-outline.at-ed-btn-outline > a:hover,
.at-ed-btn-outline.at-ed-btn-outline > a:focus {
    background: var(--at-primary, #BEA567);
    color: #fff;
    text-decoration: none;
}

/* 閱讀更多：段落裡放一個連結，套用後變成靠右的文字連結加箭頭 */
.at-ed-more {
    text-align: right;
}

.at-ed-more.at-ed-more > a {
    position: relative;
    display: inline-block;
    padding: 0 26px 6px 0;
    border-bottom: 1px solid var(--at-border, #D9D9D9);
    color: inherit;
    text-decoration: none;
    transition: color .3s ease;
}

.at-ed-more.at-ed-more > a::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 4px;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-top: 1px solid var(--at-primary, #BEA567);
    border-right: 1px solid var(--at-primary, #BEA567);
    transform: rotate(45deg);
}

.at-ed-more.at-ed-more > a:hover,
.at-ed-more.at-ed-more > a:focus {
    color: var(--at-primary, #BEA567);
    text-decoration: none;
}

/* 備註：補充小字 */
.at-ed-note {
    font-size: 1.3rem;
    line-height: 1.8;
}

@media (min-width: 768px) {
    .at-ed-icon-title.at-ed-icon-title {
        min-height: 70px;
        margin-bottom: 27px;
        padding: 0 25px;
        line-height: 1.68;
    }

    .at-ed-icon-title .fa-icon-wrapper {
        width: 30px;
        margin-right: 16px;
        font-size: 2.8rem;
    }

    .at-ed-focus {
        font-size: 3.4rem;
    }

    .at-ed-point {
        font-size: 2.1rem;
    }

    .at-ed-quote {
        font-size: 2.6rem;
    }

    .at-ed-bg.at-ed-bg,
    .at-ed-border.at-ed-border {
        margin: 60px 0;
    }

    .at-ed-bg.at-ed-bg {
        padding: 40px 50px;
    }

    .at-ed-border.at-ed-border {
        padding: 32px 36px;
    }
}

/* ============================================================
   其他編輯器內容
   ============================================================ */
/* 引用（工具列「“」按鈕）：客戶評價、引述一段話。淡主色底、左上角大引號；
   跟「重點底色」的差別：這個是「別人說的話」，重點底色是「我們要強調的事」 */
blockquote,
.at-content-body blockquote.at-default-style {
    position: relative;
    margin: 30px 0;
    padding: 28px 30px 28px 76px;
    border: 0 !important;
    border-radius: 10px;
    background: var(--at-surface, #EEF7F2);
}

blockquote::before,
.at-content-body blockquote.at-default-style::before {
    content: "\201C";   /* 左雙引號 “ */
    position: absolute;
    top: 14px;
    left: 22px;
    color: var(--at-primary, #13AA5E);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 64px;   /* 裝飾：不跟字級放大 */
    line-height: 1;
}

blockquote > :first-child {
    margin-top: 0;
}

blockquote > :last-child {
    margin-bottom: 0;
}

@media (max-width: 767px) {
    blockquote,
    .at-content-body blockquote.at-default-style {
        padding: 22px 20px 22px 58px;
    }

    blockquote::before,
    .at-content-body blockquote.at-default-style::before {
        top: 12px;
        left: 16px;
        font-size: 50px;
    }
}

/* at-gallery-item */
.at-gallery-item a {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.at-gallery-item a img {
    transition: transform 0.3s ease;
    border-radius: 10px;
}

.at-gallery-item a:hover img {
    transform: scale(1.05);
}

/* /.at-gallery-item */

/* at-mark 螢光筆：只畫在文字下半部（像真的螢光筆劃過去），顏色改 --at-mark-color
   --- 前台預設狀態：寬度 0%（捲到時 JS 加 .is-visible，由左往右劃過去） --- */
.at-mark {
    --at-mark-color: #FFE45C;   /* 螢光黃 */
    background-image: linear-gradient(transparent 55%, var(--at-mark-color) 55%, var(--at-mark-color) 92%, transparent 92%);
    background-repeat: no-repeat;
    background-position: left bottom;
    background-size: 0% 100%;
    /* 前台預設看不見 */
    transition: background-size 3s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 0 2px;
    /* 一段螢光跨兩行時，每一行都各自畫滿 */
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

.at-mark.is-visible {
    background-size: 100% 100%;
}

/* --- 後台編輯器專屬：強制顯示 (不需要動畫) --- */
.editor-styles-wrapper .at-mark,
.mce-content-body .at-mark,
body.wp-admin .at-mark {
    background-size: 100% 100% !important;
    transition: none !important;
}

/* /at-mark */

/* 不斷行：選取的字當成一整塊，放得下就排在同一行、不會被拆開；
   比一整行還長時才在塊裡換行（不用 nowrap，手機上不會撐出畫面） */
.at-ed-nowrap {
    display: inline-block;
    max-width: 100%;
    text-indent: 0;   /* 在編號清單裡不要繼承 li 的負縮排（不然字會往左疊到前面） */
}

/* 後台編輯器裡標出來，客戶看得到哪些字套了不斷行（前台不顯示） */
.mce-content-body .at-ed-nowrap {
    outline: 1px dashed rgba(19, 170, 94, .6);
    outline-offset: 1px;
}

/* ============================================================
   清單款式（工具列「項目清單／編號清單」旁的 ▾ 選）
   class 加在 <ul>/<ol>：.at-list ＋ 款式。自己帶完整排版，不靠佈景的 .at-default-style；
   class 寫兩次是要蓋過佈景預設清單的記號。記號大小用 em，跟著字級放大
   項目：小圓點（預設，佈景畫）／.at-list-square-o 空心方塊／.at-list-tri 三角形／.at-list-bar 直條
   編號：01.（預設，佈景畫）／.at-list-circle 圓圈數字／.at-list-box 方塊數字／.at-list-point POINT 01
   「打勾清單」.at-ed-check（實心方塊）在「樣式選擇」裡，是設計款
   ============================================================ */
.at-list.at-list {
    margin: 10px 0 10px 26px;   /* 清單一律比段落內縮 26px */
    padding-left: 0;
    list-style: none;
}

/* 清單裡的第二層：不再多內縮 26px（外層 li 本來就有內縮） */
li > .at-list.at-list,
li > .at-ed-check.at-ed-check {
    margin: 5px 0 0;
}

.at-list.at-list > li {
    position: relative;
    list-style: none;
    text-indent: 0;
}

.at-list.at-list > li + li {
    margin-top: 8px;
}

/* 項目清單款式：記號對齊第一行文字中線 */
.at-list-square-o.at-list-square-o > li,
.at-list-tri.at-list-tri > li,
.at-list-bar.at-list-bar > li {
    padding-left: 1.5em;
}

.at-list-square-o.at-list-square-o > li::before,
.at-list-tri.at-list-tri > li::before,
.at-list-bar.at-list-bar > li::before {
    content: "";
    position: absolute;
    top: calc(1lh / 2);
    left: .15em;   /* 寬 .5em 的記號，中心在 .4em */
    box-sizing: border-box;
    border-radius: 0;   /* 蓋掉編輯器預設小圓點的圓角 */
    transform: translateY(-50%);
}

.at-list-square-o.at-list-square-o > li::before {
    width: .5em;
    height: .5em;
    border: 1.5px solid var(--at-primary, #13AA5E);
    background: transparent;
}

.at-list-tri.at-list-tri > li::before {
    width: 0;
    height: 0;
    border-top: .3em solid transparent;
    border-bottom: .3em solid transparent;
    border-left: .5em solid var(--at-primary, #13AA5E);
    background: transparent;
}

.at-list-bar.at-list-bar > li::before {
    left: calc(.4em - 2px);
    width: 4px;
    height: 1em;
    background: var(--at-primary, #13AA5E);
}

/* 編號清單款式 */
.at-list-circle.at-list-circle,
.at-list-box.at-list-box,
.at-list-point.at-list-point {
    counter-reset: at-list;
}

.at-list-circle.at-list-circle > li,
.at-list-box.at-list-box > li,
.at-list-point.at-list-point > li {
    counter-increment: at-list;
}

/* 號碼徽章跟第一行文字排在同一行（inline，vertical-align: middle 對齊文字中線），換行的字靠 text-indent 對齊 */
.at-list-circle.at-list-circle > li,
.at-list-box.at-list-box > li {
    padding-left: 2em;
    text-indent: -2em;
}

.at-list-circle.at-list-circle > li::before,
.at-list-box.at-list-box > li::before {
    content: counter(at-list);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 1.6em;
    height: 1.6em;
    margin-right: .7529em;   /* 徽章寬＋間距＝li 的 2em（徽章字級 .85em） */
    font-family: var(--at-font-en, "Jost", sans-serif);
    font-size: .85em;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
    text-indent: 0;
    vertical-align: middle;
    position: relative;
    top: -.08em;
}

.at-list-circle.at-list-circle > li::before {
    border: 1px solid var(--at-primary, #13AA5E);
    border-radius: 50%;
    background: #fff;
    color: var(--at-primary, #13AA5E);
}

.at-list-box.at-list-box > li::before {
    border-radius: 3px;
    background: var(--at-primary, #13AA5E);
    color: #fff;
}

/* POINT 01：左邊上方小字 POINT、下方大號碼，文字排在右邊 */
/* 文字第一行對齊大號碼的中間（號碼中心在 .75em＋1.7em/2＝1.6em；內文第一行中心 .95em，往下推 .65em） */
.at-list-point.at-list-point > li {
    min-height: 2.5em;
    padding-top: .65em;
    padding-left: 4em;
}

.at-list-point.at-list-point > li + li {
    margin-top: 16px;
}

.at-list-point.at-list-point > li::before,
.at-list-point.at-list-point > li::after {
    position: absolute;
    left: 0;
    color: var(--at-primary, #13AA5E);
    font-family: var(--at-font-en, "Jost", sans-serif);
    font-weight: 600;
    line-height: 1;
    letter-spacing: .08em;
}

.at-list-point.at-list-point > li::before {
    content: "POINT";
    top: .1em;
    font-size: .6em;
}

.at-list-point.at-list-point > li::after {
    content: counter(at-list, decimal-leading-zero);
    top: .75em;
    font-size: 1.7em;
}
