/********** Template CSS **********/

/*** 全站配色：版面底色 #ffffff、深灰文字 #333333、按鈕主色 #445D7E ***/
:root {
    --bs-body-bg: #ffffff;
    --bs-body-color: #333333;
    --bs-primary: #445D7E;
    --bs-primary-rgb: 68, 93, 126;
    --bs-primary-dark: #3a5169;
}
body {
    background-color: #ffffff !important;
    color: #333333 !important;
}
.btn-primary, .bg-primary.btn {
    background-color: #445D7E !important;
    border-color: #445D7E !important;
}
.btn-primary:hover, .btn-primary:focus, .bg-primary.btn:hover {
    background-color: #3a5169 !important;
    border-color: #3a5169 !important;
}
.btn-outline-primary { color: #445D7E; border-color: #445D7E; }
.btn-outline-primary:hover { background-color: #445D7E; border-color: #445D7E; color: #fff; }
.text-primary { color: #445D7E !important; }
.border-primary { border-color: #445D7E !important; }

/*** 頁腳：與主色 #445D7E 搭配之深色 ***/
#site-footer .container-fluid.footer,
#site-footer .container-fluid.bg-dark {
    background-color: #2d4059 !important;
}
#site-footer .btn-link { color: rgba(255,255,255,.85); }
#site-footer .btn-link:hover { color: #fff !important; }
#site-footer h5.text-white { color: #fff !important; }

.page-title-bar { background: #ffffff !important; border-bottom-color: #d0dce5 !important; }
.navbar { border-bottom: 2px solid #445D7E; }
.navbar .navbar-nav .nav-link:hover, .navbar .navbar-nav .nav-link.active { color: #445D7E !important; }
.navbar .dropdown-menu .dropdown-item:hover, .navbar .dropdown-menu .dropdown-item.active { background-color: #445D7E !important; color: #fff !important; }
.navbar .navbar-nav .nav-link { color: #333333; }
.navbar .navbar-nav .nav-link .nav-hover-caret { color: #445D7E; font-size: 16px; line-height: 1; vertical-align: middle; margin-left: 4px; }

/*** Spinner ***/
#spinner {
    opacity: 0;
    visibility: hidden;
    transition: opacity .5s ease-out, visibility 0s linear .5s;
    z-index: 99999;
}

#spinner.show {
    transition: opacity .5s ease-out, visibility 0s linear 0s;
    visibility: visible;
    opacity: 1;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 45px;
    bottom: 45px;
    z-index: 99;
}

/*** Button ***/
.btn {
    transition: .5s;
}

.btn-square {
    width: 38px;
    height: 38px;
}

.btn-sm-square {
    width: 32px;
    height: 32px;
}

.btn-lg-square {
    width: 48px;
    height: 48px;
}

.btn-square,
.btn-sm-square,
.btn-lg-square {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: normal;
}


/*** 統一頁面標題列（與頂部導覽一致，不再使用第二條深色列） ***/
.page-title-bar {
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 0.6rem 0;
}
.page-title-bar .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}
.page-title-bar .breadcrumb-item a {
    color: var(--bs-primary);
    text-decoration: none;
}
.page-title-bar .breadcrumb-item a:hover {
    text-decoration: underline;
}
.page-title-bar .breadcrumb-item.active {
    color: #6c757d;
}
.page-title-bar .breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

/*** Navbar ***/
.sticky-top {
    top: -150px;
    transition: .5s;
}

.navbar {
    padding: 15px 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 18px;
}

.navbar .navbar-nav .nav-link {
    margin-left: 30px;
    padding: 0;
    outline: none;
    color: #333333;
}
.navbar .navbar-nav .nav-link .nav-hover-caret {
    color: #445D7E;
    font-size: 16px;
    line-height: 1;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}
.navbar .navbar-nav .nav-link:hover .nav-hover-caret,
.navbar .navbar-nav .nav-link.active .nav-hover-caret { opacity: 1; }

.navbar .navbar-nav .nav-link:hover,
.navbar .navbar-nav .nav-link.active {
    color: var(--bs-primary)
}

.navbar .dropdown-menu .dropdown-item:hover,
.navbar .dropdown-menu .dropdown-item.active {
    color: var(--bs-white);
    background: var(--bs-primary);
}

@media (max-width: 991.98px) {
    .navbar .navbar-nav .nav-link  {
        margin-left: 0;
        padding: 10px 0;
    }
    /* 我的功能：左側不展開，只保留右方滑出選單 */
    #site-header .navbar-collapse .nav-item.dropdown .dropdown-menu {
        display: none !important;
    }
}

/* 手機版：次選單滑出層（與桌機相同內容） */
.nav-mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 1050;
    pointer-events: none;
    visibility: hidden;
}
.nav-mobile-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}
.nav-mobile-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
}
.nav-mobile-drawer.is-open .nav-mobile-drawer-backdrop {
    opacity: 1;
}
.nav-mobile-drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.nav-mobile-drawer.is-open .nav-mobile-drawer-panel {
    transform: translateX(0);
}
.nav-mobile-drawer-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #dee2e6;
    background: #fff;
}
.nav-mobile-drawer-back {
    background: none;
    border: none;
    font-size: 1rem;
    color: #445D7E;
    cursor: pointer;
    padding: 0.25rem 0;
}
.nav-mobile-drawer-title {
    font-weight: 600;
    color: #333;
}
.nav-mobile-drawer-body {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}
.nav-mobile-drawer-body .dropdown-item,
.nav-mobile-drawer-body .dropdown-header {
    display: block;
    padding: 0.6rem 1.25rem;
    color: #333;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 1rem;
}
.nav-mobile-drawer-body .dropdown-header {
    color: #6c757d;
    font-size: 0.8rem;
    font-weight: 600;
}
.nav-mobile-drawer-body .dropdown-item:hover {
    background: #f0f0f0;
    color: #445D7E;
}
.nav-mobile-drawer-body .dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid #dee2e6;
}
@media (min-width: 992px) {
    .nav-mobile-drawer {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .navbar .nav-item .dropdown-menu {
        display: block;
        border: none;
        margin-top: 0;
        top: 150%;
        opacity: 0;
        visibility: hidden;
        transition: .5s;
    }

    .navbar .nav-item:hover .dropdown-menu {
        top: 100%;
        visibility: visible;
        transition: .5s;
        opacity: 1;
    }
}


/*** Hero Header ***/
.hero-header {
    margin-top: -100px;
    padding-top: 150px;
    background: url(../img/hero-bg.jpg) top center no-repeat;
    background-size: cover;
}

.hero-header .breadcrumb-item+.breadcrumb-item::before {
    color: var(--light);
}

.header-carousel {
    position: relative;
    padding: 45px 90px 45px 0;
}

.header-carousel::before {
    position: absolute;
    content: "";
    top: 0;
    right: 0;
    width: calc(50% + 45px);
    height: 100%;
    background: var(--bs-primary);
    z-index: -1;
}

.header-carousel .owl-dots {
    position: absolute;
    top: 50%;
    right: 38px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin: 5px 0;
    width: 15px;
    height: 15px;
    border: 2px solid var(--bs-white);
    transition: .5s;
}

.header-carousel .owl-dot.active {
    height: 30px;
    background: var(--bs-white);
}


/*** About ***/
.about-img {
    position: relative;
    overflow: hidden;
}

.about-img::after {
    position: absolute;
    content: "";
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: url(../img/bg-about-img.png) top left no-repeat;
    background-size: contain;
}


/*** Project ***/
.project-item img {
    transition: .5s;
}
  
.project-item:hover img {
    transform: scale(1.2);
}
  
.project-overlay {
    position: absolute;
    padding: 25px;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    background: linear-gradient(rgba(255, 255, 255, .1) 50%, var(--bs-dark));
    z-index: 1;
}


/*** Service ***/
.service-item {
    position: relative;
    padding: 30px 25px;
    transition: .5s;
}

.service-item.bg-primary:hover {
    background: var(--bs-light) !important;
}

.service-item.bg-primary p {
    color: var(--bs-light);
    transition: .5s;
}

.service-item.bg-primary:hover p {
    color: var(--bs-secondary);
}

.service-item.bg-light:hover {
    background: var(--bs-primary) !important;
}

.service-item.bg-light p {
    color: var(--bs-secondary);
    transition: .5s;
}

.service-item.bg-light:hover p {
    color: var(--bs-light);
}


.service-item .service-img h3 {
    position: absolute;
    top: 0;
    left: 0;
    padding: 0 12px 7px 0;
}

.service-item.bg-primary .service-img h3 {
    background: var(--bs-primary);
    color: var(--bs-white);
    transition: .5s;
}

.service-item.bg-primary:hover .service-img h3 {
    background: var(--bs-light);
    color: var(--bs-dark);
}

.service-item.bg-light .service-img h3 {
    background: var(--bs-light);
    color: var(--bs-dark);
    transition: .5s;
}

.service-item.bg-light:hover .service-img h3 {
    background: var(--bs-primary);
    color: var(--bs-white);
}


/*** Our Team ***/
.team-item img {
    transition: .5s;
}
  
.team-item:hover img {
    transform: scale(1.2);
}
  
.team-overlay {
    position: absolute;
    padding: 30px;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    background: linear-gradient(rgba(255, 255, 255, .1) 50%, var(--bs-dark));
    z-index: 1;
}

.team-overlay small {
    display: inline-block;
    padding: 3px 15px;
    color: var(--bs-white);
    background: var(--bs-primary);
}


/*** Testimonial ***/
.testimonial-img {
    position: relative;
    padding: 45px 0 45px 90px;
}

.testimonial-img::before {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    width: calc(50% + 45px);
    height: 100%;
    background: var(--bs-primary);
    z-index: -1;
}

.testimonial-text h5 {
    position: relative;
    padding-left: 45px;
}

.testimonial-text h5::before {
    position: absolute;
    content: "";
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 40px;
    height: 2px;
    background: var(--bs-primary);
}

.testimonial-carousel .owl-dots {
    position: absolute;
    height: 17px;
    bottom: 0;
    right: 0;
    left: auto;
}

.testimonial-carousel .owl-dot {
    position: relative;
    display: inline-block;
    margin-left: 10px;
    width: 15px;
    height: 15px;
    background: var(--bs-white);
    border: 2px solid var(--bs-primary);
    transition: .5s;
}

.testimonial-carousel .owl-dot.active {
    width: 30px;
    background: var(--bs-primary);
}

@media (max-width: 768px) {
    .testimonial-carousel .owl-dots {
        left: 0;
        right: auto;
    }

    .testimonial-carousel .owl-dot {
        margin-right: 10px;
        margin-left: 0;
    }
}


/*** Newsletter ***/
.newsletter {
    background: url(../img/hero-bg.jpg) bottom right no-repeat;
    background-size: cover;
}

@media (min-width: 992px) {
    .newsletter .container {
        max-width: 100% !important;
    }

    .newsletter .newsletter-text  {
        padding-right: calc(((100% - 960px) / 2) + .75rem);
    }
}

@media (min-width: 1200px) {
    .newsletter .newsletter-text  {
        padding-right: calc(((100% - 1140px) / 2) + .75rem);
    }
}

@media (min-width: 1400px) {
    .newsletter .newsletter-text  {
        padding-right: calc(((100% - 1320px) / 2) + .75rem);
    }
}


/*** Footer ***/
.footer .btn.btn-link {
    display: block;
    margin-bottom: 10px;
    padding: 0;
    text-align: left;
    color: rgba(255,255,255,.5);
    font-weight: normal;
    transition: .3s;
}

.footer .btn.btn-link:hover {
    color: var(--bs-white);
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    margin-right: 10px;
}

.footer .copyright {
    padding: 25px 0;
    font-size: 14px;
    border-top: 1px solid rgba(256, 256, 256, .1);
}

.footer .copyright a {
    color: rgba(255,255,255,.5);
}

.footer .copyright a:hover {
    color: var(--bs-white);
}

.footer .footer-menu a {
    margin-right: 15px;
    padding-right: 15px;
    border-right: 1px solid rgba(255, 255, 255, .1);
}

.footer .footer-menu a:last-child {
    margin-right: 0;
    padding-right: 0;
    border-right: none;
}

/* ===== Navbar：會員點數顯示（桌機在個人選單旁、手機在漢堡左邊） ===== */
/* 桌機版點數：頭像下方、兩條橫線中間，與頭像同寬靠右、不佔滿寬就不撐開 */
#site-header .navbar {
    flex-wrap: wrap;
}
#site-header .nav-points-desktop-row {
    flex: 0 0 auto;
    width: auto;
    order: 10;
    margin-left: auto;
    background: #ffffff;
    box-sizing: border-box;
}
/* 第二排：只放點數；Logo 用負 margin 疊在選單圖層上，不佔第二排高度（照第一排寫法） */
#site-header .nav-second-row-wrap {
    background: #fff;
    box-sizing: border-box;
    min-height: 0;
}
/* Logo 疊在選單圖層上：負 margin 往上，置中，不推擠第一排 */
#site-header .nav-second-row-wrap .navbar-brand {
    order: 0 !important;
    margin: -39px auto 0 !important;
    border: none !important;
}
#site-header .nav-second-row-wrap .navbar-brand img {
    height: 78px !important;
    background: #fff;
    padding: 4px 12px;
    border-radius: 4px;
}
#site-header .nav-points-desktop {
    font-size: 0.95rem;
    color: #6c757d;
    white-space: nowrap;
    text-shadow: none;
    -webkit-font-smoothing: subpixel-antialiased;
}
#site-header .nav-points-desktop:hover {
    color: #445D7E;
}
#site-header .nav-points-desktop #navPointsDesktopValue,
#site-header #navPointsMobileValue {
    color: #ffc107;
    font-weight: 600;
    text-shadow: none;
    -webkit-font-smoothing: subpixel-antialiased;
}
#site-header #navPointsMobile .nav-points-link {
    display: inline-flex;
    align-items: center;
    font-size: 1rem;
    color: #333;
    white-space: nowrap;
    text-shadow: none;
    -webkit-font-smoothing: subpixel-antialiased;
}
#site-header #navPointsMobile .nav-points-link:hover {
    color: #445D7E;
}

/* ===== Navbar：authSection 緊貼頭像，減少右側空白 ===== */
@media (min-width: 992px) {
    #site-header #authSection {
        width: auto;
        min-width: auto;
        max-width: none;
        justify-content: flex-end;
        padding-left: 0.5rem;
        padding-right: 0;
    }
    /* 個人選單右緣對齊頭像 */
    #site-header #authSection .dropdown-menu {
        left: auto;
        right: 0;
    }
}

/* ===== Navbar：桌機 Logo 置中蓋住選單（全站共用）；選單列左右保留 Logo 半寬，永遠不擋 ===== */
@media (min-width: 992px) {
    #site-header .navbar { flex-wrap: wrap; }
    /* 已登入時第一排的 Logo 隱藏，只顯示第二排置中的那一個 */
    #site-header .navbar > .navbar-brand.d-lg-none {
        display: none !important;
    }
    /* 第一排：照原本寫法，不另加高度／padding */
    #site-header .navbar-collapse {
        order: 1; width: 100%; flex-grow: 1;
        border-bottom: 1px solid #dee2e6;
        padding-left: 110px;
        box-sizing: border-box;
    }
    #site-header .navbar-brand {
        order: 2;
        display: flex !important;
        border-right: none !important;
        padding: 0;
        margin: -39px auto 0;
        position: relative;
        z-index: 5;
    }
    /* Logo 為圖檔 matchdo-logo.png；「DO」區塊請與下方登入按鈕同色：.btn-primary = #445D7E */
    #site-header .navbar-brand img {
        height: 78px !important;
        background: #fff;
        padding: 4px 12px;
        border-radius: 4px;
    }
}

/* ===== 解析度變小時縮短選單列、縮小選單間距，避免 Logo 蓋住選單 ===== */
@media (max-width: 1509px) and (min-width: 992px) {
    #site-header .navbar .navbar-nav .nav-link {
        margin-left: 16px;
    }
    #site-header .navbar-collapse .navbar-nav {
        margin-right: 0.25rem;
    }
}
@media (max-width: 1460px) and (min-width: 992px) {
    #site-header .navbar .navbar-nav .nav-link {
        margin-left: 12px;
    }
    #site-header .navbar {
        font-size: 17px;
    }
}
@media (max-width: 1400px) and (min-width: 992px) {
    #site-header .navbar .navbar-nav .nav-link {
        margin-left: 10px;
    }
}
@media (max-width: 1300px) and (min-width: 992px) {
    #site-header .navbar .navbar-nav .nav-link {
        margin-left: 8px;
    }
    #site-header .navbar {
        font-size: 16px;
    }
}
@media (max-width: 1200px) and (min-width: 992px) {
    #site-header .navbar .navbar-nav .nav-link {
        margin-left: 6px;
    }
    #site-header .navbar {
        font-size: 15px;
    }
}

/* 1350 以下不顯示「方案與定價」 */
@media (max-width: 1350px) and (min-width: 992px) {
    #site-header .nav-link-subscription {
        display: none !important;
    }
}
