/* AI NEWS DAILY — poster-inspired dashboard */
:root {
  --bg: #f5efe1;
  --bg-card: #ffffff;
  --accent: #f4a623;
  --accent-soft: #fbe4a3;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-mute: #8a8a8a;
  --red: #d93636;
  --green: #2a9d4a;
  --blue: #2a6fd9;
  --line: #e8e0cd;
  --shadow: 0 2px 8px rgba(40, 30, 10, 0.04);
  --shadow-lg: 0 4px 16px rgba(40, 30, 10, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px 48px;
}

/* ===== HEADER ===== */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 28px;
}

.header-left { flex: 1; }

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.logo-mark {
  display: flex;
  gap: 3px;
}
.logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  display: inline-block;
}
.logo-dot:nth-child(1) { background: var(--red); }
.logo-dot:nth-child(2) { background: var(--accent); }
.logo-dot:nth-child(3) { background: var(--green); }

.brand-name {
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 14px;
  color: var(--ink);
}

.brand-tag {
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 999px;
  text-transform: uppercase;
}

.main-title {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 12px;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}
.meta-divider { color: var(--ink-mute); }

.mascot {
  flex-shrink: 0;
}

/* ===== SECTIONS ===== */
.section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.accent-bar {
  width: 4px;
  height: 22px;
  background: var(--accent);
  border-radius: 2px;
}
.accent-bar.small { height: 16px; }

.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
}

.section-sub {
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ===== NEWS CARDS ===== */
.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.news-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  position: relative;
  border-left: 3px solid var(--accent);
  transition: transform 0.15s ease;
}
.news-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.news-rank {
  font-family: 'Inter', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
  width: 32px;
}

.news-body { flex: 1; min-width: 0; }

.news-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.news-headline {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
  line-height: 1.4;
}

.news-summary {
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.55;
}

/* ===== STOCKS GRID ===== */
.stocks-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stock-card {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stock-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.stock-ticker {
  font-weight: 800;
  font-size: 14px;
  color: var(--ink);
}

.stock-change {
  font-weight: 800;
  font-size: 13px;
  padding: 2px 6px;
  border-radius: 4px;
}
.stock-change.up { color: var(--red); background: #ffe9e9; }
.stock-change.down { color: var(--green); background: #e8f7ec; }

.stock-name {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.stock-price {
  font-family: 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  line-height: 1;
}

.stock-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.stock-target {
  color: var(--accent);
  font-weight: 700;
}
.stock-rating {
  background: var(--accent-soft);
  color: var(--ink);
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 10px;
}

/* ===== AGENTS GRID ===== */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.agent-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--green);
}

.agent-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8f7ec;
  color: var(--green);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.agent-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 4px;
}

.agent-desc {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-bottom: 8px;
}

.agent-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-mute);
}
.agent-meta strong { color: var(--ink); }

/* ===== TIPS / QUOTES ===== */
.tips-quotes {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
}

.tips-card, .quotes-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.tq-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.tq-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.tips-list {
  list-style: none;
  counter-reset: tips;
}
.tips-list li {
  counter-increment: tips;
  padding: 6px 0 6px 28px;
  position: relative;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  border-bottom: 1px dashed var(--line);
}
.tips-list li:last-child { border-bottom: none; }
.tips-list li::before {
  content: counter(tips, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 6px;
  font-family: 'Inter', monospace;
  font-weight: 800;
  font-size: 11px;
  color: var(--accent);
}

.daily-quote {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.5;
  margin-bottom: 10px;
  position: relative;
  padding-left: 14px;
  border-left: 3px solid var(--accent);
}
.quote-author {
  font-size: 12px;
  color: var(--ink-mute);
  text-align: right;
  font-style: italic;
}

/* ===== FOOTER ===== */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 18px;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-mute);
  letter-spacing: 0.05em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .news-grid, .agents-grid { grid-template-columns: 1fr; }
  .stocks-grid { grid-template-columns: repeat(2, 1fr); }
  .tips-quotes { grid-template-columns: 1fr; }
  .main-title { font-size: 28px; }
  .header { flex-direction: column; }
  .mascot svg { width: 120px; height: 120px; }
}

@media (max-width: 540px) {
  .stocks-grid { grid-template-columns: 1fr; }
  .page { padding: 20px 16px; }
}

/* ===== PRINT BUTTON (screen only) ===== */
.print-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s;
}
.print-btn:hover { background: var(--accent); color: var(--ink); }

/* ===== PRINT: POSTER MODE =====
   - A3 portrait (297×420mm), edge-to-edge full bleed
   - Cream paper background, amber accent preserved
   - Bump font sizes ~1.6× so printed copy reads from across the room
   - Hide print button, prevent card splits
*/
@media print {
  @page {
    size: A3 portrait;
    margin: 0;
  }

  html, body {
    background: var(--bg) !important;
    color: var(--ink) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-size: 16px;
  }

  /* hide UI chrome */
  .print-btn { display: none !important; }
  .footer > span:not(:first-child) { display: none; }

  .page {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 18mm 16mm 14mm;
  }

  /* HEADER — bigger title for poster */
  .header {
    gap: 24px;
    margin-bottom: 14mm;
    padding-bottom: 8mm;
    border-bottom: 2px solid var(--ink);
  }
  .brand-name { font-size: 18px !important; }
  .brand-tag { font-size: 12px !important; padding: 4px 12px !important; }
  .main-title { font-size: 56px !important; line-height: 1.1 !important; margin: 6mm 0 4mm !important; }
  .meta-item { font-size: 12px !important; }
  .mascot svg { width: 120px !important; height: 120px !important; }

  /* SECTION TITLES */
  .section { margin-bottom: 8mm; }
  .section-header { margin-bottom: 4mm; }
  .section-title { font-size: 22px !important; letter-spacing: 0.12em !important; }
  .section-sub { font-size: 12px !important; }
  .accent-bar { width: 6px !important; height: 22px !important; margin-right: 10px !important; }

  /* NEWS GRID — 2 columns on print so cards stay legible */
  .news-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 5mm !important;
  }

  /* CARDS — keep together, paper-flat shadows */
  .news-card,
  .stock-card,
  .agent-card,
  .tips-card,
  .quotes-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid var(--line) !important;
    padding: 5mm !important;
  }

  .news-card .card-title { font-size: 15px !important; line-height: 1.35 !important; }
  .news-card .card-summary { font-size: 12px !important; }
  .news-card .card-meta { font-size: 10px !important; }

  /* STOCKS — 4 columns, tight grid */
  .stocks-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4mm !important;
  }
  .stock-card { padding: 4mm !important; }
  .stock-ticker { font-size: 18px !important; }
  .stock-name { font-size: 10px !important; }
  .stock-price { font-size: 16px !important; }
  .stock-change { font-size: 13px !important; }

  /* AGENTS — 3 columns */
  .agents-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4mm !important;
  }
  .agent-card { padding: 4mm !important; }
  .agent-name { font-size: 13px !important; }
  .agent-meta { font-size: 10px !important; }

  /* TIPS + QUOTES */
  .tips-quotes { grid-template-columns: 1.4fr 1fr !important; gap: 5mm !important; }
  .tips-card, .quotes-card { padding: 5mm !important; }
  .tips-list li { font-size: 12px !important; padding: 3px 0 !important; }
  .daily-quote { font-size: 17px !important; line-height: 1.45 !important; }
  .quote-author { font-size: 11px !important; }

  /* FOOTER */
  .footer {
    margin-top: 6mm !important;
    padding-top: 4mm !important;
    border-top: 1px solid var(--ink) !important;
    font-size: 10px !important;
  }

  /* Never break a section title away from its first card */
  .section-header { break-after: avoid; page-break-after: avoid; }
}
