/* ==============================================
   INVENTORY FORECASTING HERO — JEKYLL THEME CSS
   ============================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:   #0c5fa8;
  --blue2:  #0a4e8c;
  --blue-bright: #1a7fd4;
  --red:    #d91c1c;
  --red2:   #b81515;
  --yellow: #ffd600;
  --cream:  #eef5fc;
  --muted:  #777777;
  --border: #d4e4f0;
  --green:  #2d9c5e;
  --radius: 14px;
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --max-width: 1080px;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: #fff;
  color: #222;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 5%;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-head); font-size: 1.2rem; color: var(--blue);
}
.nav-logo-icon {
  width: 34px; height: 34px; background: var(--blue);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-size: 0.9rem; color: var(--muted); font-weight: 500; transition: color .2s; }
.nav-links a:hover, .nav-links a.active { color: var(--blue); font-weight: 600; }
.nav-cta {
  background: var(--blue); color: var(--yellow) !important;
  padding: 9px 20px; border-radius: 8px; font-weight: 600;
  font-size: 0.875rem; transition: background .2s, transform .15s;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--blue2); transform: translateY(-1px); }

/* Hamburger (mobile) */
.nav-hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px;
  background: var(--blue); border-radius: 2px; transition: all .2s;
}

/* ── BUTTONS ── */
.btn-primary {
  display: inline-block;
  background: var(--red); color: var(--yellow); font-weight: 700;
  padding: 14px 32px; border-radius: 10px; font-size: 1rem;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(217,28,28,0.35);
}
.btn-primary:hover { background: var(--red2); transform: translateY(-2px); box-shadow: 0 6px 28px rgba(217,28,28,0.45); }

.btn-yellow {
  display: block; background: var(--yellow); color: var(--blue);
  font-weight: 700; padding: 12px 20px; border-radius: 8px;
  font-size: 0.9rem; text-align: center;
  transition: transform .15s, box-shadow .2s;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
}
.btn-yellow:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2); }

/* ── SECTION HELPERS ── */
.section { padding: 80px 5%; }
.section-inner { max-width: var(--max-width); margin: 0 auto; }
.section-label {
  display: inline-block; font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue);
  margin-bottom: 12px;
}
.section-title {
  font-family: var(--font-head); font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  color: var(--blue); line-height: 1.2; max-width: 640px; margin-bottom: 16px;
}
.section-sub { color: var(--muted); font-size: 1.05rem; max-width: 560px; line-height: 1.7; }
.divider { width: 48px; height: 3px; background: var(--yellow); border-radius: 2px; margin: 20px 0; }

/* ── FOOTER ── */
footer {
  background: var(--blue2); color: #888;
  padding: 48px 5%; border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-inner {
  max-width: var(--max-width); margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between;
}
.footer-brand .logo-text { font-family: var(--font-head); color: #fff; font-size: 1.1rem; margin-bottom: 6px; }
.footer-brand p { font-size: 0.82rem; line-height: 1.65; max-width: 260px; }
.footer-links h4 { color: #999; font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 14px; }
.footer-links a { display: block; color: #888; font-size: 0.875rem; margin-bottom: 8px; transition: color .2s; }
.footer-links a:hover { color: #ccc; }
.footer-bottom {
  max-width: var(--max-width); margin: 32px auto 0; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  font-size: 0.8rem; color: #666;
}

/* ── BLOG HERO ── */
.blog-hero {
  background: var(--blue-bright);
  padding: 64px 5% 56px;
  position: relative; overflow: hidden;
}
.blog-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-conic-gradient(rgba(255,255,255,0.06) 0deg 10deg, transparent 10deg 20deg);
  pointer-events: none;
}
.blog-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 50%, transparent 0%, rgba(10,78,140,0.5) 100%);
  pointer-events: none;
}
.blog-hero-inner { max-width: var(--max-width); margin: 0 auto; position: relative; z-index: 1; }
.blog-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(2rem, 4vw, 3rem);
  color: #fff; margin-bottom: 12px;
}
.blog-hero h1 em { color: var(--yellow); font-style: italic; }
.blog-hero p { color: rgba(255,255,255,0.8); font-size: 1.05rem; max-width: 520px; }
.blog-hero .section-label { color: var(--yellow); }

/* ── BLOG LAYOUT ── */
.blog-body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 64px 5%;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  align-items: start;
}

/* ── POST CARDS ── */
.post-card {
  padding: 28px 0;
  border-bottom: 1px solid var(--border);
}
.post-card:first-child { padding-top: 0; }
.post-card:last-child { border-bottom: none; }

.post-card.featured {
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 8px;
}
.post-card.featured .post-tag {
  background: var(--yellow); color: var(--blue);
}
.post-card.featured .post-title { font-size: 1.6rem; }

.post-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.post-tag {
  background: var(--cream); color: var(--blue);
  font-size: 0.72rem; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; text-transform: uppercase; letter-spacing: 0.05em;
}
.post-date { font-size: 0.8rem; color: var(--muted); }

.post-title {
  font-family: var(--font-head);
  font-size: 1.35rem; color: var(--blue);
  line-height: 1.25; margin-bottom: 10px;
  transition: color .2s;
}
.post-card:hover .post-title { color: var(--red); }

.post-excerpt {
  color: var(--muted); font-size: 0.9rem; line-height: 1.7; margin-bottom: 14px;
}
.post-read {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 600; color: var(--blue);
  transition: gap .2s, color .2s;
}
.post-card:hover .post-read { gap: 10px; color: var(--red); }

/* ── INDIVIDUAL POST ── */
.post-hero {
  background: var(--blue-bright);
  padding: 64px 5%;
  position: relative; overflow: hidden;
}
.post-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-conic-gradient(rgba(255,255,255,0.06) 0deg 10deg, transparent 10deg 20deg);
  pointer-events: none;
}
.post-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 70% at 50% 50%, transparent 0%, rgba(10,78,140,0.5) 100%);
  pointer-events: none;
}
.post-hero-inner { max-width: 760px; margin: 0 auto; position: relative; z-index: 1; }
.post-hero-meta {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.back-link { color: rgba(255,255,255,0.7); font-size: 0.875rem; transition: color .2s; }
.back-link:hover { color: #fff; }
.post-hero h1 {
  font-family: var(--font-head);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: #fff; line-height: 1.2;
}
.post-hero-sub { color: rgba(255,255,255,0.8); font-size: 1.05rem; margin-top: 14px; line-height: 1.7; }

.post-body {
  max-width: var(--max-width); margin: 0 auto;
  padding: 64px 5%;
  display: grid; grid-template-columns: 1fr 300px; gap: 56px; align-items: start;
}

/* ── POST CONTENT (Markdown rendered) ── */
.post-content { min-width: 0; }

.post-content h2 {
  font-family: var(--font-head);
  font-size: 1.7rem; color: var(--blue);
  margin: 40px 0 16px; line-height: 1.25;
}
.post-content h3 {
  font-size: 1.15rem; font-weight: 700; color: var(--blue);
  margin: 28px 0 10px;
}
.post-content p {
  color: #333; font-size: 1rem; line-height: 1.8; margin-bottom: 20px;
}
.post-content ul, .post-content ol {
  margin: 0 0 20px 24px; color: #333; font-size: 1rem; line-height: 1.8;
}
.post-content li { margin-bottom: 6px; }
.post-content strong { color: var(--blue); font-weight: 600; }
.post-content a { color: var(--blue); text-decoration: underline; text-decoration-color: var(--border); transition: color .2s; }
.post-content a:hover { color: var(--red); }
.post-content blockquote {
  border-left: 4px solid var(--yellow); padding: 12px 20px;
  background: var(--cream); border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0; color: var(--blue); font-style: italic;
}
.post-content code {
  background: var(--cream); color: var(--blue);
  padding: 2px 6px; border-radius: 4px; font-size: 0.875em;
}
.post-content pre {
  background: #1a1a2e; color: #e2e8f0; padding: 20px;
  border-radius: var(--radius); overflow-x: auto; margin-bottom: 20px;
}
.post-content pre code { background: none; color: inherit; padding: 0; }
.post-content hr {
  border: none; border-top: 1px solid var(--border); margin: 40px 0;
}
.post-content table {
  width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 0.9rem;
}
.post-content table th {
  background: var(--blue); color: #fff; padding: 10px 14px; text-align: left;
}
.post-content table td {
  padding: 10px 14px; border-bottom: 1px solid var(--border); color: #333;
}
.post-content table tr:nth-child(even) td { background: var(--cream); }

/* In-post CTA */
.post-cta-inline {
  background: var(--cream); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px; margin-top: 48px; text-align: center;
}
.post-cta-inline strong { display: block; font-family: var(--font-head); font-size: 1.2rem; color: var(--blue); margin-bottom: 8px; }
.post-cta-inline p { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }

/* ── SIDEBAR ── */
.sidebar { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 80px; }

.sidebar-cta {
  background: var(--blue); border-radius: var(--radius); padding: 24px; text-align: center;
}
.sidebar-cta h3 { font-family: var(--font-head); color: #fff; font-size: 1.2rem; margin-bottom: 8px; }
.sidebar-cta p { color: rgba(255,255,255,0.75); font-size: 0.85rem; margin-bottom: 18px; line-height: 1.6; }

.sidebar-card {
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.sidebar-head {
  background: var(--blue); color: #fff; padding: 12px 18px;
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
}
.sidebar-body { padding: 18px; }

.popular-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.popular-list li a {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 0.85rem; color: #333; transition: color .2s; line-height: 1.4;
}
.popular-list li a:hover { color: var(--blue); }
.pop-num {
  min-width: 22px; height: 22px; background: var(--blue); color: var(--yellow);
  border-radius: 5px; font-size: 0.7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px; flex-shrink: 0;
}

.category-list { list-style: none; }
.category-list li a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 0.875rem; color: var(--blue);
  border-bottom: 1px solid var(--border); transition: color .2s;
}
.category-list li:last-child a { border-bottom: none; }
.category-list li a:hover { color: var(--red); }
.cat-count {
  background: var(--cream); color: var(--muted);
  font-size: 0.7rem; font-weight: 700; padding: 2px 7px; border-radius: 20px;
}

/* ── RESPONSIVE ── */
@media (max-width: 860px) {
  .blog-body, .post-body {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .sidebar {
    position: static;
    order: -1;
  }
  .sidebar-card { display: none; }
  .sidebar-cta { display: block; }
}

@media (max-width: 640px) {
  .nav-links a:not(.nav-cta):not(.active) { display: none; }
  .nav-hamburger { display: flex; }
  .nav-links.mobile-open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: #fff; border-bottom: 1px solid var(--border);
    padding: 16px 5%; gap: 16px; z-index: 99;
  }
  .nav-links.mobile-open a { display: block; font-size: 1rem; }
  .post-hero-meta { gap: 8px; }
}
