/* =====================================================================
   長輩大字（2026-11-15）：手機設定字型調大（130%～200%）時版面不擠爆＋無障礙補強
   - 全站字級已改 rem（16px＝1rem），預設字級時畫面跟以前一模一樣
   - 字放大時 library/text_scale_head.lbi 會在 <html> 加 text-lg（約 120% 起）、text-xl（約 160% 起）；
     第一大段的版面調整都掛在這兩個 class 底下，所以「沒調字型的人」畫面一點都不變
   - 放最後載入（html_header.lbi），同權重蓋得過前面的檔；版號在 themes/drycleaner/functions.php
   - 量測工具與報告：scratchpad a11y-textscale（360／390／768／1280 寬 × 100／130／200%）
   ===================================================================== */

/* ---------- 1. 底部常用功能列：五格固定寬，字到 15px 為止（原本 12px），再大五個字會撞在一起 ---------- */
html.text-lg body #mobile-nav.customer-nav .nav-text { font-size: 15px; }
html.text-lg #mobile-nav .mobile-cart-badge { font-size: 13px; }

/* ---------- 2. 右下浮動圓鈕（每日籤、LINE）：圓圈固定大小，字跟圖示維持原本大小（它們只是捷徑，放大會擠出圓圈） ---------- */
html.text-lg #floating-buttons a { font-size: 14px; }
html.text-lg #floating-buttons .btn-icon { font-size: 20px; }

/* ---------- 3. 頁首「歡迎…／註冊／登入」：原本高 20px、行高 20px，字大會壓到下一行 ---------- */
html.text-lg #account_area { height: auto; min-height: 1.25rem; line-height: 1.25rem; }
/* 2026-11-21：字放大後「註冊」會斷成上下兩個字，按鈕字整個不斷行 */
html.text-lg #account_area a { white-space: nowrap; }

/* ---------- 4. 麵包屑：原本一行、超出變「…」，字大時幾乎整串看不到 → 可換行 ---------- */
html.text-lg body #top .top-breadcrumbs { white-space: normal; overflow: visible; text-overflow: clip; }

/* ---------- 5. 商品格（分類、搜尋、品牌）：手機兩欄；字大到一欄放不下約 6 個字時改一欄 ---------- */
@media screen and (max-width: 768px) {
    html.text-lg body#page_category ul.product-grid,
    html.text-lg body#page_search ul.product-grid,
    html.text-lg body#page_brand ul.product-grid {
        grid-template-columns: repeat(auto-fill, minmax(min(100%, max(6em, calc(50% - 6px))), 1fr));
    }
}
/* 排序頁籤（推薦／上架時間／價格）：那一列原本固定高 32px，字大換行會蓋到下面的商品 */
html.text-lg .tab_wrapper .tabs { height: auto; min-height: 32px; }

/* ---------- 6. 數量加減鈕：框固定大小，＋－符號到 22px 為止 ---------- */
html.text-lg .quantity-selector .btn-minus,
html.text-lg .quantity-selector .btn-plus { font-size: min(1rem, 22px); }

/* ---------- 7. 會員中心選單（我的訂單、取件預約…）：原本一行、超出變「我的…」→ 可換行；字很大時改一欄 ---------- */
html.text-lg body#page_user .app-user-menu .app-menu-item { height: auto; white-space: normal; overflow: visible; text-overflow: clip; }
html.text-lg body#page_user .app-user-menu .app-menu-icon { font-size: min(1.125rem, 24px); }
html.text-xl body#page_user .app-user-menu { grid-template-columns: 1fr; }

/* ---------- 8. 訂單明細：左欄標題（訂單狀態：）原本不換行（keep-all），字大會被切掉一半 → 可以斷行；
                 很大字時標題放上一行、內容放下一行。商品表欄位多，放不下時改成可以左右滑（原本超出的部分直接被切掉） ---------- */
html.text-lg body#page_user .order_detail .data_table:not(.order_product_list) th { white-space: normal; word-break: normal; }
html.text-xl body#page_user .order_detail .data_table:not(.order_product_list) tr,
html.text-xl body#page_user .order_detail .data_table:not(.order_product_list) th,
html.text-xl body#page_user .order_detail .data_table:not(.order_product_list) td { display: block; width: auto; }
html.text-lg body#page_user #order-detail .order_detail.box { overflow-x: auto; }

/* ---------- 9. 商品頁分享列（手機三格）「推薦賺獎金」：原本超出變「…」→ 可換行 ---------- */
@media screen and (max-width: 800px) {
    html.text-lg body .goods-share-bar .goods-share-btn { white-space: normal; overflow: visible; text-overflow: clip; height: auto; min-height: 44px; line-height: 1.15; text-align: center; }
}

/* ---------- 10. 登入／註冊頁按鈕（樣板 user_passport.dwt 寫死高度）：字大換兩行時按鈕跟著長高，不壓到下一顆 ---------- */
html.text-lg .btn-action,
html.text-lg .btn-line-primary,
html.text-lg .btn-google-secondary { height: auto; min-height: 44px; }

/* ---------- 11. 價目表：價格跟「加入」擠不下時，價格在上、「加入」換到下一行（原本會超出畫面右邊被切掉） ---------- */
html.text-lg .price-cell { flex-wrap: wrap-reverse; }

/* ---------- 13. 購物流程步驟列（① 購物車 ② 登入…）：手機原本每格固定 36px 高、不換行，字大會疊在一起 → 圓圈在上、字在下 ---------- */
@media screen and (max-width: 800px) {
    html.text-lg body#page_flow .progress_bar li { height: auto; min-height: 36px; flex-direction: column; white-space: normal; padding: 2px; }
}

/* ---------- 14. 購物車、結帳的數量加減鈕：框固定 30～44px，＋－符號到 22px 為止 ---------- */
html.text-lg body#page_flow .cart_produst_list .data_table tbody td.quantity .btn-minus,
html.text-lg body#page_flow .cart_produst_list .data_table tbody td.quantity .btn-plus,
html.text-lg #checkout_form .co-qty-btn,
html.text-lg .co-qty-btn { font-size: min(1rem, 22px); }

/* ---------- 15. 結帳頁收件資料：很長的 Email 字大時超出框 → 允許任意處斷行 ---------- */
html.text-lg body#page_flow .checkout_wrapper .consignee_info { overflow-wrap: anywhere; }

/* ---------- 16. 文章頁「文字大小」工具列：字大時「文字大小：」自己一行，按鈕不被擠成直排 ---------- */
html.text-lg body#page_article .article_font_toolbar { flex-wrap: wrap; }
html.text-lg body#page_article .article_font_toolbar .font_toolbar_label { flex: 0 0 100%; }

/* ---------- 17. 核取方塊、單選鈕（記住我、同意條款、性別）：瀏覽器預設 13px 不會跟著字變大，字大時跟著放大比較好點
                  （樣板有 style="width:auto;height:auto" 寫在元素上，要 !important 才蓋得過；只在字放大時） ---------- */
html.text-lg .modern-form input[type="checkbox"],
html.text-lg .form input[type="checkbox"],
html.text-lg .form input[type="radio"] { width: 1.15em !important; height: 1.15em !important; vertical-align: middle; }

/* ---------- 12. 首頁：動畫區是固定比例的畫框，裡面的備用文字（動畫還沒跑時）跟服務圖的編號不再跟著放大 ---------- */
html.text-lg body#page_index .hn-motion-fallback strong { font-size: min(clamp(calc(10px + 1.125rem), 5vw, calc(46px + 1.125rem)), 36px); }
html.text-lg body#page_index .hn-motion-fallback p { font-size: min(1.125rem, 22px); }
html.text-lg body#page_index .hn-fallback { font-size: min(calc(54px + 1.125rem), 72px); }


/* =====================================================================
   無障礙補強（2026-11-15，接著 10/13 那一輪；品牌色按鈕 LINE 綠、Google 藍照店主決定不改）
   這一段不分字級都套用，但都不改變版面
   ===================================================================== */

/* ---------- A. 「跳到主要內容」（html_header.lbi）：平常看不到，按 Tab 才出現在左上角 ---------- */
.skip-link:not(:focus) {
    position: absolute !important;
    width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link:focus {
    position: fixed; left: 8px; top: 8px; z-index: 100001;
    padding: 12px 18px; border-radius: 8px;
    background: #103f49; color: #fff; font-size: 1rem; font-weight: 700; text-decoration: none;
    outline: 3px solid #f2b84b; outline-offset: 2px;
}

/* ---------- B. 頁尾是深綠底：鍵盤焦點框改白色（原本 #147486 在 #103f49 上只有 2.1:1，看不出焦點在哪） ---------- */
#footer a:focus-visible,
#footer button:focus-visible,
#footer input:focus-visible,
#footer select:focus-visible { outline-color: #fff; }

/* ---------- C. 手機上第一個大標題被 display:none 藏起來，讀屏找不到這頁的標題 → 改成「看不到但讀得到」 ---------- */
@media screen and (max-width: 800px) {
    #main .wrapper > h1:first-child {
        display: block;
        position: absolute !important;
        width: 1px; height: 1px; margin: -1px; padding: 0;
        overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
    }
}

/* ---------- D. 手機觸控目標補到 44×44：只把「點得到的範圍」往外擴，外觀與排版不變 ---------- */
@media screen and (max-width: 767px) {
    /* 商品卡的收藏愛心原本只有 18×18 */
    li.product-card .btn-collect-icon { position: relative; }
    li.product-card .btn-collect-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%); }
    /* 首頁「標準／大字／特大」、文章頁「中／大／特大」字級鈕原本 40、36px 高 */
    body#page_index .hn-reading button,
    body#page_article .article_font_toolbar .font_size_btn { position: relative; }
    body#page_index .hn-reading button::after,
    body#page_article .article_font_toolbar .font_size_btn::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
    /* 商品頁規格選項（例：超過三公斤）原本 40px 高（label 本來就是 position:relative） */
    body#page_goods .product_details .properties dd.radio label::after { content: ""; position: absolute; left: 0; right: 0; top: -2px; bottom: -2px; }
    /* 登入頁「您忘記密碼了嗎？」原本 17px 高、會員中心「重寄信件」27px 高 */
    body#page_user a[href="user.php?act=get_password"],
    body#page_user .btn-validate { position: relative; }
    body#page_user a[href="user.php?act=get_password"]::after,
    body#page_user .btn-validate::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 44px; transform: translateY(-50%); }
}

/* ---------- F. 段落裡的連結加底線：原本只靠顏色跟旁邊的字區分（對比 1.1:1，色弱的人看不出哪裡可以點） ---------- */
.pricelist p a,
.pricelist dd a,
.pricelist-note a,
.search-split-note a { text-decoration: underline; text-underline-offset: 0.15em; }

/* ---------- E. 系統設定「減少動態」時：側邊選單直接開關、每日籤不搖 ---------- */
@media (prefers-reduced-motion: reduce) {
    body #header_nav,
    body #header_nav * { transition-duration: 0s !important; transition-delay: 0s !important; }
    body .fortune-pot-box.shaking { animation: none; }
}
