/* Required styles to normalize default css */

@use "../variables";
@use "../colors";
@use "../helpers";
@use "../fonts";
@use "../screen-sizes";

@forward "../normalize";

:root {
	--db-breakpoint-xs: #{screen-sizes.$db-breakpoint-xs};
	--db-breakpoint-sm: #{screen-sizes.$db-breakpoint-sm};
	--db-breakpoint-md: #{screen-sizes.$db-breakpoint-md};
	--db-breakpoint-lg: #{screen-sizes.$db-breakpoint-lg};

	@extend %db-font-size-md;
}

// *! this is an opionionated (especially based on "enhancing" normalize.css) version of minireset.css v0.0.4 | MIT License | github.com/jgthms/minireset.css
html,
body {
	margin: 0;
	padding: 0;
}

/* stylelint-disable selector-max-id */
body,
#root,
#app {
	block-size: inherit;
}
/* stylelint-enable selector-max-id */

body {
	font-family: var(--db-font-family-sans);
}

// Box sizing
html {
	box-sizing: var(--db-box-sizing, border-box);
}

// global
* {
	/*
		we overwrite this for all elements to pass the correct sizes even for elements
		which have a default font-size/line-height set
	*/
	font-size: inherit;
	line-height: inherit;
	font-family: inherit;
}

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

// Make sure every elements has the current color from container above
body,
button,
input,
textarea,
summary,
select,
a {
	color: inherit;
}

// Media
img,
embed,
iframe,
object,
video {
	block-size: auto;
	max-inline-size: 100%;
}

// Iframe
iframe {
	border: 0;
}

// Focus styles
:is(
	a,
	button,
	input,
	textarea,
	summary,
	select,
	[tabindex]:not([tabindex="-1"])
) {
	&:focus-visible {
		@extend %focus-placeholder;
	}
}

// List style / https://marketingportal.extranet.deutschebahn.com/marketingportal/Marke-und-Design/Basiselemente/Typografie#Aufzaehlungszeichen-9693110
:where(ul) {
	padding-inline-start: variables.$db-spacing-fixed-md;
	/* stylelint-disable-next-line declaration-property-value-no-unknown, no-irregular-whitespace */
	list-style-type: "\2022"+ " ";

	li::marker {
		color: #{colors.$db-brand-origin-default};
	}
}

// * Individual styles
// Navigation lists
nav,
[role="navigation"] {
	ol,
	ul {
		list-style-type: "";
		margin: 0;
		padding: 0;
	}
}

// Block
fieldset {
	border: 0;
}

// details/summary box-sizing / https://kittygiraudel.com/2021/08/23/shadow-roots-and-inheritance/
details {
	> *,
	> ::before,
	> ::after {
		box-sizing: var(--db-box-sizing, border-box);
	}
}
