/*
Theme Name: GeneratePress Child
Theme URI: https://generatepress.com
Template: generatepress
Author: sunungyang
Description: GeneratePress child theme with Nanum Gothic font
Version: 1.0.0
*/

/* 부모 테마 스타일 상속 */
@import url("../generatepress/style.css");

/* 기본 폰트 설정 */
body,
button,
input,
select,
textarea {
    font-family: 'Nanum Gothic', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #333333;
}

/* 제목 스타일 */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Nanum Gothic', sans-serif;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 20px;
    color: #222222;
}

h1 { font-size: 2em; }
h2 { font-size: 1.8em; }
h3 { font-size: 1.6em; }
h4 { font-size: 1.4em; }
h5 { font-size: 1.2em; }
h6 { font-size: 1em; }

/* 컨테이너 너비 및 여백 조정 */
.container {
    max-width: 1200px;
    padding: 0 20px;
}

/* 헤더 스타일링 */
.site-header {
    background-color: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    padding: 10px 0;
}

.site-header .inside-header {
    padding: 20px 40px;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-logo-link {
    display: inline-block;
}

.site-logo {
    width: 300px;
    height: auto;
    max-width: 100%;
}

/* 모바일에서 로고 크기 조정 */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }
    
    h1 { font-size: 1.4em; }
    h2 { font-size: 1.2em; }
    h3 { font-size: 1em; }
    
    .entry-title {
        font-size: 1.2em;
    }
    .site-logo {
        width: 100px;
    }
    
    .site-header .inside-header {
        padding: 0px 20px;
    }
}

/* 메인 내비게이션 */
.main-navigation {
    background: transparent;
}

.main-navigation a {
    font-size: 15px;
    padding: 10px 15px;
    font-weight: 500;
}

/* 포스트 스타일링 */
.entry-header {
    margin-bottom: 2em;
}

.entry-title {
    font-size: 1.8em;
    margin-bottom: 0.5em;
}

.entry-meta {
    font-size: 14px;
    color: #666666;
    margin-bottom: 1.5em;
}

.entry-content {
    line-height: 1.8;
    margin: 1.5em 0;
}

/* 사이드바 위젯 */
.widget-title {
    font-size: 1.2em;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 2px solid #f0f0f0;
}

.widget {
    margin-bottom: 2em;
    padding: 20px;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

/* 푸터 스타일링 */
.site-footer {
    background: #f9f9f9;
    padding: 2em 0 0 0;
    color: #666666;
}

/* 로고 색상 변수 지정 */
:root {
    --logo-color: #0A4621; /* 로고의 녹색 계열 색상 */
    --logo-color-hover: #0d5729; /* 호버시 약간 밝은 색상 */
}

/* 검색 위젯 타이틀 숨기기 */
.widget_search .widget-title,
h2.screen-reader-text {
    display: none !important;
}

/* 검색 입력 필드 */
.wp-block-search .wp-block-search__input,
.wp-block-search__input,
.search-form input[type="search"] {
    border: 1px solid #e0e0e0 !important;
    padding: 6px 12px !important;
    font-size: 15px !important;
    height: 40px !important;
    min-height: 40px !important;
    line-height: 1.5 !important;
    border-radius: 4px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* 검색 버튼 공통 스타일 */
.wp-block-search .wp-block-search__button,
.wp-block-search__button,
.search-form .search-submit {
    position: relative !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    padding: 0 !important;
    margin-left: 8px !important;
    overflow: hidden !important;
    text-indent: -9999px !important;
    white-space: nowrap !important;
    background-color: var(--logo-color) !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
}

/* 검색 버튼 호버 효과 */
.wp-block-search .wp-block-search__button:hover,
.wp-block-search__button:hover,
.search-form .search-submit:hover {
    background-color: var(--logo-color-hover) !important;
}

/* 머터리얼 디자인 돋보기 아이콘 추가 */
.wp-block-search .wp-block-search__button::after,
.wp-block-search__button::after,
.search-form .search-submit::after {
    content: "search" !important;
    font-family: 'Material Icons' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 24px !important;
    text-indent: 0 !important;
    color: #ffffff !important;
}

/* 검색 폼 내부 래퍼 */
.wp-block-search__inside-wrapper {
    display: flex !important;
    align-items: center !important;
    max-width: 100% !important;
}

/* 위젯 최신 글 스타일링 */
.widget_recent_entries ul li,
.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.widget_recent_entries ul li:last-child,
.widget ul li:last-child {
    border-bottom: none;
}

.widget_recent_entries ul li a,
.widget ul li a {
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    line-height: 1.4;
    color: #333;
    transition: color 0.2s ease;
    word-break: break-all;
}

.widget_recent_entries ul li a:hover,
.widget ul li a:hover {
    color: var(--logo-color);
}

/* 위젯 최신 글 날짜 스타일링 */
.widget_recent_entries .post-date {
    display: block;
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

/* 테스트 AdSense 스타일 */
.test-adsense {
    max-width: 100%;
    overflow: hidden;
    margin: 0 auto 15px auto;
}

.test-adsense > div {
    background: #f8f8f8 !important;
    padding: 10px !important;
    text-align: center;
    margin: 0 auto;
    border: 1px dashed #ddd;
    border-radius: 4px;
    max-width: 728px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.test-adsense > div:hover {
    background-color: #f0f0f0 !important;
    cursor: pointer;
}

/* 사이드바 광고 스타일 */
.sidebar-ad .test-adsense > div {
    max-width: 300px;
    min-height: 250px;
}

/* 폰트 크기 조절 버튼 스타일 */
.content-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f8f8;
    border-radius: 8px;
}

.font-size-control {
    display: flex;
    gap: 8px;
}

.font-size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.font-size-btn:hover {
    background: var(--logo-color);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.font-size-btn:active {
    transform: translateY(0);
}

/* 공유 버튼 스타일 */
.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 8px;
    border: none;
    border-radius: 50%;
    background: var(--logo-color);
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.share-btn:hover {
    background: var(--logo-color-hover);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.share-btn:active {
    transform: translateY(0);
}

.font-size-btn .material-icons,
.share-btn .material-icons {
    font-size: 20px;
}

.wp-block-search__label {
    display: none;
}

.cards-grid {
	display: grid;
	grid-template-columns: repeat(1, 1fr);
	gap: 20px;
}

.card-item {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid #e0e0e0;
	border-radius: 0 0 8px 8px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.2s ease;
}

.card-item:hover {
	box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-thumbnail {
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #f8f8f8;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
    border-bottom: none;
    border-radius: 0;
}

.card-thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 제목과 요약이 밀리지 않게 */
.card-title {
	font-size: 1.1rem;
	margin: 0 0 10px;
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.card-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	padding: 15px;
    padding-top: 10px;
}

.card-excerpt {
	font-size: 0.95em;
	color: #666;
	flex-grow: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
}

.card-meta {
	font-size: 0.85em;
	color: #999;
	margin-top: 10px;
}

/* 모바일 대응 */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }

    .content-controls {
        padding: 8px;
        gap: 10px;
    }
    
    .font-size-control {
        gap: 6px;
    }
    
    .font-size-btn,
    .share-btn {
        width: 36px;
        height: 36px;
        padding: 6px;
    }
    
    .font-size-btn .material-icons,
    .share-btn .material-icons {
        font-size: 18px;
    }
    
    .test-adsense {
        margin: 10px auto;
    }
    
    .test-adsense > div {
        padding: 8px !important;
        min-height: 60px;
        font-size: 0.9em;
    }
    
    .sidebar-ad .test-adsense > div {
        min-height: 200px;
    }
}

/* 태블릿 (768px 이상)에서 2열 */
@media (min-width: 768px) {
	.cards-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.custom-footer-center {
    background: #181818;
    color: #fff;
    text-align: center;
    padding: 40px 10px 25px 10px;
}
.footer-menu {
    margin-bottom: 12px;
}
.footer-menu a {
    color: #fff;
    text-decoration: none;
    margin: 0 10px;
    font-size: 17px;
    transition: color 0.2s;
}
.footer-menu a:hover {
    color: #4ad295;
    text-decoration: underline;
}
.footer-copyright {
    color: #aaa;
    font-size: 15px;
}
/* Kevin Batdorf Code Block의 위쪽 간격 줄이기 */
h2 + .wp-block-kevinbatdorf-code-block-pro,
h3 + .wp-block-kevinbatdorf-code-block-pro {
    margin-top: 4px !important;  /* 거의 붙게 */
}

/* Code Block 아래쪽 제목과는 더 간격 주기 */
.wp-block-kevinbatdorf-code-block-pro + h2,
.wp-block-kevinbatdorf-code-block-pro + h3 {
    margin-top: 32px !important; /* 아래 헤더와는 여유 있게 */
}

/* 기존 아래 마진도 유지 (너가 한 설정 포함) */
.wp-block-kevinbatdorf-code-block-pro {
    margin-bottom: 10px;
}