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

/* --------------------------------
   기본 구조 - 공통 스타일
-------------------------------- */
.container.grid-container {
  width: 100%;
  max-width: 1260px;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

/* 링크 스타일 */
a {
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* 헤딩 크기 */
* {
	font-size: 15px;
}
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 {
  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;
}

/* 검색창 */
.widget_search input[type="search"] {
  height: 32px;
  padding: 4px 8px;
  font-size: 15px;
  line-height: 1.4;
  box-sizing: border-box;
}
.widget_search button {
  height: 32px;
  padding: 0 12px;
  font-size: 15px;
  line-height: 1.4;
  white-space: nowrap;
  box-sizing: border-box;
  font-family: "Noto Sans KR", sans-serif;
}

/* --------------------------------
   🖥 데스크탑 (1025px 이상)
-------------------------------- */
@media (min-width: 1025px) {
  .generate-columns-container {
    display: grid !important;
    grid-template-columns: 1000px 260px !important;
    column-gap: 0 !important;
  }

  #primary.content-area {
    width: 1000px !important;
    margin: 0;
    padding: 0;
  }

  .inside-article {
    width: 100%;
    margin: 0 auto;
    padding: 0;
  }

  .entry-content {
    width: 900px !important;
    margin: 0 auto;
    box-sizing: border-box;
  }

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

/* -------------------------------
   💻 태블릿 (768px ~ 1024px)
------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .site-content {
    display: flex;
    flex-direction: column !important;
    gap: 40px;
  }

  #primary.content-area {
    width: 100% !important;
  }

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

  .inside-right-sidebar {
    padding: 0 16px !important;
  }

  .custom-post-box {
    flex-direction: row !important;
    align-items: flex-start;
    gap: 16px;
  }

  .custom-thumb img {
    width: 40vw !important;
    height: auto !important;
    border-radius: 6px;
  }

  .custom-summary h3 {
    font-size: 18px;
    margin-bottom: 8px;
  }

  .custom-summary .excerpt {
    font-size: 15px;
    line-height: 1.6;
  }

  /* 요약문에만 줄 제한 적용 */
  .entry-summary p,
  .custom-summary .excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;  
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 본문 내용은 전체 표시 */
  .entry-content p {
    display: block !important;
    overflow: visible !important;
    text-overflow: unset !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
  }
}

/* -------------------------------
   📱 모바일 (최대 767px)
------------------------------- */
@media (max-width: 767px) {
  html, body {
    font-size: 15px; /* ✅ 전체 기준 폰트 크기 */
    line-height: 1.7;
    color: #333;
  }

  .generate-columns-container {
    display: block !important;
  }

  #primary.content-area,
  .entry-content,
  #right-sidebar {
    width: 100% !important;
    padding: 0 16px !important;
    box-sizing: border-box;
  }

  .inside-article {
    padding: 0 !important;
  }

  img {
    max-width: 100% !important;
    height: auto !important;
    display: block;
  }

  /* 제목 크기 균형 조정 */
  h1 {
    font-size: 20px !important;
    line-height: 1.4;
  }
  h2 {
    font-size: 17px !important;
    line-height: 1.5;
  }
  h3 {
    font-size: 15px !important;
    line-height: 1.6;
  }

  /* ✅ 본문 전체 보이게 + 폰트 크기 최적화 */
  .entry-content p {
    display: block !important;
    overflow: visible !important;
    font-size: 14px !important; /* 📱 본문 기본 크기 */
    line-height: 1.8;
    text-overflow: unset !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: unset !important;
    white-space: normal !important;
  }

  /* ✅ 표 내부 폰트 조정 */
  .entry-content table {
    font-size: 13.5px !important;
    line-height: 1.6;
  }
  .entry-content th,
  .entry-content td {
    padding: 8px 10px !important;
  }

  /* ✅ 리스트 폰트 조정 */
  .entry-content ul li,
  .entry-content ol li {
    font-size: 14px !important;
    line-height: 1.8;
  }

  /* ✅ 요약글에만 줄 제한 유지 */
  .entry-summary p,
  .custom-summary .excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px !important;
    line-height: 1.6;
    max-height: calc(1.6em * 3);
  }

  /* 카드형 포스트 정렬 */
  .custom-post-box {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .custom-thumb img {
    width: 100% !important;
    height: auto !important;
  }

  .custom-summary {
    width: 100%;
    margin-top: 10px;
  }

  /* ✅ 사이드바 위젯 */
  #right-sidebar {
    font-size: 14px !important;
    line-height: 1.7;
  }

  .widget h2, .widget h3 {
    font-size: 16px !important;
  }
}
