/**
 * CSS Reset for MGN-containers Design System
 * Современный CSS reset для нормализации стилей браузеров
 */

/* ========================================
   HTML & Body Reset
   ======================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  color: var(--color-gray-900);
  background-color: var(--color-gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography Reset
   ======================================== */

h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
dl, dd, ol, ul,
figure, hr,
fieldset, legend {
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
}

h1, h2, h3, h4, h5, h6 {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
}

h1 {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
}

h2 {
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

h3 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

h4 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

h5 {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
}

h6 {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

p {
  margin-top: 0;
  margin-bottom: var(--spacing-4);
}

small {
  font-size: var(--font-size-sm);
}

strong, b {
  font-weight: var(--font-weight-bold);
}

em, i {
  font-style: italic;
}

/* ========================================
   Links Reset
   ======================================== */

a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
  -webkit-text-decoration-skip: objects;
}

a:hover {
  text-decoration: underline;
}

a:active {
  outline: 0;
}

a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   Lists Reset
   ======================================== */

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ========================================
   Images Reset
   ======================================== */

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-style: none;
  vertical-align: middle;
}

svg {
  display: block;
  max-width: 100%;
}

/* ========================================
   Forms Reset
   ======================================== */

button,
input,
optgroup,
select,
textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

button,
input {
  overflow: visible;
}

button,
select {
  text-transform: none;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  padding: 0;
  border-style: none;
}

input[type="checkbox"],
input[type="radio"] {
  box-sizing: border-box;
  padding: 0;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
  -webkit-appearance: listbox;
}

textarea {
  overflow: auto;
  resize: vertical;
}

fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

legend {
  display: block;
  width: 100%;
  max-width: 100%;
  padding: 0;
  margin-bottom: var(--spacing-2);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  line-height: inherit;
  color: inherit;
  white-space: normal;
}

label {
  display: inline-block;
  margin-bottom: var(--spacing-2);
}

select {
  word-wrap: normal;
}

/* ========================================
   Tables Reset
   ======================================== */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin-bottom: var(--spacing-4);
}

caption {
  caption-side: bottom;
  text-align: left;
  padding: var(--spacing-2);
  color: var(--color-gray-500);
  font-size: var(--font-size-sm);
}

th,
td {
  padding: var(--table-cell-padding);
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--table-border-color);
}

thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--table-border-color);
  font-weight: var(--font-weight-semibold);
}

tbody tr:hover {
  background-color: var(--table-row-hover-bg);
}

/* ========================================
   Code Reset
   ======================================== */

code,
kbd,
pre,
samp {
  font-family: var(--font-family-mono);
  font-size: 1em;
}

code {
  padding: var(--spacing-1) var(--spacing-2);
  background-color: var(--color-gray-100);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
}

pre {
  display: block;
  padding: var(--spacing-4);
  margin: 0 0 var(--spacing-4);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--color-gray-900);
  background-color: var(--color-gray-100);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

pre code {
  padding: 0;
  font-size: inherit;
  color: inherit;
  background: none;
  border-radius: 0;
}

/* ========================================
   HR Reset
   ======================================== */

hr {
  height: 0;
  margin: var(--spacing-8) 0;
  border: 0;
  border-top: 1px solid var(--divider-color);
  box-sizing: content-box;
  overflow: visible;
}

/* ========================================
   Blockquote Reset
   ======================================== */

blockquote {
  margin: 0 0 var(--spacing-4);
  padding: var(--spacing-4) var(--spacing-6);
  border-left: 4px solid var(--color-primary);
  background-color: var(--color-gray-50);
  color: var(--color-gray-700);
}

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

/* ========================================
   Address Reset
   ======================================== */

address {
  margin-bottom: var(--spacing-4);
  font-style: normal;
  line-height: inherit;
}

/* ========================================
   Details & Summary Reset
   ======================================== */

details {
  display: block;
}

summary {
  display: list-item;
  cursor: pointer;
}

/* ========================================
   Iframe Reset
   ======================================== */

iframe {
  border: 0;
}

/* ========================================
   Figure & Figcaption Reset
   ======================================== */

figure {
  margin: 0 0 var(--spacing-4);
}

figcaption {
  margin-top: var(--spacing-2);
  margin-bottom: 0;
  font-size: var(--font-size-sm);
  color: var(--color-gray-500);
  text-align: center;
}

/* ========================================
   Abbr Reset
   ======================================== */

abbr[title],
abbr[data-original-title] {
  text-decoration: underline;
  text-decoration: underline dotted;
  cursor: help;
  border-bottom: 0;
}

/* ========================================
   Mark Reset
   ======================================== */

mark {
  padding: var(--spacing-1) var(--spacing-2);
  background-color: var(--color-warning);
  color: var(--color-gray-900);
}

/* ========================================
   Progress Reset
   ======================================== */

progress {
  display: inline-block;
  vertical-align: baseline;
}

/* ========================================
   Sub & Sup Reset
   ======================================== */

sub,
sup {
  position: relative;
  font-size: var(--font-size-xs);
  line-height: 0;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* ========================================
   Template Reset
   ======================================== */

[hidden],
template {
  display: none !important;
}

/* ========================================
   Focus Styles Reset
   ======================================== */

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

/* ========================================
   Selection Reset
   ======================================== */

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

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

/* ========================================
   Scrollbar Reset
   ======================================== */

::-webkit-scrollbar {
  width: var(--scrollbar-width);
  height: var(--scrollbar-width);
}

::-webkit-scrollbar-track {
  background: var(--scrollbar-track-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb-bg);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-bg-hover);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb-bg) var(--scrollbar-track-bg);
}
