/*
Theme Name: Blofinder hELLO
Theme URI: https://blog.blofinder.com
Author: Antigravity
Description: Tech blog theme with top title and sub-header horizontal category navigation
Version: 1.2.0
*/

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css');

:root {
  --bg-color: #f8f9fa;
  --surface-color: #ffffff;
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-dim: #9ca3af;
  --border-color: #e5e7eb;
  --border-light: #f3f4f6;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --code-bg: #f3f4f6;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg-color: #0f1015;
  --surface-color: #181920;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --text-dim: #6b7280;
  --border-color: #272833;
  --border-light: #1f2029;
  --accent: #3b82f6;
  --accent-light: #1e293b;
  --code-bg: #22232e;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.7;
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* =========================================
   1. 헤더: 상단 타이틀 + 하단 가로 카테고리 바
   ========================================= */
.site-header {
  background: var(--surface-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s ease;
}

/* 1행: 상단 타이틀 영역 */
.header-top {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap !important;
}

.site-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  display: inline-block;
}

.site-logo-text {
  display: inline-block;
  line-height: 1.2;
}

.site-logo:hover {
  opacity: 0.9;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-main);
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  background-color: var(--code-bg);
  border-color: var(--accent);
}

/* 2행: 타이틀 바로 아래 카테고리 가로 정렬 바 */
.header-nav-bar {
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-color);
  width: 100%;
}

.header-nav-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.cat-nav-list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0.45rem 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.cat-nav-list::-webkit-scrollbar {
  display: none;
}

.cat-nav-item {
  flex-shrink: 0;
}

.cat-nav-link {
  display: inline-block;
  padding: 0.4rem 0.85rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap !important;
  word-break: keep-all;
  transition: all 0.15s ease;
}

.cat-nav-link:hover {
  color: var(--accent);
  background: var(--accent-light);
}

.cat-nav-link.active {
  color: var(--accent);
  background: var(--accent-light);
  font-weight: 700;
}

/* =========================================
   2. 본문 및 피드 레이아웃
   ========================================= */
.main-wrapper {
  max-width: 900px;
  margin: 2rem auto 3.5rem;
  padding: 0 1.25rem;
  flex: 1;
  width: 100%;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.post-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.post-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.post-category {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.4rem;
  white-space: nowrap;
}

.post-title {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.45;
  margin-bottom: 0.5rem;
  word-break: keep-all;
}

.post-title a:hover {
  color: var(--accent);
}

.post-excerpt {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.post-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 500;
}

.post-thumb {
  width: 140px;
  height: 105px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--code-bg);
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s ease;
}

.post-card:hover .post-thumb img {
  transform: scale(1.05);
}

/* =========================================
   3. 개별 글 상세 페이지
   ========================================= */
.single-article {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.75rem 2.25rem;
}

.single-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.single-category {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
  display: inline-block;
}

.single-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1rem;
  word-break: keep-all;
}

.single-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.single-content {
  font-size: 1.05rem;
  line-height: 1.85;
  word-break: break-word;
}

.single-content p {
  margin-bottom: 1.5rem;
}

.single-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 1.75rem auto;
  display: block;
}

/* =========================================
   4. 페이지네이션 & 푸터
   ========================================= */
.pagination {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

.pagination .page-numbers {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  font-weight: 600;
  font-size: 0.88rem;
}

.pagination .page-numbers.current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--surface-color);
  padding: 2.5rem 1.25rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* =========================================
   5. 모바일 반응형 최적화 (< 768px)
   ========================================= */
@media (max-width: 768px) {
  .header-top {
    padding: 0.85rem 1rem 0.6rem;
  }

  .site-logo {
    font-size: 1.2rem;
  }

  .site-logo-img {
    width: 28px;
    height: 28px;
  }

  .header-nav-container {
    padding: 0 0.75rem;
  }

  .cat-nav-link {
    font-size: 0.85rem;
    padding: 0.35rem 0.75rem;
  }

  .main-wrapper {
    margin: 1.25rem auto 2.5rem;
    padding: 0 1rem;
  }

  .post-card {
    padding: 1.15rem;
    gap: 1rem;
  }

  .post-title {
    font-size: 1.05rem;
  }

  .post-thumb {
    width: 95px;
    height: 75px;
    border-radius: 8px;
  }

  .single-article {
    padding: 1.75rem 1.15rem;
    border-radius: 12px;
  }

  .single-title {
    font-size: 1.45rem;
  }
}

/* =========================================
   6. 본문 타이포그래피 및 서식 스타일
   ========================================= */
.single-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  color: var(--text-main);
  word-break: keep-all;
}

.single-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
  color: var(--text-main);
}

.single-content ul, .single-content ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-main);
}

.single-content li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.single-content blockquote {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 0 8px 8px 0;
  color: var(--text-main);
  font-size: 0.98rem;
}

.single-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background-color: var(--surface-color) !important;
  color: var(--text-main) !important;
}

.single-content table thead tr,
.single-content table tbody tr {
  background-color: var(--surface-color) !important;
  color: var(--text-main) !important;
}

.single-content th, .single-content td {
  border: 1px solid var(--border-color) !important;
  padding: 0.75rem 1rem;
  text-align: left;
  color: var(--text-main) !important;
}

.single-content th {
  background-color: var(--code-bg) !important;
  font-weight: 700;
  color: var(--text-main) !important;
}

.single-content figure {
  max-width: 100% !important;
  margin: 1.75rem auto 1rem !important;
  text-align: center;
}

.single-content figure img,
.single-content img {
  width: auto !important;
  max-width: 520px !important;
  height: auto !important;
  border-radius: 10px !important;
  display: block !important;
  margin: 0 auto 0.5rem !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  background-color: transparent !important;
}

@media (max-width: 768px) {
  .single-content figure img,
  .single-content img {
    max-width: 100% !important;
  }
}

.single-content figcaption {
  font-size: 0.88rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 0.5rem;
}


.single-content hr {
  border: 0;
  height: 1px;
  background: var(--border-color);
  margin: 2.5rem 0;
}

