/* ==========================================================================
   HAFLINE MAIN CUSTOM CSS (Final Fix)
   ========================================================================== */

/* [핵심 수정] 변수를 :root에 선언하여 어디서든 색상이 나오도록 수정 */
:root {
  --hf-bg-dark: #0b1b34; /* 뉴스 슬라이더 배경 (남색) */
  --hf-card-bg: #0e2345; /* 뉴스 카드 배경 */
  --hf-primary: #5c83ff;
  --hf-point: #e74c3c;
  --hf-text-main: #0e1628;
}

/* 위젯 타이틀 라인 숨기기 */
hr.hr {
  display: none;
}

/* 1. 공통 레이아웃 */
.hf-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 10px;
}

/* 카드 공통 */
.hf-card {
  background: #fff;
  border: 1px solid #e9eef5;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
  overflow: hidden;
  margin-bottom: 20px;
}

.hf-head-title {
  font-size: 17px;
  font-weight: 800;
  color: #1a1a1a;
  padding: 15px 18px;
  border-bottom: 1px solid #f1f4f8;
  margin: 0;
}

/* 2. 상단 알림 티커 */
.hf-ticker-wrap {
  background: #fff;
  border: 1px solid #ff7a3d;
  border-radius: 8px;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(255, 122, 61, 0.1);
}

.hf-ticker-label {
  background: #fff1ea;
  color: #ff6a28;
  font-weight: 800;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  margin-right: 15px;
  white-space: nowrap;
  border: 1px solid #ffe0d0;
}

.hf-ticker-viewport {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
}

.hf-ticker-track {
  display: flex;
  gap: 30px;
  white-space: nowrap;
  will-change: transform;
}

.hf-ticker-item {
  font-size: 14px;
  color: #333;
  text-decoration: none;
  display: flex;
  align-items: center;
  font-weight: 600;
}

.hf-ticker-item .cate {
  color: #666;
  font-size: 12px;
  background: #f5f5f5;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 6px;
}

/* 3. HERO 섹션 */
.hf-hero-grid {
  display: grid;
  grid-template-columns: 2.4fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.hero-video-box {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.hero-video-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.hero-video-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 40px 20px 20px;
  pointer-events: none;
}

.hero-video-title {
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  background: var(--hf-point);
  padding: 5px 12px;
  border-radius: 6px;
}

/* 우측 사이드 리스트 */
.hf-side-list {
  list-style: none;
  padding: 0 15px;
  margin: 0;
}
.hf-side-list li {
  padding: 10px 0;
  border-bottom: 1px dashed #eee;
  display: flex;
  gap: 10px;
}
.hf-side-list li:last-child {
  border-bottom: none;
}

.hf-side-thumb {
  width: 90px;
  height: 56px;
  border-radius: 6px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.hf-side-text {
  font-size: 13px;
  line-height: 1.4;
  font-weight: 600;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 4. 와이드 뉴스 슬라이더 (배경색 문제 해결됨) */
.hf-news-section {
  background-color: var(--hf-bg-dark); /* 변수 적용 */
  padding: 30px 0;
  margin: 30px 0;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.hf-news-header {
  max-width: 1240px;
  margin: 0 auto 15px;
  padding: 0 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hf-news-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.hf-news-track {
  display: flex;
  gap: 15px;
  padding: 0 10px;
  width: max-content;
  will-change: transform;
}

.hf-news-card {
  display: block;
  width: 260px;
  min-width: 260px;
  background: var(--hf-card-bg);
  border: 1px solid #1a3b6e;
  border-radius: 10px;
  padding: 10px;
  text-decoration: none;
  transition: transform 0.2s;
}
.hf-news-card:hover {
  transform: translateY(-3px);
  border-color: var(--hf-primary);
}

.hf-news-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 6px;
  object-fit: cover;
  background: #000;
  margin-bottom: 10px;
}

.hf-news-title {
  color: #e9f0ff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  height: 2.8em;
  overflow: hidden;
}

/* 애니메이션 정의 */
@keyframes hf-slide-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* 5. 하단 2열 */
.hf-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.hf-text-list {
  list-style: none;
  padding: 0 15px;
  margin: 0;
}
.hf-text-list li {
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  display: flex;
  justify-content: space-between;
}
.hf-text-list a {
  color: #444;
  font-size: 14px;
  text-decoration: none;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hf-text-list .date {
  font-size: 12px;
  color: #999;
}

@media (max-width: 991px) {
  .hf-hero-grid,
  .hf-dual-grid {
    grid-template-columns: 1fr;
  }
}
