/*
 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
*/

/* 전체 컨테이너 너비 확장 */
@media (min-width: 1025px) {
  /* 전체 레이아웃 wrapper */
  .container.grid-container {
    max-width: 1260px !important;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
  }

  /* 본문 + 사이드바 2단 grid 레이아웃 */
  .generate-columns-container {
    display: grid !important;
    grid-template-columns: 1000px 260px !important;  /* 본문+사이드바 포함 총 1260px */
    column-gap: 0 !important;
    box-sizing: border-box;
  }

  /* 본문 wrapper */
  #primary.content-area {
    width: 1000px !important; /* 본문 전체 크기 (내용 + 여백) */
    padding: 0;
    margin: 0;
    box-sizing: border-box;
  }

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

  /* 본문 내용: 900px 고정, 가운데 정렬 */
  .entry-content {
    width: 900px !important;           /* 핵심: 본문 내용 폭 고정 */
    margin-left: 0px !important;      /* 좌우 여백 = (1000 - 900)/2 */
    margin-right: 0px !important;
    box-sizing: border-box;
  }

  /* 내부 요소들 */
  .entry-content > * {
    max-width: 100% !important;
    box-sizing: border-box;
  }

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

/* 검색 입력창 높이 및 글자 크기 조정 */
.widget_search input[type="search"] {
  height: 32px !important;             /* 전체 입력창 높이 조절 */
  padding: 4px 8px !important;         /* 위아래/좌우 여백 */
  font-size: 15px !important;          /* 텍스트 크기 */
  line-height: 1.4 !important;         /* 줄 높이로 정렬 */
  box-sizing: border-box;              /* 패딩 포함 너비 계산 */
}

/* 검색 버튼(<button>) 높이 및 글자 크기 정리 */
.widget_search button {
  height: 32px !important;             /* 버튼 높이 입력창과 동일하게 */
  padding: 0 12px !important;          /* 좌우 여백만 설정 */
  font-size: 15px !important;          /* 글자 크기 동일하게 */
  line-height: 1.4 !important;         /* 줄 높이 */
  white-space: nowrap !important;      /* 버튼 안 텍스트 줄바꿈 방지 */
  box-sizing: border-box;              /* 너비 계산 방식 통일 */
  font-family: "Noto Sans KR", sans-serif; /* 한글 폰트 명시 */
}

/* 기본 상태에서는 밑줄 제거 */
a {
  text-decoration: none;
}

/* 마우스 오버 시 밑줄 표시 */
a:hover {
  text-decoration: underline;
}

/* ------------------------------
   헤딩(h2, h3 등) 크기 조정
------------------------------ */
h1 {
  font-size: 28px;
  line-height: 1.4;
  margin-bottom: 1em;
}
h2 {
  font-size: 22px;
  line-height: 1.4;
  margin-bottom: 1em;
}
h3 {
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 0.8em;
}

/* ------------------------------
   <code> 태그에 코드 스타일 적용
------------------------------ */
code {
  font-family: 'Courier New', Courier, monospace;
  background-color: #f4f4f4;
  padding: 2px 4px;
  font-size: 14px;
  color: #c7254e;
  border-radius: 4px;
}

.related-posts {
	border: 2px solid #e9e9e9;
	border-radius: 20px;
	padding: 20px;
}

/* 커스텀 카드(.custom-post-box) - 모바일 세로 스택 강제 */
@media (max-width: 768px) {
  .custom-post-box {
    display: block !important;           /* 인라인 flex 무력화 */
    margin-bottom: 28px !important;
  }
  .custom-post-box .custom-thumb {
    float: none !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    flex-shrink: 1 !important;           /* 인라인 flex-shrink:0 덮기 */
  }
  .custom-post-box .custom-thumb img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover;
  }
  .custom-post-box .custom-summary {
    width: 100% !important;
  }
  .custom-post-box .custom-summary h3,
  .custom-post-box .custom-summary .excerpt {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
    line-height: 1.5;
  }
}

/* =========================================
   공통: 리스트 카드 여백/타이포/시각 톤
========================================= */

/* 카드 공통 스타일(배경/둥근모서리/그림자는 은은하게) */
.custom-post-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
  overflow: hidden;                 /* 이미지 모서리 일치 */
  transition: box-shadow .2s ease, transform .1s ease;
  margin-bottom: 20px;              /* 카드 간 간격(모바일 기준) */
}
.custom-post-box:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

/* 썸네일은 컨테이너와 모서리 통일 */
.custom-post-box .custom-thumb img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* 제목/본문 가독성 */
.custom-post-box .custom-summary h3 {
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 8px 0;
}
.custom-post-box .custom-summary .excerpt {
  font-size: 15px;
  line-height: 1.6;
  color: #404040;
}

/* =========================================
   모바일 (≤768px): 좌우 패딩 + 세로 스택
========================================= */
@media (max-width: 768px) {

  /* 페이지 좌우 여백(사이트 전역) */
  .site-content,
  .grid-container,
  .inside-article {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  /* 카드 내부 여백 */
  .custom-post-box { 
    padding: 0 0 12px 0;            /* 위는 썸네일이 채우므로 0 */
  }
  .custom-post-box .custom-summary {
    padding: 10px 14px 6px 14px;     /* 좌우 여백을 카드 안쪽에서 확보 */
  }

  /* (이미 적용된) 세로 스택 유지 */
  .custom-post-box { display: block !important; }
  .custom-post-box .custom-thumb { width: 100% !important; margin: 0 0 8px 0 !important; }
  .custom-post-box .custom-summary { width: 100% !important; }

  /* 긴 제목/본문 줄바꿈 */
  .custom-post-box .custom-summary h3,
  .custom-post-box .custom-summary .excerpt {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
  }

  /* 제목/요약 행 수 제한(선택) — 깔끔한 리스트를 원하면 주석 해제 */
  /*
  .custom-post-box .custom-summary h3 {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .custom-post-box .custom-summary .excerpt {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  */
}

/* =========================================
   태블릿(769~1024px): 여백을 살짝 키우고 두께감
========================================= */
@media (min-width: 769px) and (max-width: 1024px) {
  .site-content,
  .grid-container,
  .inside-article { padding-left: 20px; padding-right: 20px; }

  .custom-post-box { 
    display: flex; gap: 18px; align-items: flex-start;
    padding: 12px; margin-bottom: 24px;
  }
  .custom-post-box .custom-thumb { flex: 0 0 280px; }
  .custom-post-box .custom-summary { padding: 4px 6px 0 0; }
}

/* =========================================
   데스크톱(≥1025px): 가로 카드형 + 넉넉한 좌우 여백
========================================= */
@media (min-width: 1025px) {
  .site-content,
  .grid-container,
  .inside-article { padding-left: 24px; padding-right: 24px; }

  .custom-post-box { 
    display: flex; gap: 20px; align-items: flex-start;
    padding: 14px; margin-bottom: 28px;
  }
  .custom-post-box .custom-thumb { flex: 0 0 300px; }
  .custom-post-box .custom-summary { padding: 6px 8px 0 0; }
}

/* =========================================
   보너스: 링크 상태 가독성(접근성)
========================================= */
.custom-post-box .custom-summary h3 a {
  text-decoration: none;
}
.custom-post-box .custom-summary h3 a:hover,
.custom-post-box .custom-summary h3 a:focus {
  text-decoration: underline;
}