/* ═══════════════════════════════════════════════
   OESTLER BLOG — style.css
   Inspired by Deigo Ghost theme · Oestler palette
   ═══════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

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

:root {
  --bg-primary: #070b17;
  --bg-secondary: #0d1526;
  --bg-card: #0a101f;
  --bg-card-hover: #0f1830;
  --accent: #1677ff;
  --accent-soft: rgba(22, 119, 255, 0.15);
  --text-primary: #e1e5eb;
  --text-secondary: #bfc7d1;
  --text-muted: #6b7a99;
  --border: #1e2d4a;
  --border-soft: rgba(30, 45, 74, 0.5);
  --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(22, 119, 255, 0.08) 0%, transparent 60%);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --max-width: 1200px;
  --content-width: 720px;
}

html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--sans);
  background: var(--bg-primary);
  color: var(--text-secondary);
  line-height: 1.7;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s, opacity 0.2s; }
a:hover { opacity: 0.85; }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--accent); color: #fff; }

/* ── Layout ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: var(--content-width); margin: 0 auto; }

/* ── Header / Nav ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(7, 11, 23, 0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-logo {
  font-family: var(--sans); font-size: 18px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase; color: var(--text-primary);
}
.site-logo:hover { color: var(--text-primary); opacity: 1; }
.site-nav { display: flex; gap: 32px; align-items: center; }
.site-nav > a, .nav-dropdown > .nav-dropdown-trigger {
  font-size: 13px; font-weight: 500; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--text-muted); transition: color 0.2s;
  cursor: pointer; background: none; border: none; font-family: var(--sans); padding: 0;
}
.site-nav > a:hover, .site-nav > a.active { color: var(--text-primary); opacity: 1; }

/* ── Nav Dropdown ── */
.nav-dropdown { position: relative; display: flex; align-items: center; }
.nav-dropdown-trigger {
  display: flex; align-items: center; gap: 6px;
}
.nav-dropdown-trigger::after {
  content: ''; width: 0; height: 0;
  border: 4px solid transparent; border-top: 5px solid var(--text-muted);
  margin-top: 3px; transition: border-top-color 0.2s;
}
.nav-dropdown:hover .nav-dropdown-trigger,
.nav-dropdown:hover .nav-dropdown-trigger::after { color: var(--text-primary); border-top-color: var(--text-primary); }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px; min-width: 148px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  z-index: 200;
}
/* Bridge the gap so moving the mouse down into the menu doesn't lose hover */
.dropdown-menu::before {
  content: ''; position: absolute; bottom: 100%; left: 0;
  width: 100%; height: 12px;
}
.nav-dropdown:hover .dropdown-menu {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-menu a {
  display: block; padding: 9px 16px;
  font-size: 12px; font-weight: 600; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted);
  border-radius: 6px; transition: background 0.15s, color 0.15s;
}
.dropdown-menu a:hover { background: var(--bg-card-hover); color: var(--text-primary); opacity: 1; }

.site-nav > a.nav-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  padding: 8px 22px; border-radius: 6px; line-height: 1;
  font-weight: 600; font-size: 12px; letter-spacing: 0.8px;
  white-space: nowrap; text-decoration: none;
}
.site-nav > a.nav-cta:hover { opacity: 0.9; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-muted); margin: 5px 0; transition: 0.3s; }

/* ── Hero ── */
.hero {
  padding: 100px 0 80px; text-align: center;
  background: var(--gradient-glow); border-bottom: 1px solid var(--border-soft);
}
.hero-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: 2px; text-transform: uppercase; color: var(--accent);
  margin-bottom: 24px; padding: 6px 16px;
  border: 1px solid var(--accent-soft); border-radius: 100px; background: var(--accent-soft);
}
.hero h1 {
  font-family: var(--serif); font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 700;
  color: var(--text-primary); line-height: 1.2; max-width: 800px; margin: 0 auto 24px;
}
.hero p { font-size: 18px; color: var(--text-muted); max-width: 560px; margin: 0 auto; line-height: 1.7; }

/* ── Featured post ── */
.featured-section { padding: 80px 0 0; }
.featured-label {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 32px;
}
.featured-card {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; align-items: stretch;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; overflow: hidden; transition: border-color 0.3s, transform 0.3s;
}
.featured-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.featured-card .card-image {
  min-height: 400px; background-size: cover; background-position: center; position: relative;
}
.featured-card .card-image::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 60%, var(--bg-card) 100%);
}
.featured-card .card-body { padding: 48px; display: flex; flex-direction: column; justify-content: center; }
.card-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); margin-bottom: 16px;
}
.card-title {
  font-family: var(--serif); font-weight: 700; color: var(--text-primary); line-height: 1.3; margin-bottom: 16px;
}
.featured-card .card-title { font-size: 28px; }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--accent); opacity: 1; }
.card-excerpt { font-size: 15px; color: var(--text-muted); line-height: 1.7; margin-bottom: 24px; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-muted); }
.card-meta .dot { opacity: 0.4; }

/* ── Post grid ── */
.posts-section { padding: 80px 0; }
.section-heading {
  font-size: 11px; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 32px;
}
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; transition: border-color 0.3s, transform 0.3s;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.post-card .card-image { height: 200px; background-size: cover; background-position: center; }
.post-card .card-body { padding: 24px; }
.post-card .card-tag { font-size: 10px; margin-bottom: 12px; }
.post-card .card-title { font-size: 20px; font-weight: 600; }
.post-card .card-excerpt {
  font-size: 14px; line-height: 1.65; margin-bottom: 20px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .card-meta { font-size: 12px; }

/* ── Hero images (gradient placeholders) ── */
.img-data-problem { background: linear-gradient(135deg, #0a1628 0%, #1a3060 50%, #1677ff 100%); }
.img-janus-ai { background: linear-gradient(135deg, #0a1628 0%, #1e2d4a 40%, #faad14 100%); }
.img-handover { background: linear-gradient(135deg, #0a1628 0%, #2d1a3f 50%, #722ed1 100%); }
.img-graphs { background: linear-gradient(135deg, #0a1628 0%, #0d3320 50%, #52c41a 100%); }
.img-notebook { background: linear-gradient(135deg, #0a1628 0%, #3a1a1a 50%, #ff4d4f 100%); }
.img-todo-deep-dive { background: linear-gradient(135deg, #0a1628 0%, #1a2d3a 50%, #13c2c2 100%); }
.img-ai-regex { background: linear-gradient(135deg, #0a1628 0%, #1a1a3a 40%, #b37feb 100%); }
.img-validation-register { background: linear-gradient(135deg, #0a1628 0%, #1a2a3a 45%, #36cfc9 100%); }
.img-spatial-hub { background: linear-gradient(135deg, #0a1628 0%, #102b4a 45%, #4096ff 100%); }
.img-me-graph { background: linear-gradient(135deg, #050816 0%, #1a1f3a 40%, #9254de 100%); }
.img-cost-bad-data { background: linear-gradient(135deg, #0a1628 0%, #2a1a0a 45%, #fa8c16 100%); }
.img-spreadsheet-migration { background: linear-gradient(135deg, #0a1628 0%, #0d2b1a 45%, #73d13d 100%); }
.img-security-compliance { background: linear-gradient(135deg, #0a1628 0%, #1a0a2a 45%, #722ed1 100%); }

/* ── Tags bar ── */
.tags-bar { padding: 48px 0; border-top: 1px solid var(--border-soft); }
.tags-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-pill {
  font-size: 12px; font-weight: 500; color: var(--text-muted);
  padding: 6px 16px; border: 1px solid var(--border); border-radius: 100px; transition: all 0.2s;
}
.tag-pill:hover { border-color: var(--accent); color: var(--accent); opacity: 1; background: var(--accent-soft); }

/* ── Subscribe banner ── */
.subscribe-banner {
  padding: 80px 0; text-align: center;
  border-top: 1px solid var(--border-soft); background: var(--gradient-glow);
}
.subscribe-banner h2 {
  font-family: var(--serif); font-size: 28px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 12px;
}
.subscribe-banner p { color: var(--text-muted); font-size: 15px; margin-bottom: 28px; max-width: 440px; margin-left: auto; margin-right: auto; }
.subscribe-form { display: flex; gap: 10px; justify-content: center; max-width: 440px; margin: 0 auto; }
.subscribe-form input {
  flex: 1; padding: 12px 18px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-secondary); color: var(--text-primary);
  font-size: 14px; font-family: var(--sans); outline: none; transition: border-color 0.2s;
}
.subscribe-form input::placeholder { color: var(--text-muted); }
.subscribe-form input:focus { border-color: var(--accent); }
.subscribe-form button {
  padding: 12px 28px; background: var(--accent); color: #fff; border: none; border-radius: 8px;
  font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s; white-space: nowrap;
}
.subscribe-form button:hover { opacity: 0.9; }

/* ── Footer ── */
.site-footer { border-top: 1px solid var(--border-soft); padding: 48px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-left { font-size: 13px; color: var(--text-muted); }
.footer-left a { color: var(--text-muted); }
.footer-left a:hover { color: var(--accent); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--text-muted); transition: color 0.2s; }
.footer-links a:hover { color: var(--text-primary); opacity: 1; }

/* ═══════════════════════════
   ARTICLE PAGE
   ═══════════════════════════ */
.article-header {
  padding: 80px 0 48px; text-align: center; background: var(--gradient-glow);
}
.article-header .card-tag {
  padding: 6px 16px; border: 1px solid var(--accent-soft);
  border-radius: 100px; background: var(--accent-soft);
}
.article-header h1 {
  font-family: var(--serif); font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700;
  color: var(--text-primary); line-height: 1.2; max-width: 760px; margin: 0 auto 20px;
}
.article-excerpt {
  font-size: 18px; color: var(--text-muted); max-width: 600px;
  margin: 0 auto 28px; line-height: 1.7;
}
.article-header .card-meta { justify-content: center; }

.article-hero-image { max-width: 900px; margin: 0 auto 64px; padding: 0 24px; }
.article-hero-image .hero-img {
  width: 100%; height: 420px; border-radius: 12px; border: 1px solid var(--border);
}

/* ── Article body ── */
.article-body { padding: 0 24px 80px; }
.article-body .narrow { font-size: 17px; line-height: 1.85; color: var(--text-secondary); }
.article-body h2 {
  font-family: var(--serif); font-size: 26px; font-weight: 600;
  color: var(--text-primary); margin: 48px 0 20px; line-height: 1.3;
}
.article-body h3 {
  font-family: var(--sans); font-size: 18px; font-weight: 600;
  color: var(--text-primary); margin: 36px 0 16px;
}
.article-body p { margin-bottom: 24px; }
.article-body strong { color: var(--text-primary); font-weight: 600; }
.article-body blockquote {
  border-left: 3px solid var(--accent); padding: 4px 0 4px 24px; margin: 32px 0;
  font-family: var(--serif); font-size: 20px; font-style: italic;
  color: var(--text-primary); line-height: 1.6;
}
.article-body ul, .article-body ol { margin: 0 0 24px 24px; }
.article-body li { margin-bottom: 8px; }
.article-body code {
  background: var(--bg-secondary); padding: 2px 8px; border-radius: 4px;
  font-size: 0.9em; color: var(--accent); border: 1px solid var(--border-soft);
}
.article-body pre {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; padding: 24px; overflow-x: auto; margin: 32px 0;
}
.article-body pre code { background: none; border: none; padding: 0; color: var(--text-secondary); }

/* ── Article footer / related ── */
.article-footer { border-top: 1px solid var(--border-soft); padding: 64px 0; }
.article-footer .section-heading { text-align: center; margin-bottom: 40px; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-card { grid-template-columns: 1fr; }
  .featured-card .card-image { min-height: 260px; }
  .featured-card .card-image::after { background: linear-gradient(180deg, transparent 60%, var(--bg-card) 100%); }
  .featured-card .card-body { padding: 32px; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .site-nav { display: none; }
  .site-nav.open {
    display: flex; flex-direction: column; position: fixed;
    top: 64px; left: 0; right: 0;
    height: auto;
    background-color: #070b17;
    padding: 32px 24px; gap: 24px; border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    z-index: 999;
  }
  /* mobile: flatten dropdown into plain links */
  .site-nav.open .nav-dropdown { flex-direction: column; align-items: flex-start; gap: 0; }
  .site-nav.open .nav-dropdown-trigger { display: none; }
  .site-nav.open .dropdown-menu {
    position: static; transform: none; opacity: 1; visibility: visible;
    pointer-events: auto; box-shadow: none; border: none; border-radius: 0;
    padding: 0; margin: 0; min-width: 0;
    background: transparent; display: flex; flex-direction: column; gap: 20px;
  }
  .site-nav.open .dropdown-menu::before { display: none; }
  .site-nav.open .dropdown-menu a {
    padding: 0; border-radius: 0; background: none;
    font-size: 13px; font-weight: 500; letter-spacing: 0.5px;
    color: var(--text-muted);
  }
  .site-nav.open .dropdown-menu a:hover { background: none; }
  .nav-toggle { display: block; }
  .hero { padding: 64px 0 48px; }
  .hero h1 { font-size: 2rem; }
  .featured-card .card-body { padding: 24px; }
  .subscribe-form { flex-direction: column; }
  .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
  .article-header { padding: 48px 0 32px; }
  .article-body .narrow { font-size: 16px; }
  .article-hero-image .hero-img { height: 240px; }
}
