/* Shared by the main site pages: base styles, header, menus, slider and footer.
   Three layouts: desktop above 1020px, tablet from 481px to 1020px, phone at 480px and under. */

* {
	box-sizing: border-box;
}

html,
body,
h1,
h2,
h3,
p,
ul {
	margin: 0;
	padding: 0;
}

html {
	scroll-padding-top: 150px;
}

body {
	background: #fff;
	color: #000;
	font-family: 'Noto Sans KR', sans-serif;
	-webkit-text-size-adjust: 100%;
}

body.is-locked {
	overflow: hidden;
}

/* Keeps hidden list rows hidden even when they have their own display rule. */
[hidden] {
	display: none !important;
}

ul {
	list-style: none;
}

a {
	color: inherit;
	text-decoration: none;
}

img {
	max-width: 100%;
	vertical-align: top;
}

button {
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

/* Header */
.header-bar {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 900;
	width: 100%;
	background: #fff;
}

.header-inner {
	position: relative;
	max-width: 1430px;
	height: 150px;
	margin: 0 auto;
	padding: 39px 15px 0;
}

/* Lines up with the right edge of the home page content. */
.header-social {
	position: absolute;
	top: 12px;
	right: max(15px, calc(50% - 651px));
	display: flex;
	gap: 10px;
}

.header-social a {
	display: block;
	transition: transform 0.2s ease;
}

.header-social img {
	display: block;
	width: 29px;
	height: 29px;
}

.header-social .header-login {
	height: 29px;
	padding: 0 14px;
	border: 1px solid #1d69a9;
	border-radius: 15px;
	color: #1d69a9;
	font-size: 14px;
	font-weight: 500;
	line-height: 27px;
	transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) {
	.header-social a:hover {
		transform: scale(1.1);
	}

	.header-social .header-login:hover {
		background: #1d69a9;
		color: #fff;
	}
}

/* Equal side columns keep the menu in the middle of the screen, with the logo on the left. */
.header-row {
	display: grid;
	grid-template-columns: minmax(253px, 1fr) minmax(0, 760px) minmax(0, 1fr);
	column-gap: 24px;
	align-items: center;
	height: 79px;
}

.site-logo {
	display: block;
	justify-self: start;
	padding-bottom: 6px;
}

.site-logo img {
	display: block;
	width: 253px;
	height: 77px;
	object-fit: contain;
}

.site-logo .logo-light {
	display: none;
}

.gnb ul {
	display: flex;
	justify-content: space-between;
}

.gnb li {
	position: relative;
	font-size: 23px;
	font-weight: 500;
	letter-spacing: -0.5px;
}

.gnb li.is-open {
	color: #1d69a9;
}

.gnb li.is-open::after {
	content: '';
	position: absolute;
	right: 0;
	bottom: -42px;
	left: 0;
	height: 6px;
	background: #1d69a9;
}

/* Tablets and phones only: on desktop the main menu is always on screen. */
.menu-button {
	display: none;
}

.menu-button svg {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible;
	fill: none;
	stroke: currentColor;
	stroke-width: 3;
}

/* While the menu is open, the three lines fold into an X. */
.menu-button path {
	transform-box: view-box;
	transform-origin: center;
	transition: transform 0.25s ease, opacity 0.2s ease;
}

.menu-button[aria-expanded='true'] path:nth-child(1) {
	transform: rotate(45deg) translateY(12px);
}

.menu-button[aria-expanded='true'] path:nth-child(2) {
	opacity: 0;
}

.menu-button[aria-expanded='true'] path:nth-child(3) {
	transform: rotate(-45deg) translateY(-12px);
}

/* Mega menu: opens under the header bar on hover */
.mega {
	position: relative;
	display: none;
	max-height: calc(100vh - 150px);
	overflow-y: auto;
	border-top: 2px solid #ededed;
}

.header-bar.is-open .mega {
	display: block;
}

.mega-panel {
	display: none;
	max-width: 1400px;
	margin: 20px auto 30px;
}

.mega-panel.is-open {
	display: flex;
}

.mega-title {
	margin: 40px 0 0 130px;
	color: #1d69a9;
	font-size: 20px;
	font-weight: 500;
	text-align: center;
}

.mega-title .material-symbols-outlined {
	display: block;
	margin-bottom: 5px;
	font-size: 110px;
	font-weight: 200;
}

.mega-list {
	min-width: 310px;
	min-height: 200px;
	margin-left: 40px;
	padding-left: 60px;
	border-right: 2px solid #ededed;
	border-left: 2px solid #ededed;
	font-size: 18px;
	font-weight: 500;
}

.mega-list li {
	height: 40px;
}

.mega-list a {
	display: flex;
	justify-content: space-between;
	padding-right: 25px;
}

.mega-list a:hover,
.mega-list a:focus,
.mega-sub a:hover,
.mega-sub a:focus {
	color: #1d69a9;
}

.mega-sub {
	padding-left: 60px;
	font-size: 18px;
	font-weight: 500;
}

.mega-sub ul {
	display: none;
}

.mega-sub ul.is-open {
	display: block;
}

.mega-sub li {
	height: 40px;
}

.mega-close {
	position: absolute;
	top: 20px;
	right: 17px;
	width: 35px;
	height: 35px;
	color: #bbb;
}

.mega-close .material-symbols-outlined {
	font-size: 35px;
}

/* Tablet and phone menu: a panel that grows out of the floating button, whose centre is the transform-origin.
   It stays laid out while it's closed, because an element can't animate in from display: none. */
.drawer {
	position: fixed;
	right: 16px;
	bottom: calc(28px + var(--menu-button) + env(safe-area-inset-bottom));
	z-index: 1000;
	display: none;
	width: min(320px, calc(100vw - 32px));
	max-height: calc(100vh - 56px - var(--menu-button));
	max-height: calc(100svh - 56px - var(--menu-button));
	overflow-y: auto;
	overscroll-behavior: contain;
	border-radius: 20px;
	background: #fff;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
	opacity: 0;
	transform: scale(0.1);
	transform-origin: calc(100% - var(--menu-button) / 2) calc(100% + 12px + var(--menu-button) / 2);
	visibility: hidden;
	transition: transform 0.2s ease-in, opacity 0.2s ease-in, visibility 0s 0.2s;
}

.drawer.is-open {
	opacity: 1;
	transform: none;
	visibility: visible;
	transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease-out, visibility 0s;
}

/* Dims the page behind the open menu. Tapping it closes the menu. */
.drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: 999;
	display: none;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	touch-action: none;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0s 0.2s;
}

.drawer-backdrop.is-open {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.2s ease, visibility 0s;
}

.drawer-name {
	display: block;
	padding: 14px 18px;
	color: #123d63;
	font-size: 18px;
	font-weight: 700;
}

.drawer summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	list-style: none;
}

.drawer summary::-webkit-details-marker {
	display: none;
}

.drawer-group > summary {
	padding: 10px 18px;
	border-top: 1px solid #dfdfdf;
	background: #f4f7f9;
	font-size: 17px;
}

.drawer-group > summary .material-symbols-outlined {
	color: #494949;
	font-size: 26px;
	font-weight: 300;
}

.drawer-group > ul a,
.drawer-group li > details > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 46px;
	padding: 0 18px;
	color: #474747;
	font-size: 16px;
	font-weight: 500;
}

.drawer-group li .material-symbols-outlined {
	color: #494949;
	font-size: 26px;
	font-weight: 300;
}

.drawer-group > ul summary a {
	flex: 1;
	padding: 0;
}

/* A bigger area to tap, beside the link */
.drawer-group > ul summary .material-symbols-outlined {
	padding: 10px 0 10px 20px;
}

.drawer-group > ul .drawer-third a {
	min-height: 36px;
	padding-left: 30px;
	font-size: 15px;
	font-weight: 400;
}

/* Slider */
.slider-track {
	display: flex;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.slider-track::-webkit-scrollbar {
	display: none;
}

.slider-track > * {
	flex: 0 0 100%;
	scroll-snap-align: start;
}

.pager {
	display: flex;
	justify-content: center;
	gap: 6px;
}

.pager button {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #ccc;
}

.pager button.is-active {
	background: #888;
}

/* Footer */
.site-footer {
	min-height: 199px;
}

.footer-inner {
	display: flex;
	gap: 39px;
	max-width: 1300px;
	margin: 0 auto;
	padding: 61px 0 0 52px;
}

.footer-logo {
	flex: none;
	width: 253px;
	height: 77px;
	object-fit: contain;
}

.footer-info {
	color: #282828;
	font-size: 17px;
	font-weight: 500;
	line-height: 27.2px;
}

.footer-links {
	display: flex;
	gap: 12px;
	margin-top: 6px;
	color: #8f8f8f;
	font-size: 13px;
	font-weight: 400;
	line-height: 20.8px;
}

@media (prefers-reduced-motion: reduce) {
	.menu-button path,
	.drawer,
	.drawer.is-open,
	.drawer-backdrop,
	.drawer-backdrop.is-open {
		transition: none;
	}
}

@media (max-width: 1020px) {
	:root {
		--menu-button: 52px;
	}

	html {
		scroll-padding-top: 0;
	}

	.drawer,
	.drawer-backdrop {
		display: block;
	}

	#site-header {
		min-height: 110px;
	}

	.site-header {
		position: relative;
		height: 110px;
	}

	.header-bar {
		position: static;
	}

	.header-inner {
		position: static;
		height: auto;
		padding: 0;
	}

	/* Level with the logo, with the login button straight after the Instagram icon. */
	.header-social {
		top: 41px;
		right: 15px;
		align-items: center;
		gap: 8px;
	}

	.header-social img {
		width: 34px;
		height: 34px;
	}

	.header-social .header-login {
		order: 1;
		height: 34px;
		border-radius: 17px;
		line-height: 32px;
	}

	.gnb,
	.mega {
		display: none;
	}

	.site-logo {
		position: absolute;
		top: 22px;
		left: 19px;
		padding: 0;
	}

	.site-logo img {
		width: 214px;
		height: 65px;
	}

	/* Floats over the page in the bottom corner, in reach of a thumb. It stays above the open menu to close it. */
	.menu-button {
		position: fixed;
		right: 16px;
		bottom: calc(16px + env(safe-area-inset-bottom));
		z-index: 1001;
		display: block;
		width: var(--menu-button);
		height: var(--menu-button);
		padding: 16px 13px;
		border-radius: 50%;
		background: #333;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
		color: #fff;
	}

	/* The extra room at the bottom keeps the links clear of the floating menu button. */
	.footer-inner {
		flex-direction: column;
		align-items: center;
		gap: 16px;
		padding: 40px 15px 84px;
		text-align: center;
	}

	.footer-logo {
		width: 214px;
		height: 65px;
	}

	.footer-info {
		font-size: 16px;
		line-height: 26px;
	}

	.footer-links {
		justify-content: center;
	}
}

@media (max-width: 480px) {
	:root {
		--menu-button: 48px;
	}

	#site-header {
		min-height: 116px;
	}

	.site-header {
		height: 116px;
	}

	.header-social {
		top: 42px;
		gap: 6px;
	}

	.header-social img {
		width: 30px;
		height: 30px;
	}

	.header-social .header-login {
		padding: 0 12px;
		font-size: 13px;
		white-space: nowrap;
	}

	.menu-button {
		padding: 14px 12px;
	}

	.site-logo {
		top: 25px;
		left: 15px;
	}

	/* Shrinks on the narrowest phones to stay clear of the icons beside it. */
	.site-logo img {
		width: min(214px, calc(100vw - 182px));
		height: auto;
	}

	.site-footer {
		min-height: 257px;
	}

	.footer-logo {
		width: 214px;
		height: 65px;
	}

	.footer-info {
		font-size: 15px;
		line-height: 24px;
	}
}
