/* EWYB ESN - site public (clair, sobre) */
:root {
    --primary: #1a56db;
    --primary-ink: color-mix(in srgb, var(--primary) 82%, #000);
    --primary-soft: color-mix(in srgb, var(--primary) 9%, #fff);
    --ink: #111827;
    --text: #374151;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #ffffff;
    --bg-alt: #f7f8fa;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-lg: 0 12px 32px -12px rgba(16, 24, 40, .18);
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[dir="rtl"] { --font: "Noto Sans Arabic", "Inter", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.6; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .6em; font-weight: 650; letter-spacing: -.01em; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; }
h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.wrap { width: 100%; max-width: 1160px; margin-inline: auto; padding-inline: 20px; }
.narrow { max-width: 820px; }
.center { text-align: center; }
.skip { position: absolute; inset-inline-start: -999px; }
.skip:focus { inset-inline-start: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 100; border-radius: 8px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; background: var(--primary); color: #fff; border: 1px solid var(--primary);
       padding: .65em 1.2em; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, box-shadow .15s, transform .05s; }
.btn:hover { background: var(--primary-ink); text-decoration: none; box-shadow: var(--shadow); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: .45em 1em; font-size: .9rem; }
.btn-lg { padding: .8em 1.6em; font-size: 1.02rem; }
.btn-ghost { background: #fff; color: var(--primary); border-color: var(--line); }
.btn-ghost:hover { background: var(--primary-soft); border-color: var(--primary-soft); }
.btn-light { background: #fff; color: var(--primary); border-color: #fff; }
.btn-light:hover { background: #f1f5ff; }
.link-arrow { font-weight: 600; color: var(--primary); white-space: nowrap; }
.link-arrow::after { content: " > "; }
[dir="rtl"] .link-arrow::after { content: " ←"; }

/* En-tête */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 700; }
.nav { display: flex; align-items: center; gap: 24px; flex: 1; }
.nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; flex: 1; }
.nav ul a { display: block; padding: 8px 12px; border-radius: 8px; color: var(--text); font-weight: 500; }
.nav ul a:hover { background: var(--bg-alt); text-decoration: none; color: var(--ink); }
.nav ul a.active { color: var(--primary); background: var(--primary-soft); }
.nav-actions { display: flex; align-items: center; gap: 14px; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.lang-switch a { padding: 3px 9px; border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.lang-switch a.on { background: var(--ink); color: #fff; }
.lang-switch a:hover { text-decoration: none; }
.nav-toggle { display: none; margin-inline-start: auto; background: none; border: 0; width: 42px; height: 42px; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--ink); margin: 5px 0; border-radius: 2px; transition: .2s; }

@media (max-width: 920px) {
    .nav-toggle { display: block; }
    .nav { display: none; position: absolute; top: 68px; inset-inline: 0; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 12px 20px 20px; box-shadow: var(--shadow-lg); }
    .nav.open { display: flex; }
    .nav ul { flex-direction: column; }
    .nav-actions { justify-content: space-between; }
}

/* Hero */
.hero { background: radial-gradient(1200px 400px at 85% -10%, var(--primary-soft), transparent), linear-gradient(180deg, #fff, var(--bg-alt)); border-bottom: 1px solid var(--line); }
.hero-inner { padding-block: clamp(56px, 10vw, 120px); max-width: 900px; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 720px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* Sections */
.section { padding-block: clamp(40px, 7vw, 80px); }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { margin: 0 0 .2em; }
.section-head p { margin: 0; }
.page-head { padding-block: clamp(40px, 7vw, 72px) clamp(28px, 4vw, 40px); background: linear-gradient(180deg, var(--bg-alt), #fff); border-bottom: 1px solid var(--line); }
.page-head .back { display: inline-block; margin-bottom: 14px; font-weight: 500; }
.page-head .badges { margin-bottom: 12px; }
.content { padding-block: 40px 64px; }
.home-content { padding-block: 56px 24px; }

/* Contenu riche */
.prose { font-size: 1.05rem; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol { padding-inline-start: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.4em 0; padding: .4em 1.2em; border-inline-start: 4px solid var(--primary); background: var(--bg-alt); border-radius: 0 8px 8px 0; }
.prose pre { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 10px; overflow: auto; direction: ltr; }
.prose img { border-radius: 10px; }
.prose table { width: 100%; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: start; }

/* Blocs utilisables dans l'éditeur */
.block { margin-bottom: 48px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.cards .card h3 { color: var(--primary); }
.cards .card p:last-child { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; text-align: center; background: var(--ink); color: #fff; border-radius: var(--radius); padding: 32px 20px; }
.stats strong { display: block; font-size: 2.4rem; font-weight: 700; color: #fff; }
.stats span { color: #cbd5e1; }

/* Offres */
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 500; background: #f3f4f6; color: #374151; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.job-list { display: grid; gap: 14px; }
.job-card { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; color: inherit; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; }
.job-card:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.job-card h3 { margin: 0; color: var(--ink); }
.job-card p { margin: 0; }
.job-card.featured { border-inline-start: 4px solid var(--primary); }
.job-card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; gap: 12px; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto auto; gap: 10px; align-items: center; margin-top: 24px; background: #fff; border: 1px solid var(--line); padding: 10px; border-radius: 16px; box-shadow: var(--shadow); }
@media (max-width: 860px) { .filters { grid-template-columns: 1fr 1fr; } .filters input[type=search] { grid-column: 1 / -1; } }
.results-head { display: flex; justify-content: space-between; margin-bottom: 16px; }
.job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: start; }
.job-facts { position: sticky; top: 92px; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.job-facts dl { margin: 0 0 16px; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; }
.job-facts dt { color: var(--muted); font-size: .9rem; }
.job-facts dd { margin: 0; font-weight: 600; color: var(--ink); text-align: end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chips span { background: #fff; border: 1px solid var(--line); padding: 3px 10px; border-radius: 8px; font-size: .85rem; }
@media (max-width: 900px) { .job-layout { grid-template-columns: 1fr; } .job-facts { position: static; } }

/* Blog */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 24px; }
.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.post-card:hover { text-decoration: none; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.post-cover { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--primary-soft), #eef2ff) center / cover no-repeat; display: grid; place-items: center; }
.post-cover span { font-size: 3rem; font-weight: 700; color: color-mix(in srgb, var(--primary) 45%, #fff); }
.post-body { padding: 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.post-body h3 { margin: 0; }
.post-body p { margin: 0 0 8px; }
.post-body .link-arrow { margin-top: auto; }
.post-hero { width: 100%; border-radius: var(--radius); margin-top: 28px; }

/* Bandeau d'appel */
.cta-band { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; background: var(--primary); color: #e8efff; border-radius: 20px; padding: clamp(28px, 4vw, 44px); }
.cta-band h2 { color: #fff; margin-bottom: .3em; }
.cta-band p { margin: 0; max-width: 620px; }
.cta-band.soft { background: var(--primary-soft); color: var(--text); margin-top: 48px; }
.cta-band.soft h2 { color: var(--ink); }

/* Formulaires */
.form { display: grid; gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
label { display: grid; gap: 6px; font-weight: 500; color: var(--ink); font-size: .95rem; }
input, select, textarea { font: inherit; color: var(--ink); background: #fff; border: 1px solid #d1d5db; border-radius: 10px; padding: .65em .8em; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; margin-top: 2px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--text); }
.filters label.check { align-items: center; white-space: nowrap; }
label small { color: var(--muted); font-weight: 400; }
.file input { padding: .5em; background: var(--bg-alt); border-style: dashed; }
.field-error { color: #b42318; font-size: .85rem; font-weight: 500; margin: 0; }
.hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 18px; border: 1px solid; }
.alert.success { background: #ecfdf3; border-color: #abefc6; color: #067647; }
.alert.error { background: #fef3f2; border-color: #fecdca; color: #b42318; }
.alert.info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 40px; align-items: start; }
.contact-aside hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
@media (max-width: 900px) { .contact-layout { grid-template-columns: 1fr; } }

.empty { padding: 48px 24px; text-align: center; color: var(--muted); background: var(--bg-alt); border: 1px dashed var(--line); border-radius: var(--radius); }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 32px; }
.pagination a { padding: 8px 16px; border: 1px solid var(--line); border-radius: 999px; }
.big-404 { font-size: 6rem; font-weight: 800; color: var(--primary-soft); -webkit-text-stroke: 2px var(--primary); margin: 0; line-height: 1; }

/* Pied de page */
.site-footer { background: #0b1220; color: #cbd5e1; margin-top: 0; }
.site-footer .brand { color: #fff; }
.site-footer .muted { color: #94a3b8; }
.site-footer h4 { color: #fff; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; padding-block: 56px 32px; }
.footer-grid p { margin-top: 14px; max-width: 420px; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; border-top: 1px solid #1e293b; padding-block: 20px; font-size: .875rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
