/* Top5Solutions — Furo/Pradyun-inspired. System fonts, single accent, no framework. */

:root {
  --bg-primary:    #ffffff;
  --bg-secondary:  #f8f9fb;
  --bg-hover:      #efeff4;
  --border:        #eeebee;
  --text-primary:  #0d0e10;
  --text-secondary:#5a5c63;
  --text-muted:    #6b6f76;
  --accent:        #2757dd;
  --accent-visited:#872ee0;
  --code-bg:       #f2f2f2;
  --code-fg:       #1e1e1e;
  --content-max:   46em;
  --radius:        0.2rem;
  --shadow-sm:     0 .2rem .5rem rgba(0,0,0,.05);
}

[data-theme="dark"] {
  --bg-primary:    #131416;
  --bg-secondary:  #1a1c1e;
  --bg-hover:      #22262a;
  --border:        #303335;
  --text-primary:  #cfd0d0;
  --text-secondary:#9ca0a5;
  --text-muted:    #6b6f76;
  --accent:        #5ca5ff;
  --accent-visited:#b27aeb;
  --code-bg:       #202020;
  --code-fg:       #d0d0d0;
  --shadow-sm:     0 .2rem .5rem rgba(0,0,0,.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
}

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

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; margin: 1.5em 0 .5em; color: var(--text-primary); }
h1 { font-size: 2.25em; margin-top: 0; }
h2 { font-size: 1.5em; border-bottom: 1px solid var(--border); padding-bottom: .3em; }
h3 { font-size: 1.15em; }
h4 { font-size: 1em; }

p { margin: .75em 0; }
ul, ol { margin: .75em 0 .75em 1.5em; }
li { margin: .25em 0; }
hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

code {
  font-family: "SFMono-Regular", Menlo, Consolas, Monaco, "Liberation Mono", monospace;
  font-size: 87.5%;
  background: var(--code-bg);
  color: var(--code-fg);
  padding: .1em .3em;
  border-radius: var(--radius);
}
pre {
  background: var(--code-bg);
  color: var(--code-fg);
  border-radius: var(--radius);
  padding: .625rem .875rem;
  overflow-x: auto;
  margin: 1em 0;
  font-size: 87.5%;
  box-shadow: var(--shadow-sm);
}
pre code { background: none; padding: 0; font-size: inherit; }

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: .95em;
}
th, td {
  text-align: left;
  padding: .5em .75em;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { background: var(--bg-secondary); font-weight: 600; }

blockquote {
  border-left: 3.2px solid var(--accent);
  padding: .25em 1em;
  margin: 1em 0;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Layout */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: .8rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-brand {
  font-weight: 700;
  color: var(--text-primary);
  margin-right: auto;
}
.site-brand:hover { text-decoration: none; }
.site-nav a { margin-left: 1rem; color: var(--text-secondary); font-size: .95em; }
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  padding: .25em .55em;
  font-size: .85em;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--bg-hover); }

main.content {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .85em;
}

/* Article hero / breadcrumbs */
.breadcrumbs {
  font-size: .85em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.breadcrumbs a { color: var(--text-muted); }
.article-meta {
  color: var(--text-muted);
  font-size: .9em;
  margin: .25rem 0 1.5rem;
}

/* TL;DR / answer box — first-paint citation target for AI */
.tldr {
  border-left: 3.2px solid var(--accent);
  background: var(--bg-secondary);
  padding: .9rem 1.1rem;
  margin: 1rem 0 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
}
.tldr p:first-child { margin-top: 0; }
.tldr p:last-child { margin-bottom: 0; }

/* Item rank chip on H3 in The Top 5 */
.rank-chip {
  display: inline-block;
  font-size: .7em;
  background: var(--accent);
  color: #fff;
  padding: .15em .5em;
  border-radius: 0.4rem;
  margin-right: .5em;
  vertical-align: middle;
  letter-spacing: .03em;
}

/* Home + category index */
.card-list { display: grid; grid-template-columns: 1fr; gap: .5rem; padding: 0; list-style: none; margin: 1rem 0; }
.card-list li { margin: 0; }
.card-list a {
  display: block;
  padding: .65rem .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  background: var(--bg-primary);
  transition: background .12s;
}
.card-list a:hover { background: var(--bg-hover); text-decoration: none; }
.card-list .meta { display: block; color: var(--text-muted); font-size: .8em; margin-top: .15rem; }

/* Category section */
.category-section h2 { margin-top: 2em; }

@media (max-width: 540px) {
  h1 { font-size: 1.75em; }
  h2 { font-size: 1.3em; }
  main.content { padding: 1.25rem 1rem 3rem; }
}
