/*
 Theme Name: GeneratePress Child
 Template: generatepress
*/

.site-title, .main-title {
    font-family: 'Outfit', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
}

.site-title, .main-title, h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif !important;
}

/* GeneratePress에서 사이드바의 h2(위젯 제목) 크기만 줄임 */
.widget-area h2, .sidebar .widget-title, .sidebar h2 {
    font-size: 1.25em !important;  /* 원하는 크기로 조정, 예: 1em, 1.2em 등 */
    font-weight: 700; /* 필요에 따라 */
}	

/* 1) 모바일에서 상단 메뉴 왼쪽 정렬 및 내부 텍스트 왼쪽 정렬 - 경량화 */
@media (max-width: 768px) {
    .main-navigation {
        display: block !important;
        position: static !important;
        background: transparent !important;
        padding: 0 !important;
        text-align: left !important; /* 메뉴 전체 왼쪽 정렬 */
    }
    .main-navigation ul {
        display: flex !important;
        gap: 10px;
        justify-content: flex-start !important;
        align-items: flex-start !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .main-navigation ul li {
        display: inline-block !important;
        text-align: left !important; /* 메뉴 항목 텍스트 왼쪽 정렬 */
        margin: 0 !important;
    }
    .main-navigation ul li a {
        text-align: left !important; /* 링크 텍스트 왼쪽 정렬 */
        padding: 5px 10px 5px 0 !important;
    }
    .menu-toggle {
        display: none !important; /* 햄버거 아이콘 숨김 */
    }
}

/* 2) 모바일에서 사이드바 햄버거 버튼 스타일 및 슬라이드 메뉴 - 경량화 */
@media (max-width: 768px) {
    /* 사이드바 숨김 및 위치 조정 */
    #left-sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: -280px; /* 처음 화면 밖에 위치 */
        width: 280px;
        height: 100vh;
        background: #fff;
        box-shadow: -2px 0 10px rgba(0,0,0,0.1);
        z-index: 9999;
        overflow-y: auto;
        transition: right 0.3s ease;
        padding: 20px 15px;
    }
    /* 사이드바 열기 시 */
    #left-sidebar.sidebar-open {
        display: block;
        right: 0;
    }
    /* 햄버거 버튼 */
    .mobile-sidebar-toggle {
        position: fixed;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 28px;
        cursor: pointer;
        z-index: 10000;
        color: #333;
        display: block;
    }
    /* 뒷배경 오버레이 */
    .sidebar-overlay.active {
        position: fixed;
        top: 0; left: 0;
        width: 100%; height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 9998;
        display: block;
    }
    .sidebar-overlay {
        display: none;
    }
}

.site-footer {
    font-size: 0.85em; /* 기본 크기의 85% */
}

@media (max-width: 768px) {
    .site-header {
        position: relative !important;
    }
    
    .mobile-sidebar-toggle {
        position: absolute !important;
    }
}

/* GeneratePress 대표이미지 정확히 제거 */
.featured-image.page-header-image.grid-container.grid-parent,
.page-header-image-single {
    display: none !important;
}

/* GeneratePress 무료 버전 - 카테고리 아카이브 그리드 */
.archive #main {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    max-width: none;
}

.archive #main .page-header {
    grid-column: 1 / -1;
}

/* 아카이브 페이지에서만 적용 - 수정된 부분 */
.archive .inside-article {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: transform 0.2s ease;
    height: 100%;
}

.archive .inside-article:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.archive .inside-article .post-image {
    order: 2;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0;
}

.archive .inside-article .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive .inside-article .entry-header {
    order: 1;
    padding: 5px;
    flex: 1;
}

.archive .inside-article .entry-title {
    font-size: 0.9rem;
    line-height: 1.3;
    margin: 0;
    font-weight: 600;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.archive .inside-article .entry-summary {
    display: none !important;
}

/* 불필요한 요소 숨기기 */
.archive .entry-meta,
.archive .posted-on,
.archive .byline,
.archive .cat-links,
.archive .tags-links,
.archive .comments-link {
    display: none;
}

/* 반응형 */
@media (max-width: 768px) {
    .archive #main {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1em;
    }
}

/* 게시글*/
/* 이전/다음글 완벽 정리 - 모든 아이콘 제거 후 화살표 새로 추가 */
/* 모든 디바이스에서 한 줄 유지 - Stack Overflow 검증된 방법 */
.post-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 !important;
    background-color: #f9f9f9;
    padding: 5px;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 10px;
}

/* 이전글 영역 - 최소 너비 보장으로 한 줄 유지 */
.nav-previous {
    flex: 1 1 45%;
    text-align: left;
    min-width: 120px;
}

/* 다음글 영역 - 최소 너비 보장으로 한 줄 유지 */
.nav-next {
    flex: 1 1 45%;
    text-align: right;
    min-width: 120px;
}

/* 빈 공간 유지 */
.post-navigation .nav-previous:only-child,
.post-navigation .nav-next:only-child {
    flex: 1;
}

/* GeneratePress 기본 아이콘 제거 */
.nav-previous .gp-icon,
.nav-next .gp-icon {
    display: none !important;
}

.nav-previous .prev:before,
.nav-next .next:before {
    display: none !important;
}

/* 화살표 추가 */
.nav-previous a:before {
    content: "← ";
    display: inline-block;
    margin-right: 5px;
    font-size: 1.1em;
}

.nav-next a:after {
    content: " →";
    display: inline-block;
    margin-left: 5px;
    font-size: 1.1em;
}

/* 모바일에서 폰트 크기 줄여서 한 줄 유지 - W3Schools 검증 방법 */
@media (max-width: 480px) {
    .post-navigation {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .nav-previous,
    .nav-next {
        min-width: 100px;
    }
    
    .nav-previous a:before,
    .nav-next a:after {
        font-size: 1em;
    }
}

/* WordPress 6.1 이후 이미지 마진 문제 해결 - Staff David & Fernando 공식 답변 */
.wp-block-image figure {
    margin-bottom: 1.5em !important;
}

.wp-block-image {
    margin-bottom: 1.5em !important;
}

/* 일반 이미지 요소도 포함 */
figure {
    margin-bottom: 1.5em !important;
}

/* 개별 게시글 콘텐츠 내 모든 이미지 */
.single-post .entry-content img {
    margin-bottom: 1.5em !important;
}
