/* ============================================================
   News Portal — Airbnb Design System
   ============================================================
   Color:  white canvas + Rausch (#ff385c) accent
   Type:   Inter (≈ Airbnb Cereal VF), system fallback
   Shape:  soft rounded, pill inputs, no hard corners
   ============================================================ */

/* ----- Design Tokens ----- */
:root {
  /* Brand */
  --primary:        #ff385c;
  --primary-active: #e00b41;
  --primary-soft:   #ffd1da;

  /* Ink / Text */
  --ink:       #222222;
  --body:      #3f3f3f;
  --muted:     #6a6a6a;
  --muted-soft:#929292;
  --on-primary:#ffffff;

  /* Surfaces */
  --canvas:        #ffffff;
  --surface-soft:  #f7f7f7;
  --surface-strong:#f2f2f2;

  /* Borders */
  --hairline:      #dddddd;
  --hairline-soft: #ebebeb;

  /* Accent palette kept for section tags */
  --accent-rose:    #e85d75;
  --accent-cyan:    #1098ad;
  --accent-amber:   #d97706;
  --accent-indigo:  #4f46e5;
  --accent-violet:  #7257ff;
  --accent-emerald: #059669;
  --accent-slate:   #475569;

  /* Radius */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   32px;
  --r-full: 9999px;

  /* Spacing */
  --s-xxs:   2px;
  --s-xs:    4px;
  --s-sm:    8px;
  --s-md:    12px;
  --s-base:  16px;
  --s-lg:    24px;
  --s-xl:    32px;
  --s-xxl:   48px;
  --s-section: 64px;

  /* Shadow — single tier, Airbnb style */
  --elevation: 0 0 0 1px rgba(0,0,0,0.02),
               0 2px 6px 0 rgba(0,0,0,0.04),
               0 4px 8px 0 rgba(0,0,0,0.10);

  /* Typography (adapted from Airbnb scale) */
  --font-stack: 'Inter', -apple-system, system-ui, Roboto, 'Helvetica Neue',
                'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html, body {
  margin: 0; padding: 0;
  font-family: var(--font-stack);
  color: var(--ink);
  background: var(--surface-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--primary); }
button, input { font: inherit; border: none; outline: none; }
button { cursor: pointer; }

/* ----- Page Shell ----- */
.page-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--s-xl);
}

/* ============================================================
   Top Nav — Airbnb-style clean header bar
   ============================================================ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-base);
  flex-wrap: wrap;
  height: 80px;
  padding: 0 var(--s-lg);
  margin-bottom: var(--s-xxl);
  background: var(--canvas);
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 10;
}

/* Logo / Brand area */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
}
.topbar-logo {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  background: var(--primary);
  display: grid; place-items: center;
  color: var(--on-primary);
  font-size: 18px; font-weight: 700;
}
.topbar-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* Timestamp — quiet */
.topbar-meta {
  display: flex; align-items: center; gap: var(--s-sm);
}
.stamp {
  font-size: 12px; font-weight: 500;
  color: var(--muted-soft);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.generated-at {
  font-size: 14px; font-weight: 600;
  color: var(--ink);
}

/* Pill control group */
.control-group {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  background: var(--surface-soft);
  padding: 4px;
  border-radius: var(--r-full);
}

/* Date input — pill */
.date-input {
  height: 40px;
  min-width: 160px;
  padding: 0 var(--s-base);
  border-radius: var(--r-full);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px; font-weight: 500;
  border: 1px solid var(--hairline);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.date-input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px rgba(34,34,34,0.12);
}

/* Primary pill button */
.btn-pill {
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px; font-weight: 500;
  line-height: 1;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn-pill:hover { background: var(--primary-active); }
.btn-pill:active { background: var(--primary-active); }

/* Secondary pill */
.btn-pill-outline {
  height: 40px;
  padding: 0 20px;
  border-radius: var(--r-full);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px; font-weight: 500;
  line-height: 1;
  border: 1px solid var(--hairline);
  transition: border-color 0.15s ease;
}
.btn-pill-outline:hover { border-color: var(--ink); }

/* ============================================================
   Content Layout — sidebar + main
   ============================================================ */
.content-layout {
  display: flex;
  gap: var(--s-xl);
  align-items: flex-start;
}

/* ============================================================
   Sidebar — quick jump navigation
   ============================================================ */
.sidebar {
  width: 180px;
  flex-shrink: 0;
  position: sticky;
  top: 104px; /* below topbar (80px + 24px gap) */
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--s-md);
  padding: 0 var(--s-sm);
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--s-sm);
  padding: 8px var(--s-sm);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--body);
  transition: background 0.15s ease, color 0.15s ease;
  text-decoration: none;
}

.sidebar-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.sidebar-link.active {
  background: var(--surface-strong);
  color: var(--ink);
  font-weight: 600;
}

/* Sidebar accent dot */
.sidebar-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  background: var(--muted-soft);
  transition: transform 0.15s ease;
}
.sidebar-link.active .sidebar-dot {
  transform: scale(1.5);
}
.sidebar-dot.rose    { background: var(--accent-rose); }
.sidebar-dot.cyan    { background: var(--accent-cyan); }
.sidebar-dot.amber   { background: var(--accent-amber); }
.sidebar-dot.indigo  { background: var(--accent-indigo); }
.sidebar-dot.violet  { background: var(--accent-violet); }
.sidebar-dot.emerald { background: var(--accent-emerald); }
.sidebar-dot.slate   { background: var(--accent-slate); }

.sidebar-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted-soft);
  min-width: 20px;
  text-align: right;
}
.sidebar-link.active .sidebar-count {
  color: var(--primary);
}

/* Sidebar scrollbar — subtle */
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--hairline);
  border-radius: var(--r-full);
}

/* Main content */
.main-content {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   Stats bar
   ============================================================ */
.stats-strip {
  display: flex; gap: var(--s-xl); flex-wrap: wrap;
  margin-bottom: var(--s-xl);
  padding: var(--s-base) var(--s-lg);
  background: var(--canvas);
  border-radius: var(--r-md);
  border: 1px solid var(--hairline-soft);
}
.stat-item {
  display: flex; flex-direction: column; gap: 2px;
}
.stat-value {
  font-size: 22px; font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
}
.stat-label {
  font-size: 12px; font-weight: 500;
  color: var(--muted-soft);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* ============================================================
   Sections Grid
   ============================================================ */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-lg);
}

/* Section card — Airbnb property-card style */
.section-card {
  background: var(--canvas);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--r-md);
  padding: var(--s-lg);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex; flex-direction: column;
}
.section-card:hover {
  box-shadow: var(--elevation);
  border-color: transparent;
}

/* Top accent stripe */
.section-card::before {
  content: '';
  display: block;
  height: 4px;
  margin: calc(-1 * var(--s-lg)) calc(-1 * var(--s-lg)) var(--s-base);
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.section-card.rose::before    { background: var(--accent-rose); }
.section-card.cyan::before    { background: var(--accent-cyan); }
.section-card.amber::before   { background: var(--accent-amber); }
.section-card.indigo::before  { background: var(--accent-indigo); }
.section-card.violet::before  { background: var(--accent-violet); }
.section-card.emerald::before { background: var(--accent-emerald); }
.section-card.slate::before   { background: var(--accent-slate); }

/* Section head */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-md);
  margin-bottom: var(--s-base);
}
.section-head h2 {
  font-size: 20px; font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.section-overview {
  margin-top: var(--s-xs);
  font-size: 13px; line-height: 1.6;
  color: var(--muted);
}
.source-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 500;
  color: var(--muted);
  padding: 4px 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--hairline);
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.source-link:hover { color: var(--ink); border-color: var(--ink); }

/* Section group */
.section-group + .section-group {
  margin-top: var(--s-base);
  padding-top: var(--s-base);
  border-top: 1px solid var(--hairline-soft);
}
.group-title {
  margin-bottom: var(--s-sm);
  font-size: 12px; font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Item list */
.section-list {
  display: flex; flex-direction: column; gap: var(--s-sm);
}

/* ----- Item row ----- */
.item-row {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--s-md);
  align-items: start;
  padding: var(--s-md) var(--s-sm);
  border-radius: var(--r-sm);
  transition: background 0.15s ease;
}
.item-row:hover {
  background: var(--surface-soft);
}

/* Rank badge — circular, Rausch */
.rank {
  width: 36px; height: 36px;
  border-radius: var(--r-full);
  display: grid; place-items: center;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}

/* Item body */
.item-body {
  min-width: 0;
  line-height: 1.5;
}

/* Item title — main link */
.item-title {
  display: inline;
  font-size: 15px; font-weight: 600;
  color: var(--ink);
  line-height: 1.45;
  transition: color 0.15s ease;
}
.item-title:hover { color: var(--primary); }

/* Item meta — smaller secondary lines */
.item-original {
  margin-top: 2px;
  font-size: 12px; line-height: 1.6;
  color: var(--muted-soft);
}
.item-insight {
  margin-top: var(--s-xs);
  font-size: 13px; line-height: 1.7;
  color: #0f766e;
  font-weight: 500;
}
.item-summary {
  margin-top: var(--s-xs);
  font-size: 13px; line-height: 1.7;
  color: var(--body);
}
.item-detail {
  margin-top: var(--s-xs);
  font-size: 13px; line-height: 1.7;
  color: var(--muted);
}

/* ============================================================
   Empty / Error state
   ============================================================ */
.empty-state {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--s-xxl) var(--s-xl);
  text-align: center;
  gap: var(--s-md);
}
.empty-icon {
  width: 64px; height: 64px;
  border-radius: var(--r-full);
  background: var(--surface-strong);
  display: grid; place-items: center;
  font-size: 28px;
}
.empty-title {
  font-size: 18px; font-weight: 600;
  color: var(--ink);
}
.empty-text {
  font-size: 14px; color: var(--muted);
  max-width: 400px; line-height: 1.6;
}

/* ============================================================
   Footer
   ============================================================ */
.page-footer {
  margin-top: var(--s-xxl);
  padding: var(--s-lg) 0;
  text-align: center;
  border-top: 1px solid var(--hairline-soft);
}
.footer-text {
  font-size: 13px; color: var(--muted-soft);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1080px) {
  .content-layout { gap: var(--s-lg); }
  .sidebar { width: 160px; }
}

@media (max-width: 980px) {
  .page-shell { padding: var(--s-base); }
  .topbar {
    height: auto;
    padding: var(--s-base);
    flex-direction: column;
    align-items: flex-start;
    gap: var(--s-md);
  }
  .control-group { width: 100%; }
  .date-input { flex: 1; }
  .content-layout {
    flex-direction: column;
    gap: var(--s-base);
  }
  .sidebar {
    width: 100%;
    position: static;
    max-height: none;
    overflow-y: visible;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--s-xs);
  }
  .sidebar-link {
    padding: 6px 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--r-full);
    font-size: 12px;
  }
  .sidebar-link.active {
    border-color: var(--primary);
    background: var(--primary-soft);
  }
  .sidebar-label { margin-bottom: var(--s-sm); }
  .sections-grid { grid-template-columns: 1fr; }
  .stats-strip { gap: var(--s-base); }
}

@media (max-width: 640px) {
  .topbar-meta { display: none; }
  .stat-value { font-size: 18px; }
}
