/*
Theme Name: 복지 포털
Theme URI: https://yoursite.com
Author: 김태훈
Author URI: https://yoursite.com
Description: 복지 혜택 검색 포털 워드프레스 테마
Version: 1.0.6
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: welfare-portal
*/

/* 기본 리셋 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f8f9fa;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* 헤더 */
header {
    width: 100%;
    min-height: 160px;
    padding: 20px 0;
    background: #fff;
}

.header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* 검색바 영역 */
.search_bar {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

/* 로고 */
.top_logo {
    text-align: center;
    margin-bottom: 10px;
    font-size: 32px;
    font-weight: bold;
}

.top_logo a {
    color: #00c73c;
}

.top_logo img {
    max-height: 60px;
}

/* 검색 입력 */
.search_wrapper {
    position: relative;
    width: 100%;
}

.search_wrapper form {
    position: relative;
    width: 100%;
}

.search_bar input[type="text"] {
    width: 100%;
    height: 50px;
    border: 2px solid #00c73c;
    border-radius: 25px;
    padding: 0 50px 0 20px;
    font-size: 16px;
    outline: none;
}

.search_bar input[type="text"]:focus {
    border-color: #00a030;
}

.search_icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 5px;
}

.search_icon:hover {
    opacity: 0.7;
}

/* 아이콘 네비게이션 - 이모지 사용 */
.icon_deong {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px;
    max-width: 100%;
    margin: 0 auto;
    width: 100%;
}

.icon_deong a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #505050;
    transition: all 0.2s;
    min-width: 60px;
}

.icon_deong a:hover {
    color: #00c73c;
    transform: translateY(-3px);
}

.icon_deong a.active {
    color: #00c73c;
}

.icon_deong a .icon-emoji {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: #f7f9fa;
    border-radius: 50%;
    transition: all 0.2s;
}

.icon_deong a:hover .icon-emoji,
.icon_deong a.active .icon-emoji {
    background: #e8f5e9;
    transform: scale(1.1);
}

.icon_deong a .icon-text {
    display: block;
    text-align: center;
}

/* 메인 배너 */
main {
    width: 100%;
    padding: 40px 0;
    margin-top: 30px;
}

.main {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.banner {
    width: 100%;
    max-width: 600px;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 auto;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 카테고리 배너 */
.category-banner {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
}

.category-banner h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.category-banner p {
    font-size: 16px;
    opacity: 0.9;
}

/* 게시글 영역 */
.main2 {
    width: 100%;
    height: auto;
    padding: 40px 0;
}

.main_2_in {
    width: 100%;
    max-width: 1400px;
    height: auto;
    margin: 0 auto;
    padding: 0 20px;
}

/* 벽돌형 레이아웃 - CSS Column 방식 (기본: 데스크탑 4단) */
.masonry-grid {
    column-count: 4;
    column-gap: 20px;
}

/* 게시글 카드 */
.post-card {
    display: inline-block;
    width: 100%;
    margin-bottom: 20px;
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.post-card > a {
    display: flex;
    flex-direction: column;
}

/* 이미지 영역 */
.post-card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 48px;
    overflow: hidden;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.post-category {
    display: inline-block;
    background: #e8f5e9;
    color: #00c73c;
    padding: 6px 14px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    width: fit-content;
}

.post-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
    line-height: 1.4;
}

.post-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: #999;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

.post-views {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 페이지네이션 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination .nav-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.pagination a,
.pagination span {
    padding: 10px 15px;
    background: white;
    border-radius: 5px;
    color: #333;
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #00c73c;
    color: white;
    border-color: #00c73c;
}

.pagination .current {
    background: #00c73c;
    color: white;
    border-color: #00c73c;
}

/* 단일 게시글 */
.single-post-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.single-post {
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-category-single {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f5e9;
    color: #00c73c;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
}

.single-post-title {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 20px;
    line-height: 1.4;
}

.single-post-meta {
    display: flex;
    gap: 20px;
    font-size: 14px;
    color: #999;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.single-post-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.single-post-thumbnail {
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden;
}

.single-post-thumbnail img {
    width: 100%;
    height: auto;
}

.single-post-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.single-post-content p {
    margin-bottom: 20px;
}

.single-post-content h2 {
    font-size: 24px;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #1a1a1a;
}

.single-post-content h3 {
    font-size: 20px;
    margin-top: 25px;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.single-post-content ul,
.single-post-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.single-post-content li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* 태그 스타일 */
.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.tag-link {
    display: inline-block;
    padding: 5px 12px;
    background: #f0f0f0;
    border-radius: 15px;
    font-size: 13px;
    color: #666;
    transition: all 0.2s;
}

.tag-link:hover {
    background: #00c73c;
    color: white;
}

/* 이전/다음 글 네비게이션 */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 40px 0;
    padding: 30px 0;
    border-top: 2px solid #f0f0f0;
    border-bottom: 2px solid #f0f0f0;
}

.nav-previous,
.nav-next {
    display: flex;
    flex-direction: column;
}

.nav-next {
    text-align: right;
}

.nav-subtitle {
    font-size: 13px;
    color: #999;
    margin-bottom: 8px;
    display: block;
}

.nav-title {
    font-size: 16px;
    color: #333;
    font-weight: 600;
    display: block;
    transition: color 0.2s;
}

.nav-previous a:hover .nav-title,
.nav-next a:hover .nav-title {
    color: #00c73c;
}

/* 관련 게시글 */
.related-posts {
    margin-top: 60px;
}

.related-posts-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #00c73c;
}

.related-posts-grid {
    column-count: 3;
    column-gap: 20px;
}

/* 검색 결과 페이지 */
.search-results-header {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 10px;
    margin-bottom: 30px;
}

.search-results-header h1 {
    font-size: 28px;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.search-results-header .search-query {
    color: #00c73c;
    font-weight: 600;
}

.search-results-count {
    font-size: 14px;
    color: #666;
}

/* 404 페이지 */
.error-404-content {
    text-align: center;
    padding: 80px 20px;
}

.error-404-content h1 {
    font-size: 120px;
    color: #00c73c;
    margin-bottom: 20px;
    font-weight: 700;
}

.error-404-content h2 {
    font-size: 32px;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.error-404-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.btn-home {
    display: inline-block;
    padding: 12px 30px;
    background: #00c73c;
    color: white;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-home:hover {
    background: #00a030;
    transform: translateY(-2px);
}

/* 푸터 */
footer {
    width: 100%;
    background: #2c3e50;
    color: white;
    padding: 40px 0;
    margin-top: 60px;
}

.footer-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.footer-container p {
    margin: 0;
    font-size: 14px;
}

/* 메시지 */
.no-posts-message {
    text-align: center;
    padding: 60px 20px;
    font-size: 18px;
    color: #666;
}

/* ========================================
   반응형 미디어 쿼리 (작은 화면부터 큰 화면 순서)
   ======================================== */

/* 작은 모바일 (~ 479px) */
@media screen and (max-width: 479px) {
    header {
        min-height: auto;
        padding: 15px 0;
    }

    .header {
        padding: 0 15px;
    }

    .search_bar {
        max-width: 100%;
        gap: 15px;
    }

    .top_logo {
        font-size: 22px;
        margin-bottom: 5px;
    }

    .search_bar input[type="text"] {
        height: 40px;
        font-size: 13px;
        padding: 0 40px 0 15px;
    }

    .search_icon {
        font-size: 16px;
        right: 10px;
    }

    .icon_deong {
        gap: 10px;
    }

    .icon_deong a {
        font-size: 9px;
        min-width: 45px;
    }

    .icon_deong a .icon-emoji {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    main {
        margin-top: 20px;
        padding: 20px 0;
    }

    .banner {
        height: 120px;
        font-size: 16px;
    }

    .category-banner h1 {
        font-size: 20px;
    }

    .main2 {
        padding: 20px 0;
    }

    .main_2_in {
        padding: 0 15px;
    }

    .masonry-grid {
        column-count: 1;
    }
    
    .post-card {
        margin-bottom: 12px;
    }

    .post-card-content {
        padding: 15px;
    }

    .post-title {
        font-size: 15px;
    }

    .post-excerpt {
        font-size: 12px;
    }

    .post-meta {
        font-size: 11px;
    }

    .single-post {
        padding: 20px;
    }

    .single-post-title {
        font-size: 22px;
    }

    .single-post-content {
        font-size: 14px;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .nav-next {
        text-align: left;
    }
    
    .related-posts-grid {
        column-count: 1;
    }
    
    .related-posts-title {
        font-size: 18px;
    }
}

/* 모바일 (480px ~ 599px) */
@media screen and (min-width: 480px) and (max-width: 599px) {
    header {
        min-height: auto;
        padding: 15px 0;
    }

    .header {
        padding: 0 15px;
    }

    .search_bar {
        max-width: 100%;
        gap: 15px;
    }

    .top_logo {
        font-size: 24px;
        margin-bottom: 5px;
    }

    .search_bar input[type="text"] {
        height: 45px;
        font-size: 14px;
    }

    .icon_deong {
        gap: 12px;
        padding: 5px;
    }

    .icon_deong a {
        font-size: 10px;
        min-width: 50px;
    }

    .icon_deong a .icon-emoji {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    main {
        margin-top: 20px;
        padding: 20px 0;
    }

    .banner {
        height: 150px;
        font-size: 18px;
    }

    .category-banner h1 {
        font-size: 24px;
    }

    .main2 {
        padding: 20px 0;
    }

    .main_2_in {
        padding: 0 15px;
    }

    .masonry-grid {
        column-count: 2;
        column-gap: 12px;
    }
    
    .post-card {
        margin-bottom: 12px;
    }

    .post-card-content {
        padding: 15px;
    }

    .post-title {
        font-size: 16px;
    }

    .post-excerpt {
        font-size: 13px;
    }

    .post-meta {
        font-size: 12px;
    }

    .single-post {
        padding: 20px;
    }

    .single-post-title {
        font-size: 24px;
    }

    .single-post-content {
        font-size: 15px;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .nav-next {
        text-align: left;
    }
    
    .related-posts-grid {
        column-count: 1;
    }
    
    .related-posts-title {
        font-size: 20px;
    }
}

/* 태블릿 (600px ~ 899px) */
@media screen and (min-width: 600px) and (max-width: 899px) {
    .masonry-grid {
        column-count: 2;
        column-gap: 15px;
    }
    
    .post-card {
        margin-bottom: 15px;
    }
    
    .icon_deong {
        gap: 15px;
    }
    
    .icon_deong a {
        font-size: 11px;
        min-width: 55px;
    }
    
    .icon_deong a .icon-emoji {
        width: 44px;
        height: 44px;
        font-size: 24px;
    }
    
    .single-post {
        padding: 30px;
    }
    
    .single-post-title {
        font-size: 28px;
    }
    
    .related-posts-grid {
        column-count: 2;
    }
}

/* 중형 데스크탑 (900px ~ 1199px) */
@media screen and (min-width: 900px) and (max-width: 1199px) {
    .masonry-grid {
        column-count: 3;
        column-gap: 18px;
    }
    
    .post-card {
        margin-bottom: 18px;
    }
}

/* 대형 데스크탑 (1200px 이상) - 기본값(4단) 사용하므로 별도 정의 불필요 */