:root { 
    --apple-bg: #f5f5f7; 
    --apple-card: #ffffff; 
    --apple-blue: #0071e3; 
    --apple-text: #1d1d1f; 
    --apple-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    --apple-border: #d2d2d7;
}
body { 
    margin: 0; 
    background: var(--apple-bg); 
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif; 
    color: var(--apple-text);
}

/* 3단 레이아웃 (좌광고-메인-우광고) */
.ad-layout { 
    display: grid; 
    grid-template-columns: 1fr; 
    min-height: 100vh; 
    gap: 0;
}
.ad-side { 
    display: none;
}

.main-content { 
    padding: 0 40px; 
    max-width: 1600px; 
    margin: 0 auto; 
    width: 100%; 
    box-sizing: border-box; 
}
.header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 30px 0; 
    border-bottom: 1px solid var(--apple-border); 
}
.top-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}
.top-filters select,
.top-filters button,
#searchInput {
    max-width: 100%;
}
.logo {
    font-size: 28px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--apple-blue), #5856d6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    word-break: keep-all;
    display: inline-block;
}
.top-filters select {
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid var(--apple-border);
    background: var(--apple-card);
    margin-left: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* 앱 바디: 지도(좌) + 컨텐츠(우) */
.app-body { 
    display: grid; 
    grid-template-columns: 260px 1fr; 
    gap: 24px; 
    margin-top: 40px; 
    align-items: start; 
}

.sidebar-map { 
    position: sticky; 
    top: 20px; 
    background: var(--apple-card); 
    padding: 24px; 
    border-radius: 24px; 
    box-shadow: var(--apple-shadow); 
    min-height: 550px !important;
    display: block !important;
    z-index: 5; /* Lower than header z-index */
}
.map-container { 
    width: 100%; 
    height: 550px !important; 
    background: #f9f9f9; 
    border-radius: 20px; 
    overflow: hidden;
}
#map { 
    width: 100%; 
    height: 100%; 
    border-radius: 20px;
    z-index: 5;
}
.map-hint {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 12px;
}
.ui-hint {
    margin: 10px 0 0;
    font-size: 13px;
    color: #6b6b70;
    line-height: 1.55;
    font-weight: 500;
}
.hint-block {
    background: linear-gradient(180deg, #f0f7ff 0%, #eaf2ff 100%);
    border: 1px solid rgba(0, 113, 227, 0.25);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 8px 20px rgba(0, 113, 227, 0.12);
}
.hint-block::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 6px;
    background: var(--apple-blue);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    vertical-align: text-top;
}
.category-hint::before {
    background: #0ea5e9;
}
.category-hint[data-category="restaurant"]::before { background: #f97316; }
.category-hint[data-category="cafe"]::before { background: #a16207; }
.category-hint[data-category="hotel"]::before { background: #06b6d4; }
.category-hint[data-category="tourism"]::before { background: #22c55e; }
.category-hint[data-category="drama"]::before { background: #8b5cf6; }
.category-hint[data-category="activity"]::before { background: #ef4444; }
.category-hint[data-category="shop"]::before { background: #ec4899; }
.category-hint[data-category="nature"]::before { background: #10b981; }
.category-hint[data-category="photo"]::before { background: #6366f1; }
.footer-curation {
    display: grid;
    gap: 6px;
    color: #4b5563;
    margin-bottom: 12px;
}
.footer-curation p {
    margin: 0;
}

/* 카테고리 탭 */
.category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    overflow-x: hidden;
    padding-bottom: 0;
}
.filter-tab {
    border: none;
    padding: 12px 20px;
    border-radius: 20px;
    background: var(--apple-card);
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.filter-tab:hover {
    background: #f2f2f7;
}
.filter-tab.active { 
    background: var(--apple-text); 
    color: var(--apple-card); 
}

/* 벤토 그리드 - Apple Style */
.bento-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
    grid-auto-rows: auto;
    gap: 24px; 
}
.card { 
    background: var(--apple-card); 
    border-radius: 24px; 
    overflow: hidden; 
    box-shadow: var(--apple-shadow); 
    display: flex; 
    flex-direction: column; 
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}
.card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}
.card-img { 
    width: 100%; 
    height: 220px; 
    background-size: cover; 
    background-position: center; 
}
.card-body { 
    padding: 24px; 
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}
.card-title {
    font-size: 20px;
    font-weight: 600;
    margin: 8px 0;
    line-height: 1.3;
}
.card-desc {
    color: #666;
    font-size: 15px;
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 16px;
}
.card-content { padding: 20px; }
.card-title { margin: 10px 0; font-size: 22px; }
.card-desc { color: #666; font-size: 15px; margin-bottom: 15px; }

/* 택시 헬퍼 */
.taxi-helper { background: #1d1d1f; color: #fff; padding: 15px; border-radius: 15px; margin: 15px 0; cursor: pointer; }
.taxi-helper small { opacity: 0.6; font-size: 10px; display: block; margin-bottom: 5px; }
.taxi-helper p { margin: 5px 0 0 0; font-weight: bold; }

/* 버튼 */
.card-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.btn { border: none; padding: 12px; border-radius: 12px; font-weight: 600; cursor: pointer; flex: 1; }
.btn-primary { background: #0071e3; color: #fff; }
.btn-secondary { background: #f2f2f7; color: #1d1d1f; }
.btn-aff { background: #000; color: #fff; padding: 8px; border-radius: 8px; font-size: 12px; border: none; cursor: pointer; flex: 1; }
.audio-btn { margin-top: 15px; background: none; border: none; color: #0071e3; cursor: pointer; font-weight: 600; }

.hidden { display: none !important; }

/* 푸터 */
.site-footer {
    margin: 48px 0 60px;
    padding: 24px 0 0;
    border-top: 1px solid var(--apple-border);
    display: grid;
    gap: 12px;
    color: #4b4b4f;
    font-size: 14px;
}
.footer-brand {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: baseline;
}
.footer-brand strong {
    color: var(--apple-text);
    font-size: 16px;
}
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.footer-links a {
    color: var(--apple-blue);
    text-decoration: none;
    font-weight: 600;
}
.footer-links a:hover {
    text-decoration: underline;
}
.footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #6b6b70;
}
.footer-notes {
    display: grid;
    gap: 6px;
    font-size: 13px;
    color: #6b6b70;
    line-height: 1.5;
}

/* 정책/소개 페이지 */
.page-wrap {
    max-width: 960px;
    margin: 40px auto 80px;
    padding: 0 24px;
}
.page-card {
    background: var(--apple-card);
    border-radius: 24px;
    box-shadow: var(--apple-shadow);
    padding: 28px 30px;
    display: grid;
    gap: 14px;
}
.page-title {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--apple-text);
}
.page-subtitle {
    margin: 0;
    color: #666;
    font-size: 14px;
}
.page-section-title {
    margin: 18px 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--apple-text);
}
.page-card p {
    margin: 0;
    line-height: 1.6;
    color: #333;
}
.page-card ul {
    margin: 0;
    padding-left: 18px;
    color: #333;
}
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}
.page-nav a {
    color: var(--apple-blue);
    text-decoration: none;
    font-weight: 600;
}
.page-nav a:hover {
    text-decoration: underline;
}

@media (max-width: 1100px) {
    .ad-layout { grid-template-columns: 1fr; }
    .ad-side { display: none; }
}

@media (max-width: 1024px) {
    .main-content {
        padding: 0 24px;
    }
    .app-body {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .sidebar-map {
        position: static;
        min-height: auto !important;
        padding: 18px;
    }
    .map-container {
        height: 420px !important;
    }
    .category-tabs {
        overflow-x: auto;
        padding-bottom: 6px;
    }
}

@media (max-width: 640px) {
    .main-content {
        padding: 0 16px;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .logo {
        font-size: 24px;
        white-space: normal;
    }
    .subtitle {
        font-size: 13px;
        line-height: 1.4;
    }
    .ui-hint {
        font-size: 12px;
        line-height: 1.5;
        margin-top: 8px;
    }
    .hint-block {
        padding: 10px 12px;
    }
    .top-filters {
        justify-content: flex-start;
        width: 100%;
    }
    .top-filters select,
    #searchInput,
    #searchButton,
    #langSelect {
        width: 100% !important;
        box-sizing: border-box;
    }
    #searchInput {
        width: 100% !important;
    }
    #resultCount {
        margin-left: 0 !important;
        width: 100%;
    }
    .map-container {
        height: 320px !important;
    }
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .card-img {
        height: 180px;
    }
    .footer-brand,
    .footer-links,
    .footer-meta {
        gap: 10px;
    }
}
