/* ==========================================================================
   base.css — CSS 변수 · 리셋 · 기본 글자 스타일 · 접근성 공통
   - 모바일 우선: 기본값 = 모바일, 768px / 1024px 이상에서 덮어쓰기
   - 브레이크포인트(미디어 쿼리 안에는 변수를 못 써서 숫자로 적음)
       768px  : 태블릿 이상 (카드 2열, 푸터 2칸)
       1024px : PC (가로 메뉴, 플로팅 퀵바)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS 변수
   -------------------------------------------------------------------------- */
:root {
    /* 메인 색 */
    --color-primary: #245477;
    --color-primary-dark: #183b54;
    --color-button: #1878a8;          /* 흰 글자 대비 4.9:1 */
    --color-button-hover: #136591;    /* 마우스 오버 (시안에 없어 임시) */
    --color-accent: #22a2dd;          /* 선 · 점 장식 전용 (글자 · 버튼 금지) */
    --color-accent-on-dark: #7ccbef;  /* 어두운 배경 위 강조 글자 · 아이콘 */
    --color-point-warm: #ffa600;      /* S02 일러스트 포인트 전용 */
    --color-icon-gray: #828992;       /* 장식 아이콘 전용 (글자 금지) */

    /* 배경 */
    --bg-white: #ffffff;
    --bg-warm: #f7f6f3;
    --bg-cool: #edf1f5;
    --bg-primary-light: #eaf2f7;
    --bg-card-warm: #f2f0eb;
    --bg-footer: #0f2433;

    /* 글자 */
    --text-title: #15202b;
    --text-body: #2b3640;
    --text-sub: #5a6773;
    --text-on-dark: #ffffff;
    --text-on-dark-sub: #dce6ee;
    --text-footer: #b7c4cf;

    /* 선 */
    --line: #d9e0e7;

    /* 폰트 */
    --font-base: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
        system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

    /* 글자 크기 (모바일 기준, 1rem = 16px) */
    --fs-hero: 2.25rem;       /* 36px → PC 62px */
    --fs-sub-title: 1.75rem;  /* 28px → PC 44px */
    --fs-section: 1.625rem;   /* 26px → PC 38px  [모바일 값 임시, 서브 모바일 시안 때 확정] */
    --fs-card: 1.1875rem;     /* 19px → PC 21px */
    --fs-cta: 1.5rem;         /* 24px → PC 40px */
    --fs-body-lg: 1.0625rem;  /* 17px */
    --fs-body: 1rem;          /* 16px */
    --fs-small: 0.9375rem;    /* 15px */
    --fs-xs: 0.8125rem;       /* 13px */

    /* 줄 간격 */
    --lh-tight: 1.3;
    --lh-base: 1.7;

    /* 레이아웃 */
    --inner-max: 1200px;
    --inner-pad: 20px;            /* 좌우 여백 → 1024px 이상 40px */
    --section-space: 72px;        /* 섹션 위아래 → PC 112px */
    --cta-space: 56px;            /* CTA 띠 위아래 → PC 80px */
    --radius: 8px;                /* 카드 */
    --radius-btn: 6px;            /* 버튼 */

    /* 공통 영역 높이 */
    --header-h: 60px;             /* → PC 80px */
    --sub-visual-h: 200px;        /* → PC 280px */
    --location-h: 40px;           /* 현재 위치 띠 → PC 44px */
    --bottombar-h: 64px;          /* 모바일 하단 고정 바 */
    --tap-min: 44px;              /* 누르는 영역 최소 크기 */

    /* 쌓임 순서 */
    --z-header: 100;
    --z-quickbar: 90;
    --z-menu: 200;
    --z-skip: 300;

    /* 움직임 */
    --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
    --duration: 0.25s;

    /* 초점 표시 */
    --focus-color: var(--color-button);
}

@media (min-width: 768px) {
    :root {
        --fs-hero: 3rem;          /* 48px */
        --fs-sub-title: 2.25rem;  /* 36px */
        --fs-section: 2rem;       /* 32px */
        --fs-cta: 2rem;           /* 32px */
        --section-space: 88px;
    }
}

@media (min-width: 1024px) {
    :root {
        --fs-hero: 3.875rem;      /* 62px */
        --fs-sub-title: 2.75rem;  /* 44px */
        --fs-section: 2.375rem;   /* 38px */
        --fs-card: 1.3125rem;     /* 21px */
        --fs-cta: 2.5rem;         /* 40px */
        --inner-pad: 40px;
        --section-space: 112px;
        --cta-space: 80px;
        --header-h: 80px;
        --sub-visual-h: 280px;
        --location-h: 44px;
    }
}

/* --------------------------------------------------------------------------
   2. 리셋
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-padding-top: calc(var(--header-h) + 1px); /* 고정 헤더에 앵커 대상이 가려지지 않게 (섹션 위 여백은 섹션 padding으로) */
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd {
    margin: 0;
}

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

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

img,
video {
    height: auto;
}

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

button {
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

table {
    border-collapse: collapse;
    border-spacing: 0;
}

address {
    font-style: normal;
}

[hidden] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   3. 기본 글자 스타일
   -------------------------------------------------------------------------- */
body {
    font-family: var(--font-base);
    font-size: var(--fs-body);
    line-height: var(--lh-base);
    color: var(--text-body);
    background: var(--bg-white);
    word-break: keep-all;        /* 한글 단어 중간에서 줄바꿈하지 않기 */
    overflow-wrap: break-word;   /* 긴 URL 등은 넘치지 않게 */
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-title);
    font-weight: 700;
    line-height: var(--lh-tight);
    letter-spacing: -0.02em;
}

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

strong,
b {
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   4. 접근성 공통
   -------------------------------------------------------------------------- */

/* 키보드 초점 (마우스 클릭에는 표시 안 됨) */
:focus-visible {
    outline: 2px solid var(--focus-color);
    outline-offset: 2px;
}

/* 어두운 배경 영역에서는 밝은 초점 색 사용: 부모에 .is-dark */
.is-dark {
    --focus-color: var(--color-accent-on-dark);
}

/* 화면에서는 숨기고 스크린 리더에는 읽힘 (워드프레스 기본 클래스명과 같게) */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 본문 바로가기: Tab 키로 초점이 갈 때만 보임 (WCAG 2.4.1) */
.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: var(--z-skip);
    padding: 12px 20px;
    border-radius: var(--radius);
    background: var(--color-primary-dark);
    color: var(--text-on-dark);
    font-weight: 600;
    transform: translateY(-200%);
    transition: transform var(--duration) var(--ease);
}

.skip-link:focus {
    transform: translateY(0);
    outline-color: var(--color-accent-on-dark);
}

/* 페이지 안 이동(#링크)을 부드럽게: 움직임 줄이기 설정을 끈 사용자만 */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* 움직임 줄이기 설정을 켠 사용자 */
@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;
    }
}

/* --------------------------------------------------------------------------
   5. 공통 틀
   -------------------------------------------------------------------------- */

/* 가운데 정렬 상자 (최대 1200px + 좌우 여백) */
.cb-inner {
    width: 100%;
    max-width: calc(var(--inner-max) + var(--inner-pad) * 2);
    margin-inline: auto;
    padding-inline: var(--inner-pad);
}

/* 섹션 위아래 여백 + 배경 번갈아 */
.cb-section {
    padding-block: var(--section-space);
}

.cb-section.is-warm {
    background: var(--bg-warm);
}

/* 섹션 머리 (제목 + 설명) → 아래 내용과 간격 40px / PC 48px */
.cb-section-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    text-align: center;
}

/* 섹션 제목 (가운데 정렬, eyebrow 라벨 없음) */
.cb-section-title {
    font-size: var(--fs-section);
    line-height: 1.35;
    letter-spacing: -0.03em;
    text-align: center;
}

.cb-section-desc {
    max-width: 900px;
    margin: 0 auto;
    color: var(--text-sub);
    font-size: var(--fs-body);
    text-align: center;
}

@media (min-width: 768px) {
    .cb-section-desc {
        font-size: var(--fs-body-lg);
    }
}

@media (min-width: 1024px) {
    .cb-section-head {
        gap: 14px;
        margin-bottom: 48px;
    }
}
