/* 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;
}

body {
	background-color: hsl(var(--clr-white));
}
/* Banner */
#banner {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
}
#banner > * {
	width: max(81vw, 600px);
	margin: 0 auto;
	grid-column: 1 / 2;
	grid-row: 1 / 2;
}
#banner picture img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}
/* #banner picture.inactive {
	filter: contrast(120%) grayscale(81%);
	transition: filter 0.4s ease;
} */

.banner-navigation li {
	z-index: 10;
	color: hsl(var(--clr-primary-yellow));
	border: solid 0.2em hsl(var(--clr-primary-yellow));
	font-size: calc(81vw * 0.012);
	width: max(12%, 5.5rem);
	padding: 0.24em 0;
	text-align: center;
	cursor: pointer;
	transition: 0.4s ease;
}

.banner-navigation li[aria-selected="true"],
.banner-navigation li:hover {
	background-color: hsl(var(--clr-primary-yellow));
	color: hsl(var(--clr-white));
}
.banner-navigation .taiwan-link {
	top: 25%;
	left: 65%;
}
.banner-navigation .malaysia-link {
	bottom: 27%;
	left: 42%;
}
.banner-navigation picture {
	filter: contrast(120%) grayscale(81%);
	transition: filter 0.4s ease;
}
.banner-navigation li[aria-selected="true"] + picture {
	filter: contrast(100%) grayscale(0%);
}
.banner-navigation li:hover + picture {
	filter: contrast(100%) grayscale(0%);
}

/* Clinic */
#clinic {
	width: 100%;
	padding-top: 5rem;
}
.clinic-navigation {
	/* margin: 0 5vw; */
	width: 90vw;
	margin: 0 auto;
	min-height: 6rem;
	position: relative;
}
.countries {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: max-content;
	gap: 1.5rem;
}
.countries h2 {
	font-size: clamp(1.7rem, 1rem + 1vw, 2rem);
	letter-spacing: 0.12em;
	font-weight: 500;
	cursor: pointer;
	position: relative;
}
.countries li[aria-selected="true"] h2 {
	font-weight: 700;
}
.countries h2::after {
	position: absolute;
	content: "";
	width: 100%;
	height: 2.4px;
	left: 0;
	bottom: 0;
	background-color: hsl(var(--clr-primary-yellow));
	transform: scaleX(0);
	transform-origin: right bottom;
	transition: transform 0.4s ease-in-out;
}
.countries :is(li[aria-selected="true"], li:hover) h2::after {
	transform-origin: left bottom;
	transform: scaleX(100%);
}
.countries .lists {
	left: 0;
	bottom: 0;
	opacity: 0;
	visibility: hidden;
	transform: 0.4s ease;
}
.taiwan .lists {
	transform: translateX(-100%);
}
.malaysia .lists {
	transform: translateX(100%);
}
.countries li[aria-selected="true"] .lists {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}
.lists li ~ li {
	padding-left: 2rem;
}
.lists li h3 {
	font-size: clamp(1.1rem, 1rem + 0.2vw, 1.3rem);
	font-weight: 400;
	cursor: pointer;
	transition: 0.4s ease;
}
.lists li h3[aria-selected="true"],
.lists li h3:hover {
	font-weight: 700;
	transform: scaleY(1.05);
}

/* Clinic Container */
.clinic-container {
	width: 90vw;
	margin: 0 auto;
	position: relative;
	min-height: 38rem;
	overflow: hidden;
	margin-top: 4.5rem;
}
.clinic-container > div {
	position: absolute;
	width: 100%;
	top: 0;
	left: 0;
	/* inactive */
	opacity: 0;
	transition: transform 0.4s ease, opacity 0.2s;
}
.clinic-container > div.clinic-taiwan {
	transform: translateX(-100%);
}
.clinic-container > div.clinic-malaysia {
	transform: translateX(100%);
}
.clinic-container > div.active {
	opacity: 1;
	transform: translateX(0%);
	transition: 0.4s ease;
}
.clinic-container > div > div {
	/* inactive */
	opacity: 0;
	transform: translateX(-50%);
	transition: transform 0.4s ease, opacity 0.2s;
}
.clinic-container > div > .dental-workshop {
	transform: translateX(50%);
}
.clinic-container > div > div.active {
	opacity: 1;
	transform: translateX(0%);
	transition: 0.4s ease;
}
.clinic-taiwan {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
}
.clinic-taiwan > div {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
}

.city {
	/* inactive */
	opacity: 0;
	max-height: 0;
	transition: max-height 0.4s ease;
}
.city.active {
	padding-bottom: 3rem;
	opacity: 1;
	max-height: initial;
	transition: 0.4s ease;
}
.city-name {
	font-size: 1.3rem;
	width: max-content;
	padding: 0.24em 1em;
	/* inactive */
	padding: 0;
	max-height: 0;
	transition: 0.4s ease;
}
.city.active .city-name {
	border: solid 0.1rem hsl(var(--clr-primary-blue));
	padding: 0.24em 1em;
	max-height: initial;
}
.clinic-card {
	display: flex;
	align-items: center;
	padding: 0.8em 0;
	/* inactive */
	opacity: 0;
	padding: 0;
	max-height: 0;
	transition: padding 0.4s ease, border 0.4s ease, max-height 0.4s ease;
}
.clinic-card.active {
	border-bottom: solid 0.2em hsl(var(--clr-primary-yellow));
	opacity: 1;
	padding: 0.8rem 0;
	max-height: initial;
	transition: all 0.4s ease;
}
.clinic-card.active .name {
	width: 33%;
	font-size: 1.2rem;
	letter-spacing: 0.1em;
}
.name h4.en {
	letter-spacing: 0.08em;
}
.clinic-card.active .name .icon {
	display: inline-block;
	width: 1.65em;
	height: 1.65em;
	position: relative;
	vertical-align: -0.45em;
}
.clinic-card .name .icon a {
	color: #c30d23;
}
.clinic-card.active .name .icon a {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: block;
	font-size: 0.8em;
}
/* Map icon animation Start */
.clinic-card.active .name .icon {
	transition: transform 0.4s ease;
}
.clinic-card.active .name .icon:hover {
	transform: scale(1.5);
}
/* Map icon animation End */
.clinic-card.active .information {
	display: flex;
	flex-direction: column;
}
.clinic-card .information a {
	color: hsl(var(--clr-primary-blue));
}
.clinic-card.active .information a {
	display: inline-block;
	line-height: 2em;
	font-size: 0.95rem;
	font-weight: 400;
	position: relative;
	transition: font-weight 0.4s ease;
}
.clinic-card.active .information a:hover {
	font-weight: 600;
}
.clinic-card.active .information a::after {
	position: absolute;
	content: "";
	width: 100%;
	height: 1.3px;
	left: 0;
	bottom: 0;
	background-color: hsl(var(--clr-primary-blue));
	opacity: 0;
	transform-origin: right bottom;
	transform: scaleX(0);
	transition: opacity 0.4s ease, transform 0.4s ease;
}
.clinic-card.active .information a:hover::after {
	transform-origin: left bottom;
	opacity: 1;
	transform: scaleX(100%);
}

/* 平板版本 (768px ~ 1024px) */
@media screen and (max-width: 1024px) {
	#banner {
		--move-y: -5rem;
	}
	#banner > * {
		width: 90%;
	}
	#banner picture img {
		object-position: center var(--move-y);
		aspect-ratio: 16 / 8;
	}
	.banner-navigation .taiwan-link {
		transform: translateY(calc(var(--move-y) / 2));
	}
}

/* 手機版本 (< 768px) */
@media screen and (max-width: 768px) {
	#banner {
		--move-y: -1rem;
	}
	#banner > * {
		width: 100%;
	}
	#banner picture {
		overflow: hidden;
	}
	#banner picture img {
		aspect-ratio: initial;
		transform: scale(1.5);
	}
	.banner-navigation .taiwan-link {
		transform: translateY(0);
		top: 20%;
		left: 60%;
	}
	.banner-navigation .malaysia-link {
		left: 38%;
	}

	.banner-navigation li {
		font-size: 0.8rem;
		/* width: max(12%, 5.5rem); */
		width: auto;
		padding: 0.2em 0.8em;
	}

	/* Clinic */
	.clinic-card {
		flex-direction: column;
		align-items: flex-start;
	}
	.clinic-card.active .name {
		width: 81%;
	}
}

@media screen and (max-width: 450px) {
	.countries {
		display: flex;
		width: 92%;
		margin: 0 auto;
		justify-content: space-around;
	}
	.lists {
		width: 100%;
		justify-content: space-around;
	}
	.lists li ~ li {
		padding-left: 0;
	}
	.lists li h3 {
		font-size: 1rem;
	}
}
