/* ========================================
   엄마사랑 재가복지센터 - 메인 스타일시트
   ======================================== */

/* CSS 변수 정의 */
:root {
    /* 색상 팔레트 */
    --primary-color: #4CAF50;        /* 메인 그린 - 생명, 건강 */
    --primary-dark: #388E3C;         /* 진한 그린 */
    --primary-light: #81C784;        /* 연한 그린 */
    --secondary-color: #FF9800;      /* 오렌지 - 따뜻함 */
    --accent-color: #2196F3;         /* 블루 - 신뢰 */

    /* 텍스트 색상 */
    --text-dark: #2C3E50;
    --text-medium: #546E7A;
    --text-light: #78909C;

    /* 배경 색상 */
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --bg-gray: #ECEFF1;

    /* 그라데이션 */
    --gradient-primary: linear-gradient(135deg, #4CAF50 0%, #81C784 100%);
    --gradient-warm: linear-gradient(135deg, #FF9800 0%, #FFB74D 100%);

    /* 간격 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4.5rem;

    /* 타이포그래피 */
    --font-main: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;

    /* 기타 */
    --border-radius: 8px;
    --border-radius-large: 16px;
    --border-radius-pill: 30px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --box-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.12);
}

/* 리셋 & 기본 스타일 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--bg-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

/* 컨테이너 */
.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* 모바일 전용 줄바꿈: 기본(PC)에서는 숨김 → 모바일 미디어쿼리에서만 활성화 */
.mobile-br {
    display: none;
}

/* ========================================
   헤더
   ======================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: var(--transition);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
}

/* 로고 + (모바일) 블로그 버튼을 왼쪽에 묶어두는 래퍼 */
.header-left {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.logo-image {
    height: 80px;
    width: auto;
    object-fit: contain;
}

.main-nav {
    display: flex;
    align-items: center;
}

/* ========================================
   네이버 블로그 버튼 (이미지 링크)
   - PC: 메뉴 오른쪽 끝(.blog-link-pc)
   - 모바일: 로고 오른쪽(.blog-link-mobile)
   ======================================== */
.blog-link {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.blog-link img {
    display: block;
    height: 40px;
    width: auto;
    border-radius: 6px;
}

.blog-link:hover {
    transform: scale(1.08);
}

.blog-link-pc {
    margin-left: 0.6rem;     /* 마지막 메뉴와 살짝 간격 */
}

/* 모바일 전용 버튼은 PC에서 숨김 (반응형에서 다시 켬) */
.blog-link-mobile {
    display: none;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    position: relative;
    white-space: nowrap;       /* 메뉴 글자 줄바꿈 방지 (예: '장기요양등급 안내') */
    flex-shrink: 0;            /* flex 컨테이너 안에서 축소 금지 */
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

/* 모바일 메뉴 토글 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    padding: 0.5rem;
}

.mobile-menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

/* ========================================
   히어로 섹션
   ======================================== */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(76, 175, 80, 0.9) 0%, rgba(129, 199, 132, 0.85) 100%),
        url('../images/hero-bg.jpg') center/cover no-repeat;
    background-color: var(--primary-color);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.1), transparent);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    max-width: 900px;
    padding: var(--spacing-lg) var(--spacing-md);
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

.hero-title .highlight {
    position: relative;
    display: inline-block;
    color: #FFD54F;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    font-weight: 400;
    opacity: 0.95;
    margin-bottom: var(--spacing-lg);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.1);
}

.hero-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* ========================================
   버튼 스타일
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--border-radius-pill);
    transition: var(--transition);
    cursor: pointer;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--bg-white);
    color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
    background: var(--primary-light);
    color: white;
}

.btn-outline {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

.btn-large {
    padding: 1.2rem 2.5rem;
    font-size: 1.1rem;
}

.btn-white {
    background: white;
    color: var(--primary-color);
}

.btn-white:hover {
    background: var(--primary-color);
    color: white;
}

.btn-outline-white {
    background: transparent;
    color: white;
    border-color: white;
}

.btn-outline-white:hover {
    background: white;
    color: var(--primary-color);
}

/* ========================================
   섹션 공통 스타일
   ======================================== */
.section-header {
    max-width: 700px;
    margin-bottom: var(--spacing-xl);
}

.section-header.centered {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.section-label {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: var(--spacing-md);
}

.section-title .highlight {
    color: var(--primary-color);
    position: relative;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-medium);
    line-height: 1.7;
}

/* ========================================
   서비스 섹션
   ======================================== */
.services-section {
    padding: var(--spacing-xl) 0;
    background: var(--bg-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
}

.service-card {
    position: relative;
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-large);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-hover);
}

.service-card.featured {
    background: var(--gradient-primary);
    color: white;
}

.service-card.featured .service-title,
.service-card.featured .service-description,
.service-card.featured .service-features {
    color: white;
}

.featured-badge {
    position: absolute;
    z-index: 2;
    top: -12px;
    right: 30px;
    background: var(--secondary-color);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: var(--border-radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3);
}

.service-icon {
    margin-bottom: var(--spacing-md);
}

/* 서비스 카드 원형 사진 (이미지 캡쳐 디자인 - 카드 위로 돌출) */
.service-image {
    position: relative;
    z-index: 1;
    /* 원이 카드 콘텐츠 폭보다 커도 카드 정중앙에 고정 (margin:auto 는 이 경우 중앙정렬 실패) */
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    /* 음수 위 여백 → 원형 윗부분이 카드 밖으로 튀어나옴 */
    margin: -110px 0 var(--spacing-md);
    border-radius: 50%;
    overflow: hidden;
    border: 10px solid var(--primary-light);
    background: var(--bg-gray);
    box-shadow: var(--box-shadow);
}

.service-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.service-image.ring-green { border-color: #81C784; }
.service-image.ring-blue  { border-color: #90CAF9; }
.service-image.ring-cream { border-color: #FFE0B2; }

@media (max-width: 544px) {
    .service-image {
        width: 240px;
        height: 240px;
        margin-top: -80px;
        border-width: 7px;
    }
}

.service-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-sm);
}

.service-description {
    color: var(--text-medium);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.service-features {
    list-style: none;
    padding: 0;
}

.service-features li {
    position: relative;
    padding-left: 1.8rem;
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 900;
    font-size: 1.2rem;
}

.service-card.featured .service-features li::before {
    color: #FFD54F;
}

/* ========================================
   왜 엄마사랑인가 섹션
   ======================================== */
.why-section {
    padding: var(--spacing-xl) 0;
    background: white;
}

.why-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: center;
}

.why-image {
    position: relative;
}

.why-image .image-placeholder {
    aspect-ratio: 1367 / 1278;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--box-shadow-hover);
}

.image-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.why-features {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.why-feature {
    display: flex;
    gap: var(--spacing-md);
    align-items: flex-start;
}

.feature-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    font-size: 1.2rem;
    font-weight: 900;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-content h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
}

.feature-content p {
    color: var(--text-medium);
    line-height: 1.6;
}

/* ========================================
   프로그램 섹션
   ======================================== */
.programs-section {
    padding: var(--spacing-xl) 0;
    background: var(--bg-light);
}

.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.program-card {
    background: white;
    border-radius: var(--border-radius-large);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.program-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.program-image .image-placeholder {
    width: 100%;
    aspect-ratio: 16/10;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
}

.program-content {
    padding: var(--spacing-md);
}

.program-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.7rem;
}

.program-content p {
    color: var(--text-medium);
    line-height: 1.6;
}

/* ========================================
   CTA 섹션
   ======================================== */
.cta-section {
    padding: var(--spacing-xl) 0;
    background: var(--gradient-primary);
    color: white;
    text-align: center;
}

.cta-title {
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 900;
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.cta-description {
    font-size: 1.2rem;
    opacity: 0.95;
    margin-bottom: var(--spacing-lg);
}

.cta-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

/* ========================================
   푸터
   ======================================== */
.site-footer {
    background: var(--text-dark);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-logo {
    height: 45px;
    width: auto;
    margin-bottom: var(--spacing-md);
    filter: brightness(0) invert(1);
}

.footer-slogan {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-contact h4,
.footer-address h4,
.footer-hours h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--primary-light);
}

.footer-contact p,
.footer-address p,
.footer-hours p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* ========================================
   반응형 디자인
   ======================================== */

/* 태블릿 */
@media (max-width: 921px) {
    html {
        font-size: 15px;
    }

    .nav-menu {
        display: none;
    }

    /* 메뉴는 햄버거 안으로 들어가므로 PC 블로그 버튼은 숨기고,
       로고 옆 모바일 블로그 버튼을 노출 */
    .blog-link-pc {
        display: none;
    }
    .blog-link-mobile {
        display: inline-flex;
    }

    /* 모바일에서 끝 글자('다')만 줄바꿈되는 것 방지 → 한 줄 + 화면 폭에 맞춰 자동 축소
       문구 실측 폭 ≈ 23em → (화면폭 - 좌우여백)을 24로 나눠 항상 한 줄에 들어가게 함 */
    .services-section .section-description {
        white-space: nowrap;
        font-size: min(1.1rem, calc((100vw - 40px) / 24));
    }

    /* 모바일 전용 줄바꿈 활성화 */
    .mobile-br {
        display: inline;
    }

    /* 페이지 히어로 부제목: 줄이 길어지면 글자 중간이 아닌 단어 단위로 줄바꿈 */
    .page-hero p {
        word-break: keep-all;
    }

    /* 홈 주요서비스: 카드 위로 돌출되는 원형 사진이 섹션 제목을 가리지 않도록 그리드를 아래로 내림 */
    .services-grid {
        margin-top: 105px;
    }

    /* 햄버거 클릭 시(.active) 헤더 아래로 펼쳐지는 드롭다운 */
    .nav-menu.active {
        display: flex;
        flex-direction: column;
        gap: 0;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--bg-gray);
        padding: var(--spacing-sm) 0;
    }
    .nav-menu.active li {
        width: 100%;
    }
    .nav-menu.active .nav-link {
        display: block;
        padding: 0.9rem var(--spacing-md);
        border-radius: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero {
        min-height: 70vh;
    }

    .why-content {
        grid-template-columns: 1fr;
    }

    .programs-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 모바일 */
@media (max-width: 544px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    .header-content {
        padding: 1rem 0;
    }

    .logo-image {
        height: 60px;
    }

    .blog-link img {
        height: 34px;
    }

    .hero {
        min-height: 60vh;
    }

    .hero-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .section-header {
        margin-bottom: var(--spacing-md);
    }

    .services-section,
    .why-section,
    .programs-section,
    .cta-section {
        padding: var(--spacing-md) 0;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
        margin-top: 75px;
    }

    .why-features {
        gap: var(--spacing-sm);
    }

    .programs-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
}

/* ========================================
   유틸리티 클래스
   ======================================== */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--spacing-sm) !important; }
.mb-2 { margin-bottom: var(--spacing-md) !important; }
.mb-3 { margin-bottom: var(--spacing-lg) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--spacing-sm) !important; }
.mt-2 { margin-top: var(--spacing-md) !important; }
.mt-3 { margin-top: var(--spacing-lg) !important; }
