/* ============================================
   Daily News Monitor — Mobile-First RWD Index
   ============================================ */

:root {
  --c-bg: #f8fafc;
  --c-card: #fff;
  --c-text: #0f172a;
  --c-text-soft: #475569;
  --c-text-mute: #94a3b8;
  --c-link: #0ea5e9;
  --c-border: #e5e7eb;
  --c-accent: #fbbf24;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover: 0 6px 18px rgba(0,0,0,0.10);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Microsoft JhengHei",
          "PingFang TC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: linear-gradient(135deg, var(--c-bg) 0%, #e2e8f0 100%);
  margin: 0;
  color: var(--c-text);
  line-height: 1.6;
  font-size: clamp(14px, 2.4vw, 16px);
}

/* ============ Header ============ */
.site-head {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  padding: clamp(28px, 6vw, 44px) clamp(16px, 4vw, 24px);
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
.site-head h1 {
  margin: 0 0 6px;
  font-size: clamp(20px, 5vw, 28px);
  letter-spacing: 0.5px;
}
.site-sub {
  font-size: clamp(12px, 2.6vw, 14px);
  opacity: 0.8;
  margin-bottom: 14px;
}
.site-stat {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(12px, 3vw, 22px);
  font-size: clamp(12px, 2.6vw, 14px);
}
.site-stat b {
  font-size: clamp(15px, 3.8vw, 18px);
  color: var(--c-accent);
  padding: 0 4px;
}

/* ============ Container ============ */
.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 4vw, 28px) clamp(14px, 4vw, 20px);
}

/* ============ Filter Bar ============ */
.filter-bar {
  background: #fff;
  border-radius: var(--radius);
  padding: clamp(14px, 3vw, 18px) clamp(16px, 4vw, 22px);
  box-shadow: var(--shadow);
  margin-bottom: clamp(20px, 4vw, 28px);
  position: sticky;
  top: 8px;
  z-index: 10;
}
.filter-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}
.filter-bar-head strong {
  color: var(--c-text);
  font-size: clamp(13px, 3vw, 15px);
}
.clear-btn {
  background: #f1f5f9;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--c-text-soft);
  min-height: 32px;
}
.clear-btn:hover { background: #e2e8f0; }

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: clamp(12px, 2.5vw, 13px);
  transition: all 0.15s;
  min-height: 32px;
  white-space: nowrap;
}
.tag-btn:hover, .tag-btn:focus {
  background: #e0f2fe;
  border-color: var(--c-link);
  color: #0c4a6e;
}
.tag-btn.active {
  background: var(--c-link);
  color: #fff;
  border-color: #0284c7;
  font-weight: 600;
}
.tag-btn small { opacity: 0.7; }

/* ============ Day Block ============ */
.day-block { margin-bottom: clamp(22px, 5vw, 30px); }
.day-head {
  font-size: clamp(15px, 3.6vw, 18px);
  color: var(--c-text);
  border-left: 5px solid var(--c-link);
  padding-left: 12px;
  margin: 0 0 14px;
}

/* ============ Cards Grid ============ */
.cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(10px, 2vw, 14px);
}
@media (min-width: 600px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 980px) {
  .cards-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: clamp(14px, 3.5vw, 20px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: block;
  border: 1px solid transparent;
}
.card:hover, .card:focus {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: var(--c-link);
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-th { background: #ddd6fe; color: #5b21b6; }
.badge-ln { background: #bae6fd; color: #075985; }
.badge-other { background: #e5e7eb; color: #374151; }
.card-time {
  font-size: 11px;
  color: var(--c-text-mute);
  font-family: monospace;
  white-space: nowrap;
}

.card-title {
  font-size: clamp(14px, 3vw, 15px);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 10px;
  line-height: 1.45;
}

.card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip {
  background: #f1f5f9;
  color: var(--c-text-soft);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  min-height: 22px;
  white-space: nowrap;
}
.chip:hover, .chip:focus {
  background: #fef3c7;
  color: #92400e;
}

/* ============ Footer ============ */
.site-foot {
  text-align: center;
  padding: clamp(20px, 5vw, 28px) 16px;
  color: var(--c-text-soft);
  font-size: 13px;
}
.site-foot a { color: var(--c-link); text-decoration: none; }

/* ============ Mobile-only tweaks ============ */
@media (max-width: 600px) {
  .filter-bar { position: relative; top: 0; }
  .site-stat { gap: 10px; }
}
