/* Baystreet.ca refresh preview — static mockup
   Brand colors sampled from existing /css/all.css:
     --nav   : #0c5578  (dark teal — primary)
     --blue  : #00698C  (mid blue)
     --light : #6fa5ea  (light blue)
     --accent: #DD6F00  (orange) */

:root {
  --nav:    #0c5578;
  --blue:   #00698C;
  --light:  #6fa5ea;
  --accent: #DD6F00;
  --ink:    #1a2332;
  --muted:  #6b7785;
  --line:   #e5e9ef;
  --bg:     #f7f9fc;
  --card:   #ffffff;
  --max:    1240px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

/* ───── Header ───── */
.topbar {
  /* Same ink as ticker strip — dark band framing teal nav / white logo row */
  background: var(--ink);
  color: rgba(255,255,255,.85);
  font-size: 13px;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 36px;
}
.topbar a { color: rgba(255,255,255,.85); margin-left: 18px; }
.topbar a:hover { color: #fff; }
.topbar-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
}
.topbar-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 0;
}
.topbar-links a i {
  font-size: 12px;
  opacity: 0.92;
}
@media (max-width: 720px) {
  .topbar {
    font-size: 12px;
    padding-top: max(6px, env(safe-area-inset-top, 0px));
  }
  .topbar .container {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    height: auto;
    min-height: 0;
    padding-top: 12px;
    padding-bottom: 12px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .topbar .container > div:first-child {
    text-align: center;
    line-height: 1.45;
    padding: 0 4px;
  }
  .topbar-links {
    justify-content: center;
    gap: 12px 16px;
    row-gap: 8px;
  }
}

.header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header .container {
  display: flex; align-items: center; gap: 32px; height: 76px;
}
.brand { display: flex; align-items: center; }
.brand img { height: 44px; width: auto; }
.brand-text {
  font-weight: 800; font-size: 22px; color: var(--nav);
  letter-spacing: -0.01em; margin-left: 10px;
}
.search {
  flex: 1; max-width: 480px; position: relative;
}
.search input {
  width: 100%; padding: 10px 14px 10px 40px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; background: var(--bg);
  outline: none; transition: border-color .15s;
}
.search input:focus { border-color: var(--blue); background: #fff; }
.search::before {
  content: "";
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px;
  background: no-repeat center/contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7785' stroke-width='2'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>");
}
.actions { display: flex; align-items: center; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 18px; border-radius: 4px; font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #b75a00; color: #fff; }
.btn-ghost { background: var(--light); color: #fff; border-color: var(--light); }
.btn-ghost:hover { background: var(--blue); color: #fff; border-color: var(--blue); }
.social-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 4px;
  background: var(--blue); color: #fff;
  transition: background .15s;
}
.social-btn:hover { background: var(--nav); color: #fff; }
.social-btn svg { display: block; }

@media (max-width: 600px) {
  .header .container {
    flex-direction: column;
    height: auto;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 14px;
    text-align: center;
  }
  .header .container > div[style*="flex:1"] { display: none; }
  .actions { justify-content: center; flex-wrap: wrap; }
}

/* ───── Nav ───── */
.mainnav {
  background: var(--nav);
  margin: 0;
  padding: 0;
}
/* Only when ticker follows (homepage): bridge teal → tape so page bg never shows through */
.mainnav:has(+ .tape) {
  border-bottom: 2px solid var(--ink);
}
.mainnav .container {
  display: flex; align-items: center; gap: 0;
}
.mainnav-items { display: flex; flex: 1; gap: 0; }
.mainnav a {
  padding: 14px 22px;
  font-size: 14px; font-weight: 600; color: #fff;
  white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.08);
  transition: background .15s;
}
.mainnav-items a:first-child { border-left: 1px solid rgba(255,255,255,.08); }
.mainnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.mainnav a.active { background: var(--blue); color: #fff; }
.mainnav .search {
  max-width: 240px; margin-left: auto; flex: 0 0 auto;
}
.mainnav .search input {
  margin: 0;
  background: #fff; border-color: #fff;
  padding: 8px 14px 8px 36px; font-size: 13px;
}
.mainnav .search::before { left: 12px; }
@media (max-width: 800px) {
  .mainnav .container { flex-wrap: wrap; padding: 0; }
  .mainnav-items { overflow-x: auto; width: 100%; }
  .mainnav .search { margin: 8px 16px; max-width: none; width: calc(100% - 32px); }
}

/* ───── Ticker tape ───── */
.tape {
  background: var(--ink); color: #fff;
  font-size: 13px; font-variant-numeric: tabular-nums;
  overflow: hidden; padding: 10px 0;
  /* Overlap nav border so seam stays solid ink (subpixel gaps vary by zoom/DPR) */
  margin-top: -2px;
}
.tape .container { display: flex; gap: 32px; overflow: hidden; }
.tape-item { display: inline-flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.tape-sym { font-weight: 700; }
.tape-up { color: #41d99a; }
.tape-down { color: #ff6b6b; }

/* ───── Layout ───── */
main { padding: 32px 0 64px; }
.grid { display: grid; gap: 24px; }
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

/* ───── Section heading ───── */
.section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 8px 0 16px;
}
.section-h h2 {
  margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em;
  color: var(--nav);
}
.section-h h2 .accent {
  display: inline-block; width: 4px; height: 18px; background: var(--accent);
  border-radius: 2px; margin-right: 10px; vertical-align: -2px;
}
.section-h .more { font-size: 13px; font-weight: 600; color: var(--blue); }

/* ───── Hero (homepage) ───── */
.hero {
  display: grid;
  /* Match prior 2fr + 1fr + 1fr layout: lead is half the row */
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 36px;
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
}
/* One row: lead + quad share the same row height (tallest column wins; both stretch). */
.hero-card.lead {
  height: 100%;
  min-height: 0;
}
.hero-card.lead .body {
  flex: 0 0 auto;
}
.hero-card.lead .img {
  flex: 1 1 0;
  min-height: clamp(160px, 28vmin, 360px);
  aspect-ratio: unset;
  position: relative;
}
.hero-card.lead .img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-quad {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
  min-height: 0;
  height: 100%;
}
.hero-quad .hero-card {
  height: 100%;
  min-height: 0;
  min-width: 0;
}
.hero-quad .hero-card .img {
  flex: 1 1 0;
  /* Keep a visible photo band; flex-only sizing was collapsing images in some layouts */
  min-height: clamp(88px, 14vmin, 200px);
  aspect-ratio: unset;
  position: relative;
}
.hero-quad .hero-card .img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-quad .hero-card .body {
  flex: 0 0 auto;
}
@media (max-width: 900px) {
  .hero-card.lead {
    height: auto;
  }
  .hero-card.lead .img {
    flex: 0 0 auto;
    aspect-ratio: 16/10;
    position: relative;
  }
  .hero-card.lead .img img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: cover;
  }
  .hero-quad {
    height: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: none;
  }
  .hero-quad .hero-card {
    height: auto;
  }
  .hero-quad .hero-card .img {
    flex: 0 0 auto;
    aspect-ratio: 16/9;
    position: relative;
  }
  .hero-quad .hero-card .img img {
    position: static;
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}
@media (max-width: 600px) {
  .hero-quad { grid-template-columns: 1fr; }
}
.hero-card {
  background: var(--card); border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line);
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.hero-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(12,85,120,.10); }
.hero-card .img { aspect-ratio: 16/9; overflow: hidden; background: #eef2f7; }
.hero-card .img img { width: 100%; height: 100%; object-fit: cover; }
.hero-card .body { padding: 18px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 8px;
}
.hero-card h3 {
  margin: 0 0 10px; font-size: 18px; font-weight: 700; color: var(--ink);
  line-height: 1.35; letter-spacing: -0.005em;
}
.hero-card.lead h3 { font-size: 26px; line-height: 1.25; }
.hero-card .meta { margin-top: auto; font-size: 12px; color: var(--muted); }

/* ───── Card grid (article list) ───── */
.cards {
  display: grid; gap: 20px;
  grid-template-columns: repeat(3, minmax(0,1fr));
}
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(12,85,120,.10); }
.card .img { aspect-ratio: 16/9; background: #eef2f7; overflow: hidden; }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 16px 18px 18px; flex: 1; display: flex; flex-direction: column; }
.card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 700; line-height: 1.4; }
.card .meta { margin-top: auto; font-size: 12px; color: var(--muted); }

/* ───── List rows (sidebar) ───── */
.sidebar { display: grid; gap: 24px; align-content: start; }
.widget {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px;
}
.widget h4 {
  margin: 0 0 12px; font-size: 13px; font-weight: 800;
  color: var(--nav); text-transform: uppercase; letter-spacing: .06em;
}
.row-list { display: grid; gap: 12px; }
.row-list .row {
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.row-list .row:last-child { padding-bottom: 0; border-bottom: none; }
.row .img { aspect-ratio: 1/1; background: #eef2f7; border-radius: 8px; overflow: hidden; }
.row .img img { width: 100%; height: 100%; object-fit: cover; }
.row h5 { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.4; }
.row .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ───── Movers widget ───── */
.movers { display: grid; gap: 8px; }
.mover {
  display: grid; grid-template-columns: 1fr auto auto; gap: 12px;
  font-size: 13px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.mover:last-child { border-bottom: none; }
.mover .sym { font-weight: 700; }
.mover .price { font-variant-numeric: tabular-nums; }
.mover .chg { font-variant-numeric: tabular-nums; font-weight: 600; }
.up { color: #0a8c5a; } .down { color: #c5343d; }

/* ───── Article detail ───── */
.article-hero { margin-bottom: 24px; }
.article-hero .img {
  aspect-ratio: 16/8; border-radius: 12px; overflow: hidden;
  background: #eef2f7; margin-bottom: 20px;
}
.article-hero .img img { width: 100%; height: 100%; object-fit: cover; }
.article-hero h1 {
  margin: 0 0 12px; font-size: 36px; font-weight: 800;
  line-height: 1.2; letter-spacing: -0.015em; color: var(--ink);
}
.article-hero .lede { font-size: 18px; color: var(--muted); margin: 0; }
.article-meta {
  display: flex; gap: 16px; align-items: center;
  margin: 16px 0 24px; padding: 14px 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.article-meta .by { color: var(--ink); font-weight: 600; }
.share { margin-left: auto; display: flex; gap: 8px; }
.share a {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg); display: inline-flex; align-items: center; justify-content: center;
  color: var(--nav); font-size: 13px; font-weight: 700;
}
.share a:hover { background: var(--nav); color: #fff; }
.article-body { font-size: 17px; line-height: 1.75; color: #2a3340; }
.article-body p { margin: 0 0 18px; }
.article-body h2 { margin: 32px 0 14px; font-size: 24px; color: var(--nav); }
.article-body blockquote {
  margin: 24px 0; padding: 12px 20px;
  border-left: 4px solid var(--accent);
  background: #fff7ee; border-radius: 0 8px 8px 0;
  font-style: italic; color: var(--ink);
}

/* ───── Quote page ───── */
.quote-head {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 24px 28px; margin-bottom: 24px;
}
.quote-head .top { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.quote-head .ticker { font-size: 32px; font-weight: 800; letter-spacing: -0.01em; color: var(--nav); }
.quote-head .name { font-size: 16px; color: var(--muted); }
.quote-head .exch {
  font-size: 11px; font-weight: 700; padding: 3px 8px;
  background: var(--bg); color: var(--muted); border-radius: 4px;
  text-transform: uppercase; letter-spacing: .05em;
}
.price-row { display: flex; align-items: baseline; gap: 16px; margin-top: 16px; }
.price-row .price { font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; }
.price-row .chg {
  font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 6px 12px; border-radius: 6px;
}
.chg.up   { background: #e6f7ee; color: #0a8c5a; }
.chg.down { background: #fde8ea; color: #c5343d; }

.quote-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--line);
  margin: 8px -8px 0;
}
.quote-tabs a {
  padding: 12px 14px; font-size: 14px; font-weight: 600; color: var(--ink);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.quote-tabs a.active { color: var(--nav); border-bottom-color: var(--accent); }
.quote-tabs a:hover { color: var(--blue); }

.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; margin-bottom: 24px;
}
@media (max-width: 700px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  padding: 18px 20px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.kpi .label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.kpi .val { font-size: 18px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.chart-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 20px; margin-bottom: 24px;
}
.chart-placeholder {
  aspect-ratio: 16/6; background: linear-gradient(180deg, #eef5fb 0%, #fff 100%);
  border-radius: 8px; position: relative; overflow: hidden;
}
.chart-placeholder svg { width: 100%; height: 100%; }

/* ───── Footer ───── */
.footer {
  background: var(--nav); color: rgba(255,255,255,.85);
  margin-top: 64px; padding: 48px 0 24px;
}
.footer .grid-cols {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
@media (max-width: 800px) { .footer .grid-cols { grid-template-columns: 1fr 1fr; } }
.footer h5 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin: 0 0 16px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { color: rgba(255,255,255,.75); font-size: 14px; }
.footer a:hover { color: #fff; }
.footer .small { padding-top: 24px; font-size: 12px; color: rgba(255,255,255,.55); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }

/* Preview chrome (omit from markup for production-like demo) */
.preview-banner { display: none !important; }
