﻿/* Unify 頁 Bootstrap 5 相容：補回 Unify / BS3 會用到、但 5.3 拿掉的樣式 */

/* 對齊 BS3 字型，避免 Segoe UI 把字重 500 落到 regular */
:root {
	--bs-font-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif;
	--bs-body-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
body {
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* BS3 .container 寬度（BS5 在 1200px 只有 1140，區塊會看起來偏小） */
@media (min-width: 768px) {
	.container {
		width: 750px;
		max-width: 750px;
	}
}
@media (min-width: 992px) {
	.container {
		width: 970px;
		max-width: 970px;
	}
}
@media (min-width: 1200px) {
	.container {
		width: 1170px;
		max-width: 1170px;
	}
}

/* 對齊 BS3 .row gutter 15+15 */
.row {
	--bs-gutter-x: 30px;
}

/* BS3 thumbnail / caption，下方連結卡片才不會扁掉 */
.caption {
	padding: 9px;
	color: #333;
}
.thumbnail {
	display: block;
	padding: 4px;
	margin-bottom: 20px;
	line-height: 1.42857143;
	background-color: #fff;
	border: 1px solid #ddd;
}

/* 桌機選單：Unify 用 .collapse 但不加 .show，BS5 會整欄藏起來 */
@media (min-width: 1201px) {
	.header-v6 .navbar-collapse.collapse {
		display: block !important;
		height: auto !important;
		overflow: visible !important;
	}
}

/* 手機選單：Unify 認 .in，BS5 認 .show */
@media (max-width: 1200px) {
	.header-v6 .navbar-collapse.collapse.show,
	.header-v6 .navbar-collapse.collapse.in {
		display: block !important;
		overflow-y: auto !important;
		width: 100%;
	}
}

/* 不要讓 BS5 .navbar / .nav 的 flex 打掉 Unify 排版 */
.header-v6 .navbar {
	display: block !important;
	flex-wrap: unset !important;
}
.header-v6 .navbar > .container {
	display: block !important;
	flex-wrap: unset !important;
	align-items: unset !important;
}
.header-v6 .navbar > .container:after,
.header-v6 .navbar-collapse:after,
.header-v6 .menu-container:after {
	content: "";
	display: table;
	clear: both;
}
.header-v6 .nav.navbar-nav,
.header-v6 .navbar-nav {
	display: block !important;
	flex-direction: unset !important;
	flex-wrap: unset !important;
}
.header-v6 .dropdown-toggle::after {
	display: none;
}
.header-v6 .navbar-nav .open > .dropdown-menu,
.header-v6 .navbar-nav .dropdown-menu.show {
	display: block;
}

/* BS3 的 .dropdown-menu > li > a 是 block；5 只認 .dropdown-item。
   inline + padding 的 hover 背景會凸出去蓋住下一項 */
.header-v6 .dropdown-menu > li {
	float: none;
	display: block;
	width: 100%;
}
.header-v6 .dropdown-menu > li > a {
	display: block;
	padding: 10px 25px;
	line-height: 1.5;
	white-space: nowrap;
	box-sizing: border-box;
}
.header-v6 .dropdown-menu > li > a:hover,
.header-v6 .dropdown-menu > li > a:focus {
	background-color: #F3F3F3;
}

/* BS5 reboot：img max-width:100%、h1 字級變大；百分比 max-height 在 h1 裡算不出來 */
.header-v6 .navbar-brand h1,
.header-v6 .navbar-brand a {
	margin: 0;
	padding: 0;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	display: inline-block;
	height: 70px;
	vertical-align: middle;
}
.header-v6 .navbar-brand img {
	width: auto !important;
	height: auto;
	max-width: none;
	max-height: 65px; /* 對齊 brand 70px × Unify 93% */
}

/* 桌機：logo 左、選單右（Unify 原樣，不要 9 等分以免中文被拆開） */
@media (min-width: 1201px) {
	.header-v6 .navbar-brand {
		float: left;
	}
	.header-v6 .navbar > .container > .menu-container {
		float: left;
		width: auto;
	}
	.header-v6 .navbar-collapse.collapse {
		float: right;
		width: auto;
		display: block !important;
		height: auto !important;
		overflow: visible !important;
	}
	.header-v6 .collapse .menu-container {
		float: none !important;
		width: auto !important;
	}
	.header-v6 .navbar-nav {
		float: right !important;
		width: auto !important;
		margin: 0;
	}
	.header-v6 .navbar-nav > li {
		position: relative !important;
		display: block;
		float: left;
		flex: none;
		width: auto;
	}
	.header-v6 .navbar-nav > li > a,
	.header-v6 .navbar-nav > li > a.dropdown-toggle {
		white-space: nowrap;
	}
	.header-v6 .navbar-nav > li > a strong {
		white-space: nowrap;
		width: auto;
		flex: none;
	}
	/* 關掉 Popper 位移，下拉要貼在該選單項下面 */
	.header-v6 .navbar-nav > li > .dropdown-menu {
		position: absolute !important;
		inset: auto !important;
		left: 0 !important;
		right: auto !important;
		top: 100% !important;
		bottom: auto !important;
		transform: none !important;
		margin: 0 !important;
		float: none;
		min-width: 230px !important;
		width: max-content;
		max-width: none !important;
		padding: 15px 0;
	}
}

@media (max-width: 1200px) {
	.header-v6 .navbar > .container > .menu-container {
		float: none;
		width: auto;
	}
	.header-v6 .navbar-nav {
		float: none !important;
	}
	.header-v6 .navbar-nav > li {
		float: none;
		width: 100%;
		display: block;
	}
	.header-v6 .navbar-nav .dropdown-menu {
		position: static;
		float: none;
	}
}

/* 漢堡鈕：沒有 BS3 時桌機要藏，Unify 只在 ≤1200 設 display:block */
.navbar-toggle .icon-bar {
	display: block;
}
@media (min-width: 1201px) {
	.header-v6 .navbar-toggle {
		display: none;
	}
}

/* BS3 工具 class */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
.sr-only-focusable:active,
.sr-only-focusable:focus {
	position: static;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
	clip: auto;
	white-space: normal;
}
.img-responsive {
	display: block;
	max-width: 100%;
	height: auto;
}
.list-inline {
	padding-left: 0;
	list-style: none;
	margin-left: -5px;
}
.list-inline > li {
	display: inline-block;
	padding-right: 5px;
	padding-left: 5px;
}
.pull-left { float: left !important; }
.pull-right { float: right !important; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* BS3 collapse 認 .in，BS5 認 .show；左側選單預設展開用 .in */
.collapse.in {
	display: block;
}

/* BS3 麵包屑分隔，BS5 只認 .breadcrumb-item */
.breadcrumb > li {
	display: inline-block;
}
.breadcrumb > li + li:before {
	padding: 0 5px;
	color: #ccc;
	content: "/\00a0";
}
.hidden-xs { display: none !important; }
@media (min-width: 768px) {
	.hidden-xs { display: block !important; }
}
.col-xs-6 {
	flex: 0 0 auto;
	width: 50%;
}
.col-xs-12 {
	flex: 0 0 auto;
	width: 100%;
}

/* footer：BS5 把沒 href 的 <a> 設成 inherit，會吃到 li { color:#000 } 變成黑字 */
.footer-v1 .footer a,
.footer-v1 .footer li a {
	color: #eee;
}
.footer-v1 .footer a:hover,
.footer-v1 .footer li a:hover {
	color: #72c02c;
}

/* footer：BS5 .row 是 flex，大圖 min-width:auto 會把後面欄位擠出畫面；標章 float 也失效 */
.footer-v1 .footer .row {
	display: block;
}
.footer-v1 .footer .row:before,
.footer-v1 .footer .row:after {
	content: "";
	display: table;
	clear: both;
}
.footer-v1 .footer .row > .col-md-3 {
	box-sizing: border-box;
	min-width: 0;
}
.footer-v1 .footer-logo,
.footer-v1 .footer .row > .col-md-3 img {
	max-width: 100%;
	height: auto;
}
@media (min-width: 992px) {
	.footer-v1 .footer .row > .col-md-3 {
		float: left;
		width: 25%;
		max-width: 25%;
	}
}
@media (max-width: 991px) {
	.footer-v1 .footer .row > .col-md-3 {
		float: none;
		width: 100%;
		max-width: 100%;
	}
}
.footer-v1 .footer .row > .SC {
	float: right;
	width: auto;
	max-width: none;
}

/* 內頁側欄：BS3 col-md 是 ≥992px 才分欄，BS5 的 md 提前到 768 */
@media (min-width: 768px) and (max-width: 991px) {
	.container.content .col-md-3,
	.container.content .col-md-9 {
		flex: 0 0 auto;
		width: 100%;
		max-width: 100%;
	}
}

/* 單圖置中 .page-header 是 float:left；BS5 欄位不是 float，包不住會把 footer 擠歪 */
.container.content .row {
	display: block;
}
.container.content:after,
.container.content .row:after,
.container.content .col-md-9:after,
.page-main:after {
	content: "";
	display: table;
	clear: both;
}
@media (min-width: 992px) {
	.container.content .col-md-3 {
		float: left;
		width: 25%;
		max-width: 25%;
		min-width: 0;
	}
	.container.content .col-md-9 {
		float: left;
		width: 75%;
		max-width: 75%;
		min-width: 0;
	}
}
.container.content .page-header img,
.container.content .FloatCenterImg img {
	max-width: 100%;
	height: auto;
}
.footer-v1 {
	clear: both;
}

/* BS3 .label：附加檔案／附加連結綠底白字（5 拿掉 .label-success） */
.label {
	display: inline;
	padding: .2em .6em .3em;
	font-weight: 700;
	line-height: 1;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	vertical-align: baseline;
	border-radius: 0;
}
.label-success {
	background-color: #5cb85c;
	color: #fff;
}

/* 分頁：BS3 是 ul.pagination > li > a；5 只認 .page-item / .page-link。
   沒補回的話 inline padding 會凸上去蓋住上面的列表，且少了原本的 20px 間距 */
.pagination {
	display: inline-block;
	padding-left: 0;
	margin: 20px 0;
	border-radius: 4px;
	list-style: none;
}
.pagination > li {
	display: inline;
}
.pagination > li > a,
.pagination > li > span {
	position: relative;
	float: left;
	padding: 6px 12px;
	margin-left: -1px;
	line-height: 1.42857143;
	color: #707070;
	text-decoration: none;
	background-color: #fff;
	border: 1px solid #ddd;
}
.pagination > li:first-child > a,
.pagination > li:first-child > span {
	margin-left: 0;
}
.pagination > li > a:hover,
.pagination > li > span:hover,
.pagination > li > a:focus,
.pagination > li > span:focus {
	z-index: 2;
	color: #fff;
	background-color: #5fb611;
	border-color: #5fb611;
}
.pagination > .active > a,
.pagination > .active > span,
.pagination > .active > a:hover,
.pagination > .active > span:hover,
.pagination > .active > a:focus,
.pagination > .active > span:focus {
	z-index: 3;
	color: #fff;
	cursor: default;
	background-color: #4b7722;
	border-color: #4b7722;
}

/* Glyphicons（輪播按鈕），字型沿用舊 bootstrap fonts，不載入 3.4.1 CSS */
@font-face {
	font-family: "Glyphicons Halflings";
	src: url("../plugins/bootstrap/fonts/glyphicons-halflings-regular.eot");
	src: url("../plugins/bootstrap/fonts/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"),
		url("../plugins/bootstrap/fonts/glyphicons-halflings-regular.woff2") format("woff2"),
		url("../plugins/bootstrap/fonts/glyphicons-halflings-regular.woff") format("woff"),
		url("../plugins/bootstrap/fonts/glyphicons-halflings-regular.ttf") format("truetype"),
		url("../plugins/bootstrap/fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg");
}
.glyphicon {
	position: relative;
	top: 1px;
	display: inline-block;
	font-family: "Glyphicons Halflings";
	font-style: normal;
	font-weight: normal;
	line-height: 1;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}
.glyphicon-play:before { content: "\e072"; }
.glyphicon-pause:before { content: "\e073"; }
.glyphicon-chevron-left:before { content: "\e079"; }
.glyphicon-chevron-right:before { content: "\e080"; }
.glyphicon-triangle-right:before { content: "\e250"; }

/* BS3 carousel 控制列／指示點（BS5 只認 carousel-control-prev/next） */
.carousel {
	position: relative;
}
.carousel-inner {
	position: relative;
	width: 100%;
	overflow: hidden;
}
.carousel-inner > .item,
.carousel-inner > .carousel-item {
	display: none;
	position: relative;
}
.carousel-inner > .item > img,
.carousel-inner > .item > a > img,
.carousel-inner > .carousel-item > img,
.carousel-inner > .carousel-item > a > img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	line-height: 1;
}
.carousel-inner > .active {
	display: block;
}
.carousel-control {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 15%;
	font-size: 20px;
	color: #fff;
	text-align: center;
	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
	background-color: rgba(0, 0, 0, 0);
	opacity: 0.5;
	text-decoration: none;
}
.carousel-control:hover,
.carousel-control:focus {
	color: #fff;
	opacity: 0.9;
	text-decoration: none;
}
.carousel-control:focus {
	outline: 3px solid #0086d8;
	outline-offset: 2px;
}
.carousel-control.left {
	background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5) 0, rgba(0, 0, 0, 0.0001) 100%);
}
.carousel-control.right {
	right: 0;
	left: auto;
	background-image: linear-gradient(to right, rgba(0, 0, 0, 0.0001) 0, rgba(0, 0, 0, 0.5) 100%);
}
.carousel-control .glyphicon-chevron-left,
.carousel-control .glyphicon-chevron-right,
.carousel-control .glyphicon-pause,
.carousel-control .glyphicon-play {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: inline-block;
	margin-top: -10px;
}
.carousel-control .glyphicon-chevron-left {
	left: 50%;
	margin-left: -10px;
}
.carousel-control .glyphicon-chevron-right {
	right: 50%;
	margin-right: -10px;
}
.carousel-indicators {
	position: absolute;
	bottom: 10px;
	left: 50%;
	z-index: 15;
	width: 60%;
	padding-left: 0;
	margin-left: -30%;
	text-align: center;
	list-style: none;
}
.carousel-indicators li {
	display: inline-block;
	width: 10px;
	height: 10px;
	margin: 1px;
	text-indent: -999px;
	cursor: pointer;
	background-color: transparent;
	border: 1px solid #fff;
	border-radius: 10px;
}
.carousel-indicators .active {
	width: 12px;
	height: 12px;
	margin: 0;
	background-color: #fff;
}
