/* Zazu website: the phone app's screens laid out for a big screen.
   Below 1100px wide the page stays the phone layout. */

/* ---------- Market overview (the website's home screen) ---------- */
#home { display: none; }
.home-h { font-family: var(--serif); font-size: 30px; letter-spacing: -.03em; margin: 4px 0 2px; }
.home-sub { color: var(--muted); margin: 0 0 18px; }
.home-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 0 8px; }
.idx-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.idx { text-align: left; padding: 14px 16px; border-radius: 20px; color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.035) 55%, rgba(255,255,255,.05));
  border: 1px solid var(--border); box-shadow: var(--rim), var(--float); }
.idx:hover { border-color: rgba(255,255,255,.22); }
.idx-name { color: var(--muted); font-size: 12px; }
.idx-price { font-family: var(--serif); font-weight: 600; font-size: 22px; letter-spacing: -.02em; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.idx-sym { font-size: 11px; letter-spacing: .06em; color: var(--muted); }
/* News with pictures */
.news-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 26px 0 10px; }
.news-bar .home-label { margin: 0 0 6px; }
.news-tabs button { padding: 5px 14px; }
.news-lead { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: center;
  padding: 12px; border-radius: 22px; color: var(--text); text-decoration: none;
  background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03) 60%);
  border: 1px solid var(--border); box-shadow: var(--rim), var(--float); }
.news-lead:hover { border-color: rgba(255,255,255,.22); }
.news-lead .news-title { font-family: var(--serif); font-size: 21px; line-height: 1.25; letter-spacing: -.015em; -webkit-line-clamp: 4; }
.news-sum { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; margin-top: 10px; }
.news-item { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 12px 10px; border-radius: 16px;
  color: var(--text); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.06); min-height: 104px; }
.news-item:hover { background: rgba(255,255,255,.05); }
.news-item.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: news-shimmer 1.4s linear infinite; }
@keyframes news-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .news-item.skeleton { animation: none; } }
.news-text { min-width: 0; flex: 1; }
.news-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 5px; min-width: 0; }
.news-fav { width: 15px; height: 15px; border-radius: 4px; flex: none; background: #fff; }
.news-src { color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-when { white-space: nowrap; }
.news-tag { margin-left: auto; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  background: rgba(255,255,255,.08); color: var(--text); flex: none; }
.news-title { font-size: 14.5px; line-height: 1.35; font-weight: 550; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-pic { position: relative; flex: none; width: 92px; height: 92px; border-radius: 14px; overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,.12), rgba(255,255,255,.03)); border: 1px solid rgba(255,255,255,.08); }
.news-pic.big { width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 16px; }
.news-pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.news-initial { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 28px; color: rgba(255,255,255,.35); }
.news-pic.big .news-initial { font-size: 56px; }
.news-logo { width: 40%; max-width: 64px; aspect-ratio: 1; border-radius: 22%; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.news-pic.big .news-logo { max-width: 96px; }
.news-more { display: block; margin: 12px auto 0; padding: 8px 20px; }
.news-empty { color: var(--muted); padding: 24px 4px; margin: 0; }
@media (max-width: 1180px) {
  .news-grid { grid-template-columns: minmax(0, 1fr); }
  .news-lead { grid-template-columns: minmax(0, 1fr); }
}

.home-reports { display: flex; gap: 8px; flex-wrap: wrap; }
.home-reports a { text-decoration: none; padding: 8px 16px; }

/* ---------- Website layout (1100px and wider) ---------- */
@media (min-width: 1100px) {
  html, body { height: 100%; }
  body, body.wide {
    width: auto; max-width: 1440px; height: 100dvh; min-height: 0; margin: 0 auto; padding: 0 16px; overflow: hidden;
    display: grid; column-gap: 20px;
    grid-template-columns: 380px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto;
  }

  body > header { grid-column: 1 / 3; grid-row: 1; position: static; margin: 12px 0; padding: 10px 12px 10px 14px; }
  .brand { font-size: 20px !important; }

  /* Left column: your companies, always visible */
  #add-form, #add-form[hidden] { display: flex !important; grid-column: 1; grid-row: 2; padding: 0 0 10px; }
  #lists, #lists[hidden] { display: block !important; grid-column: 1; grid-row: 3; margin: 0 0 10px; padding: 0; }
  #lists.wl-off { display: none !important; }
  #status { grid-column: 1; grid-row: 4; margin: 0 0 8px; }
  #cards, #cards[hidden] { display: grid !important; grid-column: 1; grid-row: 5; max-height: none; margin: 0; padding: 0 2px 12px; overflow-y: auto; align-content: start; }
  footer { grid-column: 1 / 3; grid-row: 6; padding: 8px 0 12px; }

  /* Right: market overview, a company, your portfolio, or settings */
  #home, #detail, #portfolio, #history, #market, #calendar, #settings { grid-column: 2; grid-row: 2 / 6; min-height: 0; max-height: none; margin: 0; overflow-y: auto; }
  #home { display: block; padding: 6px 4px 24px; }
  body:has(#detail:not([hidden])) #home, body:has(#portfolio:not([hidden])) #home, body:has(#history:not([hidden])) #home, body:has(#calendar:not([hidden])) #home, body:has(#settings:not([hidden])) #home { display: none; }
  #detail, #portfolio, #history, #market, #calendar { padding: 0 8px 24px; }
  #settings { align-self: start; max-height: 100%; padding: 18px 20px; }

  /* Give the company page its big-screen layout back (the phone styles stack it) */
  .detail-head { flex-direction: row; align-items: flex-end; gap: 16px; }
  .detail-price { text-align: right; }
  .detail-name { font-size: 34px; }
  .chart-top { flex-direction: row; align-items: center; gap: 12px; }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .chart-hint { display: block; }
  .pf-stats { grid-template-columns: repeat(4, 1fr); }
  .pf-head-right { align-items: flex-end; flex-direction: column; }
  .remove { opacity: 0; }
  .card:hover .remove { opacity: 1; }
  .handle { opacity: .4; }
  .card:hover .handle { opacity: .8; }
}
@media (min-width: 1100px) and (max-width: 1280px) {
  body, body.wide { grid-template-columns: 330px minmax(0, 1fr); }
  .idx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
