/* ============================================================
   JCBuildsAI — Design System
   Inspired by aiprofitboardroom.com
   ============================================================ */

/* === FONTS === */
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:wght@700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* === VARIABLES === */
:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --blue-light: #EFF6FF;
  --ink: #111827;
  --ink-light: #374151;
  --ink-muted: #6B7280;
  --gray-lightest: #F9FAFB;
  --gray-light: #F3F4F6;
  --gray-border: #E5E7EB;
  --white: #FFFFFF;
  --red-accent: #EF4444;
  
  --font-display: 'Inter Tight', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --max-w: 720px;
  --max-w-wide: 1100px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);
  
  --transition: 0.2s ease;
}

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-dark); }

/* === CONTAINER === */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: var(--max-w-wide); }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--blue-dark);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-outline {
  background: transparent;
  border: 2px solid var(--blue);
  color: var(--blue);
}
.btn-outline:hover {
  background: var(--blue);
  color: var(--white);
}

/* === HEADER / NAV === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-border);
}
.site-header .container-wide {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  height: 64px;
  margin: 0 auto;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
}
.logo:hover { color: var(--blue); }

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-light);
  position: relative;
}
.main-nav a:hover { color: var(--blue); }
.main-nav a.nav-cta {
  background: var(--blue);
  color: var(--white) !important;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.main-nav a.nav-cta:hover { background: var(--blue-dark); }

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

/* === BREADCRUMB === */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-muted);
  margin-bottom: 1rem;
  padding-top: 1.5rem;
}
.breadcrumb a { color: var(--ink-muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { margin: 0 0.4rem; color: var(--gray-border); }

/* === CATEGORY BADGE === */
.category-badge {
  display: inline-block;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

/* === POST HEADER === */
.post-header { margin-bottom: 2rem; }
.post-header h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.3rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 1rem;
}

/* Author byline */
.byline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.byline img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
.byline .name { font-weight: 600; color: var(--ink); font-size: 0.9rem; }
.byline .meta { color: var(--ink-muted); font-size: 0.85rem; }
.byline .sep { color: var(--gray-border); margin: 0 0.3rem; }

/* === CTA BANDEAU === */
.cta-bandeau {
  background: var(--gray-light);
  border-left: 4px solid var(--blue);
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cta-bandeau a { color: var(--blue); font-weight: 600; }
.cta-bandeau a:hover { text-decoration: underline; }

/* === ARTICLE BODY === */
.post-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--ink);
}
.post-content p { margin-bottom: 1.2rem; }
.post-content a { text-decoration: underline; text-underline-offset: 2px; }

.post-content h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 2.5rem 0 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--gray-border);
}
.post-content h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  margin: 1.8rem 0 0.6rem;
}

.post-content ul, .post-content ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}
.post-content li { margin-bottom: 0.4rem; line-height: 1.7; }
.post-content li::marker { color: var(--blue); }

/* Blockquotes (CTA encart) */
.post-content blockquote {
  background: var(--blue-light);
  border-left: 4px solid var(--blue);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: normal;
}
.post-content blockquote p { margin-bottom: 0.3rem; }
.post-content blockquote a { color: var(--blue); font-weight: 600; text-decoration: none; }
.post-content blockquote a:hover { text-decoration: underline; }

/* Code */
.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--gray-light);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}
.post-content pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.2rem 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.88rem;
  line-height: 1.6;
}
.post-content pre code { background: none; padding: 0; color: inherit; }

/* Iframes YouTube */
.post-content iframe {
  width: 100%;
  aspect-ratio: 16/9;
  height: auto;
  margin: 1.5rem 0;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-md);
}

/* Tables */
.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.92rem;
}
.post-content th {
  background: var(--blue);
  color: var(--white);
  font-weight: 600;
  padding: 0.7rem 1rem;
  text-align: left;
}
.post-content td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--gray-border);
}
.post-content tr:nth-child(even) td { background: var(--gray-lightest); }

/* === FAQ === */
.faq-section { margin: 2.5rem 0; }
.faq-item {
  background: var(--gray-light);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
}
.faq-item h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-item h3::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--blue);
  font-weight: 400;
}
.faq-item.open h3::after { content: '−'; }
.faq-answer {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.6;
  display: none;
}
.faq-item.open .faq-answer { display: block; }

/* === AUTHOR CARD === */
.author-card {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: var(--gray-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2.5rem 0;
}
.author-card img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.author-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3rem; }
.author-card p { font-size: 0.9rem; color: var(--ink-light); line-height: 1.6; margin-bottom: 0.8rem; }

/* === RELATED ARTICLES === */
.related-section { margin: 3rem 0; }
.related-section h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; margin-bottom: 1.2rem; }
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.related-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  transition: all var(--transition);
}
.related-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.related-card .cat {
  font-size: 0.7rem;
  color: var(--blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.related-card h3 { font-size: 0.95rem; font-weight: 600; line-height: 1.4; }
.related-card h3 a { color: var(--ink); }
.related-card h3 a:hover { color: var(--blue); }
.related-card p { font-size: 0.85rem; color: var(--ink-muted); margin-top: 0.4rem; }

/* === POST NAVIGATION === */
.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-border);
}
.post-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--blue);
  max-width: 45%;
}
.post-nav a:hover { color: var(--blue-dark); }
.post-nav .prev::before { content: '← '; }
.post-nav .next::after { content: ' →'; }
.post-nav .next { text-align: right; margin-left: auto; }

/* === FINAL CTA BANNER === */
.final-cta {
  background: var(--ink);
  color: var(--white);
  text-align: center;
  padding: 3.5rem 1.5rem;
  margin: 3rem -1.5rem -3rem;
}
.final-cta h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.final-cta p { color: rgba(255,255,255,0.7); margin-bottom: 1.5rem; font-size: 1.05rem; }
.final-cta .btn-primary { font-size: 1.1rem; padding: 16px 36px; }

/* === HOMEPAGE === */
.hero {
  background: linear-gradient(135deg, var(--ink) 0%, #1e3a5f 100%);
  color: var(--white);
  padding: 5rem 0;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.8rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
}
.hero p {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.7);
  max-width: 600px;
  margin: 0 auto 1.8rem;
  line-height: 1.6;
}

.features { padding: 4rem 0; }
.features h2 { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; margin-bottom: 2rem; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.2rem;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  transition: all var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-card p { font-size: 0.92rem; color: var(--ink-light); line-height: 1.6; }

.blog-preview { padding: 4rem 0; background: var(--gray-lightest); }
.blog-preview h2 { text-align: center; font-family: var(--font-display); font-weight: 700; font-size: 1.8rem; margin-bottom: 2rem; }
.blog-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}
.blog-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}
.blog-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.blog-card-img {
  height: 180px;
  background: linear-gradient(135deg, var(--blue-light), #dbeafe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}
.blog-card-body { padding: 1.2rem 1.5rem 1.5rem; }
.blog-card-body .cat {
  font-size: 0.7rem;
  color: var(--blue);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.3rem;
}
.blog-card-body h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.4; }
.blog-card-body h3 a { color: var(--ink); }
.blog-card-body h3 a:hover { color: var(--blue); }
.blog-card-body p { font-size: 0.88rem; color: var(--ink-muted); margin-top: 0.4rem; }

/* === BLOG LISTING PAGE === */
.blog-listing { padding: 2.5rem 0; }
.blog-listing h1 { font-family: var(--font-display); font-weight: 800; font-size: 2rem; margin-bottom: 1.5rem; }
.blog-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}
.blog-filters button {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--gray-border);
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  color: var(--ink-light);
}
.blog-filters button.active, .blog-filters button:hover {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

/* === FOOTER === */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  padding: 3rem 0 1.5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
.footer-brand h3 { color: var(--white); font-family: var(--font-display); font-weight: 700; margin-bottom: 0.5rem; }
.footer-brand p { font-size: 0.9rem; line-height: 1.6; }
.footer-links h4 { color: var(--white); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.8rem; }
.footer-links a { display: block; color: rgba(255,255,255,0.6); font-size: 0.9rem; padding: 0.2rem 0; }
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.2rem;
  text-align: center;
  font-size: 0.85rem;
}

/* === EXIT POPUP === */
.exit-popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}
.exit-popup-overlay.show { display: flex; }
.exit-popup {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  position: relative;
  animation: slideUp 0.35s ease;
  text-align: center;
}
.exit-popup .close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--ink-muted);
  line-height: 1;
}
.exit-popup h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin-bottom: 0.5rem; }
.exit-popup p { color: var(--ink-light); font-size: 0.95rem; margin-bottom: 1.2rem; }
.exit-popup ul { list-style: none; padding: 0; margin: 0 0 1.5rem; text-align: left; }
.exit-popup li {
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--ink-light);
}
.exit-popup .skip {
  display: inline-block;
  margin-top: 0.8rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  body { font-size: 16px; }
  .post-header h1 { font-size: 1.6rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero { padding: 3rem 0; }
  .site-header .container-wide { padding: 0 1rem; }
  
  .hamburger { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-border);
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav a.nav-cta { text-align: center; }
  
  .feature-grid { grid-template-columns: 1fr; }
  .blog-card-grid { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .author-card { flex-direction: column; align-items: center; text-align: center; }
  .cta-bandeau { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: 1fr; }
  .post-nav { flex-direction: column; }
  .post-nav a { max-width: 100%; }
}

@media (max-width: 480px) {
  .post-header h1 { font-size: 1.4rem; }
  .hero h1 { font-size: 1.5rem; }
  .final-cta h2 { font-size: 1.4rem; }
}
