/*
Theme Name: GeneratePress Child
Theme URI: https://generatepress.com
Description: Default GeneratePress child theme
Author: Tom Usborne
Author URI: https://tomusborne.com
Template: generatepress
Version: 0.1
*/

/* ============================================================
   0. 폰트 설정 (Noto Sans KR — 한국어 최적화)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1a1a1a;
  background-color: #f9f9f9;
  word-break: keep-all;
}

/* ============================================================
   1. 전체 컨테이너 너비 확장 (데스크탑 전용)
   ============================================================ */
@media (min-width: 1025px) {

  .container.grid-container {
    max-width: 1300px !important;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    box-sizing: border-box;
  }

}

/* ============================================================
   2. 본문 + 사이드바 2단 Grid 레이아웃
   ============================================================ */
.generate-columns-container {
  display: grid !important;
  grid-template-columns: 1fr 320px !important;
  column-gap: 40px !important;
  box-sizing: border-box;
}

/* 본문 영역 */
#primary.content-area {
  width: 100% !important;
  min-width: 0;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

/* 아티클 내부 */
.inside-article {
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 본문 내용 */
.entry-content {
  width: 100% !important;
  max-width: 1100px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box;
  font-size: 16px;
  line-height: 1.9;
  color: #2d2d2d;
}

.entry-content > * {
  max-width: 100% !important;
  box-sizing: border-box;
}

.entry-content img,
.entry-content video,
.entry-content iframe {
  max-width: 100% !important;
  height: auto;
  border-radius: 6px;
}

.entry-content p {
  margin-bottom: 1.4em;
}

/* ============================================================
   3. 헤더 영역
   ============================================================ */
.site-header {
  background-color: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 !important;
}

.site-title a {
  font-size: 22px !important;
  font-weight: 700 !important;
  color: #1a1a1a !important;
  text-decoration: none !important;
}

.site-title a:hover {
  color: #0073aa !important;
}

.main-navigation a {
  font-size: 15px;
  font-weight: 500;
  color: #333 !important;
  padding: 0 14px !important;
}

.main-navigation a:hover {
  color: #0073aa !important;
  text-decoration: none !important;
}

/* ============================================================
   4. 사이드바
   ============================================================ */
#right-sidebar {
  width: 320px !important;
  box-sizing: border-box;
}

/* 위젯 공통 — 박스 스타일 제거 (블록 위젯 분리 문제 방지) */
#right-sidebar .widget,
.widget-area .widget {
  margin-bottom: 0 !important;
  padding: 0 !important;
  background: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
  box-sizing: border-box !important;
}

/* 사이드바 블록 그룹 — 흰색 박스를 wp-block-group 단위로 적용 */
#right-sidebar .wp-block-group,
.widget-area .wp-block-group {
  background: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07) !important;
  border: 1px solid #efefef !important;
  padding: 20px 20px 16px !important;
  margin-bottom: 24px !important;
  box-sizing: border-box !important;
}

/* 위젯 제목 */
#right-sidebar .widget-title,
#right-sidebar h2.widget-title,
#right-sidebar .widgettitle,
#right-sidebar .wp-block-heading,
.widget-area .widget-title,
.widget-area h2.widget-title,
.widget-area .wp-block-heading {
  font-size: 16px !important;
  font-weight: 700 !important;
  letter-spacing: 0.03em !important;
  text-transform: none !important;
  margin-bottom: 12px !important;
  padding-bottom: 10px !important;
  border-bottom: 2px solid #f0f0f0 !important;
  color: #1a1a1a !important;
  margin-top: 0 !important;
}

/* 위젯 리스트 */
#right-sidebar .widget ul,
.widget-area .widget ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

#right-sidebar .widget ul li,
.widget-area .widget ul li {
  font-size: 14px !important;
  line-height: 1.6 !important;
  padding: 5px 0 !important;
  border-bottom: none !important;
  word-break: keep-all !important;
  color: #444 !important;
}

#right-sidebar .widget ul li a,
.widget-area .widget ul li a {
  color: #0073aa !important;
  text-decoration: none !important;
}

#right-sidebar .widget ul li a:hover,
.widget-area .widget ul li a:hover {
  color: #005f8d !important;
  text-decoration: underline !important;
}

/* 최근 댓글 아바타 */
#right-sidebar .avatar,
.widget-area .avatar {
  width: 28px !important;
  height: 28px !important;
  border-radius: 50% !important;
  vertical-align: middle !important;
  margin-right: 6px !important;
}

/* 최신 댓글 위젯 간격 제거 */
.wp-block-latest-comments {
  padding: 0 !important;
  margin: 0 !important;
}

.wp-block-latest-comments__comment {
  padding: 5px 0 !important;
  margin: 0 !important;
  border-bottom: none !important;
  list-style: none !important;
}

.wp-block-latest-comments__comment:last-child {
  border-bottom: none !important;
}

/* article 태그 여백 제거 — 핵심 */
.wp-block-latest-comments__comment article {
  padding: 0 !important;
  margin: 0 !important;
}

.wp-block-latest-comments__comment-meta {
  padding: 0 !important;
  margin: 0 !important;
  font-size: 14px !important;
  line-height: 1.5 !important;
}

.wp-block-latest-comments__comment-date {
  font-size: 12px !important;
  color: #999 !important;
  display: block !important;
  margin-top: 2px !important;
}

/* 댓글 본문 숨김 */
.wp-block-latest-comments__comment-excerpt {
  display: none !important;
}

/* ============================================================
   5. 검색 위젯
   ============================================================ */
.widget_search input[type="search"],
.wp-block-search__input {
  height: 38px !important;
  padding: 4px 10px !important;
  font-size: 14px !important;
  border: 1px solid #ddd !important;
  border-radius: 4px 0 0 4px !important;
  box-sizing: border-box !important;
  width: calc(100% - 70px) !important;
  vertical-align: middle !important;
  outline: none !important;
}

.widget_search input[type="search"]:focus,
.wp-block-search__input:focus {
  border-color: #0073aa !important;
}

.widget_search button,
.widget_search input[type="submit"],
.wp-block-search__button {
  height: 38px !important;
  padding: 0 14px !important;
  font-size: 14px !important;
  line-height: 38px !important;
  white-space: nowrap !important;
  border: 1px solid #ddd !important;
  border-left: none !important;
  border-radius: 0 4px 4px 0 !important;
  background-color: #0073aa !important;
  color: #fff !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
  font-family: 'Noto Sans KR', sans-serif !important;
}

.widget_search button:hover,
.widget_search input[type="submit"]:hover,
.wp-block-search__button:hover {
  background-color: #005f8d !important;
}

.widget_search .search-form,
.wp-block-search__inside-wrapper {
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

/* ============================================================
   6. 링크 스타일
   ============================================================ */
a {
  color: #0073aa;
  text-decoration: none;
}

a:hover {
  color: #005f8d;
  text-decoration: underline;
}

/* ============================================================
   7. 헤딩(H1~H4) 크기 및 간격
   ============================================================ */
h1 {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 0.5em;
  margin-bottom: 0.8em;
  color: #1a1a1a;
}

h2 {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  color: #1a1a1a;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

h3 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.4em;
  margin-bottom: 0.5em;
  color: #1a1a1a;
}

h4 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.2em;
  margin-bottom: 0.4em;
  color: #1a1a1a;
}

/* ============================================================
   8. 인라인 코드 & 코드 블록
   ============================================================ */
code {
  font-family: 'Courier New', Courier, monospace;
  background-color: #f4f4f4;
  padding: 2px 6px;
  font-size: 14px;
  color: #c7254e;
  border-radius: 4px;
  word-break: break-all;
}

pre {
  background-color: #1e1e1e;
  border-radius: 8px;
  padding: 20px;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.7;
  margin: 1.5em 0;
}

pre code {
  background: none;
  padding: 0;
  color: #d4d4d4;
  border-radius: 0;
  word-break: normal;
  font-size: 14px;
}

/* ============================================================
   9. 포스트 카드 (홈·아카이브) — 테두리/박스 없이 깔끔하게
   ============================================================ */
.custom-post-box {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  background: transparent;       /* 흰색 박스 제거 */
  border-radius: 0;
  padding: 20px 0;               /* 좌우 패딩 제거 */
  box-shadow: none;              /* 그림자 제거 */
  margin-bottom: 0;
  border-bottom: 1px solid #ebebeb; /* 포스트 간 구분선만 */
}

.custom-post-box:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.custom-thumb {
  flex-shrink: 0;
  width: 200px;
}

.custom-thumb img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  object-fit: cover;
}

.custom-summary {
  flex: 1;
  min-width: 0;
}

.custom-summary h3 {
  font-size: 18px;
  margin: 0 0 8px 0;
  line-height: 1.4;
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 0;
}

.custom-summary h3 a {
  color: #1a1a1a;
  text-decoration: none;
}

.custom-summary h3 a:hover {
  color: #0073aa;
}

.custom-summary .excerpt {
  font-size: 15px;
  line-height: 1.7;
  color: #666;
}

.custom-summary .excerpt a {
  color: #0073aa;
  font-size: 14px;
  margin-left: 4px;
}

/* ============================================================
   10. 관련 포스트 박스
   ============================================================ */
.related-posts {
  border: 1px solid #e9e9e9;
  border-radius: 10px;
  padding: 20px 24px;
  margin-top: 48px;
  background-color: #f8f9fa;
}

.related-posts h4 {
  font-size: 15px;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 14px;
  color: #1a1a1a;
  border-bottom: 2px solid #0073aa;
  padding-bottom: 8px;
}

.related-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related-posts ul li {
  padding: 7px 0;
  border-bottom: 1px solid #eee;
  font-size: 15px;
  line-height: 1.5;
}

.related-posts ul li:last-child {
  border-bottom: none;
}

.related-posts ul li a {
  color: #333;
  text-decoration: none;
}

.related-posts ul li a:hover {
  color: #0073aa;
  text-decoration: underline;
}

/* ============================================================
   11. 푸터
   ============================================================ */
.site-footer {
  background-color: #2d2d2d !important;
  color: #aaa !important;
  padding: 24px 0 !important;
  font-size: 14px !important;
  text-align: center;
}

.site-footer a {
  color: #ccc !important;
}

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

/* ============================================================
   12. 반응형 — 태블릿 (1024px 이하)
   ============================================================ */
@media (max-width: 1024px) {

  .generate-columns-container {
    grid-template-columns: 1fr 280px !important;
    column-gap: 28px !important;
  }

  #right-sidebar {
    width: 280px !important;
  }

}

/* ============================================================
   13. 반응형 — 모바일 (768px 이하)
   ============================================================ */
@media (max-width: 768px) {

  .generate-columns-container {
    grid-template-columns: 1fr !important;
    column-gap: 0 !important;
  }

  #right-sidebar {
    width: 100% !important;
  }

  .entry-content {
    max-width: 100% !important;
    padding: 0 16px !important;
  }

  .custom-post-box {
    flex-direction: column;
    gap: 12px;
    padding: 16px 0;
  }

  .custom-thumb {
    width: 100%;
  }

  h1 { font-size: 22px; }
  h2 { font-size: 19px; }
  h3 { font-size: 17px; }
  h4 { font-size: 15px; }

}

/* ============================================================
   14. 개별 글 상세 페이지 상단 대표 이미지 숨기기
   - 목록/홈 썸네일은 유지
   - 글 상세 페이지 맨 위 대표 이미지만 숨김
   ============================================================ */
.single-post .featured-image,
.single-post .post-image,
.single-post .inside-article > .featured-image,
.single-post .inside-article > .post-image {
  display: none !important;
}

/* ============================================================
   사이드바 카테고리 제목 + 항목 하나의 박스로 통합
   ============================================================ */

/* 사이드바 위젯 자체를 카드 박스로 사용 */
#right-sidebar .widget,
.widget-area .widget {
  background: #ffffff !important;
  border-radius: 8px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07) !important;
  border: 1px solid #efefef !important;
  padding: 20px 20px 16px !important;
  margin-bottom: 24px !important;
  box-sizing: border-box !important;
}

/* wp-block-group이 별도 박스를 만들지 않도록 제거 */
#right-sidebar .wp-block-group,
.widget-area .wp-block-group,
#right-sidebar .widget .wp-block-group,
.widget-area .widget .wp-block-group {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* 카테고리 제목 */
#right-sidebar .wp-block-heading,
.widget-area .wp-block-heading,
#right-sidebar .widget-title,
.widget-area .widget-title {
  font-size: 16px !important;
  font-weight: 700 !important;
  margin: 0 0 16px 0 !important;
  padding-bottom: 10px !important;
  border-bottom: 2px solid #f0f0f0 !important;
  color: #1a1a1a !important;
}

/* 카테고리 목록 */
#right-sidebar .wp-block-categories,
.widget-area .wp-block-categories,
#right-sidebar .widget_categories ul,
.widget-area .widget_categories ul {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

/* 카테고리 항목 */
#right-sidebar .wp-block-categories li,
.widget-area .wp-block-categories li,
#right-sidebar .widget_categories ul li,
.widget-area .widget_categories ul li {
  padding: 8px 0 !important;
  margin: 0 !important;
  border-bottom: none !important;
  line-height: 1.6 !important;
}

/* 카테고리 링크 */
#right-sidebar .wp-block-categories li a,
.widget-area .wp-block-categories li a,
#right-sidebar .widget_categories ul li a,
.widget-area .widget_categories ul li a {
  color: #0073aa !important;
  text-decoration: none !important;
  font-size: 14px !important;
}

#right-sidebar .wp-block-categories li a:hover,
.widget-area .wp-block-categories li a:hover {
  color: #005f8d !important;
  text-decoration: underline !important;
}

/* 검색, 카테고리, 최신글 사이 간격 통일 */
#right-sidebar .widget + .widget,
.widget-area .widget + .widget {
  margin-top: 0 !important;
}

/* 워드프레스 이미지 캡션 중앙 정렬 - Gutenberg / Classic / GeneratePress 대응 */
.entry-content figure.wp-block-image figcaption,
.entry-content .wp-block-image figcaption,
.entry-content .wp-caption .wp-caption-text,
.entry-content .wp-caption-text,
.entry-content figure figcaption,
.single-post .entry-content figure figcaption,
.single-post .entry-content .wp-caption-text {
  text-align: center !important;
  display: block !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  color: #666666;
  font-size: 16px;
  line-height: 1.5;
}

/* 이미지 자체도 중앙 정렬 */
.entry-content figure.wp-block-image,
.entry-content .wp-block-image,
.entry-content .wp-caption {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* 이미지 태그 중앙 정렬 */
.entry-content figure.wp-block-image img,
.entry-content .wp-block-image img,
.entry-content .wp-caption img,
.single-post .entry-content figure img {
  display: block !important;
  margin-left: auto !important;
  margin-right: auto !important;
}