/* ============================================================
   CarPrism — home.css
   참조 디자인: gamtrend.tmhub.co.kr
   ============================================================ */

/* ── Google Font fallback + 기본 설정 ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800&display=swap');

:root {
  /* 색상 */
  --navy:        #0f1923;
  --navy-light:  #1a2840;
  --navy-mid:    #243450;
  --surface:     #ffffff;
  --bg:          #f4f5f7;
  --text:        #1e2430;
  --text-muted:  #8892a0;
  --border:      #e4e8ee;
  --accent:      #e53935;       /* 빨강 강조 */
  --accent-blue: #2979ff;       /* 파랑 강조 */
  --accent-ev:   #00c29f;       /* 전기차 */
  --accent-gen:  #9c6dd6;       /* 제네시스 */

  /* 레이아웃 */
  --max-width:   1200px;
  --header-h:    56px;
  --gap:         24px;
  --radius-card: 10px;
  --radius-sm:   6px;
}

/* ── 리셋 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
img, video { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ── 레이아웃 유틸 ── */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff6f61);
  z-index: 2000;
  transition: width 0.1s ease-out;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--navy);
  height: var(--header-h);
  box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

.header-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 0;
}

/* 로고 */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-right: 32px;
}
.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff6f00 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0;
  flex-shrink: 0;
}
.logo-text {
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
}
.logo-text em {
  font-style: normal;
  color: var(--accent);
  margin-left: 2px;
}

/* 메인 네비 */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-link {
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 16px;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s, background 0.2s;
  border-radius: 4px;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.07); }
.nav-link.active {
  color: #fff;
  background: var(--accent);
  border-radius: 4px;
  font-weight: 700;
}

/* 검색 버튼 */
.search-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  margin-left: auto;
}
.search-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

/* 모바일 햄버거 */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 32px;
  padding: 4px;
  margin-left: auto;
}
.mobile-menu-btn span {
  display: block;
  height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  transition: 0.3s;
}

/* 모바일 네비 드롭다운 */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-h);
  left: 0; right: 0;
  background: var(--navy);
  z-index: 800;
  padding: 8px 20px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.mobile-nav.is-open { display: flex; flex-direction: column; gap: 2px; }
.mobile-nav .nav-link {
  height: 44px;
  border-radius: var(--radius-sm);
}

/* ============================================================
   HERO SLIDER
   ============================================================ */
.hero-slider {
  position: relative;
  background: var(--navy);
  overflow: hidden;
  user-select: none;
  max-width: var(--max-width);
  margin: 20px auto 0;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* 슬라이드 트랙 */
.slider-track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* 개별 슬라이드: 좌 이미지 60% + 우 텍스트 40% */
.slide {
  display: grid;
  grid-template-columns: 60% 40%;
  flex-shrink: 0;
  width: 100%;
  height: 450px;
}

.slide-image {
  overflow: hidden;
  background: var(--navy-mid);
}
.slide-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.8s ease;
}
.hero-slider:hover .slide-image img { transform: scale(1.03); }

/* 우측 텍스트 패널 */
.slide-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 40px 40px 50px;
  background: var(--navy-light);
}

/* 카테고리 뱃지 */
.slide-cat {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
}
.slide-cat--blue  { background: var(--accent-blue); }
.slide-cat--green { background: var(--accent-ev); }

/* 제목 */
.slide-title {
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 800;
  line-height: 1.4;
  color: #ffffff;
  letter-spacing: -0.01em;
}

/* 설명 */
.slide-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 메타 */
.slide-meta {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}
.slide-source { color: rgba(255,255,255,0.3); }

/* 기사 읽기 버튼 */
.slide-btn {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 10px 22px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 4px;
  transition: background 0.2s, transform 0.2s;
}
.slide-btn:hover {
  background: #c62828;
  transform: translateX(3px);
}

/* 좌우 화살표 */
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  color: #fff;
  transition: background 0.2s;
}
.slider-arrow:hover { background: rgba(255,255,255,0.28); }
.slider-arrow--prev { left: 16px; }
.slider-arrow--next { right: 16px; }

/* 하단 도트 */
.slider-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transition: background 0.2s, transform 0.2s;
}
.dot--active {
  background: #fff;
  transform: scale(1.25);
}

/* 자동 진행 바 */
.slider-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  transition: width linear;
  z-index: 10;
}

/* ============================================================
   CONTENT LAYOUT: 메인 + 사이드바
   ============================================================ */
.content-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  padding-top: 28px;
  padding-bottom: 60px;
  align-items: start;
}

/* ── 공통 섹션 블록 ── */
.section-block { margin-bottom: 40px; }

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.section-title-bar {
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}
.section-more {
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.2s;
}
.section-more:hover { color: var(--accent); }

/* ============================================================
   FEATURED GRID (주요 기사 — 2열)
   ============================================================ */
.featured-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}

.featured-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow 0.25s, transform 0.25s;
}
.featured-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,0.12);
  transform: translateY(-3px);
}

/* 썸네일 */
.card-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--navy-mid);
}
.card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}
.featured-card:hover .card-thumb img { transform: scale(1.05); }

/* 카드 카테고리 뱃지 (썸네일 위) */
.card-cat {
  position: absolute;
  top: 10px; left: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  pointer-events: none;
}
.card-cat.cat-sales   { background: var(--accent); }
.card-cat.cat-hyundai { background: var(--accent-blue); }
.card-cat.cat-ev      { background: var(--accent-ev); }
.card-cat.cat-genesis { background: var(--accent-gen); }

/* 카드 하단 정보 */
.card-info {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
  transition: color 0.2s;
}
.featured-card:hover .card-title { color: var(--accent); }
.card-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ── 카테고리 라벨 (인라인) ── */
.cat-label {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 0;
}
.cat-label.cat-sales   { color: var(--accent); }
.cat-label.cat-hyundai { color: var(--accent-blue); }
.cat-label.cat-ev      { color: var(--accent-ev); }
.cat-label.cat-genesis { color: var(--accent-gen); }

/* ============================================================
   ARTICLE LIST (최신 기사 — 1열 리스트)
   ============================================================ */
.article-list {
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.article-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s;
}
.article-row:last-of-type { border-bottom: none; }
.article-row:hover { background: #f9fafb; }

.row-thumb {
  flex-shrink: 0;
  width: 96px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--navy-mid);
}
.row-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.article-row:hover .row-thumb img { transform: scale(1.06); }

.row-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}
.row-title {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text);
  transition: color 0.2s;
  /* 2줄 말줄임 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-row:hover .row-title { color: var(--accent); }
.row-meta {
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* 페이지네이션 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  font-size: 0.85rem;
}
.page-info { color: var(--text-muted); }
.page-next {
  color: var(--accent);
  font-weight: 600;
  transition: opacity 0.2s;
}
.page-next:hover { opacity: 0.75; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.sidebar-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 18px 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* 🔥 최신기사 목록 */
.hot-list { display: flex; flex-direction: column; }
.hot-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: opacity 0.2s;
}
.hot-item:last-child { border-bottom: none; padding-bottom: 0; }
.hot-item:hover { opacity: 0.8; }

.hot-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--navy-mid);
}
.hot-thumb img { width: 100%; height: 100%; object-fit: cover; }

.hot-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.hot-title {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-date {
  font-size: 0.73rem;
  color: var(--text-muted);
}

/* 카테고리 태그 */
.cat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cat-tag {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.cat-tag:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* 소개 */
.about-text {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--navy);
  border-top: 1px solid rgba(255,255,255,0.06);
  margin-top: 40px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 36px;
}

/* 푸터 브랜드 */
.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.footer-logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff6f00 100%);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
}
.footer-logo-text {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.02em;
}
.footer-logo-text em {
  font-style: normal;
  color: var(--accent);
  margin-left: 2px;
}
.footer-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.75;
}

/* 푸터 컬럼 */
.footer-col-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin-bottom: 14px;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links a {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
  transition: color 0.2s;
}
.footer-links a:hover { color: rgba(255,255,255,0.9); }

/* 푸터 하단 */
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07);
  padding: 14px 20px;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
}

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .content-wrap {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }
  .sidebar-block {
    /* 가로 배치 가능하도록 */
  }
}

@media (max-width: 720px) {
  .hero-slider {
    margin: 12px 12px 0;
    border-radius: var(--radius-sm);
  }
  .slide {
    grid-template-columns: 1fr;
    grid-template-rows: 220px 1fr;
    height: auto;
  }
  .slide-content {
    padding: 24px 20px;
  }
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .main-nav { display: none; }
  .search-btn { display: none; }
  .mobile-menu-btn { display: flex; }
  .content-wrap { padding-top: 20px; padding-bottom: 40px; }
}

@media (max-width: 480px) {
  .row-thumb { width: 72px; height: 52px; }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}
