/* magcollect.com/blog — shared styles for the blog index and posts.
   Colors mirror landing/index.html, which mirrors lib/theme/app_theme.dart. */
:root {
  --bg: #0A0D14;
  --surface: #131826;
  --surface-high: #1F2937;
  --text: #F9FAFB;
  --muted: #9CA3AF;
  --outline: #1F2937;
  --brand: #6B9FFF;
  --brand-tint: #1A2A4D;
  --on-brand: #0A0D14;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #FFFFFF;
    --surface: #F3F4F6;
    --surface-high: #E5E7EB;
    --text: #0A0D14;
    --muted: #4B5563;
    --outline: #E5E7EB;
    --brand: #0040A8;
    --brand-tint: #DBE6FF;
    --on-brand: #FFFFFF;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
a:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
img { display: block; max-width: 100%; height: auto; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 32px; } }

/* Header (same shape as the landing page) */
header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; font-size: 18px; letter-spacing: -0.01em; }
.logo img { width: 32px; height: 32px; border-radius: 8px; }
.nav-link { color: var(--brand); text-decoration: none; font-weight: 600; font-size: 16px; padding: 10px 4px; }
.nav-link:hover { text-decoration: underline; }

/* Article */
main { padding: 16px 0 24px; }
.crumb { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.crumb a { color: var(--muted); }
h1 { font-size: clamp(30px, 7.5vw, 44px); line-height: 1.1; letter-spacing: -0.025em; margin: 0 0 12px; font-weight: 800; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 28px; }
.lede { font-size: 19px; margin: 0 0 24px; }
h2 { font-size: clamp(22px, 5vw, 28px); line-height: 1.2; letter-spacing: -0.015em; margin: 40px 0 12px; }
h3 { font-size: 18px; line-height: 1.3; margin: 0 0 4px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* Ranked list (one row per issue: cover + text) */
.ranked { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; }
.ranked li { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: start; background: var(--surface); border-radius: 16px; padding: 14px; }
.ranked .cover { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: var(--surface-high); }
.ranked .rank { color: var(--brand); font-weight: 800; font-size: 14px; letter-spacing: 0.04em; margin: 0 0 2px; }
.ranked .price { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 2px; }
.ranked p { margin: 0; font-size: 15px; }
.ranked a { text-decoration: none; }
.ranked a:hover h3 { text-decoration: underline; }
.ranked h3 { color: var(--text); }

/* Cover grid (every-cover posts) */
.covers { list-style: none; padding: 0; margin: 16px 0 8px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
@media (min-width: 560px) { .covers { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .covers { grid-template-columns: repeat(4, 1fr); } }
.covers a { text-decoration: none; color: var(--text); display: block; }
.covers img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: var(--surface-high); }
.covers .t { font-size: 14px; font-weight: 600; line-height: 1.3; margin: 8px 0 2px; }
.covers .d { font-size: 13px; color: var(--muted); margin: 0; }
.covers a:hover .t { text-decoration: underline; }

/* Feature image (single-cover posts) */
.feature { display: grid; gap: 20px; margin: 8px 0 24px; }
.feature img { width: 100%; max-width: 320px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; background: var(--surface-high); margin: 0 auto; box-shadow: 0 20px 40px -20px rgba(0,0,0,0.5); }

/* Simple data table */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--outline); }
td .sub { display: block; color: var(--muted); font-size: 13px; }
td.num { white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }
td.num, th.num { text-align: right; }

/* Post cards on the index */
.posts { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 12px; }
.posts a { display: grid; grid-template-columns: 80px 1fr; gap: 16px; align-items: center; background: var(--surface); border-radius: 16px; padding: 14px; text-decoration: none; color: var(--text); }
.posts img { width: 80px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: var(--surface-high); }
.posts h2 { font-size: 19px; margin: 0 0 4px; }
.posts p { margin: 0; color: var(--muted); font-size: 15px; }
.posts a:hover h2 { text-decoration: underline; }

/* Call to action */
.cta { background: var(--surface); border-radius: 20px; padding: 28px 20px; margin: 40px 0 0; text-align: center; }
.cta h2 { margin: 0 0 8px; }
.cta p { color: var(--muted); margin: 0 0 20px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center; }
.badge { display: inline-block; line-height: 0; border-radius: 10px; }
.badge img { height: 52px; width: auto; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 10px; background: var(--brand); color: var(--on-brand); font-weight: 600; font-size: 16px; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }

footer { border-top: 1px solid var(--outline); padding: 28px 0 40px; margin-top: 56px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; color: var(--muted); font-size: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 4px 20px; }
footer a { color: var(--muted); text-decoration: none; padding: 8px 0; }
footer a:hover { color: var(--text); }
