/* ── 달인플라워 글로벌 스타일 (토스 스타일) ── */

:root {
    --blue: #3182f6;
    --gray-50: #f9fafb;
    --gray-100: #f2f4f6;
    --gray-200: #e5e8eb;
    --gray-500: #6b7684;
    --gray-600: #4e5968;
    --gray-900: #191f28;
    --white: #ffffff;
    --green: #05c46b;
    --kakao: #fee500;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--gray-50);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--gray-900);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ── Skip Link (접근성) ── */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 999;
    padding: 0.8rem 1.5rem;
    background: var(--blue);
    color: var(--white);
    font-weight: 700;
    font-size: 0.9rem;
    border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ── 헤더 ── */
header {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
}

.logo { font-weight: 800; font-size: 1rem; color: var(--gray-900); }

/* ── 컨테이너 ── */
.container { max-width: 700px; margin: 0 auto; padding: 0 1.5rem; }

/* ── 카드 ── */
.card {
    background: var(--white);
    border-radius: 24px;
    padding: 1.8rem;
    margin-bottom: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card-title { font-size: 1.05rem; font-weight: 800; margin-bottom: 1.2rem; color: var(--gray-900); margin-top: 0; }

/* ── 지도 버튼 ── */
.nav-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }

.nav-btn {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: opacity 0.15s;
}
.nav-btn:active { opacity: 0.8; }
.btn-kakao { background: var(--kakao); color: var(--gray-900); }
.btn-tmap { background: var(--gray-900); color: var(--white); }

/* ── 주소 복사 ── */
.address-text { font-weight: 700; margin-bottom: 1rem; color: var(--gray-900); font-size: 0.95rem; }

.copy-btn {
    width: 100%;
    margin-top: 0.8rem;
    background: var(--gray-100);
    border: none;
    padding: 1rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    color: var(--gray-900);
    font-family: inherit;
    transition: background 0.15s;
}
.copy-btn:hover { background: var(--gray-200); }

/* ── SGE 펼치기 ── */
.sge-container { overflow: hidden; position: relative; }
.sge-content { max-height: 140px; overflow: hidden; transition: max-height 0.6s ease; }
.sge-container.expanded .sge-content { max-height: 5000px; }

.view-more-btn {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--blue);
    font-weight: 800;
    padding: 1rem 0 0;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
}
.sge-container.expanded .view-more-btn { display: none; }

/* ── SGE 요약 박스 ── */
.sge-summary {
    background: var(--gray-50);
    padding: 1.4rem;
    border-radius: 14px;
    border: 1px solid var(--gray-100);
}
.sge-summary-title { font-size: 1rem; font-weight: 800; margin-bottom: 0.8rem; color: var(--gray-900); }
.sge-summary-body { font-size: 0.92rem; line-height: 1.8; color: var(--gray-600); }
.sge-summary-note {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: var(--gray-100);
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ── CTA 넛지 ── */
.safe-nudge {
    background: var(--gray-900);
    color: var(--white);
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    margin-bottom: 2rem;
}
.safe-nudge h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 0.5rem; }
.safe-nudge p { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 1.4rem; }

.nudge-btn {
    background: var(--blue);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
    display: inline-block;
    font-size: 1rem;
    transition: opacity 0.15s;
}
.nudge-btn:active { opacity: 0.85; }

/* ── FAQ ── */
.faq-item { padding: 1.1rem 0; border-bottom: 1px solid var(--gray-100); }
.faq-item:last-child { border-bottom: none; }
.faq-question { font-weight: 700; color: var(--gray-900); font-size: 0.95rem; cursor: pointer; list-style: none; }
.faq-question::-webkit-details-marker { display: none; }
.faq-question::marker { display: none; content: ''; }
.faq-answer { color: var(--gray-600); font-size: 0.9rem; line-height: 1.7; margin-top: 0.4rem; }

/* ── 개별 페이지 인트로 ── */
.page-intro { padding: 2.5rem 0 1.5rem; }
.page-intro h1 { font-size: 1.9rem; font-weight: 800; margin-bottom: 1rem; word-break: keep-all; color: var(--gray-900); }
.page-intro p { color: var(--gray-600); font-size: 0.95rem; line-height: 1.75; margin-top: 0.8rem; }

/* ── 푸터 ── */
footer { padding: 3rem 1.5rem; color: var(--gray-500); font-size: 0.8rem; text-align: center; }

/* ── 토스트 ── */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: var(--gray-900);
    color: var(--white);
    padding: 0.85rem 1.6rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.88rem;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    z-index: 9999;
    white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 메인 페이지 히어로 ── */
.hero {
    padding: 3.5rem 1.5rem 2.5rem;
    background: var(--white);
    text-align: center;
    border-bottom: 1px solid var(--gray-100);
}
.hero h1 { font-size: 2rem; font-weight: 900; color: var(--gray-900); margin-bottom: 0.5rem; }
.hero p { color: var(--gray-500); font-size: 0.95rem; margin-bottom: 1.8rem; }

.search-container { max-width: 560px; margin: 0 auto; position: relative; }

.search-container input {
    width: 100%;
    padding: 1.1rem 1.4rem;
    border-radius: 16px;
    border: 2px solid var(--blue);
    font-size: 1rem;
    box-sizing: border-box;
    outline: none;
    font-family: inherit;
    color: var(--gray-900);
    transition: box-shadow 0.15s;
}
.search-container input:focus { box-shadow: 0 0 0 4px rgba(49, 130, 246, 0.12); }

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.result-item { padding: 0.9rem 1.2rem; border-bottom: 1px solid var(--gray-100); display: block; transition: background 0.1s; }
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: var(--gray-50); }
.result-name { font-weight: 700; font-size: 0.92rem; }
.result-region { font-size: 0.78rem; color: var(--gray-500); margin-top: 2px; }

/* ── 지역/주요 섹션 ── */
.region-section { max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 0; }

.section-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.9rem;
    margin-top: 1.5rem;
}

.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 0.6rem; margin-bottom: 0.5rem; }

.region-link {
    background: var(--white);
    padding: 0.85rem 0.5rem;
    border-radius: 14px;
    color: var(--gray-900);
    font-weight: 700;
    font-size: 0.88rem;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    transition: background 0.12s;
    display: block;
}
.region-link:hover { background: var(--gray-100); }

/* ── 주요 장례식장 ── */
.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.7rem; margin-bottom: 3rem; }

.featured-card {
    background: var(--white);
    padding: 1.1rem 1.2rem;
    border-radius: 16px;
    color: var(--gray-900);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: block;
    transition: background 0.12s;
}
.featured-card:hover { background: var(--gray-50); }
.featured-name { font-weight: 800; font-size: 0.92rem; margin-bottom: 0.25rem; }
.featured-region { font-size: 0.78rem; color: var(--gray-500); }

/* ── 지역 목록 페이지 ── */
.region-page-header { max-width: 960px; margin: 2rem auto 0; padding: 0 1.5rem; }
.region-page-header h1 { font-size: 1.5rem; font-weight: 800; color: var(--gray-900); }

.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0.7rem; max-width: 960px; margin: 1.5rem auto 3rem; padding: 0 1.5rem; }

.list-card {
    background: var(--white);
    padding: 1.3rem;
    border-radius: 18px;
    color: var(--gray-900);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
    display: block;
    transition: background 0.12s;
}
.list-card:hover { background: var(--gray-50); }
.list-card-name { font-weight: 800; font-size: 0.95rem; margin-bottom: 0.4rem; }
.list-card-addr { font-size: 0.82rem; color: var(--gray-500); }

/* ── 브레드크럼 ── */
.breadcrumb {
    max-width: 700px;
    margin: 1rem auto 0;
    padding: 0 1.5rem;
    font-size: 0.82rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem;
}
.breadcrumb a { color: var(--gray-500); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { color: var(--gray-900); font-weight: 600; }
.breadcrumb-sep { color: var(--gray-200); margin: 0 0.15rem; }

/* ── 반응형 ── */
@media (max-width: 768px) {
    .hero h1 { font-size: 1.8rem; }
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .list-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .hero h1 { font-size: 1.6rem; }
    .page-intro h1 { font-size: 1.5rem; }
    .card { padding: 1.4rem; border-radius: 20px; }
    .safe-nudge { padding: 1.6rem 1.2rem; border-radius: 20px; }
    .nav-btn { height: 48px; font-size: 0.9rem; }
    .region-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
    .featured-grid { grid-template-columns: repeat(2, 1fr); }
    .list-grid { grid-template-columns: 1fr; }
}
