/*
 * public/ 정적 HTML용 공통 스타일 (토큰 → 리셋 → base → 약관 공통 순).
 * 여러 페이지가 함께 쓰는 스타일만 여기 두고, 한 페이지 전용 스타일은 각 HTML 에 둔다.
 * src/app/globals.css 의 @theme·@layer base 와 Tailwind preflight 를 옮긴 것으로,
 * 한쪽을 고치면 다른 쪽도 함께 고친다. 모바일 대응은 각 HTML 에서 한다.
 */

/* ===== variables ===== */
:root {
  /* 폰트 */
  --font-default: "Montserrat", "Pretendard", sans-serif;

  /* 색상 */
  --color-primary: #2d2864;
  --color-secondary: #6a41df;
  --color-tertiary: #b485ff;
  --color-offWhite: #f8f8f8;
  --color-softGray: #e6e6e6;
  --color-mediumGray: #999999;
  --color-slateGray: #67686c;
  --color-success: #21b497;
  --color-danger: #ff4a5f;
  --color-warning: #fe8248;
  --color-info: #2b324b;
  --color-secondary-bg: #f5f2ff;
  --color-primary-bg: #efedf8;
  --color-danger-bg: #ffe1e5;

  /* 그림자 */
  --shadow-default: 0 0 30px 0 rgb(0 0 0 / 0.2);

  /* 레이아웃 */
  --width-layout: 1440px;
}

/* ===== reset (Tailwind preflight 기준) ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: 0 solid;
}

html {
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  -webkit-tap-highlight-color: transparent;
}

body {
  line-height: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

b,
strong {
  font-weight: bolder;
}

ol,
ul,
menu {
  list-style: none;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  vertical-align: middle;
}

img,
video {
  max-width: 100%;
  height: auto;
}

button,
input,
select,
optgroup,
textarea {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  background-color: transparent;
  border-radius: 0;
}

button,
input:where([type="button"], [type="reset"], [type="submit"]) {
  appearance: button;
}

table {
  border-collapse: collapse;
  border-color: inherit;
  text-indent: 0;
}

[hidden]:where(:not([hidden="until-found"])) {
  display: none !important;
}

/* ===== base ===== */
body {
  font-family: var(--font-default);
  font-size: 16px;
  letter-spacing: -0.5px;
  color: #000;
  background-color: #fff;
  word-break: keep-all;
  overflow-wrap: break-word;
}

h1,
h2,
h3,
h4,
h5 {
  font-weight: 700;
}

strong,
b {
  font-weight: 600;
}

h1 {
  font-size: 36px;
}

h2 {
  font-size: 30px;
}

h3 {
  font-size: 24px;
}

h4 {
  font-size: 20px;
}

h5 {
  font-size: 18px;
}

:focus {
  outline: none;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

/* 화면에는 숨기고 스크린리더에만 읽히게 한다 */
.blind {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ===== table (globals.css 의 .table-default 와 같은 규칙) ===== */
.table-default {
  width: 100%;
  table-layout: fixed;
  border-top: 1px solid var(--color-softGray);
}

.table-default caption {
  position: absolute;
  left: -9999px;
}

.table-default th,
.table-default td {
  height: 48px;
  padding: 14px;
  border-right: 1px solid var(--color-softGray);
  border-bottom: 1px solid var(--color-softGray);
}

.table-default th:last-child,
.table-default td:last-child {
  border-right: 0;
}

.table-default th {
  background-color: var(--color-offWhite);
  font-weight: 600;
}

.table-default td {
  background-color: #fff;
}

/* ===== clause (약관 페이지: /html/clause/*.html) ===== */
/* 클래스명이 일반적이라 다른 정적 페이지와 겹치지 않도록 .clause 안으로 한정한다 */
.clause {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px;
}

.clause .clause-title {
  margin-bottom: 40px;
  text-align: center;
}

/* 조 */
.clause .article + .article {
  margin-top: 50px;
}

.clause .article-title {
  margin-bottom: 10px;
}

/* 항(①②…)·호(1. 2. …) — 번호는 고정 폭, 본문은 번호 오른쪽으로 줄바꿈 */
.clause .para,
.clause .items li {
  display: flex;
  gap: 4px;
}

.clause .num {
  flex-shrink: 0;
}

.clause .text {
  flex: 1;
}

/* 부칙 */
.clause .addenda {
  margin-top: 50px;
  padding-top: 50px;
  border-top: 1px solid var(--color-softGray);
}

.clause .addendum {
  text-align: center;
}

.clause .addendum + .addendum {
  margin-top: 50px;
}

.clause .addendum-title {
  margin-bottom: 10px;
  letter-spacing: 16px;
}

/* 테두리 상자 (유의사항·고객 확인 문안) */
.clause .box {
  padding: 30px;
  border: 1px solid var(--color-softGray);
}

.clause .box-list > li + li {
  margin-top: 20px;
}

.clause .box-title {
  margin-bottom: 4px;
  font-weight: 600;
}

/* 별첨 */
.clause .annex {
  margin-top: 50px;
  padding-top: 50px;
  border-top: 1px solid var(--color-softGray);
}

.clause .annex-title {
  margin-bottom: 10px;
  letter-spacing: 16px;
  text-align: center;
}

.clause .annex > .items > li + li {
  margin-top: 20px;
}

/* 장(제1장 …) 제목 */
.clause .chapter-title {
  margin: 60px 0 30px;
  text-align: center;
}

/* 구 사이트에서 일괄 이관한 본문. 조·항·호는 위 약관 공통 클래스를 쓰고, 원본 표·목록 서식만 여기서 맞춘다 */
.clause-body {
  line-height: 1.8;
}

.clause-body p + p,
.clause-body div + div,
.clause-body p + div,
.clause-body div + p {
  margin-top: 10px;
}

/* 안내 문단 뒤에 오는 소제목(1. 일반공모 개요 등) 구역도 조와 같은 간격을 둔다 */
.clause-body .article {
  margin-top: 50px;
}

/* 조·항·호로 구조화된 부분은 다른 약관 페이지처럼 문단 간격을 두지 않는다 */
.clause-body .article :is(p, div) + :is(p, div) {
  margin-top: 0;
}

.clause-body h3:not([class]),
.clause-body h4:not([class]),
.clause-body h5:not([class]) {
  margin: 40px 0 10px;
}

.clause-body > :first-child {
  margin-top: 0;
}

/* 원본 표는 빈 칸·열 너비가 제각각이라 고정 레이아웃 대신 내용 기준으로 너비를 잡는다 */
.clause-body table {
  margin: 20px 0;
  line-height: 1.5;
  table-layout: auto;
}

.clause-body ul:not(.items) {
  padding-left: 20px;
  list-style: disc;
}

/* 원본 번호 목록은 대부분 번호(1. 가. Ⅰ.)를 본문에 직접 적어 두어 자동 번호는 붙이지 않는다 */
.clause-body ol:not(.items) ol:not(.items),
.clause-body ul:not(.items) ol:not(.items) {
  padding-left: 20px;
}

.clause-body img,
.clause-body video {
  margin: 10px auto;
}

.clause-body a[href] {
  color: var(--color-secondary);
  text-decoration: underline;
}
