/* Nav */
.navbar {
	--clr-white: 216 61% 18%;
	--clr-primary-blue: 0 0% 98%;
	--clr-sub-blue: 0 0% 95%;
}
.navMenu ul li a {
	font-weight: 400;
}

/* About */
/* 共用樣式 */
#about {
	--image-height: 60vw;
	margin-bottom: 4rem;
}

.about-main {
	width: 100%;
	height: var(--image-height);
	background-attachment: scroll;
	background-repeat: no-repeat;
	background-size: cover;
	background-image: url("../images/about-main.webp");
}

.about-main img {
	width: 100%;
	height: var(--image-height);
	object-fit: cover;
	object-position: center;
}

.about-second {
	width: 100%;
	padding: 0 1rem;
}

.about-content {
	padding: 2rem 1rem;
}

.about-title {
	color: hsl(var(--clr-primary-yellow));
	border: solid 3px hsl(var(--clr-primary-yellow));
	text-align: center;
	padding: 0.5rem 1rem;
	line-height: 1.8em;
	width: fit-content;
	font-size: clamp(1rem, 0.8rem + 1.5vw, 2rem);
	font-weight: 700;
	margin-bottom: 1rem;
}

.about-title span {
	font-weight: 800;
	padding-left: 0.47em;
	white-space: nowrap;
}
.about-title-content {
	padding-top: 2.4vw;
}

/* 移動設備 */
@media (max-width: 767px) {
	.about-second {
		flex-direction: column;
	}

	.about-second .col-6 {
		width: 100%;
	}

	.about-content {
		order: -1;
	}
}

/* 平板電腦 */
@media (min-width: 768px) and (max-width: 1023px) {
	.about-second {
		flex-direction: row;
		align-items: center;
	}

	.about-second .col-6 {
		width: 50%;
	}

	.about-content {
		padding: 2rem;
	}
}

/* 桌面 */
@media (min-width: 1024px) {
	#about {
		margin-bottom: 24rem;
	}

	.about-second {
		position: absolute;
		top: calc(calc(var(--image-height) / 15) * 11.5);
		left: 50%;
		transform: translateX(-50%);
	}

	.about-content {
		padding: 6.6rem 5rem 0;
	}
}

/* Service */
#service {
	position: relative;
	background-color: hsl(var(--clr-primary-blue));
	color: hsl(var(--clr-white));
	padding-bottom: 8.1rem;
}
#service > div {
	width: min(95%, 1350px);
	margin: 0 auto;
}
.service-title {
	background-color: hsl(var(--clr-primary-yellow));
	padding: 0.6rem 1.2rem;
	margin: 5rem 0 6rem;
	font-size: 1.3rem;
}

.service-container {
	overflow: hidden;
	width: 100%;
	scroll-behavior: smooth;
}
.service-content {
	--gap: calc(2vw + 2rem);
	--img-width: 160px;
	--content-width: 180px;
	--img-padding: calc((var(--content-width) - var(--img-width)) / 2);
	--img-gap: calc(var(--gap) + var(--content-width) - var(--img-width));
	column-gap: var(--gap);

	display: flex;
	justify-content: center;
	align-items: flex-start;
	transition: transform 0.3s ease;
	min-width: max-content;
}
.service-content.grab {
	cursor: grab;
}
.service-content.grabbing {
	cursor: grabbing;
}
.service-content > div ~ div {
	position: relative;
}
.service-content > div ~ div::before {
	position: absolute;
	content: "";
	width: var(--img-gap);
	height: 0.24rem;
	background-color: hsl(var(--clr-white));
	top: calc(var(--img-width) / 2);
	left: var(--img-padding);
	transform: translate(-100%, -50%);
	z-index: 999;
}
.service-content > div > img {
	width: var(--img-width);
	height: var(--img-width);
	margin-bottom: 5rem;
	position: relative;
	z-index: 1;
}
.service-content h3 {
	font-size: 1.39rem;
	font-weight: 500;
	position: relative;
	margin-bottom: 5rem;
}
.service-content h3::after {
	position: absolute;
	content: "";
	width: 4.5rem;
	height: 0.5rem;
	background-color: hsl(var(--clr-primary-yellow));
	bottom: -2.3rem;
	left: 50%;
	transform: translateX(-50%);
}
.service-content p {
	width: var(--content-width);
	font-weight: 100;
}
.service-content p span {
	font-weight: 700;
}

/* Tablet & Mobile */
@media screen and (max-width: 1200px) {
	#service > div {
		width: 90%;
	}

	.service-content {
		--gap: calc(1.5vw + 1.5rem);

		justify-content: flex-start;
		user-select: none;
	}

	.service-content h3 {
		font-size: 1.2rem;
		margin-bottom: 4rem;
	}

	.service-content > div > img {
		margin-bottom: 3rem;
	}

	.service-container {
		padding: 0 2rem;
	}
	/* 漸層 */
	/* 
	#service > div::before {
		content: "";
		position: absolute;
		left: 0;
		top: 0;
		width: 4rem;
		height: 100%;
		background: linear-gradient(
			to right,
			hsl(var(--clr-primary-blue)) 24%,
			hsla(var(--clr-primary-blue) / 0.24) 81%,
			transparent 100%
		);
		pointer-events: none;
		z-index: 5;
	}
	#service > div::after {
		content: "";
		position: absolute;
		right: 0;
		top: 0;
		width: 4rem;
		height: 100%;
		background: linear-gradient(
			to left,
			hsl(var(--clr-primary-blue)) 24%,
			hsla(var(--clr-primary-blue) / 0.24) 81%,
			transparent 100%
		);
		pointer-events: none;
		z-index: 5;
	} */
}

@media screen and (max-width: 767px) {
	#service > div {
		width: calc(100% - 8.1rem);
	}
}

/* Scroll Hint */
.scroll-hint {
	position: absolute;
	bottom: 2rem;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	color: hsl(var(--clr-white));
	opacity: 0.8;
	transition: opacity 0.3s ease;
	opacity: 0; /* 預設隱藏 */
	visibility: hidden; /* 預設隱藏 */
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 新增這個 class 來控制顯示 */
.showScrollHint .scroll-hint {
	opacity: 0.8;
	visibility: visible;
}

.scroll-hint i {
	font-size: max(1.5vw, 1.2rem);
	animation: leftRight 2s ease-in-out infinite;
}

.scroll-hint p {
	font-size: max(1.2vw, 0.81rem);
	font-weight: 300;
	color: #eeeeee81;
}

/* 當使用者開始拖曳時隱藏提示 */
.service-container:active + .scroll-hint {
	opacity: 0;
}

@keyframes leftRight {
	0% {
		transform: translateX(-10px);
	}
	50% {
		transform: translateX(10px);
	}
	100% {
		transform: translateX(-10px);
	}
}

/* History */
#history {
	--padding-left: 3rem;
	--year-box-1: 16vw;
	--year-box-2: 11.2rem;
	/* overflow-x: hidden; */
}
.history-container {
	width: min(100%, 1980px);
	margin: 0 auto;
}
.history-title {
	background-color: hsl(var(--clr-black));
	color: hsl(var(--clr-white));
}
.history-title h2 {
	font-size: 2rem;
	letter-spacing: 0.24rem;
	padding: 2rem 0;
	padding-left: var(--padding-left);
}
.history-title .year {
	padding-left: var(--padding-left);
	width: max-content;
	position: relative;
	z-index: 1;
}
.history-title .year a {
	display: block;
	color: hsl(var(--clr-white));
	font-size: 1.24rem;
	font-weight: 600;
	padding: 0.1rem 0 0.8rem;
	width: var(--year-box-1);
	text-align: center;
	position: relative;
	transition: 0.4s;
}
.history-title .year a[aria-selected="true"],
.history-title .year a:hover {
	background-color: hsl(var(--clr-lightblack));
}
.history-title .year li:nth-of-type(1) a::before {
	position: absolute;
	content: "";
	top: 0;
	left: 0;
	height: 100%;
	width: 2px;
	border-radius: 1px;
	background-color: hsl(var(--clr-primary-yellow));
}
.history-title .year a::after {
	position: absolute;
	content: "";
	top: 0;
	right: 0;
	height: 100%;
	width: 2px;
	border-radius: 1px;
	background-color: hsl(var(--clr-primary-yellow));
}
.history-title .year span:not([class]) {
	font-size: 0.85rem;
}

.history-content {
	--year-width: 301.4px;
	width: 100%;
}
.history-content .year-title {
	width: calc(var(--padding-left) + var(--year-box-1));
	padding-left: var(--padding-left);
	padding-top: 5rem;
	transition: all 0.3;
}
.history-content .year-title h3 {
	width: max-content;
	padding: 0 2.4rem 1.5rem 1rem;
	position: relative;
}
.history-content .year-title h3::after {
	position: absolute;
	content: "";
	width: var(--year-box-1);
	height: 0.5rem;
	bottom: 0;
	left: 0;
	background-color: hsl(var(--clr-primary-yellow));
	border-radius: 0.25rem;
}
.history-content .year-title p {
	font-size: clamp(1.2rem, 1rem + 2.4vw, 3rem);
	letter-spacing: 0.24rem;
	width: max-content;
	transition: all 0.3;
}
.history-content .year-title .year-1 {
	position: relative;
	margin-bottom: 0.8rem;
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.history-content .year-title .year-1::after {
	position: absolute;
	content: "";
	width: 5px;
	height: 1rem;
	background-color: hsl(var(--clr-black));
	bottom: -1rem;
	left: 45%;
}
@keyframes yearFade {
	from {
		opacity: 0;
		transform: translateX(-50px) translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateX(0px) translateY(0px);
	}
}
.history-content .year-title span {
	font-size: 2.4rem;
}
.history-content .year-content {
	width: calc(100% - var(--padding-left) - var(--year-box-1));
	background-color: hsl(var(--clr-primary-paleblue));
	padding: 5.5rem 0 0 0;
}
.year-content-container {
	max-width: 100%;
	--padding-right: 8.1vw;
	--article-gap: 5rem;
	--container-height: 50rem;
	--section-min-height: 15rem;

	padding-left: 5rem;
	padding-right: var(--padding-right);
	width: calc(var(--year-box-1) * 4 + var(--padding-right));
	max-height: var(--container-height);
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior-inline: contain;
	scroll-behavior: smooth;
	scroll-snap-type: y proximity;
}
.year-content-container section {
	min-height: var(--section-min-height);
	/* scroll-snap-align: start; */
}
.year-content-container section > div {
	scroll-snap-align: start;
}

.year-content-container section:last-child {
	margin-bottom: calc(var(--container-height) - var(--section-min-height));
}
/* Scrollbar Design Start */
.year-content-container::-webkit-scrollbar {
	width: 0.5rem;
}
.year-content-container::-webkit-scrollbar-track {
	background-color: hsl(var(--clr-lightgrey));
	border-radius: 0.25rem;
}
.year-content-container::-webkit-scrollbar-thumb {
	background-color: hsl(var(--clr-primary-blue));
	border-radius: 0.25rem;
	border: 1px solid hsl(var(--clr-lightgrey));
}
/* Scrollbar Design End */
.year-content-container h4 {
	font-size: 1.4rem;
	position: relative;
	padding-bottom: 0.8rem;
}

.year-content-container h4::before {
	position: absolute;
	content: "";
	bottom: 0;
	left: 0;
	width: 100%;
	height: 2.4px;
	background-color: hsl(var(--clr-lightgrey));
}
.year-content-container h4::after {
	position: absolute;
	content: "";
	bottom: 0;
	left: 0;
	width: var(--article-gap);
	height: 2.4px;
	background-color: hsl(var(--clr-black));
}
.year-content-container section.active h4::after {
	background-color: hsl(var(--clr-primary-yellow));
}

.year-content-container span {
	font-size: 0.815em;
}

.year-content-container .article {
	padding: 2rem 0 2rem var(--article-gap);
	min-height: 12rem;
}
.article-with-image {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
}
.article-with-image img {
	margin-left: 2.4rem;
}

/* 平板版本 (768px ~ 1024px) */
@media screen and (max-width: 1024px) {
	.history-title .year a {
		font-size: 1rem;
	}

	.year-content-container {
		--padding-right: 10vw;
		padding-left: 2rem;
	}

	.article-with-image {
		flex-direction: column;
	}
	.article-with-image img {
		margin-left: 0;
		margin-top: 1.2rem;
		max-width: 100%;
	}

	.history-content .year-title {
		margin-top: -0.8rem;
	}
	.history-content .year-title h3 {
		padding: 0 2rem 1rem 1rem;
	}
	.history-content .year-title h3::after {
		height: 0.38rem;
	}
	.history-content .year-title p {
		font-size: 3vw;
		letter-spacing: 0.12rem;
	}
	.history-content .year-title .year-1 {
		margin-bottom: 0.5rem;
	}
}

/* 手機版本 (< 768px) */
@media screen and (max-width: 768px) {
	#history {
		--padding-left: 8vw;
		--year-box-1: 16.8vw;
	}

	.history-content .year-title {
		display: none;
	}

	.history-content .year-content {
		width: 100%;
		padding: 2.4rem var(--padding-left);
	}
	.year-content-container {
		width: 100%;
		padding: 0 5vw 0 0;
	}

	/* 年度垂直排列 */
	.history-title .year p {
		display: grid;
		line-height: 1.2;
	}

	.history-title .year .year-divider {
		text-orientation: upright;
		transform: rotate(90deg);
	}
}

@media screen and (max-width: 450px) {
	#history {
		--padding-left: 5.5vw;
		--year-box-1: 17.8vw;
	}
}
