﻿/* 한글 메인(mid_main.ascx) 캐러셀·안내 카드·피플광장. 2026-11-12 개편.
   LayerSlider 와 BS3 호환 클래스(new_main_*, btn-u)에 기대지 않고 hm- 접두어 클래스만 쓴다.
   전역 규칙 때문에 필요한 보정 (frame.css, welfare_find.css 와 같은 이유):
   - app.css 의 * { border-radius: 0 !important } 때문에 둥근 모서리는 !important 로 덮는다.
   - app.css/bs3-compat 의 a:hover(밑줄), a:focus { outline: 0 !important }, h1~h3·button 기본값을 이 범위 안에서 되돌린다.
   - custom.css 가 div, span, a 에 글꼴을 직접 지정하므로 .hm * 에서 글꼴을 물려받게 한다.
   캐러셀은 옛 디자인 그대로다: 문구 이미지·버튼·SNS 좌표는 960px 칸 기준, 높이 485px. */

.hm {
    --hm-ink: #26211f;
    --hm-ink-2: #6b625e;
    --hm-line: #e7e1de;
    --hm-sunken: #faf8f7;
    --hm-red: #ed1d24;
    --hm-red-strong: #c9151c;
    --hm-red-tint: #fdeeee;

    color: var(--hm-ink);
    font-family: "Nanum Gothic", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: break-word;
    text-align: left;
}
.hm *, .hm *::before, .hm *::after { box-sizing: border-box; font-family: inherit; }
.hm h2, .hm h3, .hm p, .hm ul { margin: 0; padding: 0; list-style: none; letter-spacing: 0; text-transform: none; text-shadow: none; }
.hm a, .hm a:hover, .hm a:focus { color: inherit; text-decoration: none; }
.hm button { font: inherit; color: inherit; cursor: pointer; }
.hm a:focus-visible, .hm button:focus-visible { outline: 3px solid var(--hm-red) !important; outline-offset: 2px; }
.hm img { display: block; max-width: 100%; }

/* ---------- 캐러셀 ---------- */
.hm-hero { position: relative; height: 485px; overflow: hidden; background-size: cover; background-position: center; }
.hm-hero.is-s1 { background-image: url(/ILP/assets/images/home/main_slider_01_bg_01_2026.png); }
.hm-hero.is-s2 { background-image: url(/ILP/assets/images/home/main_slider_02_bg_01_2018.png); }
.hm-hero.is-s3 { background: #eedfd2; }

.hm-slide { display: none; }
.hm-slide.is-active { display: block; }
.hm-slide-box { position: relative; width: 960px; height: 485px; margin: 0 auto; }
.hm-slide-box > * { position: absolute; }

.hm .hm-hero-btn { display: inline-block; padding: 10px 20px; font-size: 1.2em; font-weight: 700; letter-spacing: -.06em; line-height: 1.5; white-space: nowrap; border: 0; border-radius: 0 !important; }
.hm .hm-hero-btn:hover { text-decoration: none; }
.is-s1 .hm-hero-btn-1 { background: #4b6f01; color: #fff; }
.is-s1 .hm-hero-btn-1:hover { background: #355501; }
.is-s1 .hm-hero-btn-2 { background: #fff; color: #4b6f01; }
.is-s1 .hm-hero-btn-2:hover { color: #355501; }
.is-s2 .hm-hero-btn-1 { background: #934113; color: #fff; }
.is-s2 .hm-hero-btn-1:hover { background: #76290b; }
.is-s2 .hm-hero-btn-2 { background: #fff; color: #934113; }
.is-s2 .hm-hero-btn-2:hover { color: #76290b; }
.is-s3 .hm-hero-btn-1 { background: #cd3f15; color: #fff; }
.is-s3 .hm-hero-btn-1:hover { background: #c22c00; }
.is-s3 .hm-hero-btn-2 { background: #fff; color: #cd3f15; }
.is-s3 .hm-hero-btn-2:hover { color: #c22c00; }

.hm-sns { display: flex; gap: 7px; }
.hm-sns img { width: 38px; height: 38px; }

/* 이전/다음·시작/멈춤·점·타이머: 옛 LayerSlider(fullwidth 스킨)의 그림(skin.png)과 위치를 그대로 쓴다.
   이전/다음은 마우스를 올리면(키보드 초점이 가도) 보인다. 슬라이드(z-index 1) 위에 있어야 눌린다. */
.hm .hm-hero-nav, .hm .hm-hero-ctl, .hm .hm-hero-dot { padding: 0; border: 0; background: url(/ILP/assets/plugins/layer_slider/skins/fullwidth/skin.png) no-repeat; }
.hm .hm-hero-nav { position: absolute; top: 50%; margin-top: -20px; width: 40px; height: 40px; z-index: 5; opacity: 0; transition: opacity .2s; }
.hm .hm-hero-nav-prev { left: 10px; background-position: 0 0; }
.hm .hm-hero-nav-prev:hover { background-position: 0 -75px; }
.hm .hm-hero-nav-next { right: 10px; background-position: -150px 0; }
.hm .hm-hero-nav-next:hover { background-position: -150px -75px; }
.hm-hero:hover .hm-hero-nav, .hm .hm-hero-nav:focus-visible { opacity: 1; }
.hm-hero-bar { position: absolute; left: 0; right: 0; bottom: 10px; z-index: 5; display: flex; justify-content: center; }
.hm-hero-dots { display: flex; }
.hm .hm-hero-ctl, .hm .hm-hero-dot { position: relative; height: 20px; }
.hm .hm-hero-ctl::after, .hm .hm-hero-dot::after { content: ""; position: absolute; inset: -4px; }
.hm .hm-hero-ctl { width: 25px; }
.hm .hm-hero-dot { width: 20px; background-position: 0 -150px; }
.hm .hm-hero-dot[aria-current="true"], .hm .hm-hero-dot:hover { background-position: -75px -150px; }
.hm .hm-hero-play { background-position: -300px 0; }
.hm .hm-hero-play[aria-pressed="true"], .hm .hm-hero-play:hover { background-position: -300px -75px; }
.hm .hm-hero-pause { background-position: -450px 0; }
.hm .hm-hero-pause[aria-pressed="true"], .hm .hm-hero-pause:hover { background-position: -450px -75px; }
.hm-hero-timer { position: absolute; top: 10px; right: 10px; z-index: 5; width: 24px; height: 24px; opacity: .65; pointer-events: none; }
.hm-timer-ring { fill: none; stroke: #fff; stroke-width: 7.2; stroke-dasharray: 52.8; stroke-dashoffset: 52.8; transform: rotate(-90deg); transform-origin: 50% 50%; }
.hm-hero.is-timing .hm-timer-ring { animation: hm-timer var(--hm-interval, 6000ms) linear forwards; }
.hm-hero.is-holding .hm-timer-ring { animation-play-state: paused; }
.hm-hero.is-stopped .hm-hero-timer { display: none; }
@keyframes hm-timer { to { stroke-dashoffset: 0; } }

.hm-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 본문 ---------- */
.hm-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.hm-section { padding: 56px 0 0; }
.hm-section-last { padding-bottom: 88px; }
.hm-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.hm-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }

.hm-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--hm-line); border-radius: 16px !important; overflow: hidden; }
.hm-card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; }
.hm .hm-card-head h2 { font-size: 18px; font-weight: 800; line-height: 1.4; color: var(--hm-ink); }
.hm .hm-more { display: inline-flex; align-items: center; min-height: 32px; font-size: 13px; color: var(--hm-ink-2); }
.hm .hm-more:hover { color: var(--hm-ink); text-decoration: underline; }
.hm-card-body { flex: 1; padding: 14px 22px 20px; }
.hm-card-body-flush { padding: 0; }
.hm-card-foot { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 14px 12px 22px; color: var(--hm-ink-2); font-size: 13px; }
.hm-foot-btns { display: flex; gap: 4px; }
.hm .hm-step { width: 36px; height: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--hm-line); border-radius: 50% !important; background: #fff; }
.hm .hm-step:hover { border-color: var(--hm-ink); }

/* 공지·모금함·기부하기 한 장 */
.hm-page { display: none; }
.hm-page.is-active { display: block; }
.hm .hm-banner { display: block; }
.hm .hm-banner:hover h3 { text-decoration: underline; }
.hm-thumb { aspect-ratio: 16 / 9; border-radius: 10px !important; background: var(--hm-sunken); overflow: hidden; }
.hm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hm-thumb-empty { background: #f1ece9; }
.hm .hm-banner h3, .hm .hm-donate h3 { margin-top: 14px; font-size: 17px; line-height: 1.45; font-weight: 800; color: var(--hm-ink); }
.hm .hm-sub { margin-top: 6px; color: var(--hm-ink-2); font-size: 14px; }
.hm .hm-donate { display: block; }
.hm .hm-donate:hover h3 { text-decoration: underline; }
.hm-donate-art { aspect-ratio: 2 / 1; border-radius: 10px !important; overflow: hidden; background: var(--hm-red-tint); }
.hm-donate-art img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 피플광장 ---------- */
.hm-plaza-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.hm .hm-plaza-head h2 { font-size: 26px; font-weight: 800; line-height: 1.3; }
.hm .hm-plaza-head p { color: var(--hm-ink-2); font-size: 14px; }
.hm-p-list { padding: 6px 22px 8px; }
.hm .hm-p-item { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--hm-line); }
.hm .hm-p-item:last-child { border-bottom: 0; }
.hm .hm-p-item:hover h3 { text-decoration: underline; }
.hm-p-thumb { flex: none; width: 132px; aspect-ratio: 4 / 3; border-radius: 10px !important; background: #f1ece9; overflow: hidden; }
.hm-p-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hm .hm-p-item h3 { font-size: 16px; line-height: 1.45; font-weight: 800; color: var(--hm-ink); }
.hm .hm-p-item p { margin-top: 4px; color: var(--hm-ink-2); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.hm-m-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 16px 22px 18px; }
.hm .hm-m-item { display: block; }
.hm .hm-m-item:hover .hm-m-name { text-decoration: underline; }
.hm-m-photo { aspect-ratio: 3 / 4; border-radius: 10px !important; background: #f1ece9; overflow: hidden; }
.hm-m-photo img { width: 100%; height: 100%; object-fit: cover; }
.hm .hm-m-name { margin-top: 10px; font-size: 15px; font-weight: 800; line-height: 1.4; }
.hm .hm-m-meta { margin-top: 2px; font-size: 13px; color: var(--hm-ink-2); line-height: 1.5; }
.hm .hm-badge { display: inline-block; margin-left: 2px; padding: 0 8px; border-radius: 999px !important; font-size: 12px; font-weight: 700; line-height: 20px; vertical-align: 1px; }
.hm .hm-badge-child { background: #fdeeee; color: #c9151c; }
.hm .hm-badge-disabled { background: #eaf1fb; color: #1f4f99; }
.hm .hm-badge-dementia { background: #fff3dc; color: #7a5200; }
.hm .hm-badge-etc { background: #efeae7; color: #5a524e; }

/* 불러오는 중 뼈대, 비어 있음, 오류: 카드 안에 안내만 둔다 */
.hm-state { padding: 28px 22px; text-align: center; color: var(--hm-ink-2); font-size: 14px; }
.hm-state .hm-retry { margin-top: 10px; min-height: 36px; padding: 0 16px; border: 1px solid var(--hm-line); border-radius: 999px !important; background: #fff; font-size: 13px; }
.hm-skeleton { aspect-ratio: 16 / 9; border-radius: 10px !important; background: linear-gradient(90deg, #f1ece9 25%, #f8f5f3 50%, #f1ece9 75%); background-size: 200% 100%; animation: hm-shimmer 1.4s linear infinite; }
@keyframes hm-shimmer { to { background-position: -200% 0; } }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1023px) {
    .hm-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hm-grid-2 { grid-template-columns: minmax(0, 1fr); }
    .hm-grid-3 > .hm-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 959px) {
    .hm-hero { height: auto; min-height: 420px; }
    .hm-slide-box { width: 100%; height: auto; padding: 28px 20px 64px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
    .hm-slide-box > * { position: static; }
    .hm-slide-box .hm-deco { display: none; }
    .hm-slide-box .hm-hero-text img { max-width: 100%; height: auto; }
    .hm .hm-hero-btn { white-space: normal; font-size: 1.05em; }
    .hm-hero.is-s1 { background-position: 70% center; }
    .hm .hm-hero-nav { display: none; }
}
@media (max-width: 639px) {
    .hm-section { padding-top: 36px; }
    .hm-section-last { padding-bottom: 56px; }
    .hm-wrap { padding: 0 16px; }
    .hm-grid-3, .hm-grid-2 { gap: 16px; grid-template-columns: minmax(0, 1fr); }
    .hm-grid-3 > .hm-card:last-child:nth-child(odd) { grid-column: auto; }
    .hm-m-list { grid-template-columns: minmax(0, 1fr); }
    .hm .hm-m-item { display: flex; gap: 12px; align-items: flex-start; }
    .hm-m-photo { width: 72px; flex: none; }
    .hm-m-text { min-width: 0; }
    .hm .hm-m-name { margin-top: 0; }
    .hm-p-thumb { width: 96px; }
    .hm .hm-step { width: 44px; height: 44px; }
    .hm-plaza-head { display: block; }
    .hm .hm-plaza-head h2 { font-size: 22px; }
}
@media (prefers-reduced-motion: reduce) {
    .hm .hm-hero-nav { transition: none; }
    .hm .hm-hero-ctl, .hm-hero-timer { display: none; }
    .hm-skeleton { animation: none; }
}

/* ---------- 캐러셀 입장 움직임 (옛 LayerSlider 의 slidedirection/durationin 재현) ---------- */
@keyframes hm-in-left { from { opacity: 0; transform: translateX(-640px); } to { opacity: 1; transform: none; } }
@keyframes hm-in-right { from { opacity: 0; transform: translateX(640px); } to { opacity: 1; transform: none; } }
@keyframes hm-in-bottom { from { opacity: 0; transform: translateY(160px); } to { opacity: 1; transform: none; } }
@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
    .hm-slide.is-active .hm-hero-text, .hm-slide.is-active .hm-sns a { animation: hm-in-left var(--hm-d, 2.5s) cubic-bezier(.86, 0, .07, 1) both; }
    .hm-slide.is-active .hm-hero-btn { animation: hm-in-bottom var(--hm-d, 2.8s) cubic-bezier(.86, 0, .07, 1) both; }
    .hm-slide.is-active .hm-deco { animation: hm-in-right var(--hm-d, 1.5s) cubic-bezier(.86, 0, .07, 1) both; }
    .is-s1 .hm-hero-text:nth-child(1), .is-s3 .hm-hero-text:nth-child(3) { --hm-d: 2.5s; }
    .is-s1 .hm-hero-text:nth-child(2), .is-s3 .hm-hero-text:nth-child(4) { --hm-d: 2.7s; }
    .is-s2 .hm-hero-text:nth-child(1) { --hm-d: 1.5s; }
    .is-s2 .hm-hero-text:nth-child(2) { --hm-d: 1.7s; }
    .is-s1 .hm-hero-btn-1, .is-s3 .hm-hero-btn-1 { --hm-d: 2.8s; }
    .is-s1 .hm-hero-btn-2, .is-s3 .hm-hero-btn-2 { --hm-d: 3s; }
    .is-s2 .hm-hero-btn-1 { --hm-d: 1.8s; }
    .is-s2 .hm-hero-btn-2 { --hm-d: 2s; }
    .is-s3 .hm-deco:nth-child(2) { --hm-d: 2.2s; }
    .hm-slide.is-active .hm-sns a:nth-child(1) { --hm-d: 3.2s; }
    .hm-slide.is-active .hm-sns a:nth-child(2) { --hm-d: 3.6s; }
    .hm-slide.is-active .hm-sns a:nth-child(3) { --hm-d: 4s; }
}

/* ---------- 슬라이드 바뀔 때: 글·버튼 퇴장 -> 새 쪽 왼쪽에서 펼침 (JS 가 is-leaving / is-prev / is-wipe 를 붙인다) ---------- */
@keyframes hm-out-top { to { opacity: 0; transform: translateY(-200px); } }
@keyframes hm-out-bottom { to { opacity: 0; transform: translateY(200px); } }
@keyframes hm-wipe { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
    .hm-slide:nth-child(1) { background: url(/ILP/assets/images/home/main_slider_01_bg_01_2026.png) center / cover; }
    .hm-slide:nth-child(2) { background: url(/ILP/assets/images/home/main_slider_02_bg_01_2018.png) center / cover; }
    .hm-slide:nth-child(3) { background: #eedfd2; }
    .hm-slide.is-active { position: relative; z-index: 1; }
    .hm-slide.is-prev { display: block; position: absolute; top: 0; left: 0; right: 0; z-index: 0; }
    .hm-slide.is-prev .hm-slide-box > * { visibility: hidden; }
    .hm-slide.is-wipe { animation: hm-wipe .7s ease-in-out both; }
    .hm-slide.is-active.is-leaving .hm-hero-text { animation: hm-out-top .7s ease-in both; }
    .hm-slide.is-active.is-leaving .hm-hero-btn, .hm-slide.is-active.is-leaving .hm-sns, .hm-slide.is-active.is-leaving .hm-deco { animation: hm-out-bottom .7s ease-in both; }
}

/* 카드 쪽이 바뀔 때 오른쪽에서 살짝 들어온다(옛 carousel 의 가로 슬라이드). */
@keyframes hm-page-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
    .hm-page.is-active { animation: hm-page-in .4s ease-out; }
}
