/* ETFWinner — hand-authored stylesheet (no build step, no Node on the server) */

:root {
  --navy-900: #0a1730;
  --navy-800: #0f2043;
  --navy-700: #152c58;
  --navy-600: #1e3a6d;
  --gold-500: #e8a33d;
  --gold-400: #f0b862;
  --gold-100: #fdf3e0;
  --cream: #fdf6e3;
  --ink: #16233c;
  --muted: #64748b;
  --line: #e6eaf1;
  --bg: #ffffff;
  --bg-soft: #f6f8fc;
  --green-600: #15803d;
  --green-50: #e9f7ef;
  --red-600: #b91c1c;
  --red-50: #fdeeee;
  --radius: 14px;
  --shadow-sm: 0 1px 2px rgba(16, 34, 64, .06);
  --shadow: 0 6px 20px rgba(16, 34, 64, .08);
  --wrap: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
img { max-width: 100%; height: auto; }
a { color: var(--navy-600); text-decoration: none; }
a:hover { color: var(--gold-500); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.stack > * + * { margin-top: 1.25rem; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- ticker tape ---------- */
.tape { background: var(--navy-900); color: #fff; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.08); }
.tape-track { display: flex; gap: 2rem; padding: .55rem 0; white-space: nowrap; animation: tape 60s linear infinite; width: max-content; }
.tape:hover .tape-track { animation-play-state: paused; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tape-item { font-size: .82rem; font-weight: 600; letter-spacing: .02em; }
.tape-item .t { color: var(--gold-400); margin-right: .4rem; }
.tape-item .up { color: #4ade80; }
.tape-item .down { color: #f87171; }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } }

/* ---------- header ---------- */
.masthead { background: #fff; border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; gap: 1.5rem; height: 68px; }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 800; color: var(--navy-800); }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--navy-800); color: var(--gold-500);
  display: grid; place-items: center; font-size: 1.1rem; box-shadow: var(--shadow-sm); }
.brand-name { font-size: 1.05rem; line-height: 1.1; }
.brand-name small { display: block; font-size: .6rem; letter-spacing: .18em; color: var(--muted); font-weight: 700; }
.masthead nav { margin-left: auto; display: flex; gap: 1.4rem; }
.masthead nav a { color: var(--ink); font-weight: 600; font-size: .95rem; }

/* ---------- section nav ---------- */
.subnav { background: var(--navy-800); color: #fff; }
.subnav-inner { display: flex; align-items: center; gap: .4rem; height: 54px; overflow-x: auto; scrollbar-width: none; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a { color: #c9d6ea; font-weight: 600; font-size: .92rem; padding: .45rem .85rem; border-radius: 9px; white-space: nowrap; }
.subnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.subnav a.on { background: rgba(232,163,61,.16); color: var(--gold-400); box-shadow: inset 0 0 0 1px rgba(232,163,61,.45); }

/* ---------- breadcrumbs ---------- */
.crumbs { background: var(--bg-soft); border-bottom: 1px solid var(--line); font-size: .85rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: .7rem 0; }
.crumbs li::after { content: "›"; margin-left: .5rem; color: var(--muted); }
.crumbs li:last-child::after { content: ""; }
.crumbs a { color: var(--muted); }

/* ---------- hero ---------- */
.hero { background: linear-gradient(160deg, var(--navy-800), var(--navy-900) 65%); color: #fff; padding: 4rem 0 4.5rem; text-align: center; }
.hero h1 { color: var(--cream); }
.hero p { color: #b6c4da; max-width: 46rem; margin: 0 auto; font-size: 1.08rem; }
.pill { display: inline-flex; align-items: center; gap: .5rem; background: rgba(255,255,255,.07); color: var(--gold-400);
  border: 1px solid rgba(232,163,61,.3); padding: .4rem 1rem; border-radius: 999px; font-size: .82rem; font-weight: 700; margin-bottom: 1.2rem; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold-500); }

/* ---------- cards + grid ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.card-top { height: 4px; background: linear-gradient(90deg, var(--gold-500), var(--gold-400)); }
.card-body { padding: 1.15rem; }

.etf-head { display: flex; align-items: center; gap: .8rem; }
.ticker-tile { width: 52px; height: 52px; border-radius: 12px; background: var(--navy-800); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .82rem; letter-spacing: .02em; flex: none; }
.etf-ticker { font-size: 1.25rem; font-weight: 800; color: var(--navy-800); }
.etf-exchange { font-size: .78rem; color: var(--muted); font-weight: 600; }
.etf-name { color: var(--muted); font-size: .95rem; margin: .7rem 0 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin-top: .9rem; }
.stat { background: var(--bg-soft); border-radius: 10px; padding: .6rem .7rem; }
.stat .k { font-size: .64rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.stat .v { font-weight: 800; font-size: 1.02rem; color: var(--navy-800); }
.stat.win { background: var(--green-50); }
.stat.win .v { color: var(--green-600); }
.stat.gold { background: var(--gold-100); }

.chg { display: inline-flex; align-items: center; gap: .25rem; font-weight: 800; font-size: .85rem;
  padding: .2rem .55rem; border-radius: 999px; }
.chg.up { background: var(--green-50); color: var(--green-600); }
.chg.down { background: var(--red-50); color: var(--red-600); }

.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .9rem; }
.tag { font-size: .72rem; font-weight: 700; padding: .25rem .6rem; border-radius: 999px;
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.tag.gold { background: var(--gold-100); color: #a16207; border-color: #f2dcb4; }

.rank-badge { width: 44px; height: 44px; border-radius: 12px; background: var(--gold-500); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex: none; }
.winner { display: inline-flex; align-items: center; gap: .4rem; background: var(--gold-500); color: #fff;
  font-weight: 800; font-size: .75rem; padding: .35rem .8rem; border-radius: 999px; }

.btn { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .9rem;
  padding: .6rem 1.1rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.btn-gold { background: var(--gold-500); color: #fff; }
.btn-gold:hover { background: #d8912b; color: #fff; }
.btn-ghost { border-color: var(--line); color: var(--navy-700); background: #fff; }
.btn-ghost:hover { border-color: var(--gold-500); color: var(--gold-500); }

/* ---------- country cards ---------- */
.country-card { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; background: #fff;
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.country-card:hover { border-color: var(--gold-500); }
.country-flag { font-size: 1.7rem; line-height: 1; }
.country-card .n { font-weight: 700; color: var(--ink); font-size: .95rem; }
.country-card .c { font-size: .78rem; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 3rem 0; }
.section.soft { background: var(--bg-soft); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.section-head p { margin: .25rem 0 0; color: var(--muted); }
.eyebrow { font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--gold-500); }

/* ---------- article ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; align-items: start; }
@media (max-width: 980px) { .layout { grid-template-columns: 1fr; } }
.sidebar { position: sticky; top: 1rem; display: grid; gap: 1.25rem; }
.prose { font-size: 1.03rem; }
.prose h2 { margin-top: 2rem; padding-bottom: .4rem; border-bottom: 2px solid var(--gold-100); }
.prose h3 { margin-top: 1.5rem; }
.prose ul, .prose ol { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .93rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .6rem .7rem; text-align: left; }
.prose th { background: var(--bg-soft); font-weight: 800; }
.prose blockquote { margin: 1.2rem 0; padding: .8rem 1.1rem; border-left: 4px solid var(--gold-500);
  background: var(--gold-100); border-radius: 0 10px 10px 0; }
.table-scroll { overflow-x: auto; }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1.1rem; background: #fff; }
.faq details + details { margin-top: .6rem; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold-500); font-weight: 800; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: .7rem 0 0; color: var(--muted); }

/* ---------- cross-links ---------- */
.crosslinks { border: 1px solid var(--line); border-left: 4px solid var(--gold-500); border-radius: 12px;
  background: var(--bg-soft); padding: 1.1rem 1.2rem; }
.crosslinks h3 { font-size: 1rem; margin-bottom: .7rem; }
.crosslinks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.crosslinks li a { display: flex; gap: .5rem; font-weight: 600; font-size: .93rem; }

/* ---------- ads ---------- */
.ad-slot { margin: 1.6rem 0; text-align: center; min-height: 90px; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: #a8b3c4; margin-bottom: .3rem; }

/* ---------- footer ---------- */
.foot { background: var(--navy-900); color: #b6c4da; padding: 3rem 0 1.5rem; margin-top: 3rem; font-size: .92rem; }
.foot h4 { color: #fff; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: .9rem; }
.foot a { color: #b6c4da; }
.foot a:hover { color: var(--gold-400); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.foot-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1.2rem;
  display: flex; flex-wrap: wrap; gap: .8rem; justify-content: space-between; font-size: .85rem; }
.disclaimer { background: rgba(255,255,255,.04); border-radius: 10px; padding: .9rem 1.1rem; font-size: .8rem; line-height: 1.6; }

/* ---------- pagination + forms ---------- */
.pager { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; margin-top: 2rem; }
.pager a, .pager span { padding: .5rem .85rem; border-radius: 9px; border: 1px solid var(--line); font-weight: 700; font-size: .9rem; }
.pager .on { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.chip { padding: .45rem .95rem; border-radius: 999px; border: 1px solid var(--line); background: #fff;
  font-weight: 600; font-size: .88rem; color: var(--ink); }
.chip.on { background: var(--gold-500); border-color: var(--gold-500); color: #fff; }
.searchbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.searchbar input, .searchbar select { padding: .7rem .9rem; border: 1px solid var(--line); border-radius: 10px;
  font-size: .95rem; font-family: inherit; background: #fff; }
.searchbar input { flex: 1 1 260px; }

/* ---------- discussions ---------- */
.qa-list { display: grid; gap: .8rem; }
.qa-item { border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.15rem; background: #fff; }
.qa-item:hover { border-color: var(--gold-500); }
.qa-item h3 { font-size: 1.02rem; margin: 0 0 .35rem; }
.qa-meta { font-size: .78rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .8rem; }
.qa-topic { font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #a16207; background: var(--gold-100); border: 1px solid #f2dcb4; padding: .18rem .55rem; border-radius: 999px; }
.answer { border: 1px solid var(--line); border-radius: 12px; padding: 1.1rem 1.25rem; background: #fff; }
.answer + .answer { margin-top: .8rem; }
.answer.staff { border-left: 4px solid var(--gold-500); background: #fffdf7; }
.answer-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-800); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.avatar.gold { background: var(--gold-500); }
.author { font-weight: 700; font-size: .93rem; }
.badge-staff { font-size: .65rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: var(--navy-800); color: #fff; padding: .15rem .5rem; border-radius: 999px; }
.badge-best { font-size: .65rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  background: var(--green-50); color: var(--green-600); padding: .15rem .5rem; border-radius: 999px; }
.ask-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; background: var(--bg-soft); }
.ask-box label { display: block; font-size: .8rem; font-weight: 700; margin: .7rem 0 .25rem; }
.ask-box input, .ask-box textarea { width: 100%; padding: .65rem .8rem; border: 1px solid var(--line);
  border-radius: 10px; font-family: inherit; font-size: .95rem; background: #fff; }
.ask-box textarea { min-height: 110px; resize: vertical; }
.hp { position: absolute; left: -9999px; }
.notice { background: var(--green-50); color: var(--green-600); border-radius: 10px; padding: .7rem 1rem;
  font-weight: 600; font-size: .9rem; margin-bottom: 1rem; }
.errors { background: var(--red-50); color: var(--red-600); border-radius: 10px; padding: .7rem 1rem; font-size: .88rem; margin-bottom: 1rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* The country links duplicate the scrolling section nav below, so drop them
     rather than let them wrap and break the masthead. */
  .masthead nav { display: none; }
  .masthead-inner { height: 60px; }
  .brand-name { font-size: .98rem; }
  .hero { padding: 2.5rem 0 3rem; }
  .section { padding: 2.25rem 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .layout { gap: 2rem; }
  .sidebar { position: static; }
}

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .wrap { padding: 0 16px; }
  .hero p { font-size: 1rem; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .ticker-tile { width: 44px; height: 44px; font-size: .72rem; }
  .etf-ticker { font-size: 1.1rem; }
  .prose table { font-size: .86rem; }
  .btn { width: 100%; justify-content: center; }
  .searchbar input, .searchbar select { flex: 1 1 100%; }
  .foot-bottom { flex-direction: column; gap: .5rem; }
}

/* Tables never push the page sideways */
.prose table, .table-scroll table { min-width: 480px; }
.table-scroll { -webkit-overflow-scrolling: touch; }
