/* ========== 외국인 관심 뉴스 위젯 ========== */
:root{
  --fg-bg:#f6f8fb;
  --fg-card:#ffffff;
  --fg-text:#1f2937;
  --fg-muted:#6b7280;
  --fg-primary:#4f46e5;    /* 포인트 보라블루 */
  --fg-primary-weak:#eef2ff;
  --fg-accent:#f97316;     /* HOT */
  --fg-border:#e5e7eb;
  --radius-xl:20px;
  --radius-lg:14px;
  --shadow-sm:0 2px 8px rgba(0,0,0,.06);
  --shadow-md:0 10px 30px rgba(79,70,229,.12);
}

.fg-news{
  max-width: 960px;
  margin: 30px auto 60px;
  padding: 28px 22px 40px;
  background: #f6f8fb;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  font-family: 'Noto Sans KR', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--fg-text);
}

.fg-news__header{ text-align: center; margin-bottom: 20px; }
.fg-news__title{
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.fg-news__desc{ font-size: 14px; color: var(--fg-muted); margin: 0 0 10px; }
.fg-news__chips{ display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.chip{
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--fg-primary-weak);
  color: var(--fg-primary);
  font-size: 12px;
  font-weight: 700;
}
.chip--muted{ background: #eef2f7; color: #64748b; }

/* KPI */
.fg-news__stats{
  margin: 18px 0 22px;
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 12px;
}
.stat-card{
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-card__value{
  font-size: 26px;
  font-weight: 800;
  color: var(--fg-primary);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-card__label{ font-size: 12px; color: var(--fg-muted); }

/* 리스트 */
.fg-news__list{
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.fg-card{
  background: var(--fg-card);
  border: 1px solid var(--fg-border);
  border-radius: var(--radius-lg);
  padding: 16px 16px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .2s ease, border-color .2s ease;
}
.fg-card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #d9ddff;
}

/* 카드 본문 레이아웃 – 중복 제거 후 정리 */
.fg-card__body{
  display: grid;
  gap: 14px;
  align-items: start;
  grid-template-columns: 1fr;             /* 기본 한 열 */
}
/* 썸네일 있을 때만 140px + 본문 1fr 두 열 */
.fg-card__body.has-thumb{ grid-template-columns: 140px 1fr; }
/* 썸네일 1열 고정 */
.fg-card__body.has-thumb .fg-card__thumb{ grid-column: 1; }
/* 본문은 항상 가로 전체 사용 (안전장치) */
.fg-card__excerpt{ grid-column: 1 / -1; }
/* 썸네일 있을 때 본문은 2열(오른쪽)에만 위치 */
.fg-card__body.has-thumb .fg-card__excerpt{ grid-column: 2; }

.fg-card__head{
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.badge{
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
}
.badge--source{ background: #ebf1ff; color: #1e40af; border: 1px solid #dbe4ff; }
.badge--hot{ background: #fff1e7; color: #9a3412; border: 1px solid #ffd7bf; }
.fg-card__time{ margin-left: auto; font-size: 12px; color: var(--fg-muted); }

/* 제목/링크 */
.fg-card__title{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  display: -webkit-box;              /* 긴 제목 안정 처리 */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;             /* 데스크톱 2줄 */
  overflow: hidden;
}
.fg-card__title a{ color: #0f172a; text-decoration: none; }
.fg-card__title a:hover{ text-decoration: underline; }

/* 부제 */
.fg-card__subtitle{
  font-size: 14px;
  color: #374151;
  margin: 0 0 10px;
  display: -webkit-box;              /* 길이 안정 처리 */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;             /* 데스크톱 2줄 */
  overflow: hidden;
}

/* 썸네일(기본) */
.fg-card__thumb{
  display: block;
  width: 140px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--fg-border);
  position: relative; /* 폴백용 기준 컨테이너 */
}
.fg-card__thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.fg-card__thumb:hover img{ transform: scale(1.04); }

/* 본문 요약 – 데스크톱 3줄 클램프 */
.fg-card__excerpt{
  font-size: 14px;
  color: #334155;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;   /* ← 데스크톱 3줄 */
  overflow: hidden;
}

/* 더보기 버튼 + 노트 */
.fg-news__more{ display: flex; justify-content: center; margin: 18px 0 6px; }
.btn-primary{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--fg-text);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid #111827;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary:hover{ transform: translateY(-1px); box-shadow: var(--shadow-md); background: #0b1220; }

.fg-news__note{
  text-align: center;
  font-size: 12px;
  color: var(--fg-muted);
  margin-top: 8px;
}

/* 반응형 */
@media (max-width: 720px){
  .fg-news{ padding: 22px 14px 28px; }
  .fg-news__stats{ grid-template-columns: repeat(2,1fr); gap: 10px; }

  /* 1열로 정리하고, 요약은 숨김 */
  .fg-card__body{ grid-template-columns: 1fr; }
  .fg-card__excerpt{ display: none !important; }

  /* 이미지: 컨테이너 너비 100% + 16:9 고정 비율 */
  .fg-card__thumb{
    width: 100%;
    height: auto;            /* 고정 높이 제거 */
    border-radius: 14px;
    border: 1px solid var(--fg-border);
    overflow: hidden;

    /* 최신 브라우저용 */
    aspect-ratio: 16 / 9;
  }
  .fg-card__thumb img{
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* 제목/부제 타이트 세팅 */
  .fg-card__title{
    -webkit-line-clamp: 2;    /* 필요 시 1로 변경 */
    font-size: 16px;
  }
  .fg-card__subtitle{
    -webkit-line-clamp: 1;
    font-size: 13px;
    margin-bottom: 8px;
  }
}

/* ▼ aspect-ratio 미지원 브라우저 폴백(패딩 해크) */
@supports not (aspect-ratio: 1) {
  @media (max-width: 720px){
    .fg-card__thumb{
      position: relative;
      width: 720px;
      height: auto;
    }
    .fg-card__thumb::before{
      content: "";
      display: block;
      padding-top: 56.25%; /* 16:9 = 9/16*100 */
    }
    .fg-card__thumb img{
      position: absolute;
      inset: 0;
      width: 100%;
      height: ;
      object-fit: cover;
    }
  }
}
