/* Shared styles for DummyTrader content / education pages.
   These are static, crawlable pages (served directly by Cloudflare Pages) —
   separate from the React app at "/". Ads load only here, next to real content. */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f9fc;
  --ink: #1d2733;
  --muted: #5b6675;
  --line: #e3e8ef;
  --brand: #131722;
  --accent: #2962ff;
  --accent-soft: #eaf0ff;
  --radius: 12px;
  --maxw: 760px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  font-size: 17px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Header / nav ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.site-header .wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.2px;
  border-radius: 8px;
  transition: opacity .15s;
}
.brand:hover { text-decoration: none; opacity: .85; }
.brand img { width: 26px; height: 26px; }
.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;   /* keep text links vertically centred with the CTA button */
  gap: 6px;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  color: #c7ccd6;
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1;
  transition: color .15s, background .15s;
}
.site-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .08);
  text-decoration: none;
}
.site-nav a.cta {
  margin-left: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 0 16px;
}
.site-nav a.cta:hover {
  background: #1f54e6;
  color: #fff;
}

/* ---- Layout ---- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 60px;
}
main.wide { max-width: 1040px; }

h1 { font-size: 32px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -0.4px; }
h2 { font-size: 23px; margin: 38px 0 12px; letter-spacing: -0.2px; }
h3 { font-size: 19px; margin: 26px 0 8px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin: 6px 0; }

.lead { font-size: 19px; color: var(--muted); margin-bottom: 26px; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 28px; }

.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.breadcrumb a { color: var(--muted); }

blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  color: #25324a;
}

table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 15.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-alt); font-weight: 600; }

code {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 14.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---- Hero (learn home) ---- */
.hero {
  background: linear-gradient(160deg, #131722 0%, #1f2a44 100%);
  color: #fff;
  text-align: center;
  padding: 64px 20px 56px;
}
.hero h1 { font-size: 40px; color: #fff; }
.hero p { max-width: 620px; margin: 0 auto 22px; color: #c7ccd6; font-size: 19px; }
.hero .btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 12px 26px;
  border-radius: 10px;
  font-weight: 600;
}
.hero .btn:hover { text-decoration: none; opacity: .92; }
.hero .btn.ghost { background: transparent; border: 1px solid #3a455f; margin-left: 8px; }

/* ---- Card grid ---- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin: 26px 0;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--bg);
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: 0 6px 22px rgba(20,30,60,.08); transform: translateY(-2px); }
.card h3 { margin: 0 0 6px; font-size: 18px; }
.card h3 a { color: var(--ink); }
.card p { color: var(--muted); font-size: 15px; margin: 0; }
.card .tag { font-size: 12px; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; font-weight: 600; }

/* ---- Article extras ---- */
.note {
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 24px 0;
  font-size: 15.5px;
}
.note strong { color: var(--ink); }

.next-read {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.next-read h3 { margin-top: 0; }

/* ---- Ad slot styling (labelled, non-intrusive) ---- */
.ad-slot {
  margin: 34px auto;
  text-align: center;
  min-height: 100px;
}
.ad-slot small {
  display: block;
  color: #9aa3b2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 4px;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14.5px;
}
.site-footer .wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
}
.site-footer a { color: var(--muted); }
.site-footer .col h4 { color: var(--ink); font-size: 14px; margin: 0 0 10px; text-transform: uppercase; letter-spacing: .5px; }
.site-footer .col a { display: block; margin: 5px 0; }
.disclaimer {
  border-top: 1px solid var(--line);
  padding: 16px 20px;
  text-align: center;
  font-size: 13px;
  color: #9aa3b2;
  max-width: 1040px;
  margin: 0 auto;
}

/* ---- Mobile navigation (hamburger) ---- */
.nav-toggle { display: none; }   /* desktop: hidden, enhanced only on mobile */

@media (max-width: 720px) {
  .site-header.nav-enhanced .wrap {
    flex-wrap: wrap;
    row-gap: 0;
  }
  .site-header.nav-enhanced .nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin-left: auto;
    width: 44px;
    height: 40px;
    padding: 10px 9px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 9px;
    cursor: pointer;
  }
  .site-header.nav-enhanced .nav-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: #fff;
    border-radius: 2px;
    transition: transform .22s ease, opacity .18s ease;
  }
  /* hamburger morphs into an X when open */
  .site-header.nav-enhanced.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.nav-enhanced.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.nav-enhanced.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .site-header.nav-enhanced .site-nav {
    flex-basis: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    max-height: 0;
    overflow: hidden;
    transition: max-height .28s ease;
  }
  .site-header.nav-enhanced.nav-open .site-nav {
    max-height: 380px;
    padding: 8px 0 6px;
  }
  .site-header.nav-enhanced .site-nav a {
    height: 46px;
    padding: 0 14px;
    font-size: 16px;
    border-radius: 10px;
  }
  .site-header.nav-enhanced .site-nav a.cta {
    margin: 8px 0 0;
    justify-content: center;
  }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  h1 { font-size: 27px; }
  .hero h1 { font-size: 31px; }
}
