/* ═══════════════════════════════════════════
   BLOG — Feuille de style partagée
   Intuisio · 2026
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --soft: #f4f3f0;
  --border: rgba(0,0,0,0.09);
  --border-mid: rgba(0,0,0,0.16);
  --text: #1a1a18;
  --text-sec: #5a5957;
  --text-ter: #9a9895;
  --teal-l: #DCF5F5;
  --teal: #AAE8E8;
  --teal-d: #1a5f5f;
  --teal-b: #7dd4d4;
  --blue-l: #E6F1FB;
  --blue: #6bb8f5;
  --blue-d: #0C447C;
  --blue-b: #a8d4f5;
  --amber-l: #FAEEDA;
  --amber: #F5C842;
  --amber-d: #633806;
  --amber-b: #e8b830;
  --purple-l: #EEEDFE;
  --purple: #9b8ef5;
  --purple-d: #3C3489;
  --purple-b: #c0b8f8;
  --r-md: 10px;
  --r-lg: 14px;
}

html.dark {
  --bg: #161614;
  --surface: #222220;
  --soft: #2a2a28;
  --border: rgba(255,255,255,0.13);
  --border-mid: rgba(255,255,255,0.22);
  --text: #f2efe8;
  --text-sec: #c4c1ba;
  --text-ter: #8a8784;
  --teal-l: #1a3333;
  --teal-d: #8de0e0;
  --teal-b: #2a5555;
  --blue-l: #0e2035;
  --blue-d: #9dc8f5;
  --blue-b: #1a3d5c;
  --amber-l: #2e1f06;
  --amber-d: #f8c97a;
  --amber-b: #4a3010;
  --purple-l: #1e1c3a;
  --purple-d: #bdb8f5;
  --purple-b: #352e6a;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-top: 100px; /* topbar 32px + nav 68px */
}

a { color: inherit; }

.logo-fill { fill: #2d2d2d; }
html.dark .logo-fill { fill: #e8e6e0; }

/* ═══════════ TOPBAR ═══════════ */
.blog-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 101;
  background: var(--soft);
  border-bottom: 0.5px solid var(--border);
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 2rem;
  gap: 0;
}

.ec-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-ter);
  text-decoration: none;
  padding: 0 10px;
  height: 32px;
  transition: color 0.15s;
  white-space: nowrap;
}
.ec-link:hover { color: var(--text-sec); }
.ec-link.ec-bourse { color: #3aacac !important; font-weight: 500; }
.ec-sep { width: 0.5px; height: 12px; background: var(--border-mid); flex-shrink: 0; }
.ec-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-ter);
  margin-left: 12px;
  line-height: 32px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

/* ═══════════ NAV ═══════════ */
.blog-nav {
  position: fixed;
  top: 32px;
  left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  border-bottom: 0.5px solid var(--border);
  backdrop-filter: blur(8px);
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 2.5rem;
  gap: 12px;
}
html.dark .blog-nav { background: rgba(30,30,28,0.96); }

.nav-brand {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.nav-brand a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.nav-brand svg {
  height: 28px;
  width: auto;
  display: block;
}

.nav-profil-group {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-left: 12px;
  border-left: 0.5px solid var(--border-mid);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-sec);
  padding: 6px 12px;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--soft); }
.nav-link.active { color: var(--text); font-weight: 500; background: var(--soft); }

.nav-cta {
  font-size: 12px;
  font-weight: 500;
  padding: 7px 16px;
  border-radius: 30px;
  background: #AAE8E8;
  color: #1a5f5f;
  border: 0.5px solid #7dd4d4;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  margin-left: 8px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}
.nav-cta:hover { background: #8fdede; }

.nav-profil-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 30px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
  border: 0.5px solid var(--border-mid);
  background: transparent;
  color: var(--text-sec);
  text-decoration: none;
  display: inline-block;
}
.nav-profil-btn:hover { background: var(--soft); color: var(--text); }
.nav-profil-btn.profil-frontalier:hover { background: var(--blue-l); color: var(--blue-d); border-color: var(--blue-b); }
.nav-profil-btn.profil-tns:hover { background: var(--amber-l); color: var(--amber-d); border-color: var(--amber-b); }
.nav-profil-btn.profil-entreprise:hover { background: var(--purple-l); color: var(--purple-d); border-color: var(--purple-b); }

#theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-ter);
  padding: 4px 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
#theme-toggle:hover { color: var(--text-sec); background: var(--soft); }

/* ═══════════ HAMBURGER ═══════════ */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
  flex-shrink: 0;
}
.nav-hamburger span {
  width: 22px;
  height: 1.5px;
  background: var(--text);
  display: block;
  transition: all 0.2s;
}

/* ═══════════ MOBILE MENU ═══════════ */
.mobile-menu {
  display: none;
  position: fixed;
  top: 100px;
  left: 0; right: 0;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border);
  z-index: 99;
  flex-direction: column;
  padding: 0;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.mobile-menu.open { display: flex; }

.mobile-section-label {
  padding: 8px 1.4rem 4px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-ter);
  background: var(--soft);
}

.mobile-link {
  font-size: 14px;
  color: var(--text-sec);
  padding: 10px 1.4rem;
  border-bottom: 0.5px solid var(--border);
  text-decoration: none;
  display: block;
  transition: background 0.1s;
}
.mobile-link:active { background: var(--soft); }
.mobile-link.active-page { color: var(--text); font-weight: 500; }

/* ═══════════ CONTAINER ═══════════ */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ═══════════ RETOUR AU BLOG ═══════════ */
#back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-ter);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 30px;
  border: 0.5px solid var(--border-mid);
  background: var(--surface);
  margin: 2rem 1.5rem 0;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
#back-to-blog:hover {
  color: var(--text-sec);
  background: var(--soft);
  border-color: var(--border-mid);
}

/* ═══════════ BREADCRUMB ═══════════ */
.breadcrumb {
  font-size: 12px;
  color: var(--text-ter);
  margin: 2.5rem 0 1.2rem;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--text-ter);
  text-decoration: none;
  transition: color 0.15s;
}
.breadcrumb a:hover { color: var(--text-sec); }
.breadcrumb .sep { color: var(--text-ter); opacity: 0.5; }
.breadcrumb .current { color: var(--text-sec); }

/* ═══════════ ARTICLE ═══════════ */
article.post {
  padding: 0.5rem 0 3rem;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.blog-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.tag-teal { background: var(--teal-l); color: var(--teal-d); }
.tag-blue { background: var(--blue-l); color: var(--blue-d); }
.tag-amber { background: var(--amber-l); color: var(--amber-d); }
.tag-purple { background: var(--purple-l); color: var(--purple-d); }

.post-date {
  font-size: 12px;
  color: var(--text-ter);
}

h1.post-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 4.5vw, 40px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}

.post-body {
  font-size: 16px;
  color: var(--text-sec);
  line-height: 1.75;
}

.post-body p {
  margin-bottom: 1.3rem;
}

.post-body h2,
.post-body h3 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text);
  margin: 2.2rem 0 0.8rem;
  line-height: 1.3;
  letter-spacing: -0.005em;
}

.post-body h2 {
  font-size: 24px;
  font-weight: 700;
}
.post-body h3 {
  font-size: 19px;
  font-weight: 600;
}

.post-body strong {
  color: var(--text);
  font-weight: 600;
}

.post-body a {
  color: var(--teal-d);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 0.5px;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.3rem 1.4rem;
}

.post-body li {
  margin-bottom: 0.4rem;
}

/* ═══════════ CTA ═══════════ */
.post-cta {
  margin: 2.5rem 0 3.5rem;
  padding: 1.6rem 1.8rem;
  background: var(--surface);
  border: 1px solid var(--teal-b);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.post-cta .cta-text {
  font-size: 14px;
  color: var(--text-sec);
  flex: 1;
  min-width: 240px;
}
.post-cta .cta-text strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  background: #AAE8E8;
  color: #1a5f5f;
  border: 0.5px solid #7dd4d4;
  border-radius: 30px;
  padding: 11px 22px;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ═══════════ RELATED ═══════════ */
.related {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 0.5px solid var(--border);
}
.related-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.related-card {
  display: block;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}
.related-card:hover {
  border-color: var(--border-mid);
  transform: translateY(-1px);
}
.related-card .rc-tag {
  font-size: 10px;
  color: var(--text-ter);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.related-card .rc-title {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text);
}

/* ═══════════ BLOG INDEX ═══════════ */
.blog-hero {
  padding: 3rem 0 2rem;
  text-align: center;
}
.blog-hero .eyebrow {
  font-size: 11px;
  color: var(--text-ter);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.6rem;
}
.blog-hero h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 4.5vw, 38px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 0.8rem;
  letter-spacing: -0.01em;
}
.blog-hero p {
  font-size: 15px;
  color: var(--text-sec);
  max-width: 600px;
  margin: 0 auto;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.4rem;
  padding: 2rem 0 4rem;
}

.blog-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.blog-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-mid);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}
.blog-card-img {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}
.blog-card-body {
  padding: 1.2rem 1.3rem 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.blog-card-body .meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.7rem;
}
.blog-card-body h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 0.6rem;
}
.blog-card-body p.excerpt {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.55;
  margin-bottom: 0.9rem;
  flex: 1;
}
.blog-card-body .read {
  font-size: 12px;
  font-weight: 500;
  color: var(--teal-d);
}

/* ═══════════ FOOTER ═══════════ */
footer.blog-footer {
  background: var(--surface);
  border-top: 0.5px solid var(--border);
  padding: 1.5rem 2rem;
  margin-top: 2rem;
}
.blog-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.blog-footer .f-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--text-ter);
}
.blog-footer .f-brand svg {
  height: 18px;
  width: auto;
  display: block;
}
.blog-footer .f-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.blog-footer .f-links a {
  font-size: 11px;
  color: var(--text-ter);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ═══════════ BACK TO TOP ═══════════ */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid var(--border-mid);
  color: var(--text-sec);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, background 0.15s, color 0.15s;
  pointer-events: none;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover {
  background: var(--soft);
  color: var(--text);
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 640px) {
  .blog-topbar { display: none; }
  body { padding-top: 68px; }
  .blog-nav { top: 0; height: 68px; padding: 0 1.2rem; }
  .nav-profil-group { display: none; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }
  .mobile-menu { top: 68px; max-height: calc(100vh - 68px); }
  .container, .container-wide { padding: 0 1.2rem; }
  .post-cta { padding: 1.3rem 1.4rem; }
  article.post { padding: 0.5rem 0 2rem; }
  .post-body { font-size: 15px; }
}

@media (min-width: 641px) and (max-width: 960px) {
  .nav-profil-group { display: none; }
  .nav-links { gap: 2px; }
  .nav-link { font-size: 11px; padding: 5px 8px; }
  .nav-cta { font-size: 11px; padding: 6px 12px; margin-left: 4px; }
}
