/* =============================================
   AI Daily News — 한국형 블로그 디자인
   티스토리/브런치 스타일 참고
   ============================================= */

/* 1. 변수 */
:root {
  --primary: #2563eb;
  --primary-light: #eff6ff;
  --text: #1a1a2e;
  --text-sub: #64748b;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-hover: 0 8px 32px rgba(37,99,235,0.13);
  --max-w: 1200px;
  --header-h: 64px;
}

/* 2. 리셋 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* 3. 헤더 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}
.nav-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.nav-right { display: flex; gap: 8px; }
.nav-link {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-sub);
  transition: all 0.2s;
}
.nav-link:hover { background: var(--primary-light); color: var(--primary); }

/* 4. 히어로 섹션 */
.hero {
  position: relative;
  height: 520px;
  overflow: hidden;
  margin-bottom: 60px;
}
.hero-inner {
  display: block;
  height: 100%;
  position: relative;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}
.hero:hover .hero-bg { transform: scale(1.03); }
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 15, 40, 0.92) 0%,
    rgba(10, 15, 40, 0.5) 50%,
    rgba(10, 15, 40, 0.1) 100%
  );
}
.hero-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 60px;
  color: #fff;
}
.hero-title {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 12px 0 16px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  max-width: 800px;
}
.hero-desc {
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.hero-date {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
}

/* 5. 배지 */
.badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}
/* 카테고리별 배지 색상 */
.card-cat[data-cat="AI 서비스"] { background: #f0fdf4; color: #16a34a; }
.card-cat[data-cat="AI 연구"]   { background: #eff6ff; color: #2563eb; }
.card-cat[data-cat="AI 뉴스"]   { background: #fef9c3; color: #a16207; }

/* 6. 컨테이너 */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* 7. 섹션 타이틀 */
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

/* 8. 카드 그리드 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 80px;
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.25s ease;
  border: 1px solid var(--border);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.card-inner { display: block; height: 100%; }
.card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--border);
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.card:hover .card-thumb img { transform: scale(1.06); }
.card-body { padding: 20px; }
.card-cat {
  display: inline-block;
  padding: 3px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 10px;
}
.card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-desc {
  font-size: 0.85rem;
  color: var(--text-sub);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-sub);
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* 9. 포스트 상세 */
.post-wrap { padding-bottom: 80px; }
.post-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  color: #fff;
  padding: 64px 0 48px;
  margin-bottom: 0;
}
.post-header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}
.post-cats { margin-bottom: 16px; }
.post-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: rgba(255,255,255,0.7);
}
.dot { opacity: 0.5; }

/* 10. 포스트 대표 이미지 */
.post-featured {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  margin-bottom: 48px;
}
.post-featured img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
}

/* 11. 포스트 본문 */
.post-content {
  max-width: 760px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
  line-height: 1.9;
  color: #2d3748;
}
.post-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 48px 0 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}
.post-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 36px 0 14px;
  color: var(--text);
}
.post-content p { margin-bottom: 20px; }
.post-content img {
  border-radius: var(--radius-sm);
  margin: 24px auto;
  box-shadow: var(--shadow);
}
.post-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { opacity: 0.8; }
.post-content ul, .post-content ol {
  padding-left: 24px;
  margin-bottom: 20px;
}
.post-content li { margin-bottom: 8px; }
.post-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 16px 24px;
  background: var(--primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 24px 0;
  font-style: italic;
  color: var(--text-sub);
}
.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 24px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 24px 0;
  font-size: 0.9rem;
  line-height: 1.7;
}
.post-content code {
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.9em;
  color: #e11d48;
}
.post-content pre code { background: none; padding: 0; color: inherit; }
.post-content strong { color: var(--text); }
.post-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 40px 0;
}

/* 12. 태그 */
.post-tags {
  max-width: 760px;
  margin: 0 auto 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  padding: 6px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.82rem;
  color: var(--text-sub);
  transition: all 0.2s;
}
.tag:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* 13. 목록으로 버튼 */
.post-back {
  max-width: 760px;
  margin: 0 auto 48px;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 0.88rem;
  color: var(--text-sub);
  transition: all 0.2s;
}
.back-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* 14. 이전/다음 포스트 */
.post-nav {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  border-top: 1px solid var(--border);
  padding-top: 32px;
}
.post-nav-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.post-nav-item:hover { border-color: var(--primary); background: var(--primary-light); }
.post-nav-item.next { text-align: right; }
.nav-label { font-size: 0.75rem; color: var(--text-sub); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.nav-title { font-size: 0.92rem; font-weight: 600; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 15. 푸터 */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,0.5);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.85rem;
}
.site-footer a { color: rgba(255,255,255,0.7); }
.site-footer a:hover { color: #fff; }

/* 16. 반응형 */
@media (max-width: 1024px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-content { padding: 40px 40px; }
  .hero-title { font-size: 1.8rem; }
}
@media (max-width: 640px) {
  .hero { height: 380px; }
  .hero-content { padding: 28px 20px; }
  .hero-title { font-size: 1.4rem; }
  .hero-desc { display: none; }
  .card-grid { grid-template-columns: 1fr; gap: 16px; }
  .post-title { font-size: 1.5rem; }
  .post-nav { grid-template-columns: 1fr; }
}
