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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  color: var(--gray-900);
  background: #fff;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

/* 메뉴(드로어)나 팝업이 열려 있는 동안 뒤 페이지가 스크롤되지 않게 — 열린 상태에서 바로 정해서 JS 가 따로 켜고 끄지 않는다 */
body:has(dialog[open], .drawer:not([hidden])) {
  overflow: hidden;
}

/* hidden 속성은 display 를 정한 클래스보다 항상 이긴다 */
[hidden] {
  display: none !important;
}

h1, h2, h3, p, ul, ol, dl, dd {
  margin: 0;
}

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

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

svg {
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

input {
  font: inherit;
}

:focus-visible {
  outline: 2px solid var(--green-600);
  outline-offset: 2px;
}

[id] {
  scroll-margin-top: calc(var(--gnb-h) + 8px);
}

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 200;
  padding: 12px 16px;
  background: var(--navy-900);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

.icon {
  flex: none;
}

/* 화면에는 안 보이고 화면 낭독기만 읽는 글자 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-green {
  color: var(--green-700);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  /* 길이만 줄이면 무한 반복 움직임은 깜빡이게 되므로 한 번만 돌게 한다 */
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
