/* =========================
   Babdori App Header
========================= */

.babdori-app-header {
	position: relative;
	z-index: 10;

	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) 44px;
	align-items: center;

	width: 100%;
	min-height: 48px;

	padding: 6px 0;

	background: #fff;

	box-sizing: border-box;
}

/* =========================
   Header With Back Button
========================= */

.babdori-app-header.has-back
.babdori-app-header-left {
	grid-column: 1;
	grid-row: 1;
}

.babdori-app-header.has-back
.babdori-app-header-title {
	grid-column: 2;
	grid-row: 1;

	text-align: left;
}

.babdori-app-header.has-back
.babdori-app-header-right {
	grid-column: 3;
	grid-row: 1;
}

/* =========================
   Header Side
========================= */

.babdori-app-header-side {
	display: flex;
	align-items: center;

	width: 40px;
	height: 40px;
}

.babdori-app-header-left {
	justify-content: flex-start;
}

.babdori-app-header-right {
	justify-content: flex-end;
}


/* =========================
   Header Title
========================= */

.babdori-app-header-title {
	min-width: 0;

	margin: 0;

	color: #111827;

	font-size: 22px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: -0.035em;

	text-align: left;

	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}


/* =========================
   Back Button
========================= */

.babdori-app-header-back {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	flex: 0 0 auto;

	width: 40px;
	height: 40px;

	padding: 0;

	border: 0;
	border-radius: 50%;

	background: transparent;
	color: #334155;

	text-decoration: none;

	cursor: pointer;

	appearance: none;
	-webkit-appearance: none;
	-webkit-tap-highlight-color: transparent;
}

.babdori-app-header-back svg {
	display: block;

	width: 26px;
	height: 26px;

	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}


/* =========================
   Notification Button
========================= */

.babdori-app-header-notification {
	position: relative;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	flex: 0 0 auto;

	width: 44px;
	height: 44px;

	border-radius: 50%;

	background: transparent;
	color: #334155;

	text-decoration: none;

	cursor: pointer;

	-webkit-tap-highlight-color: transparent;
}

.babdori-app-header-notification svg {
	display: block;

	width: 32px;
	height: 32px;

	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}


/* =========================
   Hover / Focus
========================= */

.babdori-app-header-back:hover,
.babdori-app-header-notification:hover {
	background: #E9EEF5;
}

.babdori-app-header-back:focus-visible,
.babdori-app-header-notification:focus-visible {
	outline: none;

	box-shadow:
		0 0 0 3px
		rgba(37, 99, 235, 0.14);
}


/* =========================
   Notification Count
========================= */

.babdori-app-header-notification-count {
	position: absolute;

	top: 1px;
	right: -1px;

	display: inline-flex;
	align-items: center;
	justify-content: center;

	min-width: 24px;
	height: 24px;

	padding: 0 4px;

	border: 2px solid #F5F7F9;
	border-radius: 999px;

	background: #2563EB;
	color: #FFFFFF;

	font-size: 9px;
	font-weight: 800;
	line-height: 1;

	box-sizing: border-box;

	pointer-events: none;
}


/* =========================
   Main Page
   뒤로가기 없는 메인 페이지
========================= */

.babdori-app-header:not(.has-back)
.babdori-app-header-left {
	display: none;
}

.babdori-app-header:not(.has-back)
.babdori-app-header-title {
	grid-column: 1 / 3;
	grid-row: 1;
}

.babdori-app-header:not(.has-back)
.babdori-app-header-right {
	grid-column: 3;
	grid-row: 1;
}

/* =========================
   Sub Page
========================= */

.babdori-app-header.has-back
	.babdori-app-header-title {
	padding-left: 4px;
}


/* =========================
   Mobile
========================= */

@media (max-width: 480px) {

	.babdori-app-header {
		grid-template-columns:
			34px
			minmax(0, 1fr)
			34px;

		min-height: 44px;
		padding: 8px 0;
	}

	.babdori-app-header-side {
		width: 34px;
		height: 34px;
	}

	.babdori-app-header-back,
	.babdori-app-header-notification {
		width: 38px;
		height: 38px;
	}

	.babdori-app-header-back svg {
		width: 28px;
		height: 28px;
	}

	.babdori-app-header-notification svg {
		width: 28px;
		height: 28px;
	}

	.babdori-app-header-title {
		font-size: 21px;
	}

	.babdori-app-header-notification-count {
		top: -1px;
		right: -1px;

		min-width: 17px;
		height: 17px;

		font-size: 9px;
	}
}

/* =========================
   Android App Top Spacing
========================= */

@media (max-width: 480px) {

	body.babdori-android-app
	.babdori-app-header {
		padding-top: 20px;
	}
}

/* =========================
   Small Mobile
========================= */

@media (max-width: 360px) {

	.babdori-app-header-title {
		font-size: 21px;
	}

}

/* =========================
   Dark Mode
========================= */

@media (prefers-color-scheme: dark) {

	.babdori-app-header {
		background: #101013;
	}

	.babdori-app-header-title {
		color: #F4F4F5;
	}

	.babdori-app-header-back,
	.babdori-app-header-notification {
		color: #D4D4D8;
	}

	.babdori-app-header-back:hover,
	.babdori-app-header-notification:hover {
		background: #27272A;
		color: #FFFFFF;
	}

	.babdori-app-header-back:focus-visible,
	.babdori-app-header-notification:focus-visible {
		box-shadow:
			0 0 0 3px
			rgba(96, 165, 250, 0.20);
	}

	.babdori-app-header-notification-count {
		border-color: #101013;
		background: #3B82F6;
		color: #FFFFFF;
	}

}