/*
Theme Name: job50
Theme URI: https://job.50dar.com/
Author: 50dar
Description: Thème de job.50dar.com — offres d'emploi, concours et stages au Maroc. Mise en page éditoriale à deux colonnes, fiche d'offre, articles en français ou en arabe (RTL par article).
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: job50
*/

:root {
  --c-primary: #0b3d91;
  --c-primary-d: #082c69;
  --c-accent: #e8590c;
  --c-accent-d: #c2480a;
  --c-text: #171c28;
  --c-muted: #667085;
  --c-line: #e5e8ee;
  --c-soft: #f5f7fa;
  --c-bg: #fff;
  --c-ok: #177a46;
  --c-warn: #b54708;
  --radius: 10px;
  --wrap: 1200px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Arial, "Noto Sans Arabic", "Noto Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.65; color: var(--c-text); background: var(--c-bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border: 2px solid var(--c-primary); border-radius: 6px; }
.skip:focus { inset-inline-start: 12px; }

/* ---------- En-tête ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--c-line); position: relative; z-index: 50; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px 14px; }
.brand { font-size: 2.5rem; font-weight: 800; letter-spacing: -.035em; line-height: 1; color: var(--c-primary-d); display: inline-block; }
.brand:hover { text-decoration: none; }
.brand .b-accent { color: var(--c-accent); }
.custom-logo-link img { max-height: 56px; width: auto; }

.social { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 18px; }
.social a { display: grid; place-items: center; color: var(--c-text); }
.social a:hover { color: var(--c-accent); text-decoration: none; }

.nav-bar { border-top: 1px solid var(--c-line); background: #fff; }
.nav { display: flex; align-items: center; gap: 8px; min-height: 58px; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0 2px; }
.menu > li { position: relative; }
.menu a { display: block; padding: 16px 12px; font-weight: 700; color: var(--c-text); white-space: nowrap; }
.menu a:hover { color: var(--c-primary); text-decoration: none; }
.menu .current-menu-item > a, .menu .current-menu-ancestor > a, .menu .current-cat > a, .menu .current-menu-parent > a { color: var(--c-primary); box-shadow: inset 0 -3px 0 var(--c-accent); }
.menu .menu-item-has-children > a::after {
  content: ""; display: inline-block; margin-inline-start: 7px; padding: 2.5px;
  border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-3px);
}
.sub-menu {
  list-style: none; margin: 0; padding: 8px; position: absolute; inset-inline-start: 0; top: 100%;
  min-width: 230px; background: #fff; border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: 0 14px 34px rgba(16, 24, 40, .14); display: none; z-index: 60;
}
.menu li:hover > .sub-menu, .menu li:focus-within > .sub-menu { display: block; }
.sub-menu a { padding: 9px 12px; font-weight: 600; border-radius: 6px; box-shadow: none !important; }
.sub-menu a:hover { background: var(--c-soft); }

.nav-tools { margin-inline-start: auto; display: flex; align-items: center; gap: 14px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; color: var(--c-accent); cursor: pointer; border-radius: 50%; }
.icon-btn:hover { background: var(--c-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 20px;
  border: 0; border-radius: 6px; font: inherit; font-weight: 700; cursor: pointer; line-height: 1.2; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-cta { background: var(--c-accent); color: #fff; white-space: nowrap; }
.btn-cta:hover { background: var(--c-accent-d); color: #fff; }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-d); color: #fff; }
.btn-light { background: #fff; color: var(--c-primary-d); }
.btn-light:hover { background: #eef3fb; }

.search-panel { background: var(--c-soft); border-top: 1px solid var(--c-line); padding-block: 14px; }
.search-panel[hidden] { display: none; }
.searchform { display: flex; gap: 10px; }
.searchform input[type=search] {
  flex: 1; min-width: 0; padding: 11px 14px; border: 1px solid var(--c-line); border-radius: 6px; font: inherit; background: #fff; color: var(--c-text);
}

.burger { display: none; width: 42px; height: 42px; border: 0; background: transparent; cursor: pointer; padding: 10px; flex-direction: column; justify-content: center; gap: 5px; }
.burger span { display: block; height: 2px; background: var(--c-text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Publicité (vide tant qu'aucun code n'est saisi) ---------- */
.ad-slot { margin: 22px auto; text-align: center; background: var(--c-soft); border-radius: var(--radius); padding: 8px; min-height: 90px; overflow: hidden; }
.ad-label { display: block; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); margin-bottom: 4px; }

/* ---------- Une ---------- */
.hero { display: grid; grid-template-columns: 1.6fr 1fr 1fr; grid-template-rows: repeat(2, minmax(190px, 1fr)); gap: 14px; margin-block: 26px 14px; }
.hero--few { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-template-rows: none; }
.hero-item { position: relative; border-radius: var(--radius); overflow: hidden; color: #fff; display: flex; align-items: flex-end; isolation: isolate; min-height: 190px;
  background: linear-gradient(135deg, var(--tone-a), var(--tone-b)); }
.hero-item.is-main { grid-row: span 2; min-height: 400px; }
.hero-item .media { position: absolute; inset: 0; z-index: -2; }
.hero-item .media img { width: 100%; height: 100%; object-fit: cover; }
.hero-item .ghost { position: absolute; inset-inline-end: 14px; top: -6px; font-size: 8rem; font-weight: 800; line-height: 1; opacity: .13; }
.hero-item .ghost svg { width: 1em; height: 1em; stroke-width: 1.2; }
.tile svg { width: 34px; height: 34px; }
.hero-item::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(6, 16, 40, .86), rgba(6, 16, 40, .05) 72%); }
.hero-body { padding: 18px 20px; width: 100%; }
.hero-title { margin: 8px 0 0; font-size: 1.12rem; font-weight: 800; }
.is-main .hero-title { font-size: 1.9rem; }
.hero-title a { color: #fff; }
.hero-title a:hover { text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; }
.hero-item .chip { color: #ffd8bf; }
.hero-item .meta-line { color: #dbe5f5; margin: 8px 0 0; }

/* Teintes par rubrique (pastilles et fonds sans image) */
.tone-0 { --tone-a: #0b3d91; --tone-b: #2a6fd6; }
.tone-1 { --tone-a: #0f6b4b; --tone-b: #2aa377; }
.tone-2 { --tone-a: #7a2e8e; --tone-b: #b45ccf; }
.tone-3 { --tone-a: #b4380a; --tone-b: #ec7c3d; }
.tone-4 { --tone-a: #0a6c7a; --tone-b: #35a9bb; }
.tone-5 { --tone-a: #8a5a00; --tone-b: #d19a1f; }

.tile {
  width: 100%; height: 100%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.6rem; letter-spacing: .02em;
  background: linear-gradient(135deg, var(--tone-a), var(--tone-b));
}

.cat-row { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 14px 8px; }
.cat-row a { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1px solid var(--c-line); border-radius: 999px; color: var(--c-text); font-weight: 700; font-size: .92rem; background: #fff; }
.cat-row a:hover { border-color: var(--c-primary); color: var(--c-primary); text-decoration: none; }
.cat-row a span { background: var(--c-soft); border-radius: 999px; padding: 0 8px; font-size: .78rem; color: var(--c-muted); }

/* ---------- Mise en page à deux colonnes ---------- */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 44px; margin-block: 24px 10px; align-items: start; }
.main--narrow { max-width: 780px; margin: 30px auto; }
.section-title, .archive-head h1 { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 4px; }
.archive-head { margin-bottom: 4px; }
.archive-desc { color: var(--c-muted); margin: 4px 0 0; }
.empty { color: var(--c-muted); padding: 30px 0; }

/* ---------- Cartes de la liste ---------- */
.list { display: grid; }
.card { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 20px; padding: 18px 0; border-bottom: 1px solid var(--c-line); }
.card .thumb { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 10; background: var(--c-soft); align-self: start; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-title { font-size: 1.16rem; font-weight: 800; line-height: 1.38; margin: 6px 0 6px; text-align: start; }
.card-title a { color: var(--c-text); }
.card-title a:hover { color: var(--c-primary); text-decoration: none; }
.meta-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .84rem; color: var(--c-muted); }
.meta-line { margin: 0; font-size: .9rem; color: var(--c-muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.chip { display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--c-accent); }
a.chip:hover { text-decoration: underline; }

.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 1px 10px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge.open { background: #e8f6ee; color: var(--c-ok); }
.badge.soon { background: #fff1e6; color: var(--c-warn); }
.badge.closed { background: #eef0f4; color: var(--c-muted); }

.navigation.pagination { margin: 28px 0 6px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-numbers { display: inline-block; min-width: 40px; padding: 8px 12px; text-align: center; border: 1px solid var(--c-line); border-radius: 6px; color: var(--c-text); font-weight: 700; }
a.page-numbers:hover { border-color: var(--c-primary); text-decoration: none; color: var(--c-primary); }
.page-numbers.current { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.page-numbers.dots { border-color: transparent; }

/* ---------- Colonne latérale ---------- */
.sidebar { position: sticky; top: 16px; }
.widget { margin-bottom: 34px; }
.widget-title { font-size: 1.18rem; font-weight: 800; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 2px solid var(--c-line); position: relative; }
.widget-title::after { content: ""; position: absolute; inset-inline-start: 0; bottom: -2px; width: 70px; height: 2px; background: var(--c-accent); }
.mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.mini { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: start; }
.mini-thumb { display: block; border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--c-soft); }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-thumb .tile { font-size: 1.1rem; }
.mini-title { display: block; font-weight: 800; line-height: 1.35; color: var(--c-text); margin-bottom: 4px; text-align: start; }
.mini-title:hover { color: var(--c-primary); text-decoration: none; }
.mini .meta-line { font-size: .8rem; }

.cta-widget { background: linear-gradient(135deg, var(--c-primary-d), var(--c-primary)); color: #fff; border-radius: var(--radius); padding: 22px; }
.cta-widget h2 { margin: 0 0 6px; font-size: 1.2rem; }
.cta-widget p { margin: 0 0 14px; color: #d6e2f7; font-size: .95rem; }

.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--c-line); font-weight: 600; }
.cat-list a { color: var(--c-text); }
.cat-list a:hover { color: var(--c-primary); }

/* ---------- Article ---------- */
.crumbs { font-size: .88rem; color: var(--c-muted); margin-top: 6px; }
.crumbs a { color: var(--c-muted); }
.crumbs .sep { margin-inline: 8px; }
.single-head { margin-block: 14px 8px; }
.entry-title { font-size: clamp(1.8rem, 4.4vw, 2.9rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; margin: .3em 0 .35em; }
.entry-sub { font-size: 1.22rem; color: var(--c-muted); margin: 0 0 16px; line-height: 1.5; }
.byline { margin: 0; font-size: .92rem; color: var(--c-muted); display: flex; flex-wrap: wrap; gap: 4px 20px; }
.byline strong { color: var(--c-primary); }

.fiche { border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-soft); margin: 22px 0; overflow: hidden; }
.fiche-head { background: var(--c-primary); color: #fff; padding: 12px 18px; font-weight: 800; }
.fiche dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fiche dl > div { padding: 12px 18px; border-bottom: 1px solid var(--c-line); }
.fiche dt { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
.fiche dd { margin: 2px 0 0; font-weight: 700; }
.fiche-foot { padding: 16px 18px; background: #fff; }

.entry-content { font-size: 1.08rem; line-height: 1.85; overflow-wrap: anywhere; }
.entry-content[dir="rtl"] { font-size: 1.18rem; line-height: 2; }
.entry-content h2 { font-size: 1.55rem; margin: 1.7em 0 .5em; }
.entry-content h3 { font-size: 1.25rem; margin: 1.4em 0 .4em; }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; }
.entry-content li { margin-bottom: .4em; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: var(--radius); }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content th, .entry-content td { border: 1px solid var(--c-line); padding: 8px 12px; text-align: start; }

.notice { background: #fff8ec; border: 1px solid #f6dfb3; border-radius: var(--radius); padding: 14px 18px; color: #6d4a0c; font-size: .95rem; margin: 26px 0; }

.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 22px 0 8px; }
.share-label { font-weight: 700; color: var(--c-muted); margin-inline-end: 4px; }
.share a, .share button {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--c-line); border-radius: 999px;
  background: #fff; color: var(--c-text); font: inherit; font-size: .92rem; font-weight: 700; cursor: pointer;
}
.share a:hover, .share button:hover { border-color: var(--c-primary); color: var(--c-primary); text-decoration: none; }
.share svg { width: 18px; height: 18px; }

.related { margin-top: 36px; }
.not-found { text-align: center; padding-block: 50px; }
.nf-code { font-size: 5rem; font-weight: 800; color: var(--c-accent); margin: 0; line-height: 1; }
.not-found .searchform { max-width: 520px; margin: 22px auto; }

/* ---------- Pied de page ---------- */
.site-footer { background: #0d1b3a; color: #c9d4ea; margin-top: 60px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding-block: 48px 26px; }
.footer-brand { font-size: 2rem; font-weight: 800; letter-spacing: -.03em; color: #fff; margin: 0 0 10px; line-height: 1; }
.footer-brand span { color: #ff9c5e; }
.site-footer h4 { color: #fff; margin: 0 0 12px; font-size: 1.05rem; }
.site-footer a { color: #e6ecf7; }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .14); padding-block: 18px 26px; font-size: .86rem; color: #9fb0cc; display: grid; gap: 8px; }
.footer-bottom p { margin: 0; }

/* ---------- Adaptation aux écrans étroits ---------- */
@media (max-width: 1100px) {
  .page-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sidebar { position: static; }
}
@media (max-width: 1120px) {
  .burger { display: flex; }
  .nav { flex-wrap: wrap; }
  .nav .menu { display: none; order: 3; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 10px; }
  .nav-open .nav .menu { display: flex; }
  .menu a { padding: 12px 6px; white-space: normal; }
  .menu .current-menu-item > a, .menu .current-cat > a, .menu .current-menu-parent > a { box-shadow: none; }
  .sub-menu { display: block; position: static; box-shadow: none; border: 0; padding: 0 0 0 14px; min-width: 0; }
  .menu .menu-item-has-children > a::after { display: none; }
}
@media (max-width: 960px) {
  .top { padding-block: 14px 10px; }
  .brand { font-size: 2rem; }
  .hero { grid-template-columns: 1fr 1fr; grid-template-rows: none; }
  .hero-item.is-main { grid-column: 1 / -1; grid-row: auto; min-height: 300px; }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
}
@media (max-width: 640px) {
  .wrap { padding-inline: 16px; }
  .social { gap: 12px; }
  .social svg { width: 20px; height: 20px; }
  .hero { grid-template-columns: 1fr; gap: 10px; }
  .hero-item { min-height: 104px; }
  .hero-item.is-main { min-height: 260px; }
  .hero-item:not(.is-main) .ghost { font-size: 4.5rem; }
  .hero-item:not(.is-main) .hero-body { padding: 12px 16px; }
  .hero-item:not(.is-main) .hero-title { font-size: 1rem; }
  .is-main .hero-title { font-size: 1.5rem; }
  .card { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  .card-title { font-size: 1.05rem; }
  .fiche dl { grid-template-columns: 1fr; }
  .nav-tools .btn-cta { padding: 9px 14px; font-size: .9rem; }
  .searchform { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .site-header, .sidebar, .share, .site-footer, .ad-slot { display: none !important; }
  .page-grid { grid-template-columns: 1fr; }
}
