/* =========================================================
   이숲치과 메인 페이지 (2026 리뉴얼)
   - 따뜻한 숲·자연 톤 / 원내 실제 사진 중심
   - 메인 페이지에서만 불러옵니다 (views/pages/index.php)
   ========================================================= */

:root {
    --es-forest: #0e473f;
    --es-green: #11827a;
    --es-leaf: #cfe6d8;
    --es-cream: #f7f3ec;
    --es-sand: #e9e1d2;
    --es-ink: #1c1c1c;
    --es-muted: #5c5a55;
    --es-line: #e3ddd1;
    --es-radius: 20px;
    --es-wrap: 1320px;
    --es-gutter: 24px;
}

/* ---------- 공통 ---------- */
.es-wrap { max-width: calc(var(--es-wrap) + var(--es-gutter) * 2); margin: 0 auto; padding: 0 var(--es-gutter); }
.es-sec { padding: 120px 0; }
.es-center { display: flex; justify-content: center; margin-top: 48px; }
.es-mo { display: none; }
.es-sec, .es-hero { word-break: keep-all; }

.es-head__eyebrow { font-size: 14px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--es-green); }
.es-head__title { margin-top: 12px; font-size: 44px; font-weight: 700; line-height: 1.32; letter-spacing: -.02em; color: var(--es-ink); }
.es-head__desc { margin-top: 16px; font-size: 18px; line-height: 1.7; color: var(--es-muted); }
.es-head--center { text-align: center; }

.es-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 56px; padding: 0 26px; border-radius: 999px;
    font-size: 16px; font-weight: 700; white-space: nowrap;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}
.es-btn:hover { transform: translateY(-2px); }
.es-btn--naver { background: #03C75A; color: #fff; box-shadow: 0 8px 22px rgba(3, 199, 90, .28); }
.es-btn--kakao { background: #FEE500; color: #191600; }
.es-btn--ghost { color: #fff; border: 1.5px solid rgba(255, 255, 255, .7); background: rgba(255, 255, 255, .06); }
.es-btn--ghost:hover { background: #fff; color: var(--es-forest); }
.es-btn--line { height: 52px; color: var(--es-forest); border: 1.5px solid var(--es-forest); }
.es-btn--line:hover { background: var(--es-forest); color: #fff; }

/* ---------- 히어로 ---------- */
.es-hero {
    position: relative; overflow: hidden; isolation: isolate;
    min-height: clamp(640px, 94vh, 940px);
    padding-top: var(--header-height, 100px);
    display: flex; align-items: center;
    background: var(--es-forest); color: #fff;
}
.es-hero__media { position: absolute; inset: 0; z-index: -2; }
.es-hero__img {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; animation: esHeroFade 21s infinite; transform: scale(1.04);
}
.es-hero__img:nth-child(1) { animation-delay: 0s; object-position: 50% 60%; }
.es-hero__img:nth-child(2) { animation-delay: 7s; object-position: 60% 40%; }
.es-hero__img:nth-child(3) { animation-delay: 14s; object-position: 50% 30%; }
@keyframes esHeroFade {
    0% { opacity: 0; transform: scale(1.06); }
    5% { opacity: 1; }
    33% { opacity: 1; }
    40% { opacity: 0; transform: scale(1); }
    100% { opacity: 0; }
}
.es-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background:
        linear-gradient(90deg, rgba(10, 52, 46, .88) 0%, rgba(10, 52, 46, .66) 38%, rgba(10, 52, 46, .18) 72%, rgba(10, 52, 46, .05) 100%),
        linear-gradient(0deg, rgba(10, 40, 36, .55) 0%, rgba(10, 40, 36, 0) 40%);
}
.es-hero__inner { width: 100%; padding-top: 56px; padding-bottom: 56px; }
.es-hero__eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    font-size: 15px; font-weight: 600; letter-spacing: .02em; color: var(--es-leaf);
}
.es-hero__eyebrow::before { content: ""; width: 28px; height: 1.5px; background: var(--es-leaf); }
.es-hero__title { margin-top: 20px; font-size: 72px; font-weight: 700; line-height: 1.18; letter-spacing: -.03em; }
.es-hero__title em { font-style: normal; color: var(--es-leaf); }
.es-hero__desc { margin-top: 24px; font-size: 20px; line-height: 1.75; color: rgba(255, 255, 255, .9); }
.es-hero__btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.es-hero__facts {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
    max-width: 760px; margin-top: 56px; border-radius: 16px; overflow: hidden;
    background: rgba(255, 255, 255, .18);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.es-hero__facts li { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; background: rgba(10, 52, 46, .35); }
.es-hero__facts strong { font-size: 17px; font-weight: 700; }
.es-hero__facts span { font-size: 14px; color: rgba(255, 255, 255, .8); }

@media (prefers-reduced-motion: reduce) {
    .es-hero__img { animation: none; }
    .es-hero__img:first-child { opacity: 1; }
}

/* ---------- 진료 안내 카드 ---------- */
.es-care { background: var(--es-cream); }
.es-care__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 56px; }
.es-care__card {
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: var(--es-radius); background: #fff;
    box-shadow: 0 1px 0 var(--es-line);
    transition: transform .3s ease, box-shadow .3s ease;
}
.es-care__card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(14, 71, 63, .12); }
.es-care__media { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; }
.es-care__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.es-care__card:hover .es-care__media img { transform: scale(1.05); }
.es-care__tag {
    position: absolute; left: 14px; top: 14px; padding: 6px 12px; border-radius: 999px;
    font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--es-forest);
    background: rgba(255, 255, 255, .92);
}
.es-care__body { display: flex; flex-direction: column; flex: 1; padding: 26px 24px 24px; }
.es-care__title { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.es-care__title a { font: inherit; color: var(--es-ink); }
.es-care__desc { margin-top: 10px; font-size: 15px; line-height: 1.7; color: var(--es-muted); }
.es-care__links { margin-top: auto; padding-top: 18px; border-top: 1px solid var(--es-line); margin-top: 20px; }
.es-care__links li + li { border-top: 1px dashed var(--es-line); }
.es-care__links a {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 11px 0; font-size: 15px; font-weight: 600; color: var(--es-forest);
}
.es-care__links i { font-size: 12px; opacity: .5; transition: transform .2s, opacity .2s; }
.es-care__links a:hover i { transform: translateX(4px); opacity: 1; }
.es-care__more {
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px 20px;
    margin-top: 28px; padding: 20px 24px; border-radius: 16px; background: #fff;
}
.es-care__more-label { font-size: 15px; font-weight: 700; color: var(--es-ink); }
.es-care__more ul { display: flex; flex-wrap: wrap; gap: 8px; }
.es-care__more a {
    display: inline-block; padding: 9px 16px; border-radius: 999px;
    font-size: 14px; font-weight: 600; color: var(--es-forest);
    background: var(--es-cream); transition: background .2s, color .2s;
}
.es-care__more a:hover { background: var(--es-forest); color: #fff; }

/* ---------- 의료진 ---------- */
.es-docs__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 56px; }
.es-doc {
    display: grid; grid-template-columns: 42% 1fr; overflow: hidden;
    border-radius: var(--es-radius); background: var(--es-cream);
}
.es-doc__photo { margin: 0; background: var(--es-sand); }
.es-doc__photo img { width: 100%; height: 100%; min-height: 100%; object-fit: cover; object-position: 50% 15%; display: block; }
.es-doc__body { padding: 36px 32px; }
.es-doc__major { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; background: var(--es-green); }
.es-doc__name { margin-top: 14px; font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.es-doc__name small { margin-left: 6px; font-size: 17px; font-weight: 600; color: var(--es-muted); }
.es-doc__line { margin-top: 12px; font-size: 17px; font-weight: 600; line-height: 1.55; color: var(--es-forest); }
.es-doc__creds { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.es-doc__creds li { position: relative; padding-left: 16px; font-size: 15px; line-height: 1.5; color: var(--es-ink); }
.es-doc__creds li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--es-green); }
.es-doc__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.es-doc__chips li { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #fff; color: var(--es-forest); border: 1px solid var(--es-line); }

/* ---------- 진료 철학 ---------- */
.es-philo { background: var(--es-forest); color: #fff; }
.es-philo__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.es-philo__photo { margin: 0; border-radius: var(--es-radius); overflow: hidden; aspect-ratio: 4 / 5; }
.es-philo__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 55% 50%; }
.es-philo .es-head__eyebrow { color: var(--es-leaf); }
.es-philo__title { margin-top: 12px; font-size: 44px; font-weight: 700; line-height: 1.3; letter-spacing: -.02em; }
.es-philo__title em { font-style: normal; color: var(--es-leaf); }
.es-philo__list { margin: 36px 0 40px; display: flex; flex-direction: column; }
.es-philo__list li { display: grid; grid-template-columns: 56px 1fr; gap: 8px; padding: 24px 0; border-top: 1px solid rgba(255, 255, 255, .16); }
.es-philo__list li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .16); }
.es-philo__num { font-size: 15px; font-weight: 700; color: var(--es-leaf); padding-top: 4px; }
.es-philo__list h3 { font-size: 21px; font-weight: 700; }
.es-philo__list p { margin-top: 8px; font-size: 16px; line-height: 1.75; color: rgba(255, 255, 255, .8); }
.es-philo .es-btn--line { color: #fff; border-color: rgba(255, 255, 255, .7); }
.es-philo .es-btn--line:hover { background: #fff; color: var(--es-forest); }

/* ---------- 실제 치료 사례 (기존 섹션 감싸기) ---------- */
.es-cases .no-mic { background: #fff; }

/* ---------- 공간 ---------- */
.es-space { background: var(--es-cream); overflow: hidden; }
.es-space__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.es-space__nav { display: flex; gap: 10px; }
.es-space__arrow {
    width: 52px; height: 52px; border-radius: 50%;
    border: 1.5px solid var(--es-forest); color: var(--es-forest); background: transparent;
    cursor: pointer; transition: background .2s, color .2s;
}
.es-space__arrow:hover { background: var(--es-forest); color: #fff; }
.es-space__track {
    display: flex; gap: 16px; margin-top: 48px;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    padding-inline: max(var(--es-gutter), calc((100vw - var(--es-wrap)) / 2));
    scroll-padding-inline: max(var(--es-gutter), calc((100vw - var(--es-wrap)) / 2));
    outline: none;
}
.es-space__track::-webkit-scrollbar { display: none; }
.es-space__item { flex: 0 0 clamp(280px, 38vw, 560px); scroll-snap-align: start; }
.es-space__item figure { margin: 0; position: relative; border-radius: var(--es-radius); overflow: hidden; aspect-ratio: 4 / 3; }
.es-space__item img { width: 100%; height: 100%; object-fit: cover; }
.es-space__item figcaption {
    position: absolute; left: 16px; bottom: 16px; padding: 8px 14px; border-radius: 999px;
    font-size: 14px; font-weight: 700; color: var(--es-forest); background: rgba(255, 255, 255, .92);
}

/* 메인 하단 상담 박스와 여백 */
.es-space + .no-cta, .es-space ~ .no-cta { padding-top: 0; background: var(--es-cream); }

/* ---------- 반응형 ---------- */
@media (max-width: 1199px) {
    .es-care__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .es-docs__list { grid-template-columns: 1fr; max-width: 760px; margin-left: auto; margin-right: auto; }
    .es-hero__title { font-size: 60px; }
}

@media (max-width: 1023px) {
    .es-sec { padding: 96px 0; }
    .es-philo__grid { grid-template-columns: 1fr; gap: 40px; }
    .es-philo__photo { aspect-ratio: 16 / 10; }
    .es-head__title, .es-philo__title { font-size: 36px; }
}

@media (max-width: 767px) {
    :root { --es-gutter: 20px; --es-radius: 16px; }
    .es-pc { display: none; }
    .es-mo { display: inline; }
    .es-sec { padding: 72px 0; }
    .es-head__title, .es-philo__title { font-size: 28px; }
    .es-head__desc { font-size: 16px; }

    .es-hero { min-height: auto; align-items: flex-end; }
    .es-hero::before {
        background: linear-gradient(0deg, rgba(10, 52, 46, .95) 0%, rgba(10, 52, 46, .78) 45%, rgba(10, 52, 46, .25) 100%);
    }
    .es-hero__inner { padding-top: 180px; padding-bottom: 36px; }
    .es-hero__eyebrow { font-size: 13px; }
    .es-hero__eyebrow::before { width: 18px; }
    .es-hero__title { font-size: 42px; }
    .es-hero__desc { font-size: 16px; margin-top: 16px; }
    .es-hero__btns { margin-top: 26px; display: grid; grid-template-columns: 1fr 1fr; }
    .es-hero__btns .es-btn { height: 52px; padding: 0 12px; font-size: 15px; }
    .es-hero__btns .es-btn--kakao { grid-column: 1 / -1; }
    .es-hero__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 28px; }
    .es-hero__facts li { padding: 14px 16px; }
    .es-hero__facts strong { font-size: 15px; }
    .es-hero__facts span { font-size: 13px; }

    .es-care__grid { grid-template-columns: 1fr; gap: 16px; margin-top: 36px; }
    .es-care__media { aspect-ratio: 16 / 10; }
    .es-care__body { padding: 22px 20px 18px; }
    .es-care__title { font-size: 22px; }
    .es-care__more { padding: 18px; }

    .es-docs__list { margin-top: 36px; gap: 20px; }
    .es-doc { grid-template-columns: 1fr; }
    .es-doc__photo { aspect-ratio: 4 / 4.2; }
    .es-doc__body { padding: 26px 22px 28px; }
    .es-doc__name { font-size: 26px; }

    .es-philo__list li { grid-template-columns: 40px 1fr; padding: 20px 0; }
    .es-philo__list h3 { font-size: 18px; }
    .es-philo__list p { font-size: 15px; }

    .es-space__nav { display: none; }
    .es-space__track { margin-top: 32px; gap: 12px; }
    .es-space__item { flex-basis: 82vw; }
}

/* 공간 슬라이드: PC 마우스 끌기 */
@media (hover: hover) and (pointer: fine) {
    .es-space__track { cursor: grab; user-select: none; }
    .es-space__track.is-dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; }
    .es-space__track img { pointer-events: none; }
}
