/* ==========================================================================
   forestable.kr — Editorial Design System
   디자인 패키지 styles.css를 forestable 헤리티지 토큰으로 매핑.
   forestable.css 다음에 로드되어 일부 클래스를 보강한다.
   ========================================================================== */

:root {
    /* Editorial 디자인 alias — forestable 헤리티지 토큰에 매핑 */
    --forest-deep: var(--pine);     /* #1a3a2e */
    --forest-dark: var(--moss);     /* #2d4a36 */
    --forest-mid:  var(--leaf);     /* #5a7a4f */
    --forest-soft: var(--sage);     /* #8da884 */
    --moss-soft:   #c9d4b5;
    --paper-warm:  #efe9d8;
    --gold-soft:   #c9a567;
    --ink-soft:    #5a4f42;
    --ink-mute:    #8a8275;
    --rose:        var(--terracotta); /* #c46d3a */
    --max-w:       1320px;
}

/* Pretendard + Gowun Batang 추가 로드 */
@import url('https://fonts.googleapis.com/css2?family=Gowun+Batang:wght@400;700&display=swap');
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css');

/* 본문 타이포 보강 (헤리티지 폰트 우선, Pretendard fallback) */
.ft-body {
    font-family: 'Pretendard Variable', Pretendard, 'IBM Plex Sans KR', system-ui, sans-serif;
    background: var(--paper);
    /* 한국어 단어 단위 줄바꿈 (글자 사이 끊김 방지).
       overflow-wrap 은 안전장치 — 한 단어가 컨테이너를 초과할 때만 끊김. */
    word-break: keep-all;
    overflow-wrap: break-word;
}
/* 한국어 줄바꿈 예외 — 표/코드 영역은 컬럼 너비에 맞춰 자유롭게 끊김 */
.ft-body table, .ft-body td, .ft-body th,
.ft-body code, .ft-body pre {
    word-break: break-word;
}

/* ============ Editorial Page Wrapper ============ */
.ed-page {
    position: relative;
    overflow: hidden;
    padding: 0 !important;
}
.ed-page::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(168,124,61,.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(45,74,54,.05) 0%, transparent 50%);
    pointer-events: none; z-index: 0;
}
.ed-page > section,
.ed-page > header { position: relative; z-index: 1; }

/* ============ Page Header ============ */
.ed-header {
    position: relative;
    padding: 80px 56px 60px;
    z-index: 5;
    max-width: var(--max-w);
    margin: 0 auto;
}
.ed-breadcrumb {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13px;
    color: var(--gold);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 18px;
}
.ed-header h1 {
    font-family: 'Noto Serif KR', serif;
    font-weight: 300;
    font-size: clamp(44px, 6.5vw, 88px);
    letter-spacing: -0.04em;
    color: var(--forest-deep);
    line-height: 1;
    margin: 0;
}
.ed-header h1 .accent {
    font-style: italic;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    color: var(--gold);
    font-size: 0.7em;
    vertical-align: 0.15em;
    margin-left: 8px;
}
.ed-header-line {
    margin-top: 36px;
    display: flex; align-items: center; gap: 18px;
    max-width: 600px;
}
.ed-header-line .line {
    flex: 1; height: 1px;
    background: linear-gradient(90deg, var(--forest-mid) 0%, transparent 100%);
}
.ed-header-line .label {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    color: var(--ink-soft);
    font-size: 14px;
    letter-spacing: 0.1em;
}

/* ============ Section ============ */
.ed-section {
    padding: 110px 56px;
    max-width: var(--max-w);
    margin: 0 auto;
    position: relative; z-index: 5;
}
.ed-section.dark {
    max-width: none;
    background: var(--forest-deep);
    color: var(--cream);
}
.ed-section.warm {
    max-width: none;
    background: var(--paper-warm);
}
.ed-section-inner {
    max-width: var(--max-w);
    margin: 0 auto;
}

.ed-tag {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.ed-tag::before {
    content: '';
    display: block;
    width: 36px; height: 1px;
    background: var(--gold);
}
.ed-section.dark .ed-tag { color: var(--gold-soft); }
.ed-section.dark .ed-tag::before { background: var(--gold-soft); }

.ed-title {
    font-family: 'Noto Serif KR', serif;
    font-weight: 400;
    font-size: clamp(32px, 4vw, 52px);
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--forest-deep);
    margin: 0 0 24px;
}
.ed-section.dark .ed-title { color: var(--cream); }

.ed-lede {
    font-size: 17px;
    line-height: 1.8;
    color: var(--ink-soft);
    max-width: 640px;
}
.ed-section.dark .ed-lede { color: rgba(245,241,232,0.7); }

.ed-section-head { margin-bottom: 64px; max-width: 720px; }
.ed-section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.ed-section-head.center .ed-tag { justify-content: center; }

/* ============ Buttons ============ */
/* `.ft-body a { color: var(--ft-brand-dark) }` 규칙(specificity 0,1,1)이
   `.ed-btn`의 글자색을 덮어 어두운 배경 위 글자가 보이지 않는 문제가 있어
   `.ft-body` 자손 셀렉터로 일괄 상향한다. */
.ft-body .ed-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-family: 'Pretendard Variable', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--forest-deep);
    color: var(--cream);
    border-radius: 0;
}
.ft-body .ed-btn:hover { background: var(--forest-dark); transform: translateY(-2px); color: var(--cream); text-decoration: none; }
.ft-body .ed-btn-outline {
    background: transparent;
    color: var(--forest-deep);
    border: 1px solid var(--forest-deep);
}
.ft-body .ed-btn-outline:hover { background: var(--forest-deep); color: var(--cream); }
.ft-body .ed-btn-gold { background: var(--gold); color: var(--cream); }
.ft-body .ed-btn-gold:hover { background: var(--forest-deep); color: var(--cream); }
.ed-btn-arrow::after { content: '→'; transition: transform 0.3s ease; }
.ed-btn-arrow:hover::after { transform: translateX(4px); }

/* ============ Cards ============ */
.ed-card {
    background: var(--cream);
    border: 1px solid rgba(45,74,54,0.12);
    padding: 32px 28px;
    transition: all 0.4s cubic-bezier(0.2,0.8,0.2,1);
    border-radius: 0;
}
.ed-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -20px rgba(26,46,34,0.2);
    border-color: var(--gold-soft);
}
.ed-card-num {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 14px;
    letter-spacing: 0.2em;
    color: var(--gold);
    margin-bottom: 18px;
}
.ed-card-title {
    font-family: 'Noto Serif KR', serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--forest-deep);
    letter-spacing: -0.025em;
    margin: 0 0 12px;
    line-height: 1.3;
}
.ed-card-desc {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--ink-soft);
}

/* ============ Tags / Badges ============ */
.ed-tag-pill {
    display: inline-block;
    font-size: 12px;
    padding: 4px 12px;
    background: var(--paper-warm);
    color: var(--forest-dark);
    border-radius: 100px;
    font-weight: 500;
    letter-spacing: -0.005em;
}
.ed-tag-pill.gold { background: rgba(168,124,61,0.15); color: var(--gold); }
.ed-tag-pill.green { background: rgba(74,107,80,0.12); color: var(--forest-dark); }
.ed-tag-pill.rose { background: rgba(184,92,74,0.12); color: var(--rose); }
.ed-tag-pill.outline {
    background: transparent;
    border: 1px solid currentColor;
    color: var(--ink-soft);
}

/* ============ Form Elements ============ */
.ed-form-row { margin-bottom: 28px; }
.ed-form-row.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.ed-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--forest-deep);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.ed-form-label .req { color: var(--rose); margin-left: 4px; }
.ed-form-input,
.ed-form-select,
.ed-form-textarea {
    width: 100%;
    padding: 14px 18px;
    font-family: 'Pretendard Variable', sans-serif;
    font-size: 15px;
    background: var(--cream);
    border: 1px solid rgba(45,74,54,0.18);
    color: var(--ink);
    transition: all 0.3s ease;
    letter-spacing: -0.005em;
    border-radius: 0;
}
.ed-form-input:focus,
.ed-form-select:focus,
.ed-form-textarea:focus {
    outline: none;
    border-color: var(--forest-deep);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(168,124,61,0.1);
}
.ed-form-textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.ed-form-help {
    font-size: 12px;
    color: var(--ink-mute);
    margin-top: 6px;
    font-style: italic;
}
.ed-form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--ink-soft);
    cursor: pointer;
    line-height: 1.6;
}
.ed-form-check input[type="checkbox"],
.ed-form-check input[type="radio"] {
    margin-top: 4px;
    accent-color: var(--forest-deep);
    width: 16px; height: 16px;
}

/* ============ Table ============ */
.ed-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.ed-tbl thead th {
    text-align: left;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 500;
    font-size: 14px;
    color: var(--gold);
    letter-spacing: 0.1em;
    padding: 16px 20px;
    border-bottom: 1.5px solid var(--forest-deep);
    text-transform: uppercase;
}
.ed-tbl tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid rgba(45,74,54,0.1);
    color: var(--ink);
    vertical-align: top;
}
.ed-tbl tbody tr:hover { background: var(--cream); }
.ed-tbl strong { color: var(--forest-deep); font-weight: 600; }

/* ============ Animations ============ */
@keyframes ed-riseIn {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ed-page > .ed-header > * { animation: ed-riseIn 0.9s ease-out backwards; }
.ed-page > .ed-header > .ed-breadcrumb { animation-delay: 0.1s; }
.ed-page > .ed-header > h1 { animation-delay: 0.25s; }
.ed-page > .ed-header > .ed-header-line { animation-delay: 0.4s; }

.ed-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.9s ease-out, transform 0.9s ease-out;
}
.ed-reveal.in { opacity: 1; transform: translateY(0); }
.ed-reveal-stagger > * {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.ed-reveal-stagger.in > * { opacity: 1; transform: translateY(0); }
.ed-reveal-stagger.in > *:nth-child(1) { transition-delay: 0.05s; }
.ed-reveal-stagger.in > *:nth-child(2) { transition-delay: 0.12s; }
.ed-reveal-stagger.in > *:nth-child(3) { transition-delay: 0.19s; }
.ed-reveal-stagger.in > *:nth-child(4) { transition-delay: 0.26s; }
.ed-reveal-stagger.in > *:nth-child(5) { transition-delay: 0.33s; }
.ed-reveal-stagger.in > *:nth-child(6) { transition-delay: 0.40s; }
.ed-reveal-stagger.in > *:nth-child(7) { transition-delay: 0.47s; }
.ed-reveal-stagger.in > *:nth-child(8) { transition-delay: 0.54s; }

/* ============ Decorative Flourish ============ */
.ed-flourish {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; margin: 48px 0;
}
.ed-flourish .line {
    height: 1px; width: 60px; background: var(--gold-soft);
}
.ed-flourish svg { width: 20px; height: 20px; opacity: 0.7; color: var(--gold); }

/* ============ Responsive ============ */
@media (max-width: 1024px) {
    .ed-section { padding: 80px 40px; }
    .ed-form-row.grid-2 { grid-template-columns: 1fr; gap: 0; }
    .ed-form-row.grid-2 > * { margin-bottom: 28px; }
}
@media (max-width: 640px) {
    .ed-header { padding: 56px 24px 36px; }
    .ed-section { padding: 64px 24px; }
    .ed-tbl { font-size: 13px; }
    .ed-tbl thead th, .ed-tbl tbody td { padding: 12px 14px; }
}
