/**
 * WTO CMS 前台樣式
 */

/* 全局樣式 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}
.lead {
    font-size: 2.25rem;
    font-weight: 600;
}
/* 導航欄樣式 */
.navbar-brand {
    font-size: 1.5rem;
}
.navbar{
	background-color: #FFFFFF!important;
}
.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
	color: rgb(79 79 79 / 55%)!important;
	position: relative;
	margin: 0 0.25rem;
}

.navbar-nav .nav-link::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	width: 0;
	height: 2px;
	background: linear-gradient(90deg, var(--primary-color), #0056b3);
	transition: all 0.3s ease;
	transform: translateX(-50%);
}

.navbar-nav .nav-link:hover {
    color: rgba(79 79 79 / 100%) !important;
}

.navbar-nav .nav-link:hover::after {
	width: 80%;
}

.navbar-nav .nav-item:not(:last-child)::after {
	content: '';
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 1px;
	height: 20px;
	background: linear-gradient(180deg, transparent, rgba(79, 79, 79, 0.2), transparent);
}

.navbar-nav .nav-item {
	position: relative;
}

/* 電腦版專用樣式 */
@media (min-width: 992px) {
	.navbar-nav .nav-link {
		padding: 0.5rem 1.25rem;
		margin: 0 0.5rem;
	}
	
	.navbar-nav .nav-link::before {
		content: '';
		position: absolute;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: linear-gradient(135deg, rgba(13, 110, 253, 0.05), rgba(0, 86, 179, 0.05));
		opacity: 0;
		transition: opacity 0.3s ease;
		border-radius: 8px;
		z-index: -1;
	}
	
	.navbar-nav .nav-link:hover::before {
		opacity: 1;
	}
	
	.navbar-nav .nav-link:hover {
		transform: translateY(-2px);
	}
	
	.navbar-nav .nav-item:not(:last-child)::after {
		height: 24px;
		background: linear-gradient(180deg, transparent, rgba(79, 79, 79, 0.15), transparent);
	}
}

.logodis {
	max-height: 40px;
	width: auto;
	position: absolute;
}

/* 行動裝置選單樣式 */
@media (max-width: 991.98px) {
	.navbar {
		padding: 0.5rem 0;
	}
	
	.navbar .container {
		position: relative;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
	}
	
	.navbar-brand {
		margin-right: 0;
	}
	
	.navbar-brand img {
		height: 60px !important;
	}
	
    .logodis-mobile {
        display: flex;
        align-items: center;
        margin-left: 0.5rem;
        width: 76%;
        margin-left: -10% !important;
    }	
	.logodis-mobile img {
		max-height: 40px;
		width: 100%!important;
	}
	
	.navbar-toggler {
		border-color: rgba(255, 255, 255, 0.3);
		margin-left: auto;
		order: 3;
    position: absolute;
    top: 15px;
    right: 0;
}
	.navbar-toggler:focus {
		box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
	}
	
	.navbar-dark .navbar-toggler-icon {
		background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
	}
	
	.navbar-collapse {
		flex-basis: 100%;
		flex-grow: 1;
		align-items: center;
		margin-top: 0rem;
		padding-top: 0rem;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
		order: 4;
	}
	
	.navbar-nav {
		text-align: center;
		width: 100%;
	}
	
	.navbar-nav .nav-link {
		padding: 0.75rem 1rem;
		margin: 0.25rem 0;
		border-radius: 5px;
		display: block;
	}
	
	.navbar-nav .nav-item:not(:last-child)::after {
		display: none;
	}
	
	.navbar-nav .nav-link:hover {
		background-color: rgba(255, 255, 255, 0.1);
	}
}

/* 桌面版樣式 */
@media (min-width: 992px) {
	.logodis-desktop {
		z-index: 10;
	}
}
/* 英雄區域 */
.hero-section {
    min-height: 500px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
}


.hero-section > .container {
    position: relative;
    z-index: 2;
}

.hero-text-shadow {
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}



/* 卡片樣式 */
.card {
    border: none;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
    border-radius: 10px 10px 0 0 !important;
}

/* 按鈕樣式 */
.btn {
    border-radius: 25px;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1.1rem;
}

/* 徽章樣式 */
.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
}

/* 頁腳樣式 */
footer {
    margin-top: auto;
}

.footer-brand-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: grayscale(1);
    flex: 0 0 auto;
}

.footer-brand-text {
    min-width: 0;
}

.footer-brand-subtitle {
    font-size: 0.9rem;
    line-height: 1.45;
    max-width: 32rem;
    word-break: break-word;
}

.footer-social-links {
    display: inline-flex;
    gap: 0.9rem;
}

.footer-social-links a {
    color: #f8f9fa;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.footer-social-links a:hover {
    color: #cbd3da;
}

.footer-social-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
    filter: invert(1);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hero-section {
        min-height: 400px;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .hero-section .lead {
        font-size: 1rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 圖片樣式 */
.object-cover {
    object-fit: cover;
}

/* 文字截斷 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 工具提示 */
.tooltip {
    font-size: 0.875rem;
}

/* 自定義滾動條 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 表單樣式 */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* 搜尋框樣式 */
.search-box {
    position: relative;
}

.search-box .form-control {
    padding-right: 40px;
}

.search-box .search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #6c757d;
}

/* 標籤雲 */
.tag-cloud a {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin: 0.125rem;
    background-color: var(--light-color);
    color: var(--dark-color);
    text-decoration: none;
    border-radius: 15px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 分頁樣式 */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 1px solid #dee2e6;
    color: var(--primary-color);
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 返回頂部按鈕 */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #0056b3;
    transform: translateY(-3px);
}

/* 高亮文字 */
.highlight {
    background-color: #fff3cd;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}

/* 引用樣式 */
blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #6c757d;
}

/* 代碼樣式 */
code {
    background-color: #f8f9fa;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-size: 0.875rem;
    color: #e83e8c;
}

pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* 圖片燈箱效果 */
.image-lightbox {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.image-lightbox:hover {
    opacity: 0.8;
}

/* 社交分享按鈕 */
.social-share {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.social-share .btn {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-share .btn-facebook {
    background-color: #3b5998;
    color: white;
}

.social-share .btn-twitter {
    background-color: #1da1f2;
    color: white;
}

.social-share .btn-linkedin {
    background-color: #0077b5;
    color: white;
}

.social-share .btn-whatsapp {
    background-color: #25d366;
    color: white;
}

/* About / WTO Chairs：圖片左浮、文字繞排後清除浮動 */
.float-wrap-end {
    clear: both;
}

/* 分類頁：說明收合箭頭 */
.category-desc-chevron {
    transition: transform 0.2s ease;
}

.category-desc-toggle[aria-expanded="true"] .category-desc-chevron {
    transform: rotate(180deg);
}

.category-desc-welcome {
    letter-spacing: 0.14em;
    font-weight: 600;
}

.category-desc-btn.category-desc-toggle {
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.12em;
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.category-desc-btn.category-desc-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.42);
}

.category-description-content img {
    max-width: 100%;
    height: auto;
}

/* 分類說明內表格 */
.category-description-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.category-description-content table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.category-description-content th,
.category-description-content td {
    padding: 0.65rem 0.9rem;
    border: 1px solid #dee2e6;
    vertical-align: top;
}

.category-description-content th {
    background: linear-gradient(180deg, #f8f9fa 0%, #eef1f4 100%);
    font-weight: 600;
    color: #343a40;
    text-align: left;
}

.category-description-content tbody tr:nth-child(even) {
    background-color: #fafbfc;
}

.category-description-content tbody tr:hover {
    background-color: #f0f6ff;
}

/* 首頁 Latest News 橫向輪播（分類頁子分類可加 .news-carousel-wrap--plain 關閉左欄占位／第一張隱藏） */
.news-carousel-wrap {
    --news-gap: 1rem;
    --news-arrow-offset: 0.25rem;
    --news-side-pad: 2.75rem;
    --news-slot-width: calc((100% - (2 * var(--news-side-pad)) - (4 * var(--news-gap))) / 5);
    padding-left: var(--news-side-pad);
    padding-right: var(--news-side-pad);
}

.news-carousel-heading {
    position: absolute;
    left: var(--news-side-pad);
    width: var(--news-slot-width);
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    overflow: hidden;
}

.news-carousel-viewport {
    container-type: inline-size;
    container-name: news-carousel;
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE / 舊 Edge */
}

.news-carousel-viewport::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.news-carousel-track {
    display: flex;
    gap: var(--news-gap);
    width: max-content;
    min-width: 100%;
    padding-bottom: 0.25rem;
}

.news-carousel-card {
    flex: 0 0 260px;
    min-width: 0;
    transition: opacity 0.5s ease;
}

@supports (width: 1cqi) {
    .news-carousel-card {
        flex: 0 0 calc((100cqi - 4 * var(--news-gap)) / 5);
    }

    @container news-carousel (max-width: 1199.98px) {
        .news-carousel-card {
            flex: 0 0 calc((100cqi - 3 * var(--news-gap)) / 4);
        }
    }

    @container news-carousel (max-width: 991.98px) {
        .news-carousel-card {
            flex: 0 0 calc((100cqi - 2 * var(--news-gap)) / 3);
        }
    }

    @container news-carousel (max-width: 575.98px) {
        .news-carousel-card {
            flex: 0 0 min(280px, calc(100cqi - 1rem));
        }
    }
}

.news-carousel-card--ghost {
    opacity: 0;
    pointer-events: none;
}

.news-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #212529;
    box-shadow: none;
    transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.news-carousel-btn:hover:not(:disabled) {
    color: var(--primary-color);
}

.news-carousel-btn i {
    font-size: 2rem;
}

.news-carousel-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.news-carousel-btn--prev {
    left: var(--news-arrow-offset);
}

.news-carousel-btn--next {
    right: var(--news-arrow-offset);
}

.news-card-inner {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.news-card-link:hover .news-card-inner {
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.12) !important;
}

.news-card-inner.is-tilting {
    transition-duration: 0.08s;
}

.news-card-img-wrap {
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e9ecef;
}

.news-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
    will-change: transform;
}

.news-card-link:hover .news-card-img {
    transform: scale(1.05);
}

.news-card-body {
    padding: 1rem 1rem 1.125rem;
}

.news-card-date {
    letter-spacing: 0.02em;
}

.news-card-tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.4;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 2px;
    background: #fff;
}

.news-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.35;
}

.news-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.5;
}

@media (max-width: 575.98px) {
    .news-carousel-wrap {
        padding-left: 2.25rem;
        padding-right: 2.25rem;
    }

    .news-carousel-btn {
        width: 2.25rem;
        height: 2.25rem;
    }

    .news-carousel-heading {
        position: static;
        transform: none;
        margin-bottom: 0.75rem;
        pointer-events: auto;
    }
}

/* 列印樣式 */
@media print {
    .navbar,
    .btn,
    .social-share,
    .back-to-top {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
    
    body {
        padding-top: 0;
    }
}
