/* ============================================================
   뉴스 브리핑 — 대시보드 우측 하단 5칸 grid
   ============================================================
   본진 frontend/index.html에 link로 박힘.
   본진 CSS variable(var(--accent) 등) 정합.
   ============================================================ */

.news-briefing-section {
  /* 뉴스 브리핑만 슬레이트 톤 적용 — 위 메인 영역은 흰 그대로 */
  margin-top: 40px;
  padding: 22px 22px 18px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e5eb;
  box-shadow: 0 2px 10px rgba(26, 35, 50, 0.06);
  position: relative;
}

/* 라일락 그라데이션 알약·MY BRIEFING 라벨 제거 */
.news-briefing-section::before,
.news-briefing-section::after {
  display: none;
}

/* ─── 헤더 + 툴바 ─── */

.news-briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}

.news-briefing-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: #1a1f2e;
}

.news-briefing-title .nb-glyph {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #374151 0%, #6b7280 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(55, 65, 81, 0.25);
}

.news-briefing-title-sub {
  font-size: 11px;
  font-weight: 500;
  color: #8a93a6;
  margin-left: 4px;
}

.news-briefing-meta {
  font-size: 11px;
  color: #8a93a6;
  font-weight: 400;
}

.news-briefing-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ─── 작은 체크박스 (활성·비활성 토글, 서버에 기억) ─── */
.nb-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(55, 65, 81, 0.06);
  transition: background 0.15s;
}

.nb-toggle:hover {
  background: rgba(55, 65, 81, 0.12);
}

.nb-toggle input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
  accent-color: #374151;
}

.nb-toggle-label {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
}

/* 비활성 상태 — toolbar·grid 완전 슬라이드 업 (사라짐) */
.news-briefing-section.is-disabled .news-briefing-toolbar,
.news-briefing-section.is-disabled .news-briefing-grid {
  max-height: 0 !important;
  opacity: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  border: 0 !important;
  pointer-events: none;
  visibility: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.25s ease-in,
              margin 0.3s ease,
              padding 0.3s ease,
              visibility 0s linear 0.4s;
}

.news-briefing-section.is-disabled .nb-toggle {
  background: rgba(150, 150, 150, 0.08);
}

.news-briefing-section.is-disabled .nb-toggle-label {
  color: #8a93a6;
}

.news-briefing-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 8px;
  /* slide expand/collapse 정합 */
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.3s ease-out,
              margin-bottom 0.3s ease,
              padding 0.35s ease;
  opacity: 1;
}

.nb-input {
  flex: 1;
  min-width: 200px;
  padding: 7px 12px;
  border: 1px solid #d8dce4;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}

.nb-input:focus {
  outline: none;
  border-color: #374151;
}

.nb-select {
  padding: 7px 10px;
  border: 1px solid #d8dce4;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
  cursor: pointer;
}

.nb-btn {
  padding: 7px 14px;
  border: none;
  border-radius: 6px;
  background: #374151;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.nb-btn:hover {
  background: #1f2937;
}

.nb-btn.secondary {
  background: #fff;
  color: #4a5468;
  border: 1px solid #d8dce4;
}

.nb-btn.secondary:hover {
  background: #f0f2f5;
}

.nb-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nb-hint {
  font-size: 11px;
  color: #8a93a6;
  margin-left: auto;
}

/* ─── 5권역 vertical stack (가로줄 row, 위↑아래) ─── */
/* 2026-05-19 — 우측 위젯 패널(380px) 안에서 5권역 가로 grid는 cramped (권역당 ~60px).
   각 권역을 패널 전체 폭으로 vertical stack — 권역 헤더 + 카드 vertical list.
   실장님 명시 *"세로줄이 아니라 가로줄로"* 정합. */

.news-briefing-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* slide expand/collapse 정합 */
  max-height: 2400px;
  overflow: hidden;
  transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              opacity 0.35s ease-out,
              margin-top 0.3s ease;
  opacity: 1;
}

.news-column {
  display: flex;
  flex-direction: column;
  min-height: 0;                    /* vertical stack 정합 — fixed min-height 제거 */
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.news-column-header {
  display: flex;                    /* 국기 SVG + 라벨 가로 정렬 */
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #1a1f2e;
  padding: 2px 0 8px;
  border-bottom: 1px solid #e8ebf0;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 국기 SVG 정렬·여백 */
.news-column-header .nb-flag {
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);  /* 흰 배경 국기(US·KR)에 미세 외곽 */
  display: inline-block;
  vertical-align: middle;
}

.news-column-header .nb-region-text {
  flex: 1;
  letter-spacing: -0.1px;
}

.news-column-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  /* vertical stack — 권역별 자체 스크롤 X, 패널 전체 스크롤로 자연 처리 */
  max-height: 280px;
  overflow-y: auto;
}

.news-card {
  padding: 7px 0;
  border-bottom: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.1s;
}

.news-card:last-child {
  border-bottom: none;
}

.news-card:hover {
  background: rgba(55, 65, 81, 0.04);
}

.news-card-title {
  font-size: 12px;
  font-weight: 600;
  color: #1a1f2e;
  line-height: 1.35;
  margin-bottom: 4px;
  /* 2줄 ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-summary {
  font-size: 11px;
  color: #6b7585;
  line-height: 1.35;
  margin-bottom: 4px;
  /* 2줄 ellipsis */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  font-size: 10px;
  color: #a0a8b5;
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.news-card-meta .news-publisher {
  font-weight: 500;
}

.news-empty {
  font-size: 11px;
  color: #b0b8c5;
  text-align: center;
  padding: 30px 4px;
  line-height: 1.5;
}

.news-loading {
  font-size: 11px;
  color: #8a93a6;
  text-align: center;
  padding: 30px 4px;
}

/* ─── 반응형 ─── */
/* 2026-05-19 — vertical stack은 모든 폭에서 동일 (위↑아래 1열).
   미디어쿼리에는 좁은 화면에서 nb-hint 줄바꿈만 보존. */

@media (max-width: 600px) {
  .nb-hint {
    width: 100%;
    margin-left: 0;
  }
}
