/**
 * Base Styles - Reset and Typography
 *
 * @package EpicMarks
 */

/* ==========================================================================
   Modern CSS Reset
   ========================================================================== */

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

* {
	margin: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	-moz-tab-size: 4;
	tab-size: 4;
	scroll-behavior: smooth;
}

body {
	min-height: 100vh;
	line-height: var(--em-leading-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
	display: block;
	max-width: 100%;
	height: auto;
}

input,
button,
textarea,
select {
	font: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
	overflow-wrap: break-word;
}

/* Remove list styles on ul, ol elements with a list role */
ul[role="list"],
ol[role="list"] {
	list-style: none;
	padding: 0;
}

/* Set shorter line heights on headings and interactive elements */
h1,
h2,
h3,
h4,
button,
input,
label {
	line-height: var(--em-leading-tight);
}

/* Balance text wrapping on headings */
h1,
h2,
h3,
h4 {
	text-wrap: balance;
}

/* Make images easier to work with */
img,
picture {
	max-width: 100%;
	display: block;
}

/* Remove default button styles */
button {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
}

/* Remove all animations and transitions for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ==========================================================================
   Base Typography
   ========================================================================== */

body {
	font-family: var(--em-font-sans);
	font-size: var(--em-text-base);
	font-weight: var(--em-font-normal);
	color: var(--em-text-primary);
	background-color: var(--em-bg-primary);
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-weight: var(--em-font-bold);
	color: var(--em-text-primary);
	margin-bottom: var(--em-space-4);
}

h1 {
	font-size: var(--em-text-4xl);
	line-height: var(--em-leading-tight);
}

h2 {
	font-size: var(--em-text-3xl);
	line-height: var(--em-leading-tight);
}

h3 {
	font-size: var(--em-text-2xl);
	line-height: var(--em-leading-snug);
}

h4 {
	font-size: var(--em-text-xl);
	line-height: var(--em-leading-snug);
}

h5 {
	font-size: var(--em-text-lg);
	line-height: var(--em-leading-normal);
}

h6 {
	font-size: var(--em-text-base);
	line-height: var(--em-leading-normal);
}

p {
	margin-bottom: var(--em-space-4);
	line-height: var(--em-leading-relaxed);
}

/* Links */
a {
	color: var(--em-color-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	transition: color var(--em-duration) var(--em-ease);
}

a:hover {
	color: var(--em-color-primary);
}

a:focus-visible {
	outline: 2px solid var(--em-color-accent);
	outline-offset: 2px;
	border-radius: var(--em-radius-sm);
}

/* Lists */
ul,
ol {
	margin-bottom: var(--em-space-4);
	padding-left: var(--em-space-6);
}

li {
	margin-bottom: var(--em-space-2);
	line-height: var(--em-leading-relaxed);
}

/* Nested lists */
ul ul,
ol ol,
ul ol,
ol ul {
	margin-top: var(--em-space-2);
	margin-bottom: 0;
}

/* Description lists */
dl {
	margin-bottom: var(--em-space-4);
}

dt {
	font-weight: var(--em-font-semibold);
	margin-bottom: var(--em-space-1);
}

dd {
	margin-left: var(--em-space-4);
	margin-bottom: var(--em-space-2);
}

/* Blockquotes */
blockquote {
	margin: var(--em-space-4) 0;
	padding: var(--em-space-4) var(--em-space-6);
	border-left: 4px solid var(--em-color-accent);
	background-color: var(--em-bg-secondary);
	font-style: italic;
}

blockquote p:last-child {
	margin-bottom: 0;
}

/* Code */
code,
kbd,
samp,
pre {
	font-family: var(--em-font-mono);
	font-size: var(--em-text-sm);
}

code {
	background-color: var(--em-bg-secondary);
	padding: var(--em-space-1) var(--em-space-2);
	border-radius: var(--em-radius);
}

pre {
	background-color: var(--em-neutral-800);
	color: var(--em-neutral-100);
	padding: var(--em-space-4);
	border-radius: var(--em-radius-lg);
	overflow-x: auto;
	margin-bottom: var(--em-space-4);
}

pre code {
	background: none;
	padding: 0;
	color: inherit;
}

/* Horizontal rule */
hr {
	border: 0;
	border-top: 1px solid var(--em-border-color);
	margin: var(--em-space-8) 0;
}

/* Tables */
table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: var(--em-space-4);
}

th,
td {
	padding: var(--em-space-3) var(--em-space-4);
	text-align: left;
	border-bottom: 1px solid var(--em-border-color);
}

th {
	font-weight: var(--em-font-semibold);
	background-color: var(--em-bg-secondary);
}

/* Small text */
small {
	font-size: var(--em-text-sm);
	color: var(--em-text-secondary);
}

/* Strong and emphasis */
strong,
b {
	font-weight: var(--em-font-bold);
}

em,
i {
	font-style: italic;
}

/* Mark */
mark {
	background-color: #fef08a;
	padding: 0 var(--em-space-1);
	border-radius: var(--em-radius-sm);
}

/* ==========================================================================
   Selection Styles
   ========================================================================== */

::selection {
	background-color: var(--em-color-accent);
	color: var(--em-text-inverse);
}

/* ==========================================================================
   Focus Styles for Accessibility
   ========================================================================== */

:focus-visible {
	outline: 2px solid var(--em-color-accent);
	outline-offset: 2px;
}

/* Remove focus outline for mouse users */
:focus:not(:focus-visible) {
	outline: none;
}
