/* ===== Theme ===== */
:root {
  --brand: #0b3b91;
  /* WinPred blue */
  --brand-200: #e0e7ff;
  --text: #0f172a;
  --muted: #475569;
  --bg: #f4f6fa;
  --white: #fff;
  --shadow: 0 6px 18px rgba(2, 6, 23, .08);
}

/* ===== Reset / base ===== */
* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  min-height: 100%
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Inter, Arial, sans-serif;
}

main {
  min-height: 85vh;
}

a {
  text-decoration: none;
  color: inherit
}

/* ===== Header (WinPred blue bar) ===== */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--brand);
  color: var(--white);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .05);
}

.toolbar {
  max-width: 1200px;
  margin: 0 auto;
  height: 64px;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: flex-start;
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: #fff;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
  font-size: .95rem;
  height: 64px;
  display: inline-flex;
  align-items: center;
  position: relative;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: transparent;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .18s ease, background-color .18s ease;
}

.nav a:hover {
  color: var(--brand-200);
}

.nav a:hover::after {
  background: #fff;
  transform: scaleX(1);
}

.nav a.active::after,
.nav a[aria-current="page"]::after {
  background: #fff;
  transform: scaleX(1);
}

/* ===== Mobile burger ===== */
.burger {
  display: none;
  border: 0;
  background: transparent;
  padding: .5rem;
  margin-left: -.25rem;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  margin: 4px 0;
  border-radius: 2px;
}

@media (max-width: 900px) {
  .burger {
    display: inline-block;
  }

  .nav {
    display: none;
  }
}

/* ===== Drawer (mobile menu) ===== */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(2, 6, 23, .55);
  backdrop-filter: blur(1px);
}

.drawer.open {
  display: block;
}

.panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 82%;
  max-width: 340px;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1.25rem;
  border-radius: 12px 12px 12px 0;
}

.panel .nav {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.panel .nav a {
  color: var(--text);
  height: auto;
  padding: .9rem .25rem;
  border-radius: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.panel .nav a:hover {
  background: rgba(11, 59, 145, .08);
  color: var(--brand);
}

/* Optional: prevent background scroll when drawer is open (toggle this class in JS) */
.no-scroll {
  overflow: hidden;
}

/* Footer sits at the bottom when content is short */
footer {
  margin-top: auto;
  /* replace previous margin-top: 3rem; */
  background: var(--brand);
  color: #e6ecff;
  text-align: center;
  padding: 20px 16px;
  font-size: .95rem;
  border-top: 3px solid rgba(255, 255, 255, .12);
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  /* iOS safe area */
}

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1rem
}

/* Grid list of posts */
.posts-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Post card */
.post-card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  transition: transform .15s ease, box-shadow .15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(2, 6, 23, .12)
}

.post-card h2 {
  margin: .25rem 0;
  color: #0f172a;
  font-size: 1.15rem
}

.post-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6
}

.post-card a.read-more {
  margin-top: .25rem;
  color: #e11d48;
  font-weight: 700
}

/* WinPred accent */
.post-card a.read-more:hover {
  text-decoration: underline
}

/* ===== Blog Post Content ===== */
.post-content {
  background: var(--white);
  padding: 2rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
  line-height: 1.75;
  font-size: 1.05rem;
}

.post-content h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
  color: var(--brand);
}

.post-content .date {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.post-content h2 {
  margin-top: 1.75rem;
  font-size: 1.4rem;
  color: var(--text);
}

.post-content h3 {
  margin-top: 1.25rem;
  font-size: 1.2rem;
  color: var(--text);
}

.post-content p {
  margin: 1rem 0;
}

.post-content a {
  color: var(--brand);
  font-weight: 600;
}

.post-content a:hover {
  text-decoration: underline;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin: 1rem 0;
}

.post-content blockquote {
  border-left: 4px solid var(--brand);
  padding-left: 1rem;
  color: var(--muted);
  font-style: italic;
  margin: 1.5rem 0;
}

.post-content pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
}

.post-content code {
  background: #e2e8f0;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9rem;
}

.post-content .back {
  margin-top: 2.5rem;
}


.badge {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: .4rem;
  font: 700 .75rem/1 system-ui;
}

.badge.is-won {
  background: #dcfce7;
  color: #166534;
}

.badge.is-lost {
  background: #fee2e2;
  color: #991b1b;
}

.badge.is-unk {
  background: #e2e8f0;
  color: #334155;
}