/* ============================================
   Canadian Covered Call ETF Tracker
   Global Stylesheet — style.css
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Fraunces:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface2: #f0f4ff;
  --ink: #0d1117;
  --ink2: #3d4554;
  --muted: #6b7280;
  --line: #e4e8f0;
  --brand: #1a56db;
  --brand-dark: #1240a8;
  --brand-light: #e8effe;
  --green: #0e7c50;
  --green-light: #d1fae5;
  --amber: #b45309;
  --amber-light: #fef3c7;
  --red: #be123c;
  --red-light: #ffe4e6;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.10);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
}

/* ---- TOPBAR ---- */
.topbar {
  background: var(--ink);
  color: #fff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
}
.topbar-brand {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}
.topbar-brand span { color: #60a5fa; }
.topbar-cta {
  background: var(--brand);
  color: #fff;
  padding: 7px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.82rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s;
}
.topbar-cta:hover { background: var(--brand-dark); }

/* ---- NAV ---- */
.site-nav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-inner::-webkit-scrollbar { display: none; }
.nav-logo {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  padding: 14px 20px 14px 0;
  margin-right: 8px;
  border-right: 1px solid var(--line);
}
.nav-logo span { color: var(--brand); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 0;
  list-style: none;
  padding: 0 8px;
}
.nav-links a {
  display: block;
  padding: 14px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink2);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav-links a:hover, .nav-links a.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ---- PAGE HEADER ---- */
.page-header {
  background: linear-gradient(135deg, #0d1117 0%, #1a2744 100%);
  color: #fff;
  padding: 48px 24px 40px;
}
.page-header-inner { max-width: 1100px; margin: 0 auto; }
.page-header .breadcrumbs {
  font-size: 0.82rem;
  color: #94a3b8;
  margin-bottom: 16px;
}
.page-header .breadcrumbs a { color: #60a5fa; text-decoration: none; }
.page-header h1 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 12px;
}
.page-header .lead {
  font-size: 1.05rem;
  color: #cbd5e1;
  max-width: 65ch;
  margin-bottom: 8px;
}
.page-header .disclaimer {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 10px;
}

/* ---- MAIN LAYOUT ---- */
.page-body {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* ---- CARDS ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}
.card-title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink);
}

/* ---- NOTICES ---- */
.notice {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 16px 0;
  font-size: 0.92rem;
  line-height: 1.55;
}
.notice-green { background: var(--green-light); border-left: 4px solid var(--green); color: #065f46; }
.notice-amber { background: var(--amber-light); border-left: 4px solid #d97706; color: var(--amber); }
.notice-red { background: var(--red-light); border-left: 4px solid #e11d48; color: var(--red); }
.notice-blue { background: var(--brand-light); border-left: 4px solid var(--brand); color: var(--brand-dark); }

/* ---- HEADINGS ---- */
h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(20px, 2.5vw, 26px);
  font-weight: 600;
  margin: 36px 0 12px;
  color: var(--ink);
}
h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--ink);
}
p { margin-bottom: 12px; color: var(--ink2); }
p:last-child { margin-bottom: 0; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 20px; color: var(--ink2); }
li { margin-bottom: 6px; }

/* ---- TABLES ---- */
.table-wrap { overflow-x: auto; margin: 16px 0; border-radius: var(--radius-sm); border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.92rem; }
thead tr { background: var(--ink); color: #fff; }
thead th { padding: 12px 14px; text-align: left; font-weight: 600; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
tbody td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--ink2); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface2); }
tbody tr.current-month { background: #eff6ff; font-weight: 600; }
tbody tr.current-month td { color: var(--brand-dark); }

/* ---- STAT PILLS ---- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
.stat-value { font-family: 'Fraunces', Georgia, serif; font-size: 1.8rem; font-weight: 600; color: var(--ink); line-height: 1; }
.stat-sub { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* ---- CTA BUTTONS ---- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); text-decoration: none; }
.btn-outline { background: transparent; color: var(--brand); border: 2px solid var(--brand); }
.btn-outline:hover { background: var(--brand-light); text-decoration: none; }

/* ---- CALCULATOR ---- */
.calc-grid { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin: 16px 0; }
.calc-field { display: flex; flex-direction: column; gap: 6px; }
.calc-field label { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.calc-field input {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  font-size: 0.95rem;
  width: 160px;
  background: var(--surface);
  color: var(--ink);
  transition: border-color 0.15s;
}
.calc-field input:focus { outline: none; border-color: var(--brand); }
.calc-results { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; }
.calc-result-item { background: var(--surface2); border-radius: var(--radius-sm); padding: 14px 20px; }
.calc-result-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 4px; }
.calc-result-value { font-family: 'Fraunces', Georgia, serif; font-size: 1.6rem; font-weight: 600; color: var(--brand); }

/* ---- TOC ---- */
.toc {
  background: var(--surface2);
  border: 1px solid #d0dcff;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 24px 0;
}
.toc-title { font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; }
.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 4px; font-size: 0.92rem; }

/* ---- ETF GRID ---- */
.etf-grid { display: grid; gap: 16px; margin: 20px 0; }
@media(min-width: 640px) { .etf-grid { grid-template-columns: 1fr 1fr; } }
@media(min-width: 900px) { .etf-grid { grid-template-columns: 1fr 1fr 1fr; } }
.etf-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.2s;
}
.etf-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.etf-card-ticker { font-family: 'Fraunces', Georgia, serif; font-size: 1.4rem; font-weight: 600; color: var(--brand); margin-bottom: 4px; }
.etf-card-name { font-size: 0.8rem; color: var(--muted); margin-bottom: 12px; }
.etf-card-yield { font-size: 1.1rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.etf-card-link { font-size: 0.85rem; font-weight: 600; color: var(--brand); }

/* ---- RELATED LINKS ---- */
.related-grid { display: grid; gap: 12px; margin: 20px 0; }
@media(min-width: 640px) { .related-grid { grid-template-columns: 1fr 1fr; } }
.related-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s;
}
.related-link:hover { border-color: var(--brand); background: var(--brand-light); text-decoration: none; }
.related-link-arrow { color: var(--brand); font-size: 1.1rem; margin-left: auto; }

/* ---- BROKER CARDS ---- */
.broker-grid { display: grid; gap: 20px; margin: 20px 0; }
@media(min-width: 700px) { .broker-grid { grid-template-columns: 1fr 1fr; } }
.broker-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.broker-name { font-family: 'Fraunces', Georgia, serif; font-size: 1.3rem; font-weight: 600; margin-bottom: 4px; }
.broker-tag { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--green-light); color: var(--green); margin-bottom: 12px; }
.broker-tag.featured { background: var(--brand-light); color: var(--brand-dark); }

/* ---- FOOTER ---- */
.site-footer {
  background: var(--ink);
  color: #94a3b8;
  padding: 40px 24px;
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 32px;
}
@media(min-width: 640px) { .footer-inner { grid-template-columns: 1fr 1fr 1fr; } }
.footer-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 8px;
}
.footer-brand span { color: #60a5fa; }
.footer-desc { font-size: 0.82rem; line-height: 1.6; }
.footer-col-title { font-weight: 700; color: #e2e8f0; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #94a3b8; text-decoration: none; font-size: 0.85rem; transition: color 0.15s; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  max-width: 1100px;
  margin: 24px auto 0;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #475569;
}
.footer-bottom a { color: #64748b; }

/* ---- MISC ---- */
.small { font-size: 0.85rem; }
.muted { color: var(--muted); }
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

/* ---- RESPONSIVE ---- */
@media(max-width: 600px) {
  .page-header { padding: 32px 16px 28px; }
  .page-body { padding: 20px 16px 60px; }
  .card { padding: 16px; }
  .topbar { padding: 8px 16px; }
}
