/* 출산육아지원금 가이드 - 커스텀 스타일 */

/* 기본 설정 및 애니메이션 */
* {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* 특정 요소에만 부드러운 전환 효과 적용 (전체 페이지 애니메이션 방지) */
button, 
.btn, 
a:hover,
.hover-effect,
input,
textarea,
select,
.transition-smooth {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 🚨 button 기본 스타일 리셋 - Tailwind 파란색 방지 */
button {
    background: transparent;
    color: inherit;
    border: none;
}

/* 전체 폰트 설정 */
body, html {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: 'tnum';
    font-variant-numeric: tabular-nums;
}

/* 검색 필터 박스 전체 폰트 */
.bg-white.rounded-2xl.shadow-xl * {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* 입력 필드 및 셀렉트 박스 */
input, select, option, label {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
    letter-spacing: -0.01em;
}

/* 플레이스홀더 텍스트 */
input::placeholder {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
    letter-spacing: -0.01em;
}

/* 스크롤바 커스터마이징 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(to bottom, #f8fafc, #e2e8f0);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #ec4899, #8b5cf6);
    border-radius: 10px;
    border: 2px solid #f8fafc;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #db2777, #7c3aed);
}

/* Apple Style 카드 디자인 - 미리보기와 완전 동일 */
.post-card, .category-card {
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 8px !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 400px !important;
    margin: 0 auto;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.post-card:hover, .category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: #e0e0e0;
}

/* 지역별 지원 카드만 특별 스타일 */
.category-card[data-category="지역별 지원"] {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
}

.category-card[data-category="지역별 지원"]:hover {
    background: #ffffff;
    border-color: #d0d0d0;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.post-card:hover::before, .category-card:hover::before {
    opacity: 1;
}

.post-card::before, .category-card::before {
    opacity: 0.1;
}

/* 글로우 펄스 애니메이션 */
@keyframes glow-pulse {
    0% {
        opacity: 0.1;
        filter: blur(2px);
    }
    100% {
        opacity: 0.3;
        filter: blur(1px);
    }
}





/* 카드 이미지 스타일 - 정사각형 이미지 온전히 표시 */
.post-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* 정사각형 비율 유지 */
    background: linear-gradient(135deg, #fce7f3, #e0e7ff);
}

/* 🎯 모든 카드 이미지 영역을 정사각형으로 만들기 */
.post-card .relative.h-48,
.category-card .relative.h-48 {
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
}

.post-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 이미지가 잘리지 않고 온전히 표시 */
    object-position: center;
    transition: transform 0.3s ease;
}

/* 카테고리 카드 내 이미지도 동일한 효과 */
.category-card:hover img {
    transform: scale(1.05);
}

.post-card:hover .post-image {
    transform: scale(1.05);
}

/* 카테고리 배지 - absolute positioning 제거 */

/* 읽기 시간 배지 */
.reading-time {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #6366f1;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* 카드 콘텐츠 영역 */
.post-content {
    padding: 24px;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between; /* 콘텐츠를 균등 분배 */
}

/* 카드 내부 패딩 영역 (p-6 클래스 대체) */
.post-card .p-6,
.category-card .p-6 {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}

/* 버튼을 항상 하단에 고정 */
.post-card button,
.category-card button {
    margin-top: auto;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.02em;
}

.post-excerpt {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.01em;
}

/* 태그 스타일 */
.tag {
    display: inline-block;
    background: #f8fafc;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-right: 6px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.tag:hover {
    background: #e2e8f0;
    color: #334155;
    /* 태그 움직임 제거 */
}

/* 카드 하단 영역 */
.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.post-date {
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 500;
}

/* 읽기 버튼 */
.btn-read {
    background: #000;
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;

    transition: all 0.3s ease;
}

.btn-read:hover {
    background: #333;
    /* 버튼 움직임 제거 */
}

/* 빠른 필터 버튼 - 카드고릴라 스타일 */
.filter-btn {
    background: white;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    letter-spacing: -0.01em;
    font-feature-settings: 'tnum';
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* 카테고리 버튼 (전체 제외) - 진한 회색 스타일 */
.filter-btn:not(.filter-all) {
    background: #e5e7eb;
    color: #374151;
    border: 1px solid #d1d5db;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    background: #f8fafc;
    color: #111827;
    /* 필터 버튼 움직임 제거 */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border-color: #c7d2fe;
}

/* 카테고리 버튼 호버 (전체 제외) */
.filter-btn:not(.filter-all):hover {
    background: #d1d5db;
    color: #111827;
    border-color: #9ca3af;
}

.filter-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.25);
    /* 활성화 버튼 움직임 제거 */
    border-color: #3b82f6;
    font-weight: 700;
}

/* 카테고리 버튼 활성화 (전체 제외) */
.filter-btn:not(.filter-all).active {
    background: #e5e7eb;
    color: #374151;
    border-color: #9ca3af;
    font-weight: 700;
}

/* 애니메이션 클래스 */
.fade-in {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 카테고리별 아이콘 색상 - Apple 스타일 */
.category-임신출산준비 { background: #ff3b30; }
.category-출산육아지원 { background: #007aff; }
.category-직장맘아빠지원 { background: #af52de; }
.category-주거금융혜택 { background: #ff9500; }
.category-특별지원제도 { background: #34c759; }

/* 로딩 스피너 기본 숨김 */
#loadingSpinner {
    display: none !important;
}

/* 로딩 애니메이션 개선 */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    } 40% {
        transform: scale(1);
    }
}

/* 검색 입력 필드 개선 */
.search-input:focus {
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

/* 검색 박스 내부 모든 텍스트 스타일 */
#searchInput, #categoryFilter, #sortSelect {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 400;
    letter-spacing: -0.01em;
}

/* 라벨 텍스트 스타일 */
label {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* 제목과 서브타이틀 */
h2, p {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* 통계 카드 그라데이션 */
.stats-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 광고 영역 스타일 */
.ad-container {
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(156, 163, 175, 0.3);
    transition: all 0.3s ease;
}

.ad-container:hover {
    border-color: rgba(156, 163, 175, 0.5);
    /* 광고 컨테이너 움직임 제거 */
}

/* 🔧 그리드 레이아웃 재정의 */

/* 모바일 그리드 */
@media (max-width: 767px) {
    #inlineTopRegionsGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        justify-items: stretch !important;
    }
    
    #inlineAllRegionsGrid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        justify-items: stretch !important;
    }
}

/* 태블릿 그리드 */
@media (min-width: 768px) and (max-width: 1023px) {
    #inlineTopRegionsGrid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px !important;
        justify-items: center !important;
        max-width: 600px !important;
        margin: 0 auto !important;
    }
    
    #inlineAllRegionsGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        justify-items: center !important;
        max-width: 800px !important;
        margin: 0 auto !important;
    }
}

/* PC 그리드 */
@media (min-width: 1024px) {
    #inlineTopRegionsGrid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 20px !important;
        justify-items: center !important;
        max-width: 1100px !important;
        margin: 0 auto !important;
    }
    
    #inlineAllRegionsGrid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 20px !important;
        justify-items: center !important;
        max-width: 1200px !important;
        margin: 0 auto !important;
    }
}

/* 모바일 최적화 */
@media (max-width: 767px) {
    /* 📱 모바일에서 카드 5% 축소 */
    .post-card,
    .category-card {
        transform: scale(0.95);
        transform-origin: center;
    }
    
    /* 모바일 카드 호버 효과도 스케일 고려 */
    .post-card:hover,
    .category-card:hover {
        transform: scale(0.95) translateY(-4px) !important;
    }
    .post-card {
        margin-bottom: 24px;
    }
    
    .post-card:hover {
        /* 모바일 카드 움직임 제거 */
    }
    
    .category-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    .btn-read {
        width: 100%;
        justify-content: center;
        padding: 12px 20px;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.875rem;
        min-height: 40px;
        font-weight: 600;
    }
    
    #quickFilters {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }
    
    .post-title {
        font-size: 1.1rem;
    }
    
    .post-excerpt {
        font-size: 0.85rem;
    }
    
    /* 모바일에서 지역별 그리드 정렬 */
    #inlineTopRegionsGrid {
        grid-template-columns: repeat(2, 1fr) !important;
        justify-items: center !important;
        gap: 12px !important;
    }
    
    #inlineAllRegionsGrid {
        grid-template-columns: 1fr !important;
        justify-items: center !important;
        gap: 12px !important;
    }
    
    /* 모바일에서 박스 크기 */
    #inlineTopRegionsGrid .category-card,
    #inlineTopRegionsGrid .post-card,
    #inlineAllRegionsGrid .category-card,
    #inlineAllRegionsGrid .post-card {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* 다크모드 지원 */
@media (prefers-color-scheme: dark) {
    .post-card, .category-card {
        background: #1f2937;
        border-color: #374151;
        color: #f9fafb;
    }
    
    .post-title {
        color: #f9fafb;
    }
    
    .post-excerpt {
        color: #d1d5db;
    }
    
    .tag {
        background: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .filter-btn {
        background: #374151;
        color: #d1d5db;
        border-color: #4b5563;
    }
    
    .filter-btn:hover {
        background: #4b5563;
        color: #f3f4f6;
    }
}

/* 접근성 개선 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 포커스 표시 개선 */
.focus-visible {
    outline: 2px solid #ec4899;
    outline-offset: 2px;
}

/* 인쇄용 스타일 */
@media print {
    .post-card {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }
    
    .btn-read {
        background: #6b7280 !important;
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
    
    .ad-container {
        display: none;
    }
}

/* 관련 포스트 카드 및 모든 카드에 자연스러운 글로우 효과 일관 적용 */
.related-post-card, .post-card-small, .featured-card {
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(59, 130, 246, 0.2),
        0 0 15px rgba(59, 130, 246, 0.3) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.related-post-card:hover, .post-card-small:hover, .featured-card:hover {
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.15),
        0 0 0 2px rgba(59, 130, 246, 0.5),
        0 0 10px rgba(59, 130, 246, 0.6),
        0 0 20px rgba(147, 51, 234, 0.4) !important;
    border-color: rgba(59, 130, 246, 0.6) !important;
}

/* 인스타그램 스타일 좋아요 버튼 */
.like-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 8px !important;
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    border-radius: 0 !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif !important;
    filter: none !important;
}

.like-btn i {
    font-size: 1.25rem;
    color: #374151;
    transition: all 0.3s ease;
    text-shadow: none;
    filter: none;
}

.like-btn .like-count {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 700;
    text-shadow: none;
    filter: none;
    min-width: 20px;
}

/* 기본 상태: 빈 하트 */
.like-btn:not(.liked) i {
    font-family: 'Font Awesome 5 Free';
    font-weight: 400; /* far (outline) */
}

/* 좋아요 상태: 채워진 빨간 하트 */
.like-btn.liked i {
    font-family: 'Font Awesome 5 Free';
    font-weight: 900; /* fas (solid) */
    color: #ff3040;
    text-shadow: none;
}

/* 호버 효과 */
.like-btn:hover {
    transform: scale(1.1);
}

/* 모든 상태에서 파란색 배경 강제 제거 */
.like-btn:focus,
.like-btn:active,
.like-btn:hover,
.like-btn:visited {
    background: transparent !important;
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
}

.like-btn:not(.liked):hover i {
    color: #ff3040;
    transform: scale(1.1);
}

/* 클릭 애니메이션 (부드러운 스타일) */
.like-animation {
    animation: gentleLike 0.3s ease-out;
}

@keyframes gentleLike {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* 인스타그램 스타일 중앙 하트 팝업 */
.center-heart {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: white;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    animation: centerHeartPop 0.8s ease-out forwards;
}

@keyframes centerHeartPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0);
    }
    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.2);
    }
}



/* 공유하기 토글 버튼 */
.share-toggle-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 20px;
    color: #3b82f6;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

.share-toggle-btn:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
}

/* 헤더 공유 버튼 (작은 사이즈) */
.share-toggle-btn-header {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.share-toggle-btn-header:hover {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

/* 공유 모달 */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: none;
}

.share-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.share-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.share-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.share-modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.share-modal-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.share-modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.share-modal-body {
    padding: 20px 24px 24px;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 16px;
}

.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
}

.share-option i {
    font-size: 1.5rem;
}

.share-option.kakao {
    background: #fee500;
    color: #3c1e1e;
}

.share-option.sms {
    background: #10b981;
    color: white;
}

.share-option.facebook {
    background: #1877f2;
    color: white;
}

.share-option.twitter {
    background: #1d9bf0;
    color: white;
}

.share-option.copy {
    background: #6b7280;
    color: white;
}

.share-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 공유 성공 알림 */
.share-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(34, 197, 94, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
}

.share-toast.show {
    opacity: 1;
}

/* Apple Style 카테고리 배지 - 미리보기와 완전 동일 */
.category-badge {
    background: #f0f4ff;
    color: #1d4ed8;
    border: 1px solid #c7d2fe;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(29, 78, 216, 0.1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}





/* 지역별 지원 버튼 스타일 제거 - 기본 "게시물 준비중" 버튼 사용 */

/* 카테고리별 색상 - 미리보기와 완전 동일 */
.category-badge[data-category="결혼·신혼지원"] { 
    background: #fef2f2; 
    color: #dc2626; 
    border-color: #fecaca;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.1);
}

.category-badge[data-category="임신출산지원"] { 
    background: #eff6ff; 
    color: #2563eb; 
    border-color: #dbeafe;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

.category-badge[data-category="출산육아지원"] { 
    background: #f0fdf4; 
    color: #16a34a; 
    border-color: #bbf7d0;
    box-shadow: 0 2px 4px rgba(22, 163, 74, 0.1);
}

.category-badge[data-category="직장맘아빠지원"] { 
    background: #faf5ff; 
    color: #9333ea; 
    border-color: #e9d5ff;
    box-shadow: 0 2px 4px rgba(147, 51, 234, 0.1);
}

.category-badge[data-category="주거금융혜택"] { 
    background: #fff7ed; 
    color: #ea580c; 
    border-color: #fed7aa;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.1);
}

.category-badge[data-category="지역별지원"] { 
    background: #f0fdfa; 
    color: #0d9488; 
    border-color: #99f6e4;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.1);
}

/* 완벽한 Apple Style 카드 디자인 */
.category-card, .post-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.08),
        0 1px 4px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    height: auto;
    min-height: auto;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: #e0e0e0;
}

/* 지역별 지원 카드만 Style 6 (Dark Mode Inspired) */
.category-card[data-category="지역별 지원"] {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
}

.category-card[data-category="지역별 지원"]:hover {
    background: #ffffff;
    border-color: #d0d0d0;
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Apple Style 버튼 개선 */
.category-card button {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    border-radius: 12px;
    padding: 16px 24px;
    font-size: 16px;
    min-height: 50px;
    transition: all 0.2s ease;
}

.category-card button:first-child {
    background: #f8f9fa !important;
    color: #495057 !important;
    border: 1px solid #dee2e6 !important;
}

/* 기존 버튼 스타일 제거 - lightning-btn 사용 */

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .post-card {
        border: 2px solid #000;
    }
    
    .btn-read {
        background: #000 !important;
        color: #fff !important;
    }
    
    .category-badge {
        background: #000 !important;
        color: #fff !important;
    }
}

/* 🔧 PC 버전 카드 너비 제한 - 메인 페이지와 동일한 레이아웃 */
@media (min-width: 768px) {
    /* 모든 그리드 컨테이너에서 카드 최대 너비 제한 */
    #categoryGrid .category-card,
    #categoryGrid .post-card,
    #inlineSearchResults .category-card,
    #inlineSearchResults .post-card,
    #inlineAllRegionsGrid .category-card,
    #inlineAllRegionsGrid .post-card,
    #inlineTopRegionsGrid .category-card,
    #inlineTopRegionsGrid .post-card {
        max-width: 400px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }
    
    /* 그리드 컨테이너에서 카드들이 중앙 정렬되도록 */
    #categoryGrid,
    #inlineSearchResults,
    #inlineAllRegionsGrid,
    #inlineTopRegionsGrid {
        justify-items: center !important;
    }
    
    /* TOP 5 지역 박스 특별 처리 - 5열 그리드에서 적절한 크기 */
    #inlineTopRegionsGrid .category-card,
    #inlineTopRegionsGrid .post-card {
        max-width: 220px !important;
        min-width: 180px !important;
    }
    
    /* PC에서 3열 그리드의 각 컬럼 너비 제한 */
    @media (min-width: 1024px) {
        #categoryGrid,
        #inlineSearchResults,
        #inlineAllRegionsGrid,
        #inlineTopRegionsGrid {
            max-width: 1400px !important;
            margin: 0 auto !important;
        }
        
        /* 🖥️ PC에서 메인 카테고리 카드 크기 조정 - 6장이 한 화면에 들어오도록 */
        #categoryGrid .category-card,
        #categoryGrid .post-card {
            max-width: 360px !important;
            transform: scale(0.95);
            transform-origin: center;
        }
        
        /* 호버 효과도 스케일 고려 */
        #categoryGrid .category-card:hover,
        #categoryGrid .post-card:hover {
            transform: scale(0.95) translateY(-4px) !important;
        }
        
        /* PC에서 메인 카테고리 그리드 간격 축소 */
        #categoryGrid {
            gap: 16px !important;
        }
        
        /* 🎯 전체보기와 지역별 지원 카드들도 메인페이지와 동일한 크기 적용 */
        #inlineSearchResults .category-card,
        #inlineSearchResults .post-card,
        #inlineAllRegionsGrid .category-card,
        #inlineAllRegionsGrid .post-card {
            max-width: 360px !important;
            transform: scale(0.95) !important;
            transform-origin: center !important;
        }
        
        /* 전체보기와 지역별 지원 카드 호버 효과 */
        #inlineSearchResults .category-card:hover,
        #inlineSearchResults .post-card:hover,
        #inlineAllRegionsGrid .category-card:hover,
        #inlineAllRegionsGrid .post-card:hover {
            transform: scale(0.95) translateY(-4px) !important;
        }
        
        /* 전체보기와 지역별 지원 그리드 간격도 축소 */
        #inlineSearchResults,
        #inlineAllRegionsGrid {
            gap: 16px !important;
        }
        
        /* 🎯 전체보기 카드들도 메인페이지와 동일한 크기 적용 */
        #postsGrid .post-card {
            max-width: 360px !important;
            transform: scale(0.95);
            transform-origin: center;
        }
        
        /* 전체보기 카드 호버 효과 */
        #postsGrid .post-card:hover {
            transform: scale(0.95) translateY(-4px) !important;
        }
        
        /* 전체보기 그리드 간격도 축소 */
        #postsGrid {
            gap: 16px !important;
        }
        
        /* 대형 화면에서 TOP 5 지역 박스 크기 조정 */
        #inlineTopRegionsGrid .category-card,
        #inlineTopRegionsGrid .post-card {
            max-width: 200px !important;
            min-width: 160px !important;
        }
    }
}

/* 🎯 지역별 박스 크기 통일 - 완전 재작업 */

/* 📱 모바일 (767px 이하) */
@media (max-width: 767px) {
    /* TOP 5 박스 - 모바일 */
    #inlineTopRegionsGrid > div {
        height: 130px !important;
        min-height: 130px !important;
        width: 100% !important;
        padding: 20px 16px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        box-sizing: border-box !important;
    }
    
    /* TOP 5 박스 내부 요소들 모바일 전용 스타일 */
    #inlineTopRegionsGrid .top5-icon {
        line-height: 1 !important;
        margin-bottom: 8px !important;
        font-size: 2.5rem !important;
        height: auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    #inlineTopRegionsGrid .top5-region {
        line-height: 1.2 !important;
        margin-bottom: 6px !important;
        font-size: 0.875rem !important;
        font-weight: 700 !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    #inlineTopRegionsGrid .top5-count {
        line-height: 1.2 !important;
        font-size: 0.75rem !important;
        font-weight: 600 !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* 전체 지역별 박스 - 모바일 */
    #inlineAllRegionsGrid > div {
        height: 140px !important;
        min-height: 140px !important;
        width: 100% !important;
        padding: 12px 16px 16px 16px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        overflow: hidden !important;
        box-sizing: border-box !important;
    }
    
    /* 모바일 지역별 박스 내부 텍스트 간격 조정 */
    #inlineAllRegionsGrid > div .text-gray-600 {
        line-height: 1.1 !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow: hidden !important;
    }
    
    #inlineAllRegionsGrid > div .text-gray-600 > div {
        margin-bottom: 0px !important;
        line-height: 1.1 !important;
        font-size: 0.875rem !important;
    }
}

/* 💻 태블릿 (768px ~ 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    /* TOP 5 박스 - 태블릿 */
    #inlineTopRegionsGrid > div {
        height: 150px !important;
        min-height: 150px !important;
        width: 100% !important;
        max-width: 180px !important;
        padding: 20px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    /* 전체 지역별 박스 - 태블릿 */
    #inlineAllRegionsGrid > div {
        height: 180px !important;
        min-height: 180px !important;
        width: 100% !important;
        max-width: 350px !important;
        padding: 20px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
}

/* 🖥️ PC (1024px 이상) */
@media (min-width: 1024px) {
    /* TOP 5 박스 - PC */
    #inlineTopRegionsGrid > div {
        height: 170px !important;
        min-height: 170px !important;
        width: 100% !important;
        max-width: 200px !important;
        padding: 24px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
    }
    
    /* 전체 지역별 박스 - PC */
    #inlineAllRegionsGrid > div {
        height: 200px !important;
        min-height: 200px !important;
        width: 100% !important;
        max-width: 380px !important;
        padding: 24px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }
}

/* 📝 박스 내부 텍스트 처리 */

/* TOP 5 박스는 모바일에서 overflow visible */
@media (max-width: 767px) {
    #inlineTopRegionsGrid > div,
    #inlineTopRegionsGrid > div > div {
        overflow: visible !important;
    }
}

/* 태블릿, PC에서만 overflow 처리 */
@media (min-width: 768px) {
    #inlineTopRegionsGrid > div > div,
    #inlineAllRegionsGrid > div > div {
        overflow: hidden !important;
    }
}

/* 지역명 텍스트 처리 - 모바일 제외 */
@media (min-width: 768px) {
    #inlineTopRegionsGrid h4,
    #inlineAllRegionsGrid h4 {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        max-width: 100% !important;
    }
}

/* 설명 텍스트 처리 */
#inlineAllRegionsGrid .text-gray-600 > div {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    max-width: 100% !important;
}

/* ==============================================
   💫 실시간 인기순위 위젯 스타일
   ============================================== */

.ranking-widget-container {
    font-family: 'Pretendard Variable', 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* 메인 위젯 컨테이너 */
.live_ranking {
    position: relative;
    background: #fff;
    border-radius: 9999px; /* 바로찾아보기와 같은 완전한 둥근 모서리 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
    z-index: 9998;
    width: 340px;
    cursor: pointer;
    overflow: visible;
    transition: all 0.3s ease;
}

.live_ranking:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 축소 상태 - 제목 영역 */
.live_ranking .tit {
    height: 60px;
    position: relative;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 30px;
}

.live_ranking .tit strong {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 19px;
    font-weight: 800;
    color: #000;
    letter-spacing: -0.01em;
}

/* 드롭다운 화살표 - 오른쪽 끝 완전 고정 */
.dropdown-arrow {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #666;
}

/* 펼쳐진 상태 - 약간 반투명한 배경 */
.hd_slide {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 999999;
    width: 340px;
    background: rgba(255, 255, 255, 0.95); /* 약간 반투명 */
    backdrop-filter: blur(10px); /* 배경 블러 */
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.live_ranking:hover .hd_slide {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.live_ranking:hover .tit {
    opacity: 0;
}

/* 펼쳐진 박스 헤더 */
.slide_header {
    padding: 15px 20px 10px;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    color: #222;
    line-height: 1.4;
    margin-bottom: 10px;
}

.slide_lst {
    height: 100%;
    overflow: hidden;
    padding: 0 0 20px;
}

/* 순위 목록 스타일 */
.ranking_lst {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ranking_lst li {
    margin: 0;
}

.ranking_lst a {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0 20px;
    transition: background-color 0.1s;
}

.ranking_lst a:hover {
    background-color: rgba(255, 255, 255, 0.7);
}

.ranking_lst a p {
    height: 50px;
    display: table-cell;
    vertical-align: middle;
    margin: 0;
}

/* 순위 숫자 */
.lst_cmd .num {
    width: 60px;
    padding: 0 0 0 15px;
    line-height: 50px;
    text-align: center;
    font-size: 24px;
    color: rgba(0, 0, 0, 0.4);
    font-weight: 900;
    display: table-cell;
    vertical-align: middle;
}

/* 아이콘 */
.lst_cmd .card {
    width: 24px;
    height: 24px;
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    font-size: 16px;
    margin-right: 10px;
}

/* 제목 */
.lst_cmd .name {
    color: #444;
    font-weight: 700;
    font-size: 14px;
    display: table-cell;
    vertical-align: middle;
    padding-left: 10px;
}

/* 애니메이션 */
.rank-animation {
    animation: slideUp 0.5s ease-in-out;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 메인 콘텐츠 z-index 조정 - 위젯이 위에 나타나도록 */
main {
    position: relative;
    z-index: 1;
}

/* 랭킹에서 선택된 카드 펄스 효과 */
.ranking-pulse-highlight {
    animation: rankingPulse 5s ease-out;
}

@keyframes rankingPulse {
    0% { transform: scale(1); }
    10% { transform: scale(1.03); }
    20% { transform: scale(1); }
    30% { transform: scale(1.03); }
    40% { transform: scale(1); }
    50% { transform: scale(1.03); }
    60% { transform: scale(1); }
    70% { transform: scale(1.03); }
    80% { transform: scale(1); }
    100% { transform: scale(1); }
}

/* 드롭다운 제목 반응형 스타일 */

/* PC (1024px 이상) - 1줄로 제한, 길면 ... 표시 */
@media (min-width: 1024px) {
    #pcTop5List .flex-1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    #pcTop5List .flex {
        align-items: center;
        padding: 0.5rem;
    }
}

/* 태블릿 (768px ~ 1023px) - 스마트 줄바꿈으로 2줄 표시 */
@media (min-width: 768px) and (max-width: 1023px) {
    #pcTop5List .flex-1 {
        line-height: 1.4;
        max-height: calc(1.4em * 2);
        overflow: hidden;
    }
    
    #pcTop5List .flex {
        align-items: flex-start;
        padding: 0.75rem 0.5rem;
    }
    
    #pcTop5List .w-6 {
        margin-top: 0.125rem;
        flex-shrink: 0;
    }
}

/* 모바일 (767px 이하) - 스마트 줄바꿈으로 2줄 표시 */
@media (max-width: 767px) {
    #mobileTop5List .flex-1 {
        line-height: 1.4;
        max-height: calc(1.4em * 2);
        overflow: hidden;
    }
    
    #mobileTop5List .flex {
        align-items: flex-start;
        padding: 0.75rem 0.5rem;
    }
    
    #mobileTop5List .w-6 {
        margin-top: 0.125rem;
        flex-shrink: 0;
    }
}

/* 위젯 컨테이너 z-index 더욱 강화 */
.ranking-widget-container {
    position: relative;
    z-index: 99999;
}



/* ==============================================
   📱 반응형 디자인 - 위젯
   ============================================== */

/* 모바일 (767px 이하) */
@media (max-width: 767px) {
    .ranking-widget-container {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .live_ranking {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    
    .hd_slide {
        width: 100%;
        max-width: 300px;
    }
    
    .live_ranking .tit {
        padding-left: 20px;
    }
    
    .live_ranking .tit strong {
        font-size: 16px;
        gap: 8px;
    }
    
    .slide_header {
        font-size: 16px;
        padding: 12px 16px 8px;
    }
    
    .lst_cmd .name {
        font-size: 12px;
    }
    
    .lst_cmd .num {
        font-size: 20px;
        width: 50px;
    }
}

/* 태블릿 (768px ~ 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .ranking-widget-container {
        width: 340px;
        margin: 0 auto;
    }
    
    .live_ranking {
        width: 340px;
    }
    
    .hd_slide {
        width: 340px;
    }
}

/* PC (1024px 이상) */
@media (min-width: 1024px) {
    .ranking-widget-container {
        width: 340px;
        margin: 0 auto;
    }
    
    .live_ranking {
        width: 340px;
    }
    
    .hd_slide {
        width: 340px;
    }
}

/* ==============================================
   💎 PC용 고급 드롭다운 효과 (글래스모피즘)
   ============================================== */

/* 호버 시 드롭다운 표시 */
#pcRankingContainer:hover #pcRankingDropdown {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

/* 글래스모피즘 효과 강화 */
#pcRankingDropdown .bg-white\/90 {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.1),
        0 10px 25px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}



/* 🚀 완전히 새로운 라이트닝 버튼 - 트렌드 4 효과 */
/* 🔥 트렌드 4: 라이트닝 스위프 - 정확한 복사 */
button.lightning-btn.w-full {
    background: linear-gradient(135deg, #2d3748, #1a202c) !important;
    color: white !important;
    border: none !important;
    padding: 16px 24px !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    font-size: 16px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    overflow: hidden !important;
    min-height: 50px !important;
}

button.lightning-btn.w-full::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: left 0.6s ease;
}

button.lightning-btn.w-full:hover::before {
    left: 100%;
}

button.lightning-btn.w-full:hover {
    background: linear-gradient(135deg, #374151, #2d3748) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 10px 30px rgba(26, 32, 44, 0.4) !important;
}