/*
Theme Name:  집돌남 (Jipdol)
Theme URI:   https://jipdol.com
Description: 집에서 세상을 보는 남자의 블로그 - 핫이슈 & IT제품
Author:      집돌남
Version:     1.0.0
Text Domain: jipdol
*/

/* ── 구글 폰트 ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&family=Bebas+Neue&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS 변수 ──────────────────────────────────────────── */
:root {
  --bg:         #0c0c0f;
  --surface:    #141418;
  --surface2:   #1a1a20;
  --border:     #242430;
  --accent:     #ff4757;
  --accent2:    #ffa502;
  --blue:       #3d9cf5;
  --green:      #2ed573;
  --text:       #e8e8f0;
  --muted:      #6b6b85;
  --muted2:     #3a3a50;
  --sans:       'Noto Sans KR', sans-serif;
  --display:    'Bebas Neue', cursive;
  --mono:       'DM Mono', monospace;
  --radius:     12px;
  --shadow:     0 4px 24px rgba(0,0,0,.4);
  --shadow-lg:  0 8px 48px rgba(0,0,0,.6);
}

/* ── 리셋 & 기본 ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* 배경 그라디언트 레이어 */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 60% 40% at 0% 0%, rgba(255,71,87,.06) 0%, transparent 55%),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(61,156,245,.05) 0%, transparent 55%);
}

a { color: var(--accent); text-decoration: none; transition: opacity .2s; }
a:hover { opacity: .8; }
img { max-width: 100%; height: auto; display: block; }
p { margin-bottom: 1.2em; }

/* ── 레이아웃 ────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative; z-index: 1;
}

.site-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  padding: 40px 0 80px;
}

/* ── 헤더 ────────────────────────────────────────────────── */
#masthead {
  background: rgba(12,12,15,.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0; z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* 로고 */
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-size: 18px;
  color: #fff;
  letter-spacing: 0;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(255,71,87,.4);
}

.logo-text-wrap { display: flex; flex-direction: column; }

.logo-title {
  font-family: var(--display);
  font-size: 22px;
  color: var(--text);
  letter-spacing: .05em;
  line-height: 1;
}

.logo-sub {
  font-size: 10px;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: .1em;
  margin-top: 2px;
}

/* 네비게이션 */
.main-nav { display: flex; align-items: center; gap: 4px; }

.main-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.main-nav a:hover,
.main-nav a.current { background: var(--surface2); color: var(--text); }

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 2s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* 헤더 우측 */
.header-right { display: flex; align-items: center; gap: 12px; }

.search-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  transition: color .15s, border-color .15s;
}
.search-btn:hover { color: var(--text); border-color: var(--muted2); }

/* ── 히어로 배너 ─────────────────────────────────────────── */
.hero-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}

.hero-banner::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,71,87,.08) 0%, transparent 50%,
              rgba(61,156,245,.06) 100%);
  pointer-events: none;
}

.hero-inner {
  padding: 60px 0 50px;
  position: relative; z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: .15em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-eyebrow::before {
  content: '';
  width: 24px; height: 2px;
  background: var(--accent);
}

.hero-title {
  font-family: var(--display);
  font-size: clamp(48px, 7vw, 88px);
  line-height: .95;
  color: var(--text);
  letter-spacing: .03em;
  margin-bottom: 20px;
}

.hero-title span { color: var(--accent); }

.hero-desc {
  font-size: 16px;
  color: var(--muted);
  max-width: 480px;
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-stats {
  display: flex;
  gap: 40px;
}

.hero-stat-num {
  font-family: var(--display);
  font-size: 36px;
  color: var(--text);
  line-height: 1;
}

.hero-stat-label {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  margin-top: 4px;
}

/* ── 카테고리 탭 ─────────────────────────────────────────── */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 40px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all .15s;
  background: transparent;
}

.cat-tab:hover { border-color: var(--muted2); color: var(--text); }

.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.cat-tab.blue.active  { background: var(--blue); border-color: var(--blue); }
.cat-tab.green.active { background: var(--green); border-color: var(--green); color: #000; }

.cat-count {
  font-size: 11px;
  font-family: var(--mono);
  opacity: .7;
}

/* ── 포스트 카드 ─────────────────────────────────────────── */
.posts-grid {
  display: grid;
  gap: 24px;
}

/* 첫 번째 포스트: 히어로 카드 */
.post-card-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.post-card-hero:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--muted2);
}

.post-card-hero .post-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}

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

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

.post-card-hero .post-body {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* 일반 카드 그리드 */
.posts-subgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--muted2);
}

.post-card .post-thumb {
  overflow: hidden;
  aspect-ratio: 16/9;
  position: relative;
}

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

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

.post-card .post-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 공통 포스트 요소 */
.post-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.cat-hot  { background: rgba(255,71,87,.15);  color: var(--accent); }
.cat-it   { background: rgba(61,156,245,.15); color: var(--blue); }

.post-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
  margin-bottom: 10px;
  text-decoration: none;
  display: block;
  transition: color .15s;
}

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

.post-card .post-title { font-size: 15px; }

.post-excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
  margin-top: auto;
}

.post-meta .date::before { content: '📅 '; }
.post-meta .read-time::before { content: '⏱ '; }

/* 썸네일 없을 때 플레이스홀더 */
.thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, var(--surface2) 0%, var(--border) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

/* ── 사이드바 ─────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 28px; }

.widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.widget-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-header::before {
  content: '';
  width: 3px; height: 14px;
  border-radius: 2px;
  background: var(--accent);
}

.widget-body { padding: 16px 20px; }

/* 최근 글 위젯 */
.recent-post-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}

.recent-post-item:last-child { border-bottom: none; }

.recent-thumb {
  width: 64px; height: 48px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}

.recent-thumb img { width: 100%; height: 100%; object-fit: cover; }

.recent-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
}

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

.recent-date {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--mono);
  margin-top: 4px;
}

/* 카테고리 위젯 */
.cat-widget-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cat-widget-item:last-child { border-bottom: none; }

.cat-widget-name {
  font-size: 14px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

.cat-widget-name:hover { color: var(--accent); }

.cat-widget-count {
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 20px;
}

/* 태그 위젯 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.tag-cloud a {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: all .15s;
}

.tag-cloud a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,71,87,.08);
}

/* ── 싱글 포스트 ─────────────────────────────────────────── */
.single-header {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}

.single-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 900;
  line-height: 1.3;
  color: var(--text);
  margin: 16px 0 20px;
}

.single-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
}

.post-thumbnail {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.post-thumbnail img {
  width: 100%;
  aspect-ratio: 16/8;
  object-fit: cover;
}

/* 본문 스타일 */
.entry-content {
  font-size: 16px;
  line-height: 1.9;
  color: #d0d0e0;
}

.entry-content h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 2em 0 .8em;
  padding-left: 16px;
  border-left: 3px solid var(--accent);
}

.entry-content h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 1.5em 0 .6em;
}

.entry-content strong { color: var(--text); font-weight: 700; }
.entry-content em { color: var(--accent2); font-style: italic; }

.entry-content a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: rgba(61,156,245,.4);
}

.entry-content ul, .entry-content ol {
  padding-left: 1.5em;
  margin: 1em 0 1.5em;
}

.entry-content li { margin-bottom: .5em; }

.entry-content blockquote {
  margin: 2em 0;
  padding: 20px 24px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--muted);
}

.entry-content figure {
  margin: 2em 0;
  border-radius: 12px;
  overflow: hidden;
}

.entry-content figcaption {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  background: var(--surface);
}

.entry-content code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--surface2);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent2);
}

.entry-content pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}

.entry-content pre code {
  background: none;
  padding: 0;
  color: #a8d8a8;
}

/* ── 푸터 ─────────────────────────────────────────────────── */
#colophon {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 48px 0 28px;
  margin-top: 80px;
  position: relative; z-index: 1;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}

.footer-brand .logo-title { font-size: 28px; margin-bottom: 8px; }

.footer-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 12px;
  max-width: 280px;
}

.footer-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }

.footer-links a {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}

.footer-links a:hover { color: var(--text); }

.footer-bottom {
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  font-family: var(--mono);
}

/* ── 반응형 ──────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .site-wrap { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .posts-subgrid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .post-card-hero { grid-template-columns: 1fr; }
  .posts-subgrid { grid-template-columns: 1fr; }
  .hero-title { font-size: 42px; }
  .hero-stats { gap: 24px; }
  .sidebar { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .main-nav { display: none; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}

/* ── 유틸리티 ────────────────────────────────────────────── */
.fade-in {
  animation: fadeIn .5s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--accent);
  background: rgba(255,71,87,.1);
  border: 1px solid rgba(255,71,87,.2);
  padding: 3px 10px;
  border-radius: 20px;
}

.live-badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: blink 1.5s ease infinite;
}

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination a, .pagination span {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--mono);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: all .15s;
}

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