/* =========================================
   1. Variables & Global Settings
   ========================================= */
:root {
    --primary-color: #2c3e50;
    --accent-color: #27ae60; /* Golf Green */
    --accent-hover: #1e8449;
    --accent-red: #e74c3c;   /* Guide Highlight Red */
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-gray: #666;
    --header-bg: rgba(255, 255, 255, 0.98);
    --max-width-index: 1200px;
    --max-width-detail: 900px;
    --border-radius: 15px;
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; 
    margin: 0; 
    padding: 0; 
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6; 
    color: var(--primary-color); 
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased; 
    overflow-x: hidden;
}

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

.container { 
    max-width: var(--max-width-index); 
    margin: 0 auto; 
    padding: 0 15px; 
}

a { 
    text-decoration: none; 
    color: inherit; 
    transition: 0.2s ease; 
}

/* =========================================
   2. Header & Navigation (3단 레이아웃)
   ========================================= */
/* 상단 사이트 네비만 고정 — detail-header 등 article 내 header는 스티키 제외 */
.main-header {
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    padding: 15px 0;
    position: sticky; 
    top: 0; 
    z-index: 1000;
    border-bottom: 1px solid #eee;
}

.main-header .container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.header-layout {
    display: grid;
    grid-template-columns: 1fr auto 1fr; /* 좌:중:우 비율 */
    align-items: center;
    width: 100%;
}

.header-left { display: flex; justify-content: flex-start; }
.header-center { display: flex; justify-content: center; }
.header-right { display: flex; justify-content: flex-end; gap: 8px; }

/* 로고 이미지 */
.header-center .logo-img { 
    height: 70px; 
    width: auto; 
    display: block;
}

/* 네비게이션 링크 (가이드 버튼) */
.nav-link {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--primary-color);
    padding: 8px 16px;
    background: #f1f5f9;
    border-radius: 25px;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
    white-space: nowrap;
}
.nav-link:hover { background: #e2e8f0; }

/* 언어 선택 버튼 */
.lang-btn {
    padding: 7px 15px;
    border-radius: 25px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 800;
    color: #555;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.2s;
    text-decoration: none;
    line-height: normal;
}
.lang-btn.active, .lang-btn:hover { 
    background: #333; 
    color: white; 
    border-color: #333; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

/* 테마 필터 버튼 */
.theme-filter-container { width: 100%; }
.theme-filter-buttons {
    display: flex; 
    justify-content: center; 
    flex-wrap: wrap; 
    gap: 10px;
}
.theme-button {
    padding: 10px 20px; 
    font-size: 0.9rem; 
    font-weight: 700;
    border: 1px solid #eee; 
    background: #fff; 
    border-radius: 30px;
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    transition: 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
    white-space: nowrap;
}
.theme-button.active { 
    background: var(--accent-color); 
    color: white; 
    border-color: var(--accent-color);
}
.count-badge {
    background: rgba(0, 0, 0, 0.05); 
    padding: 2px 8px; 
    border-radius: 10px;
    font-size: 0.75rem; 
    margin-left: 8px; 
    font-weight: 800;
}
.theme-button.active .count-badge { background: rgba(255, 255, 255, 0.3); color: #fff; }

/* =========================================
   3. Highlighted Guide Section (NEW)
   ========================================= */
.highlight-container {
    margin-bottom: 30px;
    padding: 25px;
    border: 4px solid var(--accent-red); 
    border-radius: var(--border-radius);
    background: #fff;
    box-shadow: 0 10px 30px rgba(231, 76, 60, 0.1);
}

.highlight-container .section-title { 
    font-size: 1.6rem; 
    font-weight: 900; 
    margin-bottom: 20px; 
    color: #1a202c; 
}

.guide-highlight-grid {
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 20px;
}

.guide-highlight-card {
    position: relative; 
    border-radius: 10px; 
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06); 
    transition: 0.3s; 
    display: block; 
    background: var(--bg-color);
}
.guide-highlight-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.1); 
}

.guide-highlight-card .badge {
    position: absolute; 
    top: 10px; 
    left: 10px; 
    background: var(--accent-red); 
    color: white;
    padding: 5px 12px; 
    font-size: 0.75rem; 
    font-weight: 900; 
    border-radius: 6px; 
    z-index: 2;
}

.guide-img-wrapper { width: 100%; height: 160px; overflow: hidden; }
.guide-img-wrapper img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: 0.3s; 
}

.guide-highlight-card .card-body { padding: 15px; }
.guide-highlight-card .card-body h3 { 
    font-size: 1.1rem; 
    font-weight: 800; 
    margin-bottom: 8px; 
    color: #222; 
    line-height: 1.3; 
}
.guide-highlight-card .card-body p { 
    font-size: 0.9rem; 
    color: #666; 
    line-height: 1.5; 
}

.view-all-box { text-align: center; margin-top: 25px; }
.view-all-btn {
    display: inline-block; 
    padding: 10px 25px; 
    background: #2c3e50; 
    color: #fff !important;
    border-radius: 30px; 
    font-weight: 700; 
    font-size: 0.95rem;
}

/* =========================================
   4. Map Section & Photo Markers (사이즈 축소)
   ========================================= */
.map-section { 
    width: 100%; 
    height: 50vh; 
    min-height: 400px; 
    background: #e5e3df; 
    margin-bottom: 30px; 
}
#map { width: 100%; height: 100%; }

/* 사진 마커 (32px로 축소) */
.caddie-marker {
    width: 32px; height: 32px; 
    background: white; border-radius: 50%;
    border: 1.5px solid white; 
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    overflow: hidden; cursor: pointer; 
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.caddie-marker img { width: 100%; height: 100%; object-fit: cover; }

.caddie-marker:hover { 
    transform: scale(1.6) translateY(-5px); 
    border-color: var(--accent-color); 
    z-index: 999; 
}

/* InfoWindow 스타일 */
.info-card { padding: 10px; max-width: 220px; font-family: inherit; }
.info-title { font-weight: 800; font-size: 1rem; margin-bottom: 6px; color: #2c3e50; line-height: 1.3; }
.info-address { font-size: 0.8rem; color: #666; margin-bottom: 12px; }
.info-btn {
    display: block; background: var(--accent-color); color: white !important;
    text-align: center; padding: 10px; border-radius: 8px; font-size: 0.85rem; font-weight: 700;
}

/* =========================================
   5. Index Page Content
   ========================================= */
.content-wrapper { 
    max-width: 1100px; 
    margin: -30px auto 60px; 
    padding: 0 15px; 
    position: relative; 
    z-index: 10; 
}

.intro-box {
    background: #fff; padding: 40px 20px; border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); text-align: center; margin-bottom: 40px;
}
.intro-box h2 { font-size: 2.2rem; font-weight: 900; margin-bottom: 15px; color: #1a202c; }
.intro-box p { font-size: 1.1rem; color: #4a5568; }

.list-title { text-align: center; margin-bottom: 30px; font-size: 1.8rem; font-weight: 800; }

.course-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 30px; 
}
.course-card { 
    background: #fff; 
    border-radius: 20px; 
    overflow: hidden; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    transition: 0.3s; 
    display: flex; 
    flex-direction: column; 
}
.course-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,0.1); }
.card-thumb { width: 100%; height: 210px; object-fit: cover; }
.card-content { padding: 25px; flex-grow: 1; }
.card-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 10px; color: #222; }

/* =========================================
   6. Detail Page Settings (가독성 및 타이틀 강화)
   ========================================= */
.detail-container { 
    max-width: var(--max-width-detail); 
    margin: 30px auto 100px; 
    padding: 0 20px; 
    line-height: 1.8; 
}

.detail-header { margin-bottom: 30px; text-align: center; }

/* 페이지 최상단 메인 제목 */
.detail-title { 
    font-size: 2.6rem; 
    line-height: 1.2; 
    font-weight: 900; 
    margin-bottom: 20px; 
    word-break: keep-all;
    color: #1a202c;
}

.detail-meta { color: #7f8c8d; font-size: 0.95rem; margin-bottom: 25px; }

.detail-img { 
    width: 100%; 
    max-height: 550px; 
    object-fit: cover; 
    border-radius: 20px; 
    box-shadow: 0 15px 40px rgba(0,0,0,0.1); 
    margin-bottom: 50px; 
}

/* 회원제 안내 배너 */
.private-alert { 
    background: #fff5f5; border: 1px solid #feb2b2; 
    padding: 25px; border-radius: 12px; margin-bottom: 40px; 
    color: #c53030; line-height: 1.6; 
}
.private-alert h3 { margin-top: 0; font-size: 1.2rem; margin-bottom: 8px; font-weight: 800; }
.private-alert p { margin-bottom: 0; font-size: 1rem; }

/* -----------------------------------------
   본문 스타일 (Markdown Content)
   ----------------------------------------- */
.detail-content { 
    font-size: 1.15rem; /* 본문 크기 약간 확대 */
    color: #334155; 
    line-height: 1.9;
}

/* [핵심] 본문 내 큰 소제목 (## 제목) */
.detail-content h2 { 
    font-size: 1.9rem; /* 크기 확대 */
    font-weight: 850; 
    color: #1a202c;
    margin-top: 60px; 
    margin-bottom: 25px; 
    padding-bottom: 12px;
    border-bottom: 2px solid #f1f5f9; /* 구분선 추가 */
    line-height: 1.3;
}

/* [핵심] 본문 내 중간 소제목 (### 제목) */
.detail-content h3 { 
    font-size: 1.5rem; /* 크기 확대 */
    font-weight: 800; 
    color: #1e293b;
    margin-top: 40px; 
    margin-bottom: 15px; 
}

.detail-content p { margin-bottom: 25px; }

/* 강조 텍스트 */
.detail-content b, .detail-content strong { 
    color: #000; 
    font-weight: 800; 
}

/* 리스트 스타일 */
.detail-content ul, .detail-content ol {
    margin-bottom: 30px;
    padding-left: 25px;
}
.detail-content li {
    margin-bottom: 12px;
}

/* -----------------------------------------
   하단 액션 버튼 및 링크
   ----------------------------------------- */
.detail-actions { text-align: center; margin-top: 80px; }

.booking-btn {
    display: inline-block; background: var(--accent-color); color: white !important;
    padding: 20px 60px; font-size: 1.4rem; font-weight: 800; border-radius: 60px;
    box-shadow: 0 10px 25px rgba(39, 174, 96, 0.3); transition: 0.3s;
}
.booking-btn:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(39, 174, 96, 0.4); }

.back-btn-container { margin-top: 30px; }
.back-btn {
    display: inline-flex; align-items: center; padding: 12px 35px; background: #f1f5f9;
    color: #475569 !important; border-radius: 50px; font-weight: 700; font-size: 1rem;
    border: 1px solid #e2e8f0; transition: 0.2s;
}
.back-btn:hover { background: #e2e8f0; color: #1e293b !important; }

/* 본문 내 내부 링크 (형광펜 효과) */
.detail-content a {
    color: #1a202c; 
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(to top, rgba(39, 174, 96, 0.15) 40%, transparent 40%); 
    transition: background 0.3s ease;
    padding: 0 2px;
}

.detail-content a:hover {
    background: linear-gradient(to top, rgba(39, 174, 96, 0.35) 100%, transparent 0%); 
    color: var(--accent-hover);
}

/* =========================================
   7. Footer Styles
   ========================================= */
footer { 
    text-align: center; 
    padding: 60px 20px; 
    border-top: 1px solid #eee; 
    background: #fff; 
    margin-top: 60px; 
    font-size: 0.9rem; 
    color: #999; 
}
.footer-status-box { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
    flex-wrap: wrap; 
    margin-bottom: 30px; 
}
.footer-status-box div {
    background: #f8f9fa; border: 1px solid #eee; padding: 8px 20px;
    border-radius: 30px; font-weight: 600; font-size: 0.85rem; color: #555;
}
.site-footer {
    margin-top: 60px;
    text-align: center;
    padding: 60px 20px;
    border-top: 1px solid #eee;
    background-color: #fff;
    color: #888;
    font-size: 0.95rem;
}
.footer-pill {
    background: #f8f9fa;
    border: 1px solid #eee;
    padding: 8px 20px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.85rem;
}
.footer-pill-accent {
    background: #e9f7ef;
    border-color: #d4efdf;
    color: #27ae60;
}
.footer-brand {
    margin-bottom: 25px;
}
.footer-nav {
    margin-bottom: 25px;
    font-weight: 600;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
}
.footer-nav a {
    color: #444;
    text-decoration: none;
}

.family-sites-strip {
    background: #0f172a;
    padding: 40px 0 44px;
    margin: 0 -20px 28px;
    width: calc(100% + 40px);
    box-sizing: border-box;
}
.family-sites-inner {
    text-align: center;
}
.family-sites-title {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 0 0 18px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
}
.family-sites-row {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 14px;
    flex-wrap: wrap;
}
.family-site-card {
    display: flex;
    align-items: center;
    text-decoration: none;
    border: 1px solid #334155;
    border-radius: 12px;
    background-color: #1e293b;
    padding: 14px 22px;
    min-width: 200px;
    max-width: 280px;
    flex: 1 1 200px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    color: inherit;
    text-align: left;
}
.family-site-card:hover {
    transform: translateY(-2px);
    border-color: #475569;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.family-site-card-emoji {
    font-size: 1.35rem;
    margin-right: 12px;
    line-height: 1;
    flex-shrink: 0;
}
.family-site-card-text {
    min-width: 0;
    text-align: left;
}
.family-site-card-name {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}
.family-site-card-desc {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 2px;
    line-height: 1.35;
}

.footer-copy {
    font-size: 0.85rem;
    opacity: 0.6;
}


/* =========================================
   8. Mobile Optimizations (미디어 쿼리)
   ========================================= */
@media (max-width: 768px) {
    .main-header { padding: 10px 0; }
    
    .header-layout { 
        grid-template-columns: auto 1fr auto; 
        gap: 10px;
        margin-bottom: 12px; 
    }
    
    .header-center .logo-img { height: 52px; max-width: 58vw; object-fit: contain; } 
    
    .header-left .nav-link { padding: 6px 12px; font-size: 0.85rem; }
    .header-left .nav-link .hide-mobile { display: none; } 
    
    .header-right { gap: 4px; }
    .lang-btn { padding: 5px 10px; font-size: 0.75rem; } 

    .theme-filter-buttons {
        justify-content: flex-start; 
        flex-wrap: nowrap; 
        overflow-x: auto;
        padding: 5px 10px 10px 10px; 
        gap: 8px; 
        -webkit-overflow-scrolling: touch;
    }
    .theme-filter-buttons::-webkit-scrollbar { display: none; }
    .theme-button { padding: 7px 15px; font-size: 0.82rem; flex-shrink: 0; }

    .highlight-container { padding: 15px; border-width: 3px; margin-bottom: 20px; }
    .highlight-container .section-title { font-size: 1.3rem; margin-bottom: 15px; }
    .guide-highlight-grid { grid-template-columns: 1fr; gap: 15px; }
    .guide-img-wrapper { height: 140px; }
    
    .map-section { height: 45vh; min-height: 320px; margin-bottom: 20px; }
    
    .content-wrapper { margin-top: -10px; padding: 0 10px; }
    .intro-box { padding: 20px 15px; margin-bottom: 25px; }
    .intro-box h2 { font-size: 1.5rem; margin-bottom: 10px; }
    
    .course-grid { grid-template-columns: 1fr; gap: 20px; }
    
    .detail-container { margin: 20px auto 60px; padding: 0 15px; }
    .detail-title { font-size: 1.7rem; }
    .detail-meta { line-height: 1.5; }
    .booking-btn { width: 100%; padding: 16px; font-size: 1.15rem; }
    .back-btn { width: 100%; justify-content: center; }
    .detail-actions {
        gap: 10px;
    }
    .detail-actions a {
        width: min(100%, 320px);
        justify-content: center;
    }
    .footer-status-box {
        gap: 8px;
    }
    .footer-pill {
        width: 100%;
    }
    .site-footer {
        padding: 45px 14px;
    }
    .family-sites-strip {
        padding: 32px 0 36px;
        margin: 0 -14px 20px;
        width: calc(100% + 28px);
    }
    .family-sites-title {
        padding: 0 4px;
    }
    .family-site-card {
        flex: 1 1 100%;
        max-width: none;
        width: 100%;
        justify-content: center;
    }
    .family-site-card-text {
        text-align: left;
    }
    .footer-nav {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 모바일 마커: 26px */
    .caddie-marker { width: 26px; height: 26px; border-width: 1px; }
}

@media (max-width: 480px) {
    .header-center .logo-img { height: 44px; max-width: 70vw; }
}
