/* ForexRate MVP - global styles */
:root {
  --navy: #10243d;
  --navy-2: #1b3a5f;
  --blue: #1f6feb;
  --blue-dark: #1657c4;
  --green: #12805c;
  --red: #c0392b;
  --amber: #b7791f;
  --ink: #16202e;
  --muted: #5b6b7f;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --surface: #ffffff;
  --surface-2: #f5f8fc;
  --surface-3: #eef3fa;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 36, 61, .04), 0 8px 24px rgba(16, 36, 61, .05);
  --maxw: 1140px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); margin: 0 0 .5em; }
h1 { font-size: 2.1rem; letter-spacing: -.02em; }
h2 { font-size: 1.55rem; letter-spacing: -.01em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: .35em; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
tbody tr:hover { background: var(--surface-2); }

/* Layout */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, iframe { max-width: 100%; }
.prose table, .rate-panel table { font-size: .88rem; }
.prose th, .prose td, .rate-panel th, .rate-panel td { overflow-wrap: anywhere; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.main { min-height: 60vh; }
.section { padding: 56px 0; }
.section-alt { background: var(--surface-2); }
.section-head { margin-bottom: 28px; }
.section-head p { color: var(--muted); max-width: 640px; }
.eyebrow { color: var(--blue); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: saturate(180%) blur(8px); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.18rem; color: var(--navy); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; color: var(--navy); }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--blue); color: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 800; flex: none; }
.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--ink); font-size: .92rem; font-weight: 500; }
.nav a:hover { color: var(--blue); text-decoration: none; }
.nav-cta { background: var(--blue); color: #fff !important; padding: 8px 15px; border-radius: 8px; }
.nav-cta:hover { background: var(--blue-dark); }
.nav-toggle { display: none; background: none; border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: 1rem; color: var(--navy); }

/* Hero */
.hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 62px 0 70px; }
.hero h1 { color: #fff; font-size: 2.65rem; max-width: 720px; }
.hero p.lead { color: #c6d5e8; font-size: 1.1rem; max-width: 620px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px; border-radius: 9px; font-weight: 600; font-size: .95rem; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.btn-outline { background: #fff; color: var(--blue); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--blue); text-decoration: none; }
.hero-note { color: #9fb3cc; font-size: .8rem; margin-top: 22px; }
.home-snapshot-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-snapshot-grid > *, .pair-top-grid > *, .article-wide > * { min-width: 0; }
.pair-top-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.article-wide { display: grid; grid-template-columns: minmax(0, 1fr); }
.hero-grid > *, .grid > *, .content-layout > * { min-width: 0; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: 48px; align-items: center; }
.hero-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.28); color: var(--ink); }
.hero-card-media { padding: 16px 16px 0; background: #fff; }
.hero-card-media img { width: 100%; height: 178px; object-fit: contain; border-radius: 10px; background: var(--surface-2); display: block; }
.hero-card-body { padding: 20px 24px 24px; }
.hero-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.hero-card-head h3 { margin: 0; font-size: 1.02rem; }
.hero-card-head .rate-stamp { font-size: .74rem; }
.hero-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.hero-quick button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; padding: 8px 4px; font-size: .82rem; font-weight: 600; color: var(--muted); cursor: pointer; font-family: inherit; }
.hero-quick button.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.hero-quick button:hover { border-color: var(--blue); }
.hero-big-rate { font-size: 2.5rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.1; letter-spacing: -.02em; }
.hero-rate-sub { color: var(--muted); font-size: .85rem; margin: 4px 0 16px; }
.hero-card-cta { display: flex; gap: 10px; }
.hero-card-cta .btn { flex: 1; font-size: .86rem; padding: 9px 12px; }
.hero-card-foot { font-size: .72rem; color: var(--muted); margin-top: 12px; }

/* Cards & grids */
.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card-hover:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.card h3 { margin-bottom: .4em; }
.card p { color: var(--muted); font-size: .93rem; }
.card-link { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; font-size: .9rem; margin-top: 6px; }
.icon-box { width: 42px; height: 42px; border-radius: 10px; background: var(--surface-3); color: var(--blue); display: grid; place-items: center; font-size: 20px; margin-bottom: 14px; }

/* Rate table */
.rate-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.rate-panel-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.rate-panel-head h3 { margin: 0; font-size: 1.05rem; }
.rate-stamp { color: var(--muted); font-size: .8rem; }
.rate-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.rate-row:last-child { border-bottom: none; }
.rate-row:hover { background: var(--surface-2); }
.pair-name { font-weight: 700; color: var(--navy); }
.pair-name small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.rate-value { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 1.02rem; }
.rate-change { font-variant-numeric: tabular-nums; font-size: .85rem; font-weight: 600; min-width: 74px; text-align: right; }
.up { color: var(--green); }
.down { color: var(--red); }
.flat { color: var(--muted); }
.rate-status { padding: 10px 20px; font-size: .82rem; color: var(--muted); background: var(--surface-2); }

/* Tool / calculator */
.calc-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 6px; color: var(--navy); }
.field select, .field input { width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; font-size: .95rem; font-family: inherit; background: #fff; color: var(--ink); }
.field select:focus, .field input:focus { outline: 2px solid rgba(31,111,235,.25); border-color: var(--blue); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field-hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.result-box { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-top: 6px; }
.result-label { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.result-value { font-size: 1.9rem; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; line-height: 1.2; }
.result-sub { font-size: .85rem; color: var(--muted); }

/* Articles */
.article-list { display: grid; gap: 18px; }
.article-item { display: grid; grid-template-columns: 1fr; gap: 6px; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.article-item:last-child { border-bottom: none; }
.article-item h3 { margin: 0; font-size: 1.2rem; }
.article-item h3 a { color: var(--navy); }
.article-item h3 a:hover { color: var(--blue); text-decoration: none; }
.article-meta { color: var(--muted); font-size: .8rem; }
.article-item p { color: var(--muted); font-size: .93rem; margin: 0; }
.article-item-img { display: grid; grid-template-columns: 200px 1fr; gap: 18px; align-items: start; }
.article-thumb { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.article-thumb img { width: 100%; height: 100px; object-fit: cover; display: block; }
.article-thumb:hover { opacity: .88; }
.tag { display: inline-block; background: var(--surface-3); color: var(--blue-dark); font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; }

/* Prose */
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { color: #2b3949; }
.prose .callout { background: var(--surface-2); border-left: 3px solid var(--blue); padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 20px 0; font-size: .93rem; }
.prose .callout.warn { border-left-color: var(--amber); background: #fdf8ee; }
.article-figure { margin: 24px 0 28px; }
.article-figure img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--line); display: block; }
.page-figure { margin: 0 0 4px; }
.page-figure img { width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); display: block; }
.byline { display: flex; align-items: center; gap: 12px; padding: 16px 0 22px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.byline-text strong { display: block; color: var(--navy); font-size: .92rem; }
.byline-text span { color: var(--muted); font-size: .8rem; }

/* Layout with sidebar */
.content-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.sidebar .card { margin-bottom: 18px; }
.sidebar h4 { font-size: .95rem; margin-bottom: 12px; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.sidebar li:last-child { border-bottom: none; }

/* Ad placeholder */
.ad-slot { border: 1px dashed var(--line-2); background: var(--surface-2); border-radius: 8px; padding: 18px; text-align: center; color: var(--muted); font-size: .78rem; margin: 26px 0; }
.ad-slot strong { display: block; color: var(--muted); font-size: .82rem; }

/* Footer */
.site-footer { background: var(--navy); color: #b9c9dd; padding: 48px 0 30px; font-size: .88rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; }
.site-footer h4 { color: #fff; font-size: .9rem; margin-bottom: 14px; }
.site-footer a { color: #b9c9dd; display: block; padding: 3px 0; }
.site-footer a:hover { color: #fff; }
.site-footer .brand { color: #fff; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 34px; padding-top: 20px; font-size: .78rem; color: #8fa6c2; }
.footer-legal a { display: inline; }

/* Misc */
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.page-head { padding: 40px 0 30px; border-bottom: 1px solid var(--line); margin-bottom: 34px; }
.page-head p { color: var(--muted); max-width: 680px; margin: 0; }
.pill { display: inline-block; background: var(--surface-3); border-radius: 20px; padding: 5px 12px; font-size: .78rem; color: var(--muted); }
.disclaimer-box { background: #fdf8ee; border: 1px solid #f0dfb8; border-radius: 10px; padding: 18px 20px; font-size: .87rem; color: #6b5417; }
.notice-ok { display: none; color: var(--green); font-size: .85rem; font-weight: 600; }
.notice-err { display: none; color: var(--red); font-size: .85rem; }

@media (max-width: 900px) {
  .nav { display: none; position: absolute; top: 65px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 14px 20px; gap: 4px; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
  .nav a { padding: 8px 0; }
  .nav-toggle { display: block; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-card-media img { height: 140px; }
  .home-snapshot-grid, .pair-top-grid { grid-template-columns: minmax(0, 1fr); }
  .content-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  h1 { font-size: 1.7rem; }
  .hero { padding: 44px 0 50px; }
  .hero h1 { font-size: 2rem; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .article-item-img { grid-template-columns: 1fr; }
  .article-thumb img { height: 150px; }
  .footer-grid { grid-template-columns: 1fr; }
  .rate-row { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; padding: 12px 16px; }
  .rate-row .rate-change { display: none; }
  .pair-name { font-size: .94rem; }
  .hero-card-body { padding: 16px 18px 20px; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-big-rate { font-size: 2.05rem; }
  .hero-quick button { font-size: .74rem; padding: 8px 2px; }
  .hero-card-cta { flex-direction: column; }
  .hero-card-foot { line-height: 1.5; }
  .section { padding: 40px 0; }
  .sidebar { grid-template-columns: 1fr; }
}
