@charset "utf-8";

/*
 * ESG RWD
 * 斷點與互動方式比照主站：990 / 768 / 500 px。
 * 請在 csr.css、csr-home.css、jquery-menu.css 之後載入。
 */

html,
body {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

#wrapper,
#wrapper-home {
    position: relative;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    overflow: hidden;
}

/* ---------- Header：桌面 ---------- */

#header {
    position: relative;
    width: calc(100% - 30px) !important;
    max-width: 960px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 15px 30px 10px !important;
}

#nav_btn {
    display: none;
}

/* ---------- 主視覺 ---------- */

#main-bg,
#home-main {
    width: 100% !important;
    min-width: 0 !important;
}

#main {
    width: 100% !important;
    max-width: 960px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    background-position: center top;
    background-repeat: no-repeat;
}

/* ---------- 一般內頁：桌面 ---------- */

#com-content {
    display: grid !important;
    grid-template-columns: 190px minmax(0, 1fr);
    grid-template-areas:
        "secondary title"
        "secondary primary";
    column-gap: 30px;
    width: calc(100% - 30px) !important;
    max-width: 960px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 40px 30px !important;
}

    #com-content::before,
    #com-content::after {
        display: none !important;
        content: none !important;
    }

    #com-content #secondary {
        grid-area: secondary;
        position: relative;
        float: none !important;
        display: block !important;
        width: 190px !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

#com-content-title {
    grid-area: title;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 0 25px !important;
}

#com-content #primary {
    grid-area: primary;
    position: relative;
    float: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
}

#primary,
#primary div,
#primary section,
#primary article {
    min-width: 0;
    max-width: 100%;
}

    #primary p,
    #primary li,
    #primary a {
        overflow-wrap: break-word;
    }

    #primary table {
        max-width: 100% !important;
    }

#smenu_btn {
    display: none;
}

/* ---------- Footer：桌面 ---------- */

#footer {
    clear: both;
    width: 100% !important;
    min-width: 0 !important;
}

    #footer #footerInner {
        display: flex;
        align-items: flex-start;
        flex-wrap: wrap;
        width: calc(100% - 30px) !important;
        max-width: 960px !important;
        min-width: 0 !important;
        margin: 0 auto !important;
        padding: 20px 0 !important;
    }

        #footer #footerInner #footerA,
        #footer #footerInner #footerB,
        #footer #footerInner #footerC {
            min-width: 0;
        }

        #footer #footerInner #footerB {
            flex: 1;
        }

            #footer #footerInner #footerB .copyright {
                width: auto !important;
                max-width: 100%;
            }

/* ---------- 主站同款 Header 漢堡選單：990px ---------- */

@media screen and (max-width: 990px) {
    #header {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 51px;
        margin: 0 !important;
        padding: 5px 60px 5px 15px !important;
        border-bottom: 1px solid #357dc9;
        background: #fff;
    }

        #header > table,
        #header > table > tbody {
            display: block;
            width: 100% !important;
        }

            #header > table > tbody > tr,
            #header > table > tbody > tr > td {
                display: block;
                width: 100% !important;
                height: auto !important;
            }

                /* Logo 所在儲存格維持顯示 */
                #header > table > tbody > tr:first-child > td:first-child {
                    display: block !important;
                    width: 100% !important;
                    min-height: 40px;
                }

                    #header > table > tbody > tr:first-child > td:first-child a {
                        display: block;
                        width: 250px;
                        max-width: calc(100vw - 90px);
                        height: 40px;
                        overflow: hidden;
                    }

                    #header > table > tbody > tr:first-child > td:first-child img {
                        width: auto;
                        max-width: 100%;
                        max-height: 40px;
                    }

                /* 附加連結及主選單預設收合 */
                #header > table > tbody > tr:first-child > td:nth-child(2),
                #header > table > tbody > tr:nth-child(2) > td {
                    display: none !important;
                }

        #header.nav-open > table > tbody > tr:first-child > td:nth-child(2),
        #header.nav-open > table > tbody > tr:nth-child(2) > td {
            display: block !important;
        }

        #header #inner,
        #header #addon,
        #header #link,
        #header #share,
        #header #menu {
            position: static !important;
            float: none !important;
            width: 100% !important;
            min-width: 0 !important;
            max-width: 100% !important;
            height: auto !important;
            margin: 0 !important;
        }

        #header #addon {
            padding: 10px 0;
            border-top: 1px solid #ddd;
        }

        #header #link {
            line-height: 2;
        }

        #header #share {
            margin-top: 8px !important;
        }

        #header #menu {
            position: relative !important;
            left: -15px;
            width: 100vw !important;
            max-width: 100vw !important;
            margin: 0 !important;
            background: linear-gradient(to bottom, #90bff0 0%, #357dc9 100%);
        }

            #header #menu ul {
                display: block;
                width: 100%;
                margin: 0;
                padding: 0;
            }

            #header #menu li {
                display: block;
                float: none !important;
                width: 100% !important;
                margin: 0 !important;
                list-style: none;
            }

                #header #menu li a,
                #header #menu li a:link,
                #header #menu li a:visited {
                    display: block;
                    width: 100% !important;
                    height: 42px !important;
                    padding: 0 20px;
                    overflow: visible;
                    color: #fff;
                    font-size: 15px;
                    line-height: 42px !important;
                    text-align: left;
                    text-decoration: none;
                    background-image: none !important;
                    border-top: 1px solid rgba(255, 255, 255, 0.35);
                    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
                }

                    #header #menu li a:hover,
                    #header #menu li a:focus {
                        background-color: rgba(0, 0, 0, 0.25);
                    }

    #nav_btn {
        display: block;
        position: absolute;
        top: 25px;
        right: 5px;
        z-index: 20;
        width: 46px;
        height: 46px;
        padding: 0;
        border: 0;
        background: transparent;
        transform: translateY(-50%) scale(0.8);
        cursor: pointer;
    }

        #nav_btn > span {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 30px;
            height: 2px;
            margin-top: -1px;
            margin-left: -15px;
            background: #2c3188;
        }

            #nav_btn > span::before,
            #nav_btn > span::after {
                position: absolute;
                left: 0;
                display: block;
                width: 23px;
                height: 2px;
                content: "";
                background: #2c3188;
                transition: all 0.4s;
            }

            #nav_btn > span::before {
                top: -10px;
            }

            #nav_btn > span::after {
                bottom: -10px;
            }

        #nav_btn.open > span {
            background: transparent;
        }

            #nav_btn.open > span::before {
                top: 0;
                transform: rotate(45deg);
            }

            #nav_btn.open > span::after {
                bottom: 0;
                transform: rotate(-45deg);
            }
}

/* ---------- 主站同款次選單推出：768px ---------- */

@media screen and (max-width: 768px) {
    /* 手機版隱藏容易遭裁切的裝飾橫幅 */
    #main-bg {
        display: none !important;
    }

    #com-content {
        grid-template-columns: 190px minmax(0, 1fr);
        grid-template-areas:
            "secondary title"
            "secondary primary";
        column-gap: 40px;
        width: calc(100% + 230px) !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 0 0 -230px !important;
        padding: 58px 16px 32px !important;
        transition: margin 0.5s;
    }

        #com-content.open {
            margin-left: 0 !important;
            margin-right: -230px !important;
        }

        #com-content #secondary {
            display: block !important;
            width: 190px !important;
        }

    #secondary #smenu {
        position: static !important;
        float: none !important;
        display: block !important;
        width: 190px !important;
        margin: 0 !important;
    }

        #secondary #smenu ul,
        #secondary #smenu ul li {
            width: 100% !important;
        }

            #secondary #smenu ul li a,
            #secondary #smenu a.unit-now {
                width: 100% !important;
                box-sizing: border-box;
            }

    #com-content-title,
    #com-content #primary {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    /* 手機版：按鈕獨占第一列，頁面名稱顯示於下一列 */
    #com-content-title {
        display: block !important;
        min-height: 40px !important;
        margin: 0 0 10px !important;
        padding: 0 !important;
    }

        #com-content-title > table {
            display: table !important;
            width: 100% !important;
            margin-top: 0 !important;
            table-layout: auto;
        }

            #com-content-title > table > tbody {
                display: table-row-group !important;
            }

                #com-content-title > table > tbody > tr {
                    display: table-row !important;
                }

                    #com-content-title > table > tbody > tr > td {
                        display: table-cell !important;
                        width: auto !important;
                        height: auto !important;
                    }

        #com-content-title td.font-blue-18 {
            display: table-cell !important;
            padding: 0 0 8px !important;
            font-size: 18px;
            line-height: 1.4;
            text-align: left !important;
        }

        /* 手機版隱藏麵包屑，避免與頁名互相擠壓 */
        #com-content-title .page-title-location,
        #com-content-title td[align="right"] {
            display: none !important;
        }

        #com-content-title .dotline-1 {
            display: table-cell !important;
            height: 8px !important;
        }

        #com-content-title .dotline-2 {
            display: none !important;
        }

    #smenu_btn {
        display: block;
        position: absolute;
        top: -88px;
        left: 0;
        width: auto;
        min-height: 34px;
        padding: 5px 9px;
        border: 0;
        border-radius: 5px;
        background-color: #ccc;
        color: #222;
        cursor: pointer;
    }

        #smenu_btn::after {
            display: inline-block;
            margin-left: 6px;
            content: "開啟次選單";
            font-size: 15px;
            font-weight: bold;
        }

    #com-content.open #smenu_btn::after {
        content: "關閉次選單";
    }

    #smenu_btn > span {
        display: inline-block;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background-color: #000;
        color: #fff;
        font-size: 18px;
        font-weight: bold;
        line-height: 20px;
        text-align: center;
        transition: transform 0.5s;
    }

    #com-content.open #smenu_btn > span {
        transform: rotate(45deg);
    }

    #smenu_btn:active {
        background-color: #333;
        color: #fff;
    }

    .page-title-table,
    .page-title-table tbody,
    .page-title-table tr,
    .page-title-table td {
        display: block;
        width: 100% !important;
    }

    .page-title-location {
        width: 100% !important;
        margin-top: 0;
        padding-left: 0 !important;
        text-align: left !important;
        white-space: normal;
    }

    .page-title-table .dotline-2 {
        display: none;
    }

    #primary table,
    #primary img {
        max-width: 100% !important;
    }
}

@media screen and (max-width: 320px) {
    #com-content.open #smenu_btn::after {
        content: "關閉";
    }
}

/* ---------- Footer：500px ---------- */

@media screen and (max-width: 500px) {
    #footer {
        position: relative;
        padding-bottom: 55px;
    }

        #footer #footerInner {
            display: block;
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 !important;
            padding: 20px 15px !important;
        }

            #footer #footerInner #footerA,
            #footer #footerInner #footerB,
            #footer #footerInner #footerC {
                float: none !important;
                width: 100% !important;
                margin: 0 0 12px !important;
                text-align: center;
            }

                #footer #footerInner #footerB .copyright {
                    width: 100% !important;
                    padding: 0 15px;
                    text-align: center;
                }

                #footer #footerInner #footerC .footerTop {
                    text-align: center;
                }
}

/* ---------- ESG 首頁 ---------- */

#home-content {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-areas:
        "L1 C1 R1"
        "L2 C2 R2";
    width: calc(100% - 30px) !important;
    max-width: 960px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
}

    #home-content #L1 {
        grid-area: L1;
    }

    #home-content #L2 {
        grid-area: L2;
    }

    #home-content #C1 {
        grid-area: C1;
    }

    #home-content #C2 {
        grid-area: C2;
    }

    #home-content #R1 {
        grid-area: R1;
    }

    #home-content #R2 {
        grid-area: R2;
    }

    #home-content #L1,
    #home-content #L2,
    #home-content #C1,
    #home-content #C2,
    #home-content #R1,
    #home-content #R2 {
        float: none !important;
        width: auto !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
    }

    #home-content #L1,
    #home-content #C1,
    #home-content #R1 {
        min-height: 350px;
    }

#home-main {
    overflow: hidden;
}

    #home-main > table {
        width: 100% !important;
        table-layout: fixed;
    }

    #home-main #main {
        width: 100% !important;
        max-width: 960px !important;
        height: auto !important;
        aspect-ratio: 960 / 390;
        background-position: center;
        background-size: cover;
    }

#mainbackground {
    width: 100% !important;
    height: 100% !important;
    table-layout: fixed;
    background-position: center;
    background-size: cover;
}

@media screen and (max-width: 768px) {
    #home-main > table > tbody > tr > .main-bgL,
    #home-main > table > tbody > tr > .main-bgR {
        display: none !important;
    }

    #home-main > table > tbody > tr > td:not(.main-bgL):not(.main-bgR) {
        width: 100% !important;
    }

    #home-main #main {
        max-width: 100% !important;
    }

    #mainbackground td {
        width: auto !important;
        min-width: 0 !important;
    }

    #home-content {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "L1"
            "L2"
            "C1"
            "C2"
            "R1"
            "R2";
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

        #home-content #L1,
        #home-content #L2,
        #home-content #C1,
        #home-content #C2,
        #home-content #R1,
        #home-content #R2 {
            min-height: 0;
            padding: 20px 16px !important;
            border-right: 0 !important;
            border-left: 0 !important;
            border-bottom: 1px solid #ddd;
        }

            #home-content #L2 .pic,
            #home-content #L2 .textBox {
                float: none !important;
                width: 100% !important;
            }
}

/* 保留分隔線，只移除連結文字底線 */
#secondary #smenu ul li a,
#secondary #smenu ul li a:link,
#secondary #smenu ul li a:visited,
#secondary #smenu ul li a:hover,
#secondary #smenu ul li a:active,
#secondary #smenu ul li a:focus,
#secondary #smenu a.unit-now {
    text-decoration: none !important;
}



/* ==========================================================
   ESG 共用附件檔案區 RWD
   ========================================================== */

@media screen and (max-width: 768px) {
    .esg-attachment {
        width: 100%;
        overflow: hidden;
    }

        .esg-attachment table {
            width: 100% !important;
            max-width: 100% !important;
            table-layout: fixed !important;
            border-collapse: collapse !important;
        }

            .esg-attachment table tr:first-child td,
            .esg-attachment table tr:first-child th {
                padding: 7px 3px !important;
                font-size: 12px !important;
            }

            .esg-attachment table tr:not(:first-child) td {
                padding: 7px 3px !important;
                font-size: 12px !important;
                line-height: 1.4 !important;
                white-space: normal !important;
                word-break: break-word;
                overflow-wrap: anywhere;
            }

            .esg-attachment table td:first-child {
                padding-left: 6px !important;
            }

            .esg-attachment table td:last-child img {
                max-width: 16px !important;
                height: auto !important;
            }
}

@media screen and (max-width: 500px) {
    .esg-attachment table tr:first-child td,
    .esg-attachment table tr:first-child th,
    .esg-attachment table tr:not(:first-child) td {
        padding: 6px 2px !important;
        font-size: 11px !important;
    }
}

/* ==================================================
   共用圖片放大燈箱
   搭配 esg-rwd.js 使用
   ================================================== */

.js-image-zoom {
    cursor: zoom-in;
    transition: opacity 0.2s ease;
}

    .js-image-zoom:hover,
    .js-image-zoom:focus {
        opacity: 0.92;
        outline: 3px solid rgba(0, 140, 202, 0.28);
        outline-offset: 3px;
    }

.image-zoom-hint {
    margin: 7px 0 0;
    color: #777;
    font-size: 13px;
    text-align: center;
}

/* 開啟燈箱時禁止背景捲動 */
body.lightbox-open {
    overflow: hidden;
}

/* 燈箱背景 */
.image-lightbox {
    position: fixed;
    z-index: 99999;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    padding: 64px 24px 24px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.88);
}

    /* 開啟燈箱 */
    .image-lightbox.is-open {
        display: flex;
    }

/* 圖片容器 */
.image-lightbox-content {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}

    /* 放大後的圖片 */
    .image-lightbox-content img {
        display: block;
        width: auto;
        height: auto;
        max-width: 96vw;
        max-height: calc(100vh - 110px);
        object-fit: contain;
        background: #fff;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    }

/* 關閉按鈕 */
.image-lightbox-close {
    position: absolute;
    top: 14px;
    right: 20px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    font-size: 34px;
    line-height: 38px;
}

    /* 關閉按鈕滑入與鍵盤焦點 */
    .image-lightbox-close:hover,
    .image-lightbox-close:focus {
        background: #008cca;
        outline: 2px solid #fff;
    }

/* 圖片說明 */
.image-lightbox-caption {
    margin: 10px 0 0;
    color: #fff;
    font-size: 15px;
    text-align: center;
}

/* 手機版 */
@media screen and (max-width: 768px) {
    .image-lightbox {
        padding: 58px 10px 16px;
    }

    .image-lightbox-content img {
        max-width: 100%;
        max-height: calc(100vh - 100px);
    }

    .image-lightbox-close {
        top: 8px;
        right: 10px;
    }
}
