/* static/css/custom.css */

/* Swiper Custom Styles */
.banner-swiper,
.company-swiper {
    width: 100%;
    margin: 0;
}

.swiper-slide img {
    width: 100%;
    height: auto;
    display: block;
}

/* 指示器樣式 */
.swiper-pagination {
    bottom: 20px !important;
}

.swiper-pagination-bullet {
    width: 28px !important; /* 寬度變長 */
    height: 3px !important; /* 高度變短 */
    border-radius: 0 !important; /* 移除圓角 */
    background: rgba(255, 255, 255, 0.5) !important; /* 半透明白色 */
    margin: 0 4px !important; /* 調整間距 */
    opacity: 1!important;
}

.swiper-pagination-bullet-active {
    background: #fff !important; /* 純白色 */
}

/* 導航按鈕 */
.swiper-button-prev,
.swiper-button-next {
    width: 2em!important;
    height: 2em!important;
    background: none;
}

.swiper-button-prev:after,
.swiper-button-next:after {
    display: none;
}

.swiper-button-prev img,
.swiper-button-next img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.swiper-button-prev {
    left: 5em !important; /* 距離左邊緣 20px */
}

.swiper-button-next {
    right: 5em !important; /* 距離右邊緣 20px */
}

/* 分頁指示器 */
.swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: #fff;
}

/* General Layout */
.page-container {
    max-width: 88em;
    margin: 0 auto;
}

/* Header Styles */
.site-header {
    background-color: #fff;
    padding: 2rem 0;
    border-bottom: 1px solid #eee;
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 2.8em;
    width: auto;
}

.main-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    color: #0067ab;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 400;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
    position: relative;
}

.nav-item:hover {
    color: #003677;
}

.nav-item.is-active {
    color: #003677;
}

.nav-item.is-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #0067ab;
}

.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
}

.mobile-menu-button span {
    display: block;
    width: 25px;
    height: 2px;
    background-color: #0067ab;
    margin: 5px 0;
    transition: all 0.3s ease;
}

@media (max-width: 768px) {
    .main-nav {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: #002657;  /* 移動端選單背景改為深藍色 */
        padding: 80px 2rem 2rem;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 2rem;
        z-index: 99;
    }

    .main-nav.is-active {
        display: flex;
    }

    .nav-item {
        color: #00a8e1 !important;  /* 移動端選單文字顏色改為亮藍色 */
        font-size: 1.5rem;
    }

    .nav-item:hover,
    .nav-item.is-active {
        color: #ffffff !important;  /* Hover 和激活狀態改為白色 */
    }

    .mobile-menu-button {
        display: block;
        position: relative;
        z-index: 100;
    }

    /* 漢堡按鈕動畫 */
    .mobile-menu-button.is-active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-button.is-active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-button.is-active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* 選單項目動畫 */
    .main-nav .nav-item {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.3s ease-in-out,
                    transform 0.3s ease-in-out;
    }

    .main-nav.is-active .nav-item {
        opacity: 1;
        transform: translateY(0);
    }

    /* 選單項目動畫延遲 */
    .main-nav .nav-item:nth-child(1) { transition-delay: 0.1s; }
    .main-nav .nav-item:nth-child(2) { transition-delay: 0.2s; }
    .main-nav .nav-item:nth-child(3) { transition-delay: 0.3s; }
    .main-nav .nav-item:nth-child(4) { transition-delay: 0.4s; }
    .main-nav .nav-item:nth-child(5) { transition-delay: 0.5s; }
    .main-nav .nav-item:nth-child(6) { transition-delay: 0.6s; }
}

/* 防止選單開啟時頁面滾動 */
body.menu-open {
    overflow: hidden;
}

/* Submenu Styles */
.submenu {
    background-color: #002757;
    padding: 1.2rem 0 3rem;
}

.submenu .container {
    max-width: 960px !important;
    margin: 0 auto;
    padding: 0 1rem;
}

.submenu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.submenu-list li {
    margin-bottom: 0.5rem;
}

.submenu-list a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

/* 主選單項目（淺藍色） */
.submenu-list li:first-child a {
    color: #00a29a;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    display: block;
}

/* 子選單項目 hover 效果 */
.submenu-list a:hover {
    color: #ccc;
}

/* 當前頁面高亮 */
.submenu-list a.is-active {
    color: #00a29a;
}

/* 響應式設計 */
@media screen and (max-width: 768px) {
    .submenu .columns {
        margin: 0;
    }
    
    .submenu .column {
        padding: 0.5rem 1rem;
    }
    
    .submenu-list li:first-child {
        margin-bottom: 0.5rem;
    }
}

@media screen and (min-width: 1408px) {
    .submenu .container {
        max-width: 960px !important;
    }
}

/* Company Navigation Styles */
.company-nav {
    background-color: #002657;
    border-bottom: 1px solid #fff;
    padding: 1rem;
}

.company-nav .navbar-brand {
    color: #2ea7e0;
    font-size: 1.6rem;
    margin-right: 7rem;
}

.company-nav .navbar-item {
    color: #fff;
    font-size: 1.3rem;
    padding: 0.5rem 2rem;
}

.company-nav .navbar-item.is-active,
.company-nav .navbar-item:hover {
    color: #2ea7e0;
    background-color: transparent;
}

@media (max-width: 768px) {
	.company-nav .navbar-item{
        color:#002657;
    }
    /* 調整整個按鈕的大小 */
    button.navbar-burger.comp-nav {
        width: 3.25rem;  /* 可以調整整體寬度 */
        height: 3.25rem; /* 可以調整整體高度 */
    }
    
    /* 調整三條線的尺寸 */
    button.navbar-burger.comp-nav span {
        height: 2px;     /* 線條粗細 */
        width: 20px;     /* 線條寬度 */
        background-color: #2ea7e0;
        transition: background-color 0.3s ease;
    }
    
    /* 調整三條線之間的間距 */
    button.navbar-burger.comp-nav span:nth-child(1) {
        top: calc(50% - 8px);  /* 調整第一條線的位置 */
    }
    
    button.navbar-burger.comp-nav span:nth-child(2) {
        top: calc(50%);        /* 調整第二條線的位置 */
    }
    
    button.navbar-burger.comp-nav span:nth-child(3) {
        top: calc(50% + 8px);  /* 調整第三條線的位置 */
    }

    /* 添加激活狀態（X）的樣式 */
    button.navbar-burger.comp-nav.is-active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    button.navbar-burger.comp-nav.is-active span:nth-child(2) {
        opacity: 0;
    }

    button.navbar-burger.comp-nav.is-active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .company-nav .navbar-brand{
        margin-right:auto;
    }
}

/* 消除圖片和導航欄之間的間隙 */
.history-banner {
    line-height: 0; /* 移除圖片底部的行高間隙 */
    font-size: 0; /* 移除內聯元素之間的空白 */
}

.history-banner img {
    display: block; /* 移除圖片底部的空白 */
    margin: 0;
}

.company-nav {
    margin-top: 0;
    margin-bottom: 0;
}

/* 確保輪播圖也沒有多餘間隙 */
.carousel {
    margin-top: 0;
    margin-bottom: 0;
}

/* Quality Certifications Styles */

.quality-accordion {
    margin: 2rem 0;
    color: #fff;
    font-size: 1.2em;
}

.quality-header {
    margin-bottom: 0.1em;
    background-color: #fff;
    color: #666f74;
    border: 2px solid #b3b3b3;
    padding: 0.1em 0.8em;
    cursor: pointer;
    position: relative;
    border-radius: 0;
}

.quality-header.is-active {
    background-color: #185ea1;
    color: #fff;
    border: 2px solid #185ea1;
}

.quality-icon {
    float: right;
    font-size: 0.8em;
    margin-top: 2px;
}

.quality-content {
    display: none;
    padding: 0.2em 0.8em;
    background-color: #185ea1;
    color: #fff;
}

.quality-link {
    display: block;
    color: #fff;
    padding: 0.5rem;
    margin: 0.3rem 0;
    text-decoration: none;
    cursor: pointer;
}

.quality-link:hover {
    text-decoration: underline;
}

.modal-card {
    width: 400px;
    max-width: 90%;
}

/* History Table Styles Scan Profile */
/* Scan Profile 表格樣式 */
.scan-profile-title {
    color: #666f74;
    font-size: 1.8rem;
    font-weight: normal;
    margin-bottom: 0.5rem;
}

.scan-profile-line {
    border: none;
    border-top: 3px solid #185ea1;
    margin: 0 0 2rem 0;
}

.scan-profile-subtitle {
    color: #666f74;
    font-size: 1rem;
    font-weight: normal;
    margin-bottom: 1rem;
    text-align: center;
}

.scan-profile {
    font-size: 0.9rem;
    color: #666f74;
}

.scan-profile-row {
    display: flex;
    width: 100%;
    margin-bottom: 2px;
}

/* 左側欄位樣式 */
.profile-left {
    width: 21em;
    padding: 1.5rem;
    color: #fff;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.profile-left.company {
    background-color: #9ed3ee;
    min-height: 6rem;
}

.profile-left.production {
    background-color: #81bae0;
    min-height: 10rem;
}

.profile-left.certification {
    background-color: #0965ac;
    min-height: 7rem;
}

/* 右側內容樣式 */
.profile-right {
    flex: 1;
    padding-left: 1rem;
}

.profile-item {
    display: flex;
    border-bottom: 1px solid #dedede;
    min-height: 2.2em;
    line-height: 2.2em;
    align-items: center;
}

.item-label {
    width: 15em;
    padding-right: 2rem;
}

.item-value {
    flex: 1;
}

/* 備註樣式 */
.scan-profile-note {
    font-size: 0.85rem;
    color: #666f74;
    line-height: 1.5;
    margin-top: 1rem;
    padding-left: calc(21em + 1rem);
}

/* 移動端樣式 */
@media screen and (max-width: 768px) {
    .scan-profile-row {
        flex-direction: column;
        margin-bottom: 0;
    }

    .profile-left {
        width: 100%;
        min-height: auto !important;
        padding: 1rem;
        margin-bottom: 0;
    }

    .profile-right {
        padding-left: 0;
    }

    .profile-item {
        display: flex;
        border-bottom: 1px solid #dedede;
        padding: 0.5rem 0;
    }

    .item-label {
        width: 50%;
        padding-right: 1rem;
    }

    .item-value {
        width: 50%;
        text-align: right;
    }

    .scan-profile-note {
        padding-left: 0;
        margin-top: 1rem;
        text-align: left;
    }

    /* 移動端文字大小調整 */
    .scan-profile {
        font-size: 0.85rem;
    }

    .profile-left {
        font-size: 1rem;
    }

    /* 標題和分隔線調整 */
    .scan-profile-subtitle {
        text-align: left;
        margin-bottom: 1.5rem;
    }
}

/* Main Content Styles */
.main-center-width {
    max-width: 62em;
    margin: 0 auto;
    padding: 5em 1em 3em;
    color: #898989;
}

.blue-line-title {
    border-bottom: 4px solid #185ea1;
    color: #666f74;
    font-size: 1.3em;
    padding-bottom: 0.3em;
    margin-bottom: 1.5em;
}

/* Responsibility Page Styles */
.black-line {
    border-bottom: 1px solid #333;
    margin: 2rem 0;
}

.center-text a {
    color: #185ea1;
    text-decoration: none;
}

.center-text a:hover {
    text-decoration: underline;
}

/* Quick Links Section */
.quick-link {
    transition: all 0.3s ease;
    padding: 0;
    border: none;
    border-radius: 0;
    overflow: hidden;
}

.quick-link:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.quick-link-item {
    padding: 0;
    margin: 0;
    border: none;  
}

/* Footer Address Styles */
.footer-address {
    padding: 2rem 1rem;
}

.footer-logo {
    height: 4rem;
    width: auto;
}

.footer-info p {
    color: #898989;
    margin-top: 0.5rem;
}

/* Footer Contact Styles */
.footer-contact {
    background-color: #0068ac;
    padding: 1rem;
    color: #ffffff;
}

.footer-rt-logo {
    height: 1.2rem;
  }
  
.footer-icon-xin {
    height: 1.2rem;
    margin-right: 0.5rem;
  }

.footer-contact a:hover {
    text-decoration: underline;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .footer-menu .columns {
        margin-bottom: 0;
    }
    
    .footer-menu .column {
        padding-bottom: 1rem;
    }
    
    .footer-address .is-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-logo {
        margin-right: 0 !important;
        margin-bottom: 1rem;
    }
    
    .footer-contact .is-flex {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }
    
    .footer-contact a {
        margin-top: 0.5rem;
        width: 100%;
        text-align: center;
    }
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .navbar {
        padding: 1rem;
    }
    
    .footer-menu {
        flex-direction: column;
    }
    
    .footer-menu-item {
        margin-bottom: 1rem;
    }
}

/* Contacts Styles */
.contacts-banner {
    line-height: 0;
    font-size: 0;
}

.contacts-banner img {
    display: block;
    margin: 0;
}

.contacts-address {
    line-height: 1.5;
    margin-left: -1em;
}

.blue {
    color: #185ea1;
}

.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.icons-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.contact-icon {
    max-width: 30%; /* 圖片最大寬度為容器的30% */
    height: auto;
    object-fit: contain;
}

.icons-container-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contact-icon-mobile {
    max-width: 22%; /* 移動端調整圖片寬度 */
    height: auto;
    object-fit: contain;
}

/* 桌面端和移動端顯示控制 */
.desktop-view {
    display: flex;
}

.mobile-view {
    display: none;
}

@media screen and (max-width: 768px) {
    .desktop-view {
        display: none;
    }
    
    .mobile-view {
        display: block;
    }
    
    .has-text-right {
        text-align: right;
    }
}

/* Directory Structure */
.directory-structure {
    margin: 0 auto;
}

.directory-structure ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    border: 0px solid #dedede; /* 添加边框 */
    border-radius: 4px; /* 圆角边框 */
    padding: 1rem; /* 内部填充 */
}

.directory-structure li {
    margin: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #dedede; /* 每个列表项的边框 */
    border-radius: 4px; /* 圆角 */
    cursor: pointer;
    flex: 1 1 45%; /* 使列表项左右排列 */
    text-align: center; /* 文字居中 */
}

.directory-structure li:hover {
    background-color: #f5f5f5;
}

/* Search Section */
.search {
    width: 100%;
}

.list {
    margin-top: 1rem;
}

.list li {
    padding: 0.5rem;
    border-bottom: 1px solid #e8e8e8;
}

.list li:last-child {
    border-bottom: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 10, 10, 0.4);
    z-index: 20;
}

.modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-card {
    max-width: 400px;
    width: 90%;
}

@media screen and (max-width: 768px) {
    .modal-card {
        width: 100%;
    }
}

/* Blog News Styles */
.blog-banner {
    line-height: 0;
    font-size: 0;
}

.news-logo-img {
    width: 8em;
}

.news-main-text{
    color: #afc4e6;
}

.scan-blog-banner {
    background-color: #002757;
    padding: 2rem 0;
    text-align: center;
}

.scan-blog-nav-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 15px;
}

.scan-blog-nav-prev,
.scan-blog-nav-next {
    cursor: pointer;
    margin: 0 20px;
}

.scan-blog-nav-icon {
    width: 40px;
    height: 40px;
    transition: opacity 0.3s;
}

.scan-blog-nav-prev:hover .scan-blog-nav-icon,
.scan-blog-nav-next:hover .scan-blog-nav-icon {
    opacity: 0.7;
}

.scan-blog-posts-wrapper {
    flex: 1;
    overflow: hidden;
}

.scan-blog-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.scan-blog-post {
    width: 30%;
    margin-bottom: 30px;
    cursor: pointer;
    background-color: #fff;
    height: 25em;
}

.scan-blog-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 15px;
}

.scan-blog-img img,
.scan-blog-img video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.scan-blog-post:hover .scan-blog-img img,
.scan-blog-post:hover .scan-blog-img video {
    transform: scale(1.05);
}

/* 視頻縮略圖特殊樣式 */
.blog-video-thumbnail {
    border: none;
    outline: none;
}

.blog-video-thumbnail::-webkit-media-controls {
    display: none !important;
}

.blog-video-thumbnail::-webkit-media-controls-panel {
    display: none !important;
}

.blog-video-thumbnail::-webkit-media-controls-play-button {
    display: none !important;
}

.blog-video-thumbnail::-webkit-media-controls-start-playback-button {
    display: none !important;
}

.scan-blog-info {
    padding: 0 1em;
    text-align: left;
}

.scan-blog-date {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 8px;
}

.scan-blog-text {
    font-size: 0.9rem;
    color: #444;
    line-height: 1.4;
}

.scan-blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
}

.scan-blog-page-num,
.scan-blog-page-prev,
.scan-blog-page-next {
    display: inline-block;
    padding: 5px 10px;
    margin: 0 3px;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.scan-blog-page-num.scan-blog-page-active {
    background-color: #002757;
    color: white;
}

@media screen and (max-width: 768px) {
    .scan-blog-post {
        width: 100%;
    }
    
    .scan-blog-nav-container {
        flex-direction: column;
    }
    
    .scan-blog-nav-prev,
    .scan-blog-nav-next {
        margin: 10px 0;
    }
    
    .scan-blog-img {
        height: 180px;
    }
}

@media screen and (min-width: 769px) and (max-width: 1023px) {
    .scan-blog-post {
        width: 45%;
    }
}

/* Article Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideIn 0.3s ease-in-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    right: 15px;
    top: 10px;
    z-index: 1001;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid #eee;
    gap: 20px;
}

.modal-image,
.modal-video {
    width: 200px;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.modal-video {
    border: none;
    outline: none;
}

.modal-video::-webkit-media-controls {
    display: none !important;
}

.modal-video::-webkit-media-controls-panel {
    display: none !important;
}

.modal-video::-webkit-media-controls-play-button {
    display: none !important;
}

.modal-video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

.modal-info {
    flex: 1;
    padding-top: 10px;
}

.modal-info h2 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.5rem;
    line-height: 1.3;
}

.modal-date {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

.modal-body {
    padding: 20px;
    line-height: 1.6;
    color: #444;
    font-size: 1rem;
}

.modal-body p {
    margin: 0;
    white-space: pre-wrap;
}

/* 響應式設計 */
@media screen and (max-width: 768px) {
    .modal-content {
        margin: 5% auto;
        width: 95%;
        max-height: 85vh;
    }

    .modal-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 15px;
    }

    .modal-image,
    .modal-video {
        width: 100%;
        max-width: 300px;
        height: auto;
    }

    .modal-info h2 {
        font-size: 1.3rem;
        margin-top: 15px;
    }

    .modal-body {
        padding: 15px;
        font-size: 0.95rem;
    }

    .close {
        font-size: 24px;
        right: 10px;
        top: 8px;
    }
}