/* Styles to be used on every page */

:root {
	--pad-mb: 20px;
	--pad-dt: 30px;

	--button-primary-bg: #0073db; /* todo - ugly */
	--inverse-text: #fff;

	--text-contrast-fade: rgba(255, 255, 255, 0.7);
	--brand-light: #fec7da;

	--text-medium: #333333;

	--vibrant-blue: #4a46ff;
	--vibrant-purple: #431a43;

	--facebook-blue: #4267b2;
	--twitter-blue: #1da1f2;

	--bg-item: #fff;
}

.noselect {
	user-select: none;
}

/* This is important to enable for a. Otherwise there will be a 300ms delay
 * on link clicks as the browser waits for a possible double-tap. */
[role="button"],
a,
button,
input,
label,
select,
summary,
textarea {
	touch-action: manipulation;
}

[role="button"] {
	user-select: none;
	cursor: pointer;
}

body {
	overscroll-behavior-x: none;
	overscroll-behavior-y: none;
	transition: background-color 0.15s;
}

svg:not(:root) {
	overflow: hidden;
}

h1 {
	font-size: 1.6rem;
}
h2 {
	font-size: 1.4rem;
}
h3 {
	font-size: 1.25rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: 600;
	color: var(--text-b);
	line-height: 1.2;
	margin-bottom: 20px;
}

img {
	height: auto;
	max-width: 100%;
}

/* elements must be >0px size in order to work with lazyload */
img[loading="lazy"] {
	display: inline-block;
	min-height: 1px;
	min-width: 1px;
}

article {
	width: 100%; /* Not sure if needed */
	position: relative;
	margin-bottom: 15px;
}

.button-read-more,
.k-button,
.kus-button-container button {
	width: calc(100vw - var(--pad-mb) * 2);
	max-width: 360px;
	background-color: var(--button-primary-bg);
	color: var(--inverse-text);
	height: 38px;
	font-size: 1.25rem;
	line-height: 38px;
	text-align: center;
	border-radius: 8px;
	border: none;
	cursor: pointer;
}

.kus-button-container,
.kb-button-container {
	display: flex;
	place-items: center;
	margin-block: 40px;
	flex-direction: column;
	gap: 30px;
}

/* Header */

.header-container {
	position: relative;
	max-width: var(--max-w);
	padding: 0 20px;
	margin: auto;
}

.header-top {
	height: var(--header-h);
	display: grid;
	grid-template-columns: 56px auto 56px;
	overflow-y: hidden;
}

@media screen and (max-width: 480px) {
	/* bp-mobile */
	.w480 {
		display: none !important;
	}
}

.header-logo {
	grid-area: 1 / 1 / 2 / 2;
}

.header-nav {
	grid-area: 1 / 2 / 2 / 3;
}

.header-nav-item {
	display: inline-block;
	height: var(--header-h);
	margin-right: 13px;
	font-size: 1rem;
	letter-spacing: 0.6px;
	font-weight: 400;
	color: var(--text-contrast-fade);
	transition: color 0.2s;
}

.header-nav-item:hover {
	color: var(--text-contrast);
}

.header-nav-item div {
	height: 100%;
	display: flex;
	align-items: center;
}

/* TODO -- remove these */
.article-click-box {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 2;
}

/* SPA loading elements */

#loading_bar_container {
	position: absolute;
	bottom: -4px;
	height: 4px;
	background-color: var(--brand-light);
	border-top: var(--brand-light);
	width: 100vw;
	z-index: 100;
	box-sizing: content-box;
}

#loading_bar {
	position: absolute;
	left: 0;
	background-color: var(--brand);
	height: 4px;
	width: 0%;
}

#alert_pop {
	position: fixed;
	z-index: 101;
	bottom: 0;
	width: calc(100% - 40px);
	margin: 20px;
	padding: 15px;
	font-size: 1.25rem;
	border: 1px solid #fff;
	border-radius: 5px;
	box-sizing: border-box;
	color: var(--text-contrast);
	background-color: var(--brand);
	transition: opacity 1s;
}

.kus-button-container {
	width: calc(100% - var(--sidebar-width));
	margin-right: var(--sidebar-width);
}

/* These are absorbed by the SPA function */
.nav-links {
	display: none;
	content-visibility: hidden;
}

/* Suggestion box */

.suggestion-box {
	padding: 9px var(--body-pad);
	margin-inline: var(--section-pad);
}

.suggestion-box a {
	display: block;
	margin: calc(var(--body-pad) / 2 + 3px) 0;
	/* Double up the padding to align with other box content */
	padding: 0 var(--body-pad);
}

.card-box {
	background-color: var(--bg-item);
	transition: background-color 0.15s;
	box-shadow: 2px 2px 5px #00000011;
	border-radius: 5px;
	margin-top: 15px;
	margin-bottom: 30px;
}

@media screen and (max-width: 480px) {
	/* bp-mobile */
	.suggestion-box {
		width: 100%;
		margin-inline: 0;
	}

	.suggestion-box a {
		padding: 0 10px 10px;
	}

	.card-box {
		box-shadow: 0 2px 5px #00000011;
		border-radius: 0;
	}
}

/* Ads */

.vm-container,
.vm-ads-dynamic {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-block: 25px 20px;
}

.vm-container::before,
.vm-ads-dynamic::before {
	content: "Advertisement";
	text-align: center;
	font-size: 10px;
	position: absolute;
	top: -20px;
	color: #afafaf;
}
/* prevent the site looking broken if ad doesn't load */
.vm-ads-dynamic {
	/* Add solid square background image */
	background-image: linear-gradient(#ededed, #ededed);
	background-size: 300px 250px;
	background-position: center;
	background-repeat: no-repeat;
}

.vm-ads-dynamic.sticky-sidebar {
	background-size: 160px 300px;
	position: sticky;
	top: 80px; /* header + a bit of margin */
}

/* ensure lazyload ads can intersect */
.vm-ads-dynamic.lazyload {
	min-width: 1px;
	min-height: 1px;
}

.vmh-90 {
	min-height: 90px;
}
.vmh-100 {
	min-height: 100px;
}
.vmh-250 {
	min-height: 250px;
}
.vmh-600 {
	min-height: 600px;
}
.vmw-320 {
	min-width: 320px;
}

@media screen and (min-width: 1000px) {
	.vmh-d250 {
		min-height: 250px;
	}
	.vmw-d970 {
		min-width: 970px;
	}
}

/* Footer */

#sitemap_footer {
	width: 100%;
	background-color: #121416;
	transition: background-color 0.15s;
	color: var(--inverse-text);
	font-size: 1rem;
	padding: 20px 15px 40px;
}

#sitemap_footer h2 {
	color: var(--inverse-text);
}

.footer-container {
	max-width: 1125px;
	margin: auto;
	display: grid;
	grid-template-rows: auto auto;
	grid-template-columns: 50% 50%;
}

.footer-container a,
.footer-container .action-link {
	opacity: 0.6;
	transition: opacity 0.15s;
	cursor: pointer;
}
.footer-container a:hover,
.footer-container .action-link:hover {
	opacity: 1;
}

.footer-container li {
	margin-bottom: 15px;
}

#footer_artists_a {
	grid-area: 1 / 1 / 2 / 2;
}

#footer_artists_b {
	grid-area: 1 / 2 / 2 / 3;
	padding-top: 46px; /* align with artists_a */
}

#footer_sections {
	grid-area: 2 / 1 / 3 / 3;
}

#footer_sections ul {
	margin-bottom: 40px;
}

@media screen and (min-width: 480px) {
	/* bp-mobile */
	.footer-container {
		grid-template-columns: repeat(3, 1fr);
	}
	.footer-container li {
		margin-bottom: 10px;
	}

	#footer_artists_a {
		grid-area: 1 / 1 / 2 / 3;
	}

	#footer_artists_b {
		grid-area: 2 / 3 / 1 / 2;
	}

	#footer_sections {
		grid-area: 3 / 4 / 1 / 3;
	}
}

#scroll_top {
	cursor: pointer;
	position: fixed;
	bottom: 30px;
	right: 30px;
	background-color: #fd2870;
	border: 2px solid white;
	border-radius: 50%;
	height: 42px;
	width: 42px;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 2px 2px 5px #00000033;
	z-index: 10;
}

#scroll_top img {
	height: 66%;
	width: auto;
}

/* hotfix for silly ad */
#kba_video > span:empty,
[data-tag="Koreaboo_Video"] > span:empty {
	max-height: 360px;
}
#kba_video > span,
[data-tag="Koreaboo_Video"] > span {
	max-height: 480px;
	background-image: linear-gradient(#ededed, #ededed);
	background-size: 300px 250px;
	background-position: center;
	background-repeat: no-repeat;
}

.body-container:has(
		[data-tag="Koreaboo_Video"] > span > span[style*="position: fixed"]
	)
	~ #scroll_top {
	bottom: 260px;
}

/* fix wordpress */
.wp-video-shortcode video,
video.wp-video-shortcode {
	max-height: 70vh;
}

/* silly loader bug */
.post-article-spacer {
	height: 80px;
	/* 138px total, same as navigation buttons it replaces */
	margin: 29px auto;
	width: 100%;
	display: block;
	position: relative;
	z-index: 1;
	text-align: center;
	font-size: 56px;
	line-height: 42px;
	color: #c7dddf;
}

.post-article-container {
	padding: 0;
	font-size: 1rem;
}

.post-article-container h2 {
	font-size: 1.25rem;
	text-transform: uppercase;
	font-weight: 500;
	text-align: left;
	color: var(--text-caption);
	margin: 15px 0;
}

@media screen and (max-width: 480px) {
	/* bp-mobile */
	.post-article-container h2 {
		padding-left: 10px;
	}
}

.post-article-spacer .dot {
	display: inline-block;
	position: relative;
	width: 30px;
	vertical-align: bottom;
	animation: pulse;
	animation-duration: 3s;
	animation-iteration-count: infinite;
}

.post-article-spacer.active .dot.d2 {
	animation-delay: 1s;
}

.post-article-spacer.active .dot.d3 {
	animation-delay: 2s;
}

@keyframes pulse {
	0% {
		color: inherit;
	}
	15% {
		color: #000;
	}
	30% {
		color: inherit;
	}
}

.footer-notice {
	color: var(--text-caption);
	text-align: center;
	width: 100%;
	margin: 80px auto;
	font-size: 0.65rem;
}
