/*
Theme Name: FundingNotify Blog
Theme URI: https://fundingnotify.ca/blog
Author: KiffLabs
Author URI: https://kifflabs.com
Description: Thème blog bilingue EN/FR pour FundingNotify - design identique au site principal.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: fundingnotify
*/

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f8f8f6;
  --bg-dark: #0a0a0a;
  --surface: #ffffff;
  --border: #e8e8e4;
  --border-strong: #d4d4d0;
  --text: #0a0a0a;
  --text-muted: #525252;
  --text-light: #737373;
  --accent: #0066ff;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --danger: #dc2626;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ===== LANG SYSTEM ===== */
body.lang-en .lang-fr { display: none !important; }
body:not(.lang-en) .lang-en { display: none !important; }

/* ===== NAV ===== */
.fn-nav {
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.fn-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.fn-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.fn-logo-mark {
  width: 32px;
  height: 32px;
  background: var(--text);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
  position: relative;
}
.fn-logo-mark svg { width: 18px; height: 18px; }
.fn-logo-mark::after {
  content: '';
  position: absolute;
  top: 4px; right: 4px;
  width: 7px; height: 7px;
  background: var(--success);
  border-radius: 50%;
  border: 2px solid var(--text);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50% { opacity:0.7; transform:scale(1.2); }
}
.fn-logo-name { display: flex; flex-direction: column; line-height: 1; }
.fn-logo-name .fn-name-main { font-weight: 700; }
.fn-logo-name .fn-name-tag {
  font-size: 10px; font-weight: 500; color: var(--text-muted);
  letter-spacing: 0.04em; text-transform: uppercase; margin-top: 3px;
}
.fn-nav-right { display: flex; align-items: center; gap: 12px; }
.fn-nav-links { display: flex; gap: 4px; }
.fn-nav-links a {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; padding: 6px 12px; border-radius: 7px;
  transition: all 0.15s;
}
.fn-nav-links a:hover { color: var(--text); background: var(--bg-alt); }
.fn-nav-links a.active { color: var(--text); font-weight: 600; }
.fn-lang-switch {
  display: inline-flex; background: var(--bg-alt);
  border: 1px solid var(--border); border-radius: 7px; padding: 2px;
}
.fn-lang-btn {
  border: none; background: transparent; padding: 5px 9px;
  border-radius: 5px; font-family: inherit; font-size: 12px;
  font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.fn-lang-btn.active {
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm);
}
.fn-cta-btn {
  background: var(--text); color: white; padding: 8px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  text-decoration: none; transition: all 0.15s; white-space: nowrap;
}
.fn-cta-btn:hover { background: #1a1a1a; }

/* ===== BLOG HERO ===== */
.blog-hero {
  background: var(--bg-dark);
  padding: 56px 20px 48px;
  text-align: center;
}
.blog-hero-eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: rgba(255,255,255,0.5);
  margin-bottom: 14px;
}
.blog-hero h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 700; letter-spacing: -0.03em;
  color: white; line-height: 1.1; margin-bottom: 14px;
}
.blog-hero p {
  font-size: 16px; color: rgba(255,255,255,0.65);
  max-width: 520px; margin: 0 auto; line-height: 1.6;
}

/* ===== CATEGORY FILTER ===== */
.category-filter-wrap {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 57px; z-index: 90;
}
.category-filter {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; gap: 4px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.category-filter::-webkit-scrollbar { display: none; }
.cat-btn {
  flex-shrink: 0; padding: 14px 16px;
  font-family: inherit; font-size: 14px; font-weight: 500;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  transition: all 0.15s; white-space: nowrap; margin-bottom: -1px;
  text-decoration: none; display: inline-block;
}
.cat-btn:hover { color: var(--text); }
.cat-btn.active { color: var(--text); border-bottom-color: var(--text); font-weight: 600; }

/* ===== BLOG GRID ===== */
.blog-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}
.blog-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.2s;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.blog-card-img {
  aspect-ratio: 16/9;
  background: var(--bg-alt);
  overflow: hidden;
}
.blog-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.blog-card:hover .blog-card-img img { transform: scale(1.03); }
.blog-card-img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #f0f0ee 0%, #e8e8e4 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.blog-card-body { padding: 22px 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.blog-card-cat {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--accent);
  text-decoration: none;
}
.blog-card-dot { width: 3px; height: 3px; background: var(--border-strong); border-radius: 50%; }
.blog-card-date { font-size: 12px; color: var(--text-light); }
.blog-card-title {
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); line-height: 1.35; margin-bottom: 10px;
  text-decoration: none; display: block;
}
.blog-card-excerpt {
  font-size: 14px; color: var(--text-muted); line-height: 1.65;
  flex: 1; margin-bottom: 18px;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; border-top: 1px solid var(--border);
}
.blog-card-author { display: flex; align-items: center; gap: 8px; }
.blog-card-author-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg-dark); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.blog-card-author-name { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.blog-card-read {
  font-size: 12px; color: var(--text-light);
  display: flex; align-items: center; gap: 4px;
}

/* ===== FEATURED POST ===== */
.featured-post {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  text-decoration: none;
  transition: all 0.2s;
}
.featured-post:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.featured-post-img {
  aspect-ratio: 4/3;
  background: var(--bg-alt);
  overflow: hidden;
}
.featured-post-img img { width:100%; height:100%; object-fit:cover; }
.featured-post-img-placeholder {
  width:100%; height:100%;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
}
.featured-post-body {
  padding: 36px 40px;
  display: flex; flex-direction: column; justify-content: center;
}
.featured-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  background: #eff6ff; border: 1px solid #bfdbfe;
  padding: 4px 10px; border-radius: 20px;
  margin-bottom: 16px; width: fit-content;
}
.featured-post-cat {
  font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 10px;
}
.featured-post-title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700; letter-spacing: -0.03em;
  color: var(--text); line-height: 1.25; margin-bottom: 14px;
}
.featured-post-excerpt {
  font-size: 15px; color: var(--text-muted); line-height: 1.7;
  margin-bottom: 24px;
}
.featured-post-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: none; transition: gap 0.15s;
}
.featured-post-link:hover { gap: 10px; }

/* ===== SINGLE POST ===== */
.single-hero {
  background: var(--bg-dark);
  padding: 56px 20px 48px;
}
.single-hero-inner { max-width: 760px; margin: 0 auto; }
.single-breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: rgba(255,255,255,0.5);
  margin-bottom: 20px;
}
.single-breadcrumb a { color: rgba(255,255,255,0.5); text-decoration: none; }
.single-breadcrumb a:hover { color: rgba(255,255,255,0.8); }
.single-breadcrumb span { font-size: 10px; }
.single-cat {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--accent);
  margin-bottom: 14px; display: block;
}
.single-title {
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 700; letter-spacing: -0.03em;
  color: white; line-height: 1.15; margin-bottom: 20px;
}
.single-meta {
  display: flex; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.single-meta-author { display: flex; align-items: center; gap: 8px; }
.single-meta-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.single-meta-info { display: flex; flex-direction: column; }
.single-meta-name { font-size: 13px; font-weight: 600; color: white; }
.single-meta-date { font-size: 12px; color: rgba(255,255,255,0.5); }
.single-meta-sep { width: 1px; height: 28px; background: rgba(255,255,255,0.15); }
.single-meta-read { font-size: 13px; color: rgba(255,255,255,0.5); }
.single-lang-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7);
}

/* ===== FEATURED IMAGE — dans le body blanc ===== */
.single-featured-img {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 20px 0;
  transform: none;
}
.single-featured-img img {
  width: 100%;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  display: block;
}

/* ===== SINGLE CONTENT ===== */
.single-content-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.single-content {
  font-size: 17px; line-height: 1.8; color: var(--text-muted);
}
.single-content h2 {
  font-size: 24px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); margin: 40px 0 16px; line-height: 1.3;
}
.single-content h3 {
  font-size: 20px; font-weight: 600; color: var(--text);
  margin: 32px 0 12px;
}
.single-content p { margin-bottom: 20px; }
.single-content a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; }
.single-content ul, .single-content ol {
  padding-left: 24px; margin-bottom: 20px;
}
.single-content li { margin-bottom: 8px; }
.single-content blockquote {
  border-left: 3px solid var(--accent);
  padding: 16px 24px; background: var(--bg-alt);
  border-radius: 0 8px 8px 0; margin: 28px 0;
  font-size: 18px; font-style: italic; color: var(--text);
}
.single-content img {
  width: 100%; border-radius: 10px; margin: 24px 0;
}
.single-content .wp-caption-text {
  font-size: 13px; color: var(--text-light); text-align: center; margin-top: -16px;
}

/* ===== CTA INLINE ===== */
.inline-cta {
  background: var(--bg-dark);
  border-radius: 14px; padding: 32px 36px;
  margin: 40px 0; text-align: center;
}
.inline-cta h3 { font-size: 20px; font-weight: 700; color: white; margin-bottom: 10px; }
.inline-cta p { font-size: 14px; color: rgba(255,255,255,0.6); margin-bottom: 20px; }
.inline-cta a {
  display: inline-block; background: white; color: var(--text);
  padding: 12px 24px; border-radius: 9px;
  font-size: 15px; font-weight: 700; text-decoration: none;
  transition: opacity 0.15s;
}
.inline-cta a:hover { opacity: 0.9; }

/* ===== POST TAGS ===== */
.single-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 32px 0; padding: 24px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.single-tag {
  font-size: 13px; color: var(--text-muted);
  background: var(--bg-alt); border: 1px solid var(--border);
  padding: 5px 12px; border-radius: 20px; text-decoration: none;
  transition: all 0.15s;
}
.single-tag:hover { border-color: var(--border-strong); color: var(--text); }

/* ===== RELATED POSTS ===== */
.related-posts { margin-top: 56px; }
.related-posts h2 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.related-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ===== PAGINATION ===== */
.fn-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 56px;
}

/* Reset liste générée par paginate_links type=list */
.fn-pagination ul {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}
.fn-pagination ul li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.fn-pagination ul li::before {
  display: none !important;
  content: none !important;
}
.fn-pagination ul li a,
.fn-pagination ul li span {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
}
.fn-pagination ul li a {
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
}
.fn-pagination ul li a:hover {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-alt);
}
.fn-pagination ul li span.current {
  background: var(--text);
  color: white;
  border: 1px solid var(--text);
}
.fn-pagination ul li span.dots {
  border: none;
  background: transparent;
  color: var(--text-light);
  width: auto;
}
.fn-pagination ul li a.prev,
.fn-pagination ul li a.next {
  width: auto;
  padding: 0 14px;
}

/* ===== EMPTY STATE ===== */
.blog-empty {
  text-align: center; padding: 80px 20px; color: var(--text-muted);
}
.blog-empty-icon { font-size: 48px; margin-bottom: 16px; }
.blog-empty h2 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.blog-empty p { font-size: 15px; }

/* ===== FOOTER ===== */
.fn-footer { background: var(--bg-dark); padding: 40px 20px 24px; }
.fn-footer-inner { max-width: 1200px; margin: 0 auto; }
.fn-footer-top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
  padding-bottom: 24px; margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.fn-footer-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.fn-footer-logo .fn-logo-mark { background: white; color: var(--bg-dark); }
.fn-footer-logo .fn-logo-mark::after { border-color: white; background: var(--success); }
.fn-footer-logo .fn-name-main { color: white; font-size: 16px; font-weight: 700; }
.fn-footer-logo .fn-name-tag { color: rgba(255,255,255,0.4); }
.fn-footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.fn-footer-links a { font-size: 13px; color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.15s; }
.fn-footer-links a:hover { color: rgba(255,255,255,0.8); }
.fn-footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.fn-footer-copy { font-size: 12px; color: rgba(255,255,255,0.3); }
.fn-footer-disclaimer { font-size: 11px; color: rgba(255,255,255,0.25); max-width: 500px; line-height: 1.5; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .featured-post { grid-template-columns: 1fr; }
  .featured-post-img { aspect-ratio: 16/9; }
  .featured-post-body { padding: 24px; }
  .fn-nav-links { display: none; }
  .blog-grid { grid-template-columns: 1fr; }
  .single-title { font-size: 26px; }
  .fn-footer-top { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .fn-cta-btn { display: none; }
  .blog-hero { padding: 40px 16px 32px; }
}
