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

/* ======================================
   💻 데스크탑 (1025px 이상)
====================================== */
@media (min-width: 1025px) {
  .container.grid-container {
    max-width: 1260px !important;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
  }

  .generate-columns-container {
    display: grid !important;
    grid-template-columns: 1000px 260px !important;  /* 본문 + 사이드바 */
    column-gap: 0 !important;
  }

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

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

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

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

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

/* ======================================
   📱 모바일 (768px 이하)
   이미지 → 본문 순서 변경 + 가독성 향상
====================================== */
@media (max-width: 768px) {
  /* 리스트 카드 전체 세로 정렬 */
  .inside-article,
  article.post,
  .generate-columns-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* 이미지 블록 float 해제 및 위로 배치 */
  .post-image,
  .inside-article .post-image,
  .generate-columns-container .post-image {
    float: none !important;
    order: -1 !important;
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px 0 !important;
    clear: both !important;
  }

  .post-image img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 10px;
  }

  /* 텍스트 본문 영역 */
  .entry-summary,
  .entry-content {
    display: block !important;
    width: 100% !important;
    margin-top: 8px !important;
    line-height: 1.7 !important;
    font-size: 16px !important;
    clear: both !important;
  }

  /* 제목 크기 및 간격 */
  h1 { font-size: 24px !important; margin-bottom: 0.8em !important; }
  h2 { font-size: 20px !important; margin-bottom: 0.7em !important; }
  h3 { font-size: 17px !important; margin-bottom: 0.6em !important; }

  /* 카드 간 간격 */
  article.post {
    margin-bottom: 40px !important;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 20px;
  }
}

/* ======================================
   🔍 검색창 및 버튼 스타일
====================================== */
.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;
}

.widget_search button {
  height: 32px !important;
  padding: 0 12px !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  white-space: nowrap !important;
  font-family: "Noto Sans KR", sans-serif;
  box-sizing: border-box;
}

/* ======================================
   ✍️ 텍스트 및 링크 기본 스타일
====================================== */
a { text-decoration: none; }
a:hover { text-decoration: underline; }

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;
  margin-top: 40px;
}

.entry-content h1:first-of-type {
  display: none;
}