/* ==========================================================================
   common.css — 더감로 사이트 디자인 시스템 & 공통 컴포넌트
   (토큰 / 리셋 / 레이아웃 / 헤더 / 드로어 / 푸터 / 버튼 / 애니메이션)
   ========================================================================== */

/* ---------- 1. 디자인 토큰 ---------- */
:root {
  /* 색상 (라이트) */
  --color-base: #fffffc;
  --color-contrast: #222222;
  --color-primary: #2e7d64;
  --color-secondary: #fffffe;
  --color-white: #ffffff;
  --color-step-1: #f5f5f5;
  --color-step-2: #eeeeee;
  --color-step-3: #e7e7e7;
  --color-step-4: #e0e0e0;
  --color-step-5: #d9d9d9;
  --color-step-6: #d3d3d3;
  --color-step-7: #bfbfbf;
  --color-step-8: #b4b4b4;
  --color-step-9: #a9a9a9;
  --color-step-10: #9e9e9e;
  --color-step-11: #949494;
  --color-step-12: #898989;
  --color-step-13: #7e7e7e;
  --color-step-14: #737373;
  --color-step-15: #696969;
  --color-step-16: #5e5e5e;
  --color-step-17: #535353;
  --color-step-18: #484848;
  --color-step-19: #3e3e3e;
  --color-step-20: #333333;

  /* 간격 (유동 clamp 스케일) */
  --space-10: clamp(0.25rem, 0.5rem + 0.5vw, 0.75rem);
  --space-20: clamp(0.5rem, 0.75rem + 0.8vw, 1.25rem);
  --space-30: clamp(0.75rem, 1rem + 1vw, 1.75rem);
  --space-40: clamp(1rem, 1.25rem + 1.2vw, 2.25rem);
  --space-50: clamp(1.5rem, 1.75rem + 1.5vw, 3rem);
  --space-60: clamp(2rem, 2.5rem + 2vw, 4rem);
  --space-70: clamp(2.5rem, 3rem + 3vw, 5rem);
  --space-80: 5.06rem;

  /* 폰트 크기 (유동) */
  --fs-xx-small: clamp(0.6rem, 0.6rem + ((1vw - 0.2rem) * 1), 0.6rem);
  --fs-x-small: clamp(0.7rem, 0.7rem + ((1vw - 0.2rem) * 1), 0.7rem);
  --fs-small: clamp(0.85rem, 0.85rem + ((1vw - 0.2rem) * 1), 0.85rem);
  --fs-medium: clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.125), 1rem);
  --fs-large: clamp(0.875rem, 0.875rem + ((1vw - 0.2rem) * 0.375), 1.25rem);
  --fs-x-large: clamp(0.984rem, 0.984rem + ((1vw - 0.2rem) * 0.516), 1.5rem);
  --fs-xx-large: clamp(1.146rem, 1.146rem + ((1vw - 0.2rem) * 0.654), 1.8rem);
  --fs-xxx-large: clamp(1.317rem, 1.317rem + ((1vw - 0.2rem) * 0.808), 2.125rem);
  --fs-xxxx-large: clamp(1.502rem, 1.502rem + ((1vw - 0.2rem) * 0.998), 2.5rem);
  --fs-m-huge: clamp(1.743rem, 1.743rem + ((1vw - 0.2rem) * 1.257), 3rem);
  --fs-x-huge: clamp(1.976rem, 1.976rem + ((1vw - 0.2rem) * 1.524), 3.5rem);
  --fs-xx-huge: clamp(2.2rem, 2.2rem + ((1vw - 0.2rem) * 1.8), 4rem);
  --fs-xxx-huge: clamp(2.629rem, 2.629rem + ((1vw - 0.2rem) * 2.371), 5rem);
  --fs-xxxx-huge: clamp(3.037rem, 3.037rem + ((1vw - 0.2rem) * 2.963), 6rem);
  --fs-giant: clamp(3.2rem, 3.2rem + ((1vw - 0.2rem) * 3.3), 6.5rem);
  --fs-x-giant: clamp(3.45rem, 3.45rem + ((1vw - 0.2rem) * 3.55), 7rem);
  --fs-xx-giant: clamp(3.7rem, 3.7rem + ((1vw - 0.2rem) * 3.8), 7.5rem);
  --fs-xxx-giant: clamp(3.95rem, 3.95rem + ((1vw - 0.2rem) * 4.05), 8rem);
  --fs-xxxx-giant: clamp(4.2rem, 4.2rem + ((1vw - 0.2rem) * 4.3), 8.5rem);

  /* 레이아웃 */
  --content-size: 1680px;
  --wide-size: 1920px;
  --root-pad-x: var(--space-60);

  /* 폰트 */
  --font-body: 'Roboto', 'NanumSquare', sans-serif;
}

html[data-theme-mode='dark'] {
  --color-base: #1e1e1e;
  --color-contrast: #cccccc;
  --color-primary: #32c19b;
  --color-secondary: #fffffe;
  --color-step-1: #1d1d1d;
  --color-step-2: #212121;
  --color-step-3: #252525;
  --color-step-4: #292929;
  --color-step-5: #373737;
  --color-step-6: #454545;
  --color-step-7: #515151;
  --color-step-8: #595959;
  --color-step-9: #616161;
  --color-step-10: #696969;
  --color-step-11: #717171;
  --color-step-12: #797979;
  --color-step-13: #828282;
  --color-step-14: #8a8a8a;
  --color-step-15: #929292;
  --color-step-16: #9a9a9a;
  --color-step-17: #a2a2a2;
  --color-step-18: #ababab;
  --color-step-19: #b3b3b3;
  --color-step-20: #bbbbbb;
}

/* ---------- 2. 리셋 & 베이스 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding-top: 76px;
  background-color: var(--color-base);
  color: var(--color-contrast);
  font-family: var(--font-body);
  font-size: var(--fs-medium);
  font-weight: 400;
  line-height: 1.6;
  word-break: keep-all;
  transition: background-color 0.3s ease, color 0.3s ease;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.25; overflow-wrap: break-word; }
hr { border: none; border-top: 1px solid var(--color-step-4); margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }

body { padding-left: 0; padding-right: 0; }
@media (max-width: 1280px) {
  body { --root-pad-x: min(5vw, var(--space-60)); }
}
@media (max-width: 780px) {
  body { --root-pad-x: min(5vw, var(--space-60)); }
}

/* 공통 컨테이너 (WP constrained 동일: 컨텐츠 1680px, 패딩 포함 중앙정렬) */
.container {
  max-width: calc(var(--content-size) + (var(--root-pad-x) * 2));
  margin-inline: auto;
  padding-inline: var(--root-pad-x);
  width: 100%;
}
/* container--wide는 하위 호환 표기로 유지 — 원본 constrained가 전부 1680px이므로 동일 동작 */
.container--wide { max-width: calc(var(--content-size) + (var(--root-pad-x) * 2)); }

.section { padding-block: var(--space-60); }

/* ---------- 3. 아이콘/유틸 ---------- */
.icon-sm { font-size: 1em; }
.text-center { text-align: center; }
.color-primary { color: var(--color-primary); }
.color-white { color: #fff; }
.hide-pc { display: revert; }
@media (min-width: 1281px) { .hide-pc { display: none !important; } }
@media (max-width: 1280px) { .hide-wide { display: none !important; } }
@media (max-width: 780px) { .hide-tablet { display: none !important; } }
@media (max-width: 480px) { .hide-mobile { display: none !important; } }
.only-mobile { display: none !important; }
@media (max-width: 780px) { .only-mobile { display: revert !important; } }

/* ---------- 4. 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.5em 1.2em;
  border-radius: 5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}
.btn .icon { font-size: 1.1em; }
.btn--primary { background-color: var(--color-primary); color: var(--color-secondary); }
.btn--base { background-color: var(--color-base); color: var(--color-contrast); }
.btn--light { background-color: #f9f9f9; color: #1c1c1c; border-radius: 3px; padding: 0.3rem 0.7rem; font-size: var(--fs-small); font-weight: 400; }
.btn--flat { padding: 0; border-radius: 0; }

/* 링크 카드 (이미지 커버 + hover 확대) */
.effect-link {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  cursor: pointer;
}
.effect-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.effect-link:hover img { transform: scale(1.05); }
.effect-link .effect-link__overlay {
  position: absolute;
  inset: 0;
  transition: background-color 0.3s ease;
}

/* ---------- 5. 데스크톱 헤더 (항상 흰 배경 고정) ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--color-base);
  color: var(--color-contrast);
  border-bottom: 1px solid var(--color-step-3);
  transition: box-shadow 0.3s ease;
}
.site-header.is-stuck {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.site-header__logo img { width: 150px; height: auto; }

/* 로고: 라이트 헤더/푸터에서는 검정, 드로어(다크)에서는 흰색 */
.drawer .drawer__top img {
  filter: brightness(0) invert(1);
}
html[data-theme-mode='dark'] .site-header .site-header__logo img,
html[data-theme-mode='dark'] .m-header .m-header__logo {
  filter: brightness(0) invert(1);
}

.site-nav {
  display: flex;
  justify-content: flex-end;
  gap: clamp(3rem, 3rem + 3vw, 7rem);
  font-size: clamp(0.901rem, 0.901rem + ((1vw - 0.2rem) * 0.449), 1.35rem);
}
.nav-item { position: relative; }
.nav-item__label {
  display: block;
  padding: var(--space-10) 0;
  font-weight: 700;
  white-space: nowrap;
  text-align: center;
  cursor: pointer;
}
.nav-item__label span {
  display: block;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}
.nav-item:hover .nav-item__label span,
.nav-item.is-current .nav-item__label span { border-bottom-color: var(--color-primary); }

/* 드롭다운 패널 */
.dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 8px);
  width: 500px;
  max-width: 100vw;
  padding-top: var(--space-10);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
  z-index: 110;
}
.nav-item:hover .dropdown,
.nav-item.is-open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.dropdown__panel {
  display: flex;
  border: 1px solid #0000001c;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 3px 3px -3px #00000033;
  background: var(--color-base);
}
.dropdown__links {
  flex: 0 0 160px;
  background-color: var(--color-base);
  padding-block: var(--space-10);
  display: flex;
  flex-direction: column;
}
.dropdown__links a {
  padding: var(--space-10) var(--space-30);
  font-size: var(--fs-medium);
  color: var(--color-contrast);
  transition: color 0.2s ease, background-color 0.2s ease;
}
.dropdown__links a:hover { color: var(--color-primary); }
.dropdown__banner {
  flex: 1;
  position: relative;
  min-height: 250px;
  overflow: hidden;
}
.dropdown__banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.dropdown__banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.45));
}
.dropdown__banner a {
  position: absolute;
  right: 1.2rem;
  bottom: 1rem;
  z-index: 1;
  color: #fff;
}
.dropdown__banner a svg { width: 3em; height: auto; transition: transform 0.25s ease; }
.dropdown__banner a:hover svg { transform: translateX(4px); }

.site-header__side { flex: 0 0 300px; display: flex; justify-content: flex-end; }

/* ---------- 6. 모바일 헤더 & 드로어 ---------- */
.m-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-20) var(--root-pad-x);
  background-color: var(--color-base);
  color: var(--color-contrast);
  border-bottom: 1px solid var(--color-step-3);
  height: 64px;
}
.m-header__logo img { width: 110px; height: auto; }
.m-header__menu-btn .icon { font-size: 2rem; }

@media (max-width: 1280px) {
  .site-header { display: none; }
  .m-header { display: flex; }
  body { padding-top: 64px; }
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: #000000cc;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s;
  z-index: 9998;
}
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 450px;
  max-width: 80vw;
  background-color: var(--color-base);
  color: var(--color-contrast);
  z-index: 9999;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding-block: var(--space-60);
  overflow-y: auto;
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }
body.drawer-open { overflow: hidden; }

.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-50) var(--space-40);
}
.drawer__top img { width: 123px; height: auto; }
.drawer__close .icon { font-size: 1.8rem; }

.theme-toggle { display: inline-flex; align-items: center; gap: 6px; }
.theme-toggle .icon { font-size: 1.2em; cursor: pointer; }
.theme-toggle .theme-toggle__dark { color: var(--color-primary); }
html[data-theme-mode='light'] .theme-toggle .theme-toggle__dark { display: none; }
html[data-theme-mode='dark'] .theme-toggle .theme-toggle__light { display: none; }

.drawer__menu { flex: 1; display: flex; flex-direction: column; padding-inline: var(--space-50); }
.drawer__menu hr { margin-block: var(--space-30); }

.accordion { border-bottom: 1px solid var(--color-step-3); }
.accordion__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding-block: var(--space-20);
  font-size: var(--fs-xx-large);
  font-weight: 600;
}
.accordion__summary .icon { font-size: var(--fs-xxx-large); transition: transform 0.3s ease; }
.accordion__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}
.accordion.is-open .accordion__summary .icon { transform: rotate(180deg); }
.accordion.is-open .accordion__panel { max-height: 600px; }
.accordion__links { display: flex; flex-direction: column; padding-bottom: var(--space-20); }
.accordion__links a {
  font-size: var(--fs-x-large);
  padding-block: 0.4em;
  color: var(--color-step-15);
}
.accordion__links a:hover { color: var(--color-primary); }

.drawer__footer { padding: var(--space-30) var(--space-50); }
.drawer__copyright { font-size: var(--fs-x-small); color: var(--color-step-12); margin-top: var(--space-30); }

/* ---------- 7. 푸터 (라이트 3열) ---------- */
.site-footer {
  background-color: var(--color-base);
  color: var(--color-contrast);
  border-top: 1px solid var(--color-step-3);
  padding-block: var(--space-70) var(--space-50);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.8fr 1.4fr;
  gap: var(--space-70);
}
.site-footer__brand img { width: 130px; height: auto; }
.site-footer__brand .theme-toggle { margin-top: var(--space-20); }
.site-footer .theme-toggle .icon { font-size: var(--fs-medium); }
.site-footer__sns { display: flex; gap: var(--space-20); margin-top: var(--space-30); }
.site-footer__sns a { width: 26px; height: 26px; color: var(--color-contrast); opacity: 0.8; transition: opacity 0.2s ease, color 0.2s ease; }
.site-footer__sns a:hover { opacity: 1; color: var(--color-primary); }
.site-footer__sns svg { width: 100%; height: 100%; fill: currentColor; }

.site-footer__menu { display: flex; flex-direction: column; gap: 0.8em; }
.site-footer__menu a {
  font-size: var(--fs-medium);
  font-weight: 700;
  color: var(--color-contrast);
  transition: color 0.2s ease;
}
.site-footer__menu a:hover { color: var(--color-primary); }
.site-footer__menu em {
  font-family: 'Roboto', sans-serif;
  font-style: normal;
  font-weight: 500;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-step-11);
  margin-left: 8px;
}

.site-footer__info { font-size: var(--fs-small); }
.site-footer__info p { color: var(--color-step-13); line-height: 1.8; }
.site-footer__info .divider { color: var(--color-step-11); margin-inline: 6px; }
.site-footer__copyright { color: var(--color-step-12); font-size: var(--fs-x-small); letter-spacing: 0.04em; }
.site-footer__topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-step-3);
  padding-bottom: var(--space-30);
  margin-bottom: var(--space-40);
}
.site-footer__topline img { width: 110px; height: auto; }

@media (max-width: 1024px) {
  .site-footer__grid { grid-template-columns: 1fr; gap: var(--space-50); }
}

/* ---------- 8. 캐러셀 ---------- */
.carousel { position: relative; overflow: hidden; }
.carousel__track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.35, 1);
  height: 100%;
}
.carousel__slide { flex: 0 0 100%; position: relative; height: 100%; }
.carousel__slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  border-radius: 100px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}
.carousel__arrow:hover { background-color: rgba(255, 255, 255, 0.15); }
.carousel__arrow .icon { font-size: 2rem; }
.carousel__arrow--prev { left: var(--space-30); }
.carousel__arrow--next { right: var(--space-30); }
.carousel__pagination {
  position: absolute;
  bottom: var(--space-30);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}
.carousel__bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #fffffc7a;
  transition: background-color 0.2s ease, width 0.2s ease;
}
.carousel__bullet.is-active { background-color: #fffffc; }

/* ---------- 9. 등장 애니메이션 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal--left { transform: translateX(-48px); }
.reveal--right { transform: translateX(48px); }
.reveal.is-visible { opacity: 1; transform: none; }

/* 마스크 텍스트 (단어가 아래에서 올라오는 애니메이션) */
.masktext { overflow: hidden; display: block; }
.masktext > span {
  display: block;
  transform: translateY(110%);
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}
.is-visible .masktext > span,
.masktext.is-visible > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .masktext > span { transition: none; transform: none; opacity: 1; }
}

/* ---------- 10. 폼 (온라인문의) ---------- */
.form-field { display: flex; flex-direction: column; gap: 0.4em; margin-bottom: var(--space-30); }
.form-field label { font-size: var(--fs-medium); font-weight: 700; }
.form-field .required { color: var(--color-primary); }
.form-field input,
.form-field textarea,
.form-field select {
  padding: 0.8em 1em;
  border: 1px solid var(--color-step-4);
  border-radius: 5px;
  background-color: var(--color-base);
  transition: border-color 0.2s ease;
}
.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus { outline: none; border-color: var(--color-primary); }
.form-note { font-size: var(--fs-small); color: var(--color-step-13); }

/* ---------- 11. 국/영문 병행 캡션 ---------- */
.en-kicker {
  font-family: 'Roboto', 'NanumSquare', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: var(--space-20);
}
.en-kicker--light { color: rgba(255, 255, 252, 0.85); }

.dropdown__links em,
.accordion__links em {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-step-11);
  margin-top: 2px;
}
.drawer__en,
.btn__en {
  font-family: 'Roboto', sans-serif;
  font-style: normal;
  font-size: 0.78em;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-left: 8px;
}
/* 본문 영문 요약 단락 */
.en-para {
  margin-top: 0.9em;
  font-family: 'Roboto', sans-serif;
  font-size: 0.9em;
  line-height: 1.65;
  color: var(--color-step-13);
}
/* 한글 제목 아래 영문 소제목 */
.en-title {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-size: 0.42em;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-step-13);
  margin-top: 0.5em;
  line-height: 1.4;
}
.en-title--primary { color: var(--color-primary); }

/* FAQ 한영 병기 */
.faq-q__text em {
  display: block;
  font-family: 'Roboto', sans-serif;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--color-step-12);
  margin-top: 3px;
}
.form-field label em {
  font-family: 'Roboto', sans-serif;
  font-style: normal;
  font-size: 0.75em;
  letter-spacing: 0.08em;
  color: var(--color-step-12);
  margin-left: 6px;
}

/* 컬러 배경 위 영문 요약 (밝은 색 지정) */
.en-para--light { color: rgba(255, 255, 252, 0.85); }
