/********** Template CSS **********/
:root {
    --primary: #0067B8;
    --secondary: #FFF0E6;
    --light: #F8F8F9;
    --dark: #001D23;
}

.back-to-top {
    position: fixed;
    display: none;
    right: 30px;
    bottom: 30px;
    z-index: 99;
}


/*** 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;
}


/*** Button ***/
.btn {
    font-weight: 500;
    transition: .5s;
}

.btn.btn-primary,
.btn.btn-outline-primary:hover {
    color: #FFFFFF;
}

.btn.btn-primary:hover {
    color: var(--primary);
    background: #CFE6FF;
}

.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;
}

/*** Navbar ***/
.navbar-nav .nav-item {
    position: relative;
}

.navbar-nav .nav-link {
    color: #ffffff !important;
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 1.3px;
    padding: 15px 26px !important;
    position: relative;
    transition: color .25s ease;
    filter: drop-shadow(0 0 4px rgba(255,255,255,.35));
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    line-height: 1 !important;
}

    .navbar-nav :hover {
        color: #ffffff !important;
    }

    .navbar-nav .nav-item::after {
        content: "";
        position: absolute;
        left: 20px;
        right: 20px;
        bottom: 4px;
        height: 3px;
        background-color: #0d6efd;
        transform: scaleX(0);
        transform-origin: left;
        transition: transform .35s ease;
    }
    
    .navbar-nav .nav-item:hover::after {
        transform: scaleX(1);
    }

.navbar-nav .dropdown-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px;
    white-space: nowrap !important;
}

    .navbar-nav .dropdown-toggle::after {
        display: inline-block !important;
        vertical-align: middle !important;
        margin-left: 4px !important;
        width: 0;
        height: 0;
        border-top: 6px solid #ffffff;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
    }

.navbar-nav .nav-link img,
.navbar-nav .nav-link svg,
.navbar-nav .nav-link i,
.navbar-nav .nav-link .arrow {
    display: inline-block !important;
    vertical-align: middle !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

.dropdown-menu {
    background: #ffffff !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid #ddd;
    border-radius: 0;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

    .dropdown-menu .dropdown-item {
        background: #fff !important;
        color: #333 !important;
        font-weight: 400;
        padding: 14px 22px;
        border-bottom: 1px solid #e6e6e6;
    }

        .dropdown-menu .dropdown-item:last-child {
            border-bottom: none;
        }

        .dropdown-menu .dropdown-item:hover {
            background: #f5f5f5 !important;
            color: #000 !important;
            text-decoration: none !important;
        }

.navbar-nav .dropdown-menu {
    display: block;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease;
    position: absolute;
}

.navbar-nav .nav-item:hover > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-box {
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 18px;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    height: 36px;
    transform: translateY(4px);
    user-select: none;
    cursor: default;
}

    .lang-box .lang-icon {
        width: 16px;
        height: 16px;
        opacity: 0.85;
        filter: brightness(1.8);
    }

    .lang-box a {
        display: inline-flex; 
        align-items: center;
        justify-content: center;
        color: #ffffff !important;
        font-weight: 400;
        font-size: 15px;
        letter-spacing: 0.8px;
        text-decoration: none;
        opacity: 0.85;
        transition: .15s ease;
        cursor: pointer !important;
        user-select: none !important; 
    }

        .lang-box a:hover {
            opacity: 1;
            text-decoration: underline;
            text-underline-offset: 4px;
        }

    .lang-box .active-lang {
        font-weight: 700;
        opacity: 1 !important;
        filter: brightness(1.4);
        text-decoration: none !important;
    }

.top-bar small, .top-bar a {
    all: unset;
}

.navbar-brand img {
    max-height: 48px;
    object-fit: contain;
}

@media (max-width: 991px) {

    .navbar-collapse {
        background: #002333 !important; 
    }

        .navbar-collapse.collapsing {
            height: auto !important;
            transition: none !important;
        }

        .navbar-collapse.collapse.show {
            height: auto !important;
        }

    .navbar-nav .dropdown-menu {
        background: #ffffff !important; 
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .navbar-nav .dropdown-item {
        background: transparent !important;
    }
    
    .navbar-nav .nav-link {
        background: transparent !important;
        color: #ffffff !important;
    }
}

/*** Header ***/
.carousel-caption {
    position: absolute;
    top: 55%;
    left: 10%;
    transform: translateY(-50%);
    display: block;
    text-align: left;
}


.carousel-control-prev,
.carousel-control-next {
    width: 15%;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 3rem;
    height: 3rem;
    background-color: var(--dark);
    border: 12px solid var(--dark);
    border-radius: 3rem;
}

@media (max-width: 768px) {
    #header-carousel .carousel-item {
        position: relative;
        min-height: 450px;
    }
    
    #header-carousel .carousel-item img {
        position: absolute;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.page-header {
    padding-top: 12rem;
    padding-bottom: 6rem;
    background: linear-gradient(rgba(0, 29, 35, .4), rgba(0, 29, 35, .8)), url("../img/about_kv.jpg") center center no-repeat;
    background-size: cover;
	position: relative;
	overflow: hidden;
}

.page-header-tech {
    background: linear-gradient(rgba(0, 29, 35, .4), rgba(0, 29, 35, .8)),url("../img/technology_kv.jpg") center center no-repeat;
}

.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 45%,
    transparent 80%
  );
  transform: translateX(-100%);
  animation: headerLightSweep 8s linear infinite;
  pointer-events: none;
}

@keyframes headerLightSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}


.page-header .breadcrumb-item+.breadcrumb-item::before {
    color: #999999;
}

/*** Causes ***/
.news-wrapper {
    position: relative;
    overflow: hidden;
}

.news-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: .3s;
}

.news-arrow:hover {
    background: var(--primary);
}

.news-arrow-left {
    left: 10px;
}

.news-arrow-right {
    right: 10px;
}

.news-slider-viewport {
    position: relative;  
    overflow: hidden;
    width: 100%;
}

.news-slider-track {
    display: flex;
    transition: transform .5s ease-in-out;
}

.news-item {
    padding: 10px;
}

.news-item h5 {
    font-size: 1.1rem !important;
}

.news-item p {
    line-height: 1.3 !important;
    margin-bottom: 0 !important;
}

.JQellipsis {
    -webkit-line-clamp: 2; /* 兩行會更緊湊 */
}

.news-item .text-center {
    padding-top: 0.5rem !important;
    padding-bottom: 0.3rem !important;
}

.causes-item {
    transition: .4s;
}

.causes-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.news-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
}

.JQellipsis {
    display: -webkit-box;
    -webkit-line-clamp: 3; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.causes-item .causes-overlay {
    position: absolute;
    width: 100%;
    height: 0;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .5);
    overflow: hidden;
    opacity: 0;
    transition: .5s;
}

.causes-item:hover .causes-overlay {
    height: 100%;
    opacity: 1;
}

.causes-overlay .btn {
    font-size: 15px;
    padding: 10px 18px;
    border-width: 2px;
}

.non-border {
	border: none !important;
}

.news-item h5.news-title-spacing {
    margin-bottom: 1rem !important;
}

.news-content-spacing {
    margin-bottom: 1.5rem !important;
}

/* 調整 text-center padding，避免間距被吃掉 */
.news-item .text-center {
    padding-top: 0.2rem !important;
    padding-bottom: 1rem !important;
}

/* 標題一行… */
.one-line-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}


/*** Service ***/
.service-item {
    box-shadow: 0 0 45px rgba(0, 0, 0, .06);
}


/*** Donate ***/
.donate {
    background: rgba(0, 29, 35, .8);
}

.btn-group .btn-light:hover,
.btn-group input[type="radio"]:checked+label {
    color: var(--primary);
    border-color: var(--primary);
}


/*** Team ***/
.team-item img {
    position: relative;
    top: 0;
    transition: .5s;
}

.team-item:hover img {
    top: -30px;
}

.team-item .team-text {
    position: relative;
    height: 100px;
    transition: .5s;
}

.team-item:hover .team-text {
    margin-top: -60px;
    height: 160px;
}

.team-item .team-text .team-social {
    opacity: 0;
    transition: .5s;
}

.team-item:hover .team-text .team-social {
    opacity: 1;
}

.team-item .team-social .btn {
    display: inline-flex;
    color: var(--primary);
    background: #FFFFFF;
    border-radius: 40px;
}

.team-item .team-social .btn:hover {
    color: #FFFFFF;
    background: var(--primary);
}


/*** Testimonial ***/
.testimonial-carousel::before {
    position: absolute;
    content: "";
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

.testimonial-carousel::after {
    position: absolute;
    content: "";
    top: 0;
    right: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
    z-index: 1;
}

@media (min-width: 768px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        width: 200px;
    }
}

@media (min-width: 992px) {
    .testimonial-carousel::before,
    .testimonial-carousel::after {
        width: 300px;
    }
}

.testimonial-carousel .owl-item .testimonial-text {
    background: var(--light);
    transform: scale(.8);
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-text {
    background: var(--primary);
    transform: scale(1);
}

.testimonial-carousel .owl-item .testimonial-text *,
.testimonial-carousel .owl-item .testimonial-item img {
    transition: .5s;
}

.testimonial-carousel .owl-item.center .testimonial-text * {
    color: var(--light) !important;
}

.testimonial-carousel .owl-item.center .testimonial-item img {
    background: var(--primary) !important;
} 

.testimonial-carousel .owl-nav {
    position: absolute;
    width: 350px;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: space-between;
    opacity: 0;
    transition: .5s;
    z-index: 1;
}

.testimonial-carousel:hover .owl-nav {
    width: 300px;
    opacity: 1;
}

.testimonial-carousel .owl-nav .owl-prev,
.testimonial-carousel .owl-nav .owl-next {
    position: relative;
    color: var(--primary);
    font-size: 45px;
    transition: .5s;
}

.testimonial-carousel .owl-nav .owl-prev:hover,
.testimonial-carousel .owl-nav .owl-next:hover {
    color: var(--dark);
}


/*** Footer ***/

.footer .btn.btn-link {
    display: block;
    margin-bottom: 5px;
    padding: 0;
    text-align: left;
    color: rgba(255,255,255,0.5);
    font-weight: normal;
    text-transform: capitalize;
    transition: .3s;
}

.footer .btn.btn-link::before {
    position: relative;
    content: "\f105";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: rgba(255,255,255,0.5);
    margin-right: 10px;
}

.footer .btn.btn-link:hover {
    color: var(--light);
    letter-spacing: 1px;
    box-shadow: none;
}

.footer .btn.btn-square {
    color: rgba(255,255,255,0.5);
    border: 1px solid rgba(255,255,255,0.5);
}

.footer .btn.btn-square:hover {
    color: var(--secondary);
    border-color: var(--light);
}

.footer .copyright {
    padding: 25px 0;
    font-size: 15px;
    border-top: 1px solid rgba(256, 256, 256, .1);
}

.footer .copyright a {
    color: var(--secondary);
}

.footer .copyright a:hover {
    color: var(--primary);
}

@media (max-width: 768px) {

    /* 外層只當視窗 */
    .news-slider-viewport {
        overflow: hidden;
        width: 100%;
    }

    /* 軌道：橫向滑動 */
    .news-slider-track {
        display: flex !important;
        transition: transform .35s ease;
        will-change: transform;
    }

    /* 每一篇：強制 100% */
    .news-item {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* Bootstrap 欄位在手機失效 */
    .news-item[class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    /* 卡片本身穩定 */
    .causes-item {
        margin: 0 auto;
        height: auto;
    }

    /* 圖片比例固定 */
    .news-image {
        width: 100%;
        aspect-ratio: 4 / 3;
        height: auto;
        object-fit: cover;
        display: block;
    }

    /* 箭頭縮小，不推擠 */
    .news-arrow {
        width: 36px;
        height: 36px;
        font-size: 16px;
        opacity: .85;
    }
}
