/* ============================================================
   공개(유저) 페이지 — theme.css 토큰 사용, 반응형(모바일 퍼스트)
   ============================================================ */

/* ---- 헤더 / 내비 ---- */
.site-header {
    position: sticky; top: 0; z-index: 30;
    background: rgba(247,244,238,.82);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-serif); font-size: 1.22rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.nav-toggle-btn { font-size: 1.5rem; line-height: 1; cursor: pointer; padding: .2rem .45rem; border-radius: var(--r-sm); color: var(--ink); }
.nav-toggle-btn:hover { background: rgba(0,0,0,.05); }
.site-nav { display: none; flex-direction: column; position: absolute; top: 62px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-md); }
.site-nav a { padding: .9rem 1.25rem; color: var(--ink-soft); border-top: 1px solid var(--line-soft); font-size: .96rem; }
.site-nav a:hover { color: var(--accent); background: var(--surface-2); }
.nav-toggle:checked ~ .site-nav { display: flex; }

/* ---- 히어로 ---- */
.hero {
    position: relative; text-align: center; color: #fff; overflow: hidden;
    padding: clamp(5rem, 10vw, 8rem) 1rem clamp(4.5rem, 8vw, 6.5rem);
    background:
        radial-gradient(1200px 440px at 50% -12%, rgba(199,180,144,.30), transparent 62%),
        linear-gradient(160deg, #35576b 0%, #22333f 55%, #182530 100%);
}
/* 은은한 격자 텍스처 */
.hero::before {
    content: ""; position: absolute; inset: 0; opacity: .6; pointer-events: none;
    background:
        repeating-linear-gradient(0deg, transparent 0 39px, rgba(255,255,255,.028) 39px 40px),
        repeating-linear-gradient(90deg, transparent 0 39px, rgba(255,255,255,.028) 39px 40px);
    -webkit-mask-image: radial-gradient(72% 72% at 50% 38%, #000, transparent);
            mask-image: radial-gradient(72% 72% at 50% 38%, #000, transparent);
}
.hero::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 72px;
    background: linear-gradient(180deg, transparent, var(--paper));
}
.hero > .container { position: relative; z-index: 1; }
.hero .flower-mark { color: var(--accent-soft); font-size: 2.1rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 2.9rem); margin: .2rem 0 .9rem; color: #fff; letter-spacing: -.02em; text-shadow: 0 2px 24px rgba(0,0,0,.28); }
.hero-rule { width: 54px; height: 1px; margin: 0 auto 1.5rem; background: linear-gradient(90deg, transparent, var(--accent-soft), transparent); }
.hero p { color: rgba(255,255,255,.84); margin: 0 auto 1.9rem; max-width: 36rem; font-size: 1.05rem; }
.hero .btn-accent { box-shadow: var(--shadow-md); }

/* ---- 섹션 ---- */
.section { padding: 3.5rem 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: 2.6rem; }
.section-head .flower-mark { font-size: 1.4rem; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 1.9rem); margin: 0; }
.section-head .sub { color: var(--muted); margin: .55rem 0 0; font-size: .95rem; letter-spacing: .01em; }
.section-head h2::after { content: ""; display: block; width: 56px; height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent); margin: .85rem auto 0; border-radius: 2px; }
.section > .container > p { color: var(--ink-soft); }
.lead { font-size: 1.05rem; max-width: 52rem; margin: 0 auto; text-align: center; color: var(--ink-soft); }

/* ---- 빈소 현황 카드 ---- */
.funeral-list { display: grid; grid-template-columns: 1fr; gap: 1.4rem; }
.funeral-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .2s ease; }
.funeral-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.funeral-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 3px; background: var(--line); }
.funeral-gallery img { width: 100%; height: 240px; object-fit: cover; display: block; }
/* 사진이 1장일 때는 가로 전체를 채워 크게 보이도록 */
.funeral-gallery img:only-child { height: 300px; }
.funeral-gallery.empty-cover { background: linear-gradient(135deg, #e9e4da, #f3efe7); height: 200px; display: flex; align-items: center; justify-content: center; }
.funeral-gallery.empty-cover span { color: var(--accent); font-size: 2rem; }
.funeral-body { padding: 1.25rem 1.3rem 1.4rem; }
.room-badge { display: inline-block; background: var(--primary); color: #fff; font-size: .78rem; font-weight: 600; padding: .22rem .7rem; border-radius: 999px; letter-spacing: .02em; }
.funeral-body h3 { margin: .7rem 0 .9rem; font-size: 1.35rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.funeral-body h3 small { font-family: var(--font-sans); color: var(--muted); font-size: .82rem; font-weight: 400; }
.funeral-info { margin: 0; display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line-soft); }
.funeral-info > div { display: flex; gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--line-soft); }
.funeral-info > div:last-child { border-bottom: 0; }
.funeral-info dt { width: 3.4rem; flex: none; color: var(--muted); margin: 0; font-size: .9rem; }
.funeral-info dd { margin: 0; color: var(--ink); }

.empty-box { text-align: center; padding: 3.5rem 1rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--accent-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.empty-box .flower-mark { font-size: 2.2rem; }

/* ---- 빈소 현황 표 ---- */
.status-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); background: var(--surface); }
.status-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.status-table thead th {
    background: linear-gradient(180deg, #f3f0e9, #ebe6db); color: var(--primary-d);
    font-family: var(--font-sans); font-weight: 700; font-size: .92rem;
    padding: 1rem .9rem; text-align: center; white-space: nowrap; letter-spacing: .01em;
    border-bottom: 2px solid var(--accent-soft); border-right: 1px solid var(--line);
}
.status-table thead th:last-child { border-right: 0; }
.status-table td { padding: 1.05rem .9rem; text-align: center; vertical-align: middle; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); color: var(--ink); }
.status-table td:last-child { border-right: 0; }
.status-table tbody tr:last-child td { border-bottom: 0; }
.status-table tbody tr { transition: background .15s ease; }
.status-table tbody tr:nth-child(even) { background: var(--surface-2); }
.status-table tbody tr:hover { background: #fbf6ec; }
.status-table .col-room { font-weight: 600; white-space: nowrap; }
.status-table .deceased { font-weight: 600; }
.status-table .col-mourner { text-align: left; white-space: pre-line; line-height: 1.75; min-width: 220px; }
.status-table .col-date { white-space: nowrap; color: var(--ink-soft); font-size: .95rem; }

/* ---- 사진 갤러리 (소개 / 시설) ---- */
.photo-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; margin-top: 1.8rem; }
.photo-grid figure { margin: 0; border-radius: var(--r-md); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .2s ease; }
.photo-grid figure:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.photo-grid img { width: 100%; height: 220px; object-fit: cover; display: block; transition: transform .4s ease; }
.photo-grid figure:hover img { transform: scale(1.05); }
.photo-grid figcaption { padding: .7rem .9rem; font-size: .9rem; color: var(--ink-soft); }
@media (min-width: 600px) { .photo-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .photo-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- 이용안내 ---- */
.guide-steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
.guide-steps li { counter-increment: step; position: relative; padding: 1.2rem 1.3rem 1.2rem 3.8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .2s ease; }
.guide-steps li:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.guide-steps li::before { content: counter(step); position: absolute; left: 1.05rem; top: 1.15rem; width: 2rem; height: 2rem; display: flex; align-items: center; justify-content: center; background: linear-gradient(180deg, #37576b, var(--primary)); color: #fff; border-radius: 50%; font-family: var(--font-serif); font-weight: 700; font-size: .95rem; box-shadow: 0 4px 10px rgba(47,72,88,.25); }
.guide-steps b { color: var(--ink); }

/* ---- 빈소 소개 (호실별 블록) ---- */
.room-blocks { display: grid; gap: 2.8rem; }
.room-title { font-size: 1.35rem; color: var(--primary-d); margin: 0 0 1.1rem; padding-left: .7rem; border-left: 4px solid var(--accent); line-height: 1.35; }
.room-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 1.3rem; }
.room-photos img { width: 100%; height: 225px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow-sm); display: block; transition: transform .2s ease, box-shadow .2s ease; }
.room-photos img:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.room-photos--empty { display: flex; align-items: center; justify-content: center; height: 180px; background: linear-gradient(135deg, #e9e4da, #f3efe7); border: 1px solid var(--line); border-radius: var(--r-md); }
.room-photos--empty .flower-mark { color: var(--accent); font-size: 2rem; }
/* 규격 표 (위치/평형/빈소/구성) */
.room-spec { display: grid; grid-template-columns: 1fr; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.room-spec .spec-row { display: flex; background: var(--surface); }
.room-spec dt { flex: 0 0 5.5rem; margin: 0; background: #e9eff5; color: var(--primary-d); font-weight: 600; font-size: .92rem; display: flex; align-items: center; justify-content: center; text-align: center; padding: .9rem .6rem; border-right: 1px solid var(--line); }
.room-spec dd { flex: 1; margin: 0; padding: .9rem 1.1rem; display: flex; align-items: center; color: var(--ink); font-size: .96rem; line-height: 1.6; }
@media (min-width: 720px) {
    .room-spec { grid-template-columns: 1fr 1fr; }
    .room-spec dt { flex-basis: 6.5rem; }
}

/* ---- 안내 박스 (주차 등) ---- */
.notice-box { margin-top: 1.6rem; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-md); padding: 1.1rem 1.35rem 1.25rem; box-shadow: var(--shadow-sm); }
.notice-box .notice-title { margin: 0 0 .55rem; font-weight: 700; color: var(--primary-d); font-size: 1.02rem; }
.notice-box p { margin: .3rem 0 0; color: var(--ink-soft); font-size: .96rem; line-height: 1.7; }
.notice-box .free { color: var(--accent-d); font-weight: 600; }

/* ---- 요금표 ---- */
.price-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.price-table th, .price-table td { padding: .85rem .9rem; text-align: left; border-bottom: 1px solid var(--line-soft); }
.price-table thead th { background: linear-gradient(180deg, #37576b, var(--primary)); color: #fff; font-family: var(--font-sans); font-weight: 600; font-size: .9rem; letter-spacing: .01em; }
.price-table tbody tr:last-child td { border-bottom: 0; }
.price-table tbody tr:nth-child(even) { background: var(--surface-2); }

/* ---- 오시는길 ---- */
.contact-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.contact-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm); transition: transform .15s ease, box-shadow .2s ease; }
.contact-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.contact-item .label { color: var(--accent); font-size: .78rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; margin-bottom: .35rem; }
.contact-item .value { font-size: 1.1rem; font-weight: 600; color: var(--primary-d); }
/* ---- 지도(네이버) 위치 카드 ---- */
.map-card {
    display: block; margin-top: 1.2rem; text-decoration: none; color: var(--ink);
    border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
    background: var(--surface); box-shadow: var(--shadow-sm);
    transition: transform .15s ease, box-shadow .2s ease;
}
.map-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.map-card-visual {
    position: relative; height: 170px; display: flex; align-items: center; justify-content: center;
    background:
        linear-gradient(0deg, rgba(3,199,90,.06), rgba(3,199,90,.06)),
        repeating-linear-gradient(0deg, transparent 0 23px, rgba(47,72,88,.07) 23px 24px),
        repeating-linear-gradient(90deg, transparent 0 23px, rgba(47,72,88,.07) 23px 24px),
        linear-gradient(135deg, #eef4f0, #e6efe9);
}
/* 지도 위 가상의 도로 */
.map-card-visual::before {
    content: ""; position: absolute; inset: 0;
    background:
        linear-gradient(115deg, transparent 46%, rgba(154,123,79,.35) 46% 49%, transparent 49%),
        linear-gradient(25deg, transparent 62%, rgba(47,72,88,.18) 62% 64%, transparent 64%);
}
.map-pin { position: relative; z-index: 1; font-size: 2.8rem; line-height: 1;
    filter: drop-shadow(0 7px 9px rgba(0,0,0,.28)); animation: pinBob 2.2s ease-in-out infinite; }
.map-pin::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 26px; height: 8px;
    transform: translateX(-50%); background: rgba(0,0,0,.2); border-radius: 50%; filter: blur(2px); z-index: -1; }
@keyframes pinBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.map-card-body { padding: 1.1rem 1.3rem 1.3rem; text-align: center; }
.map-card-title { font-family: var(--font-serif); font-weight: 700; font-size: 1.15rem; color: var(--primary-d); }
.map-card-addr { color: var(--muted); font-size: .92rem; margin: .35rem 0 1rem; }
.map-card-btn { display: inline-flex; align-items: center; gap: .5rem; background: #03C75A; color: #fff;
    font-weight: 600; font-size: .95rem; padding: .62rem 1.2rem; border-radius: 999px; transition: background .15s ease; }
.map-card-btn .nmark { display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem;
    background: #fff; color: #03C75A; border-radius: 5px; font-weight: 800; font-size: .82rem; }
.map-card:hover .map-card-btn { background: #02b351; }
@media (prefers-reduced-motion: reduce) { .map-pin { animation: none; } }
@media (min-width: 720px) {
    .map-card { display: flex; }
    .map-card-visual { flex: 0 0 300px; height: auto; min-height: 180px; }
    .map-card-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
}

/* ---- 푸터 ---- */
.site-footer { position: relative; background: linear-gradient(180deg, #22333f, #1b2832); color: #c3c9d1; padding: 2.8rem 0 2.2rem; }
.site-footer::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, transparent, var(--accent-soft), transparent); }
.site-footer .brand { color: #fff; }
.site-footer p { margin: .5rem 0 0; font-size: .9rem; }
.site-footer .foot-top { display:flex; flex-wrap:wrap; gap:1rem; justify-content: space-between; align-items: center; }
.site-footer .admin-link { color: var(--accent-soft); font-size: .85rem; }
.site-footer .copy { color: #7d8893; font-size: .82rem; margin-top: 1.2rem; border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; }

/* ---- 로그인 (auth) ---- */
.auth-wrap { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem;
    background: radial-gradient(900px 380px at 50% -5%, rgba(199,180,144,.18), transparent 60%), var(--paper); }
.auth-card { position: relative; width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 2.4rem 1.9rem; text-align: center; overflow: hidden; }
.auth-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--accent-soft), var(--accent), var(--accent-soft)); }
.auth-card .flower-mark { font-size: 1.8rem; }
.auth-card h1 { font-size: 1.4rem; margin: .2rem 0 .3rem; }
.auth-card .sub { color: var(--muted); font-size: .9rem; margin: 0 0 1.5rem; }
.auth-card form { text-align: left; display: grid; gap: .9rem; }
.auth-card label { font-size: .85rem; color: var(--ink-soft); display: block; margin-bottom: .3rem; }
.auth-card input { width: 100%; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; background: var(--surface-2); }
.auth-card input:focus { outline: none; border-color: var(--accent-soft); box-shadow: 0 0 0 3px rgba(199,180,144,.25); background: #fff; }
.auth-error { background: rgba(177,65,54,.08); color: var(--danger-d); border: 1px solid #e4c6c2; border-radius: var(--r-sm); padding: .6rem .8rem; font-size: .85rem; text-align: center; }
.auth-foot { margin-top: 1.3rem; }
.auth-foot a { font-size: .85rem; color: var(--muted); }

/* ============ 반응형 ============ */
@media (max-width: 640px) {
    .price-table thead { display: none; }
    .price-table, .price-table tbody, .price-table tr, .price-table td { display: block; width: 100%; }
    .price-table { background: transparent; border: 0; box-shadow: none; }
    .price-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 1rem; box-shadow: var(--shadow-sm); overflow: hidden; }
    .price-table tbody tr:nth-child(even) { background: var(--surface); }
    .price-table td { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line-soft); }
    .price-table td::before { content: attr(data-label); color: var(--muted); font-weight: 600; }
    /* 카드 내부 행 구분선 유지(마지막 카드 포함), 각 카드의 마지막 행만 선 제거 */
    .price-table tbody tr:last-child td { border-bottom: 1px solid var(--line-soft); }
    .price-table tbody tr td:last-child { border-bottom: 0; }

    /* 빈소 현황 표 → 카드형 */
    .status-table-wrap { overflow-x: visible; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
    .status-table { min-width: 0; }
    .status-table thead { display: none; }
    .status-table, .status-table tbody, .status-table tr, .status-table td { display: block; width: 100%; }
    .status-table tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 1rem; box-shadow: var(--shadow-sm); overflow: hidden; }
    .status-table tbody tr:nth-child(even) { background: var(--surface); }
    .status-table td { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; text-align: right; border-right: 0; border-bottom: 1px solid var(--line-soft); padding: .7rem .95rem; }
    .status-table td:last-child { border-bottom: 0; }
    .status-table td::before { content: attr(data-label); color: var(--muted); font-weight: 600; text-align: left; white-space: nowrap; flex: none; }
    .status-table .col-mourner { text-align: right; white-space: pre-line; min-width: 0; }
    /* 카드 내부 행 구분선 유지(마지막 카드 포함), 각 카드의 마지막 행만 선 제거 */
    .status-table tbody tr:last-child td { border-bottom: 1px solid var(--line-soft); }
    .status-table tbody tr td:last-child { border-bottom: 0; }
}
@media (min-width: 720px) {
    .nav-toggle-btn { display: none; }
    .site-nav { display: flex; flex-direction: row; position: static; border: 0; background: transparent; box-shadow: none; gap: .2rem; }
    .site-nav a { border: 0; padding: .5rem .9rem; border-radius: var(--r-sm); font-size: .95rem; font-weight: 500; position: relative; }
    .site-nav a::after { content: ""; position: absolute; left: 50%; bottom: .28rem; width: 0; height: 2px; background: var(--accent); border-radius: 2px; transform: translateX(-50%); transition: width .2s ease; }
    .site-nav a:hover { background: transparent; color: var(--accent); }
    .site-nav a:hover::after { width: calc(100% - 1.8rem); }
    .hero { padding: 7rem 1rem 6rem; }
    .hero h1 { font-size: 2.9rem; }
    .section { padding: 4.5rem 0; }
    .funeral-list { grid-template-columns: 1fr 1fr; }
    .funeral-info { grid-template-columns: 1fr 1fr; column-gap: 1.5rem; }
    .funeral-info > div:nth-last-child(2) { border-bottom: 0; }
    .guide-steps { grid-template-columns: 1fr 1fr; }
    .contact-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
    .funeral-list { grid-template-columns: repeat(3, 1fr); }
}
