/* ── News page ────────────────────────────────────────────────────────────── */

/* Page layout: filter bar + scrollable list + sub-nav */
.news-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ── Filter chip bar ─────────────────────────────────────────────────────── */
.news-filter-bar {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 5px 5px rgba(0, 0, 0, 0.4);
  z-index: 2;
  flex-shrink: 0;
  position: relative;
}
.news-filter-bar::-webkit-scrollbar { display: none; }

/* ── News list (scrollable area) ─────────────────────────────────────────── */
.news-list {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── News card ───────────────────────────────────────────────────────────── */
.news-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border-radius: 8px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 5px rgba(0, 0, 0, var(--shadow-opacity));
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
}
.news-card:hover {
  border-color: #CD4A14;
  box-shadow: 0 4px 12px rgba(205, 74, 20, 0.15);
}

.news-card-image {
  width: 90px;
  height: 90px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}

.news-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.news-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-desc {
  font-size: 12px;
  color: var(--sub);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-date {
  font-size: 11px;
  color: var(--sub);
  font-weight: 600;
  margin-top: auto;
}

/* ── Loading spinner ─────────────────────────────────────────────────────── */
.news-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 80px 32px;
  text-align: center;
}
.news-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: #CD4A14;
  border-radius: 50%;
  animation: news-spin 0.8s linear infinite;
}
@keyframes news-spin {
  to { transform: rotate(360deg); }
}
.news-loading-text {
  color: var(--sub);
  font-size: 13px;
  font-weight: 600;
}

/* ── Error state ─────────────────────────────────────────────────────────── */
.news-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 32px;
  text-align: center;
}
.news-error ion-icon {
  font-size: 36px;
  color: var(--disabled-color);
}
.news-error-text {
  color: var(--sub);
  font-size: 14px;
  font-weight: 600;
}
.news-retry-btn {
  margin-top: 4px;
  padding: 8px 20px;
  border-radius: 6px;
  border: 1px solid #CD4A14;
  background: rgba(205, 74, 20, 0.1);
  color: #CD4A14;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.news-retry-btn:hover {
  background: rgba(205, 74, 20, 0.2);
}

/* ── Sub-navigation (Official / Community) ───────────────────────────────── */
.news-sub-nav {
  display: flex;
  flex-shrink: 0;
  background: var(--tab-bar);
  border-top: 1px solid var(--tab-bar-border);
  box-shadow: 0 -5px 5px rgba(0, 0, 0, 0.4);
  z-index: 2;
  position: relative;
}
.news-sub-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  font-size: 13px;
  font-weight: 700;
  color: var(--sub);
  cursor: pointer;
  transition: color 0.15s;
  border-top: 2px solid transparent;
  user-select: none;
}
.news-sub-tab:hover {
  color: var(--text);
}
.news-sub-tab.active {
  color: #CD4A14;
  border-top-color: #CD4A14;
}
.news-sub-tab ion-icon {
  font-size: 16px;
}

/* ── Ad placeholder ──────────────────────────────────────────────────────── */
.news-ad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 60px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--card);
  box-shadow: 0 4px 5px rgba(0, 0, 0, var(--shadow-opacity));
}
.news-ad ion-icon {
  font-size: 18px;
  color: var(--disabled-color);
}
.news-ad span {
  color: var(--sub);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
