@import (reference) "./index.less";
@import (reference) "./themes.less";
@import (reference) "../components/input/style/variables.less";
@import (reference) "../components/button/style/variables.less";

*,
*::before,
*::after {
	box-sizing: border-box;
}

::selection {
	background-color: var(--primary);
	color: var(--primary-contrast);
}

html {
	font: @font;
	font-feature-settings: @font-feature;
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

:lang(ja),
:lang(ko),
:lang(th),
:lang(zh) {
	font-style: normal;
}

:lang(ko) {
	word-break: keep-all;
}

body {
	color: var(--text-default);
	background-color: var(--bg-default);
	accent-color: var(--primary);
}

h1 {
	margin-block: 1em 0.5em;
	font-size: @font-size-h1;
	font-weight: @font-weight-bold;
}

h2 {
	margin-block: 1em 0.5em;
	font-size: @font-size-h2;
	font-weight: @font-weight-bold;
}

h3 {
	margin-block: 1em 0.5em;
	font-size: @font-size-h3;
	font-weight: @font-weight-bold;
}

h4 {
	margin-block: 1em 0.5em;
	font-size: @font-size-h4;
	font-weight: @font-weight-bold;
}

h5 {
	margin-block: 1em 0.5em;
	font-size: @font-size-h5;
	font-weight: @font-weight-bold;
}

h6 {
	margin-block: 1em 0.5em;
	font-size: @font-size-h6;
	font-weight: @font-weight-bold;
}

p {
	margin-block: 0 1em;
	font-size: @font-size-medium;
}

:where(ul, ol) {
	margin-block: 0 1em;
	padding-inline-start: 2em;

	& :where(ul, ol) {
		margin-block: 0;
	}
}

dl {
	margin-block: 0 1em;
}

dt {
	font-weight: @font-weight-bold;
}

dd {
	margin-block: 0;
	margin-inline: 0;
}

details summary {
	cursor: pointer;
}

a {
	display: inline-block;
}

a[href] {
	.outline();

	color: var(--primary);
	text-decoration: none;
	cursor: pointer;
	text-decoration-color: currentColor;

	&:hover,
	&:focus,
	&:active {
		color: var(--primary-hover);
		text-decoration: underline;
	}

	&:active {
		color: var(--primary-active);
	}
}

pre, code, kbd, samp, output {
	font-family: @font-family-monospace;
	font-size: @font-size-medium;
}

code, kbd {
	padding-block: 0.125em;
	padding-inline: 0.25em;
	background-color: var(--bg-secondary);
	border-radius: @border-radius-small;
	color: var(--text-default);
}

code {
	color: var(--purple-600);
}

.@{dark-mode-cls} {
	code {
		color: var(--purple-200);
	}
}

:root:not(@{selector}) {
	@media (prefers-color-scheme: dark) {
		code {
			color: var(--purple-200);
		}
	}

	@media (prefers-color-scheme: light) {
		code {
			color: var(--purple-600);
		}
	}
}

kbd {
	border: @border-width-medium @border-style var(--border-muted);
	border-block-end-width: @border-width-large;
}

s, strike {
	text-decoration: line-through;
}

address {
	margin-block: 0 1em;
	font-style: normal;
}

em, i, var {
	font-style: italic;
}

strong, b {
	font-weight: @font-weight-bold;
}

u {
	text-decoration: underline;
}

mark {
	background-color: Mark;
	color: MarkText;
}

abbr[title] {
	-webkit-text-decoration: underline currentColor dotted;
	text-decoration: underline currentColor dotted;
	cursor: help;
}

pre {
	margin-block: 0 1em;
	overscroll-behavior: contain;
	overflow: auto;
}

hr {
	display: block;
	margin-block: 0.5em;
	border: @border-width-medium @border-style var(--border-secondary);
	border-radius: @border-radius-medium;
	overflow: hidden;
}

fieldset {
	padding: 0.75em;
	margin-block: 0 1em;
	border: @border-width-medium @border-style var(--border-secondary);
	border-radius: @border-radius-medium;
}

fieldset legend {
	padding-inline: 0.25em;
	margin: 0;
	margin-inline-start: -0.25em;
	font-weight: @font-weight-bold;
}

input, textarea {
	font: inherit;
	line-height: inherit;
	margin: 0;
}

textarea {
	resize: block;
}

:where(input[type="submit"], input[type="reset"], input[type="button"], button):not([disabled], :disabled) {
	cursor: pointer;
}

[hidden] {
	display: none !important;
	visibility: hidden !important;
}
