/*
Theme Name: 정책베이스 - Astra Child
Theme URI: https://policybase.co.kr
Description: 정책 정보 블로그를 위한 Astra 자식 테마
Author: PolicyBase Team
Template: astra
Version: 2.0.0
License: GNU General Public License v2 or later
Text Domain: policybase-child
*/

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --pb-deep-navy: #1a2a4a;
    --pb-sky-blue: #4a9eff;
    --pb-white: #FFFFFF;
    --pb-text: #333333;
    --pb-light-gray: #f8f9fa;
    --pb-border: #e9ecef;
    
    /* Category Colors */
    --pb-cat-support: #e74c3c;
    --pb-cat-housing: #27ae60;
    --pb-cat-youth: #3498db;
    --pb-cat-senior: #9b59b6;
    --pb-cat-life: #f39c12;
}

/* ==========================================================================
   Global Reset & Base
   ========================================================================== */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
    background: var(--pb-white) !important;
    color: var(--pb-text);
    line-height: 1.7;
}

a {
    color: var(--pb-deep-navy);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--pb-sky-blue);
}

/* ==========================================================================
   Header - 시안과 동일
   ========================================================================== */
.ast-primary-header-bar,
.ast-primary-header {
    background: var(--pb-white) !important;
    border-bottom: 1px solid var(--pb-border) !important;
}

/* 로고: 정책베이스 (베이스는 스카이블루) */
.site-title {
    font-size: 28px !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
}

.site-title a {
    color: var(--pb-deep-navy) !important;
}

/* "베이스" 부분 스카이블루 - span.pb-highlight 클래스 사용 */
.site-title .pb-highlight,
.site-branding .pb-highlight {
    color: var(--pb-sky-blue) !important;
}

/* ==========================================================================
   Primary Navigation - 딥 네이비 배경
   ========================================================================== */
.ast-primary-header-bar .main-header-menu,
.ast-builder-menu .main-header-menu,
.ast-primary-header .main-header-menu {
    background: var(--pb-deep-navy) !important;
}

/* 네비게이션 전체 배경 */
.ast-primary-header-bar .ast-builder-menu,
.ast-builder-menu-1 .main-header-menu,
nav.main-header-menu {
    background: var(--pb-deep-navy) !important;
}

/* 메뉴 감싸는 row */
.ast-primary-header-bar .ast-builder-grid-row,
.ast-primary-header .site-primary-header-wrap {
    background: transparent !important;
}

/* 메뉴 아이템 스타일 */
.main-header-menu .menu-item > .menu-link,
.ast-builder-menu .menu-item > .menu-link,
.ast-nav-menu .menu-item > .menu-link {
    color: var(--pb-white) !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    padding: 14px 24px !important;
    transition: all 0.2s ease !important;
}

.main-header-menu .menu-item > .menu-link:hover,
.main-header-menu .menu-item.current-menu-item > .menu-link,
.ast-builder-menu .menu-item > .menu-link:hover {
    background: var(--pb-sky-blue) !important;
    color: var(--pb-white) !important;
}

/* 메뉴 컨테이너 */
.ast-builder-menu-1,
.ast-hfb-header .ast-builder-menu {
    background: var(--pb-deep-navy) !important;
}

/* ==========================================================================
   Search Box
   ========================================================================== */
.ast-search-menu-icon .search-field,
.ast-search-box input[type="search"] {
    background: var(--pb-light-gray) !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 10px 20px !important;
}

/* ==========================================================================
   홈페이지 제목 숨기기
   ========================================================================== */
.home .entry-title,
.home .page-title,
.home article.page > header,
body.page-template-default.home .entry-header,
.home .ast-archive-description {
    display: none !important;
}

/* ==========================================================================
   Featured Section - 시안과 동일한 레이아웃
   ========================================================================== */
.pb-featured-section {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-bottom: 50px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.pb-featured-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 400px;
    background: linear-gradient(135deg, var(--pb-deep-navy) 0%, var(--pb-sky-blue) 100%);
}

.pb-featured-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pb-featured-main .pb-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.pb-featured-main .pb-overlay .pb-category-tag {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
    color: white;
}

.pb-featured-main .pb-overlay h2 {
    font-size: 26px !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
    line-height: 1.3 !important;
    color: white !important;
}

.pb-featured-main .pb-overlay h2 a {
    color: white !important;
}

.pb-featured-main .pb-overlay h2 a:hover {
    opacity: 0.9;
}

.pb-featured-main .pb-meta {
    font-size: 13px;
    opacity: 0.8;
}

/* Featured Side - 오른쪽 2개 세로 배치 */
.pb-featured-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.pb-featured-side-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: calc(50% - 10px);
    min-height: 190px;
    background: linear-gradient(135deg, #27ae60 0%, #3498db 100%);
}

.pb-featured-side-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pb-featured-side-item .pb-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.pb-featured-side-item .pb-overlay .pb-category-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.pb-featured-side-item .pb-overlay h3 {
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: white !important;
    margin: 0 !important;
}

.pb-featured-side-item .pb-overlay h3 a {
    color: white !important;
}

/* ==========================================================================
   Category Tags - 색상
   ========================================================================== */
.pb-category-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pb-white);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pb-cat-support { background: var(--pb-cat-support) !important; }
.pb-cat-housing { background: var(--pb-cat-housing) !important; }
.pb-cat-youth { background: var(--pb-cat-youth) !important; }
.pb-cat-senior { background: var(--pb-cat-senior) !important; }
.pb-cat-life { background: var(--pb-cat-life) !important; }

/* ==========================================================================
   Section Headers - 시안과 동일
   ========================================================================== */
.pb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--pb-deep-navy);
}

.pb-section-title {
    font-size: 22px !important;
    font-weight: 700 !important;
    color: var(--pb-deep-navy) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pb-section-more {
    color: var(--pb-sky-blue);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.pb-section-more:hover {
    color: var(--pb-deep-navy);
}

/* ==========================================================================
   Content + Sidebar Layout
   ========================================================================== */
.pb-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================================================
   Posts Grid - 2컬럼 카드
   ========================================================================== */
.pb-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.pb-posts-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   Post Cards - 시안과 동일
   ========================================================================== */
.pb-post-card {
    background: var(--pb-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.pb-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.pb-post-card-image {
    height: 160px;
    overflow: hidden;
}

.pb-post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.pb-post-card-content {
    padding: 18px;
}

.pb-post-card-content .pb-category-tag {
    margin-bottom: 10px;
}

.pb-post-card-content h3 {
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--pb-text) !important;
    margin-bottom: 8px !important;
    line-height: 1.5 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pb-post-card-content h3 a {
    color: var(--pb-text);
}

.pb-post-card-content h3 a:hover {
    color: var(--pb-sky-blue);
}

.pb-post-card-content .pb-excerpt {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.6;
}

.pb-post-card-content .pb-meta {
    font-size: 12px;
    color: #999;
}

/* ==========================================================================
   Sidebar Widgets - 시안과 동일
   ========================================================================== */
.pb-sidebar .widget,
.pb-widget {
    background: var(--pb-light-gray);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
}

.pb-widget-title,
.pb-sidebar .widget-title {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: var(--pb-deep-navy) !important;
    margin-bottom: 16px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid var(--pb-deep-navy) !important;
}

/* Popular Posts Widget */
.pb-popular-post {
    display: flex;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--pb-border);
}

.pb-popular-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pb-popular-number {
    width: 28px;
    height: 28px;
    background: var(--pb-deep-navy);
    color: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.pb-popular-content h4 {
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--pb-text) !important;
    line-height: 1.4 !important;
    margin: 0 0 4px 0 !important;
}

.pb-popular-content h4 a {
    color: var(--pb-text);
}

.pb-popular-content h4 a:hover {
    color: var(--pb-sky-blue);
}

.pb-popular-content span {
    font-size: 12px;
    color: #999;
}

/* Category List Widget */
.pb-category-list {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.pb-category-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--pb-border);
}

.pb-category-list li:last-child {
    border-bottom: none;
}

.pb-category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--pb-text);
    font-size: 14px;
}

.pb-category-list a:hover {
    color: var(--pb-sky-blue);
}

.pb-category-list .count {
    background: var(--pb-deep-navy);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* ==========================================================================
   Category Section (하단 4컬럼)
   ========================================================================== */
.pb-category-section {
    margin-top: 50px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.pb-category-posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.pb-category-post {
    background: var(--pb-white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}

.pb-category-post:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.pb-category-post-image {
    height: 140px;
    overflow: hidden;
}

.pb-category-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.pb-category-post:hover .pb-category-post-image img {
    transform: scale(1.05);
}

.pb-category-post-content {
    padding: 15px;
}

.pb-category-post-content h4 {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--pb-text) !important;
    line-height: 1.4 !important;
    margin: 0 0 6px 0 !important;
}

.pb-category-post-content h4 a {
    color: var(--pb-text);
}

.pb-category-post-content h4 a:hover {
    color: var(--pb-sky-blue);
}

.pb-category-post-content .pb-meta {
    font-size: 12px;
    color: #999;
}

/* ==========================================================================
   Footer - 시안과 동일
   ========================================================================== */
.site-footer,
.ast-footer-overlay {
    background: var(--pb-deep-navy) !important;
    color: white !important;
    margin-top: 60px !important;
}

.site-footer a {
    color: rgba(255,255,255,0.7) !important;
}

.site-footer a:hover {
    color: white !important;
}

.ast-small-footer,
.ast-footer-copyright {
    background: var(--pb-deep-navy) !important;
    color: rgba(255,255,255,0.5) !important;
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.ast-footer-copyright a {
    color: rgba(255,255,255,0.7) !important;
}

/* ==========================================================================
   Single Post
   ========================================================================== */
.single .entry-title {
    font-size: 32px !important;
    font-weight: 700 !important;
    color: var(--pb-deep-navy) !important;
    line-height: 1.4 !important;
    margin-bottom: 15px !important;
}

.single .entry-meta {
    font-size: 14px;
    color: #666;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pb-border);
    margin-bottom: 30px;
}

.single .entry-content {
    font-size: 17px;
    line-height: 1.9;
}

.single .entry-content h2 {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: var(--pb-deep-navy) !important;
    margin-top: 40px !important;
    margin-bottom: 20px !important;
}

.single .entry-content h3 {
    font-size: 20px !important;
    font-weight: 600 !important;
    color: var(--pb-deep-navy) !important;
    margin-top: 30px !important;
    margin-bottom: 15px !important;
}

/* Info Box */
.pb-info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
    border-left: 4px solid var(--pb-sky-blue);
}

.pb-info-box.warning {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left-color: var(--pb-cat-life);
}

.pb-info-box.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left-color: var(--pb-cat-housing);
}

/* TOC */
.pb-toc {
    background: var(--pb-light-gray);
    border-radius: 12px;
    padding: 25px;
    margin: 30px 0;
}

.pb-toc-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--pb-deep-navy);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--pb-deep-navy);
}

.pb-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pb-toc li {
    padding: 8px 0;
    border-bottom: 1px solid var(--pb-border);
}

.pb-toc li:last-child {
    border-bottom: none;
}

.pb-toc a {
    color: var(--pb-text);
    text-decoration: none;
    font-size: 14px;
}

.pb-toc a:hover {
    color: var(--pb-sky-blue);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.pb-btn,
.ast-button,
button[type="submit"],
input[type="submit"] {
    background: var(--pb-sky-blue) !important;
    color: var(--pb-white) !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 12px 24px !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
    cursor: pointer;
}

.pb-btn:hover,
.ast-button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
    background: var(--pb-deep-navy) !important;
    transform: translateY(-2px);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.ast-pagination .page-numbers {
    background: var(--pb-light-gray);
    color: var(--pb-text);
    padding: 10px 16px;
    border-radius: 8px;
    margin: 0 4px;
    transition: all 0.3s ease;
}

.ast-pagination .page-numbers:hover,
.ast-pagination .page-numbers.current {
    background: var(--pb-deep-navy);
    color: var(--pb-white);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .pb-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .pb-category-posts,
    .pb-posts-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .pb-featured-section {
        grid-template-columns: 1fr;
    }
    
    .pb-featured-main {
        height: 300px;
    }
    
    .pb-featured-side {
        flex-direction: row;
    }
    
    .pb-featured-side-item {
        width: calc(50% - 10px);
        height: 200px;
    }
    
    .pb-posts-grid,
    .pb-posts-grid-4,
    .pb-category-posts {
        grid-template-columns: 1fr;
    }
    
    .pb-section-title {
        font-size: 18px !important;
    }
}

/* ==========================================================================
   Reading Progress Bar
   ========================================================================== */
.pb-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pb-sky-blue), var(--pb-deep-navy));
    width: 0%;
    z-index: 9999;
    transition: width 0.1s ease;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pb-animate {
    animation: fadeInUp 0.6s ease forwards;
}

.pb-post-card:nth-child(1) { animation-delay: 0.1s; }
.pb-post-card:nth-child(2) { animation-delay: 0.2s; }
.pb-post-card:nth-child(3) { animation-delay: 0.3s; }
.pb-post-card:nth-child(4) { animation-delay: 0.4s; }

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.pb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.pb-mt-30 { margin-top: 30px; }
.pb-mb-30 { margin-bottom: 30px; }
.pb-mt-50 { margin-top: 50px; }
.pb-mb-50 { margin-bottom: 50px; }
