/*
Theme Name: Catalogue ijob
Theme URI: https://catalogue.ijob.ma/
Description: Thème pour catalogue.ijob.ma : pages enseignes (/bim/), une page par catalogue daté (/bim/catalogue-bim-2-octobre-2026/), visionneuse de pages, emplacements AdSense.
Version: 1.3.1
Requires at least: 6.0
Requires PHP: 7.4
Author: ijob.ma
Text Domain: catalogue-ijob
*/

:root {
	--ink: #15171A;
	--ink-2: #3A3F45;
	--muted: #5A5F66;
	--line: #E3E5E0;
	--line-2: #C9CCC5;
	--ground: #FFFFFF;
	--surface: #F3F4F1;
	--accent: #0B6E4F;
	--accent-dark: #08523B;
	--accent-soft: #F2F8F5;
	--flag: #FFD23F;
	--wa: #25603F;
	--radius: 10px;
	--display: Archivo, "Helvetica Neue", Arial, sans-serif;
	--body: "Source Sans 3", "Segoe UI", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.5; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; margin: 0; }
h1 { font-weight: 800; font-size: clamp(28px, 4.2vw, 42px); }
h2 { font-weight: 700; font-size: clamp(22px, 2.6vw, 28px); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.cij-wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
@media (min-width: 700px) { .cij-wrap { padding-inline: 24px; } }
.cij-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cij-skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; }
.cij-skip:focus { left: 8px; }

/* Header */
.cij-header { border-bottom: 1px solid var(--line); background: var(--ground); position: relative; z-index: 20; }
.cij-header__in { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; min-height: 64px; }
.cij-logo { font-family: var(--display); font-weight: 800; font-size: 21px; color: var(--ink); text-decoration: none; }
.cij-logo span { color: var(--accent); }
.cij-logo--light { color: #fff; }
.cij-logo--light span { color: #7FD3B1; }
.custom-logo-link img { max-height: 44px; width: auto; }
.cij-menu-toggle { margin-left: auto; width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; }
.cij-nav { display: none; width: 100%; padding-bottom: 12px; }
.cij-nav.is-open { display: block; }
.cij-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cij-menu a { display: block; padding: 11px 0; color: var(--ink); text-decoration: none; font-weight: 600; }
.cij-menu a[aria-current], .cij-menu .current-menu-item > a { color: var(--accent); }
@media (min-width: 900px) {
	.cij-menu-toggle { display: none; }
	.cij-nav { display: block; width: auto; padding: 0; }
	.cij-menu { flex-direction: row; flex-wrap: wrap; gap: 0 22px; }
	.cij-menu a { padding: 20px 0; border-bottom: 2px solid transparent; }
	.cij-menu a[aria-current], .cij-menu .current-menu-item > a { border-bottom-color: var(--accent); }
}

/* Hero + search */
.cij-hero { background: var(--surface); }
.cij-hero__in { padding-block: 40px 36px; display: flex; flex-direction: column; gap: 16px; }
.cij-hero h1 { max-width: 760px; }
.cij-lead { margin: 0; font-size: 18px; color: #4B5057; max-width: 680px; }
.cij-lead p { margin: 0 0 8px; }
.cij-search { display: flex; flex-wrap: wrap; gap: 8px; max-width: 620px; }
.cij-search input { flex: 1 1 260px; min-width: 0; height: 52px; padding: 0 16px; border: 1.5px solid var(--line-2); border-radius: var(--radius); font: inherit; background: #fff; }
.cij-search button, .cij-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--radius); background: var(--accent); color: #fff; font-family: var(--display); font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; }
.cij-search button { height: 52px; }
.cij-search button:hover, .cij-btn:hover { background: var(--accent-dark); color: #fff; }
.cij-search--inline { margin-bottom: 28px; }
.cij-btn--dark { background: var(--ink); }
.cij-btn--dark:hover { background: #000; }
.cij-btn--wa { background: var(--wa); }
.cij-btn--wa:hover { background: #1B4A30; }
.cij-btn--ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); }
.cij-btn--ghost:hover { background: var(--surface); color: var(--ink); }

/* Layout */
.cij-main { padding-block: 28px 56px; display: flex; flex-direction: column; gap: 40px; }
.cij-narrow { max-width: 760px; }
.cij-layout { display: flex; flex-wrap: wrap; gap: 40px; padding-block: 20px 56px; }
.cij-layout__main { flex: 999 1 600px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.cij-layout__side { flex: 1 1 300px; display: flex; flex-direction: column; gap: 24px; }
.cij-section { display: flex; flex-direction: column; gap: 16px; }
.cij-section__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px; }
.cij-section__head a { font-weight: 600; }
.cij-crumbs { font-size: 14px; color: var(--muted); }
.cij-pagehead { display: flex; flex-direction: column; gap: 10px; }
.cij-pagehead--row { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 24px; }
.cij-pagehead--row > div { display: flex; flex-direction: column; gap: 8px; max-width: 780px; }
.cij-note { margin: 0; font-weight: 600; color: var(--accent-dark); }
.cij-empty { color: var(--muted); }
.cij-alert { margin: 0; padding: 14px 16px; border-radius: var(--radius); background: #FFF6D6; border: 1px solid #F0D98A; }

/* Badges */
.cij-badge { display: inline-block; background: var(--flag); color: var(--ink); font-weight: 700; font-size: 12px; padding: 4px 9px; border-radius: 6px; }
.cij-badge--upcoming { background: #DCE7F7; }
.cij-badge--expired { background: var(--surface); color: var(--muted); }
.cij-badge--lg { font-size: 14px; padding: 6px 12px; }

/* Cards */
.cij-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px 16px; }
@media (min-width: 700px) { .cij-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px 20px; } }
.cij-card { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; }
.cij-card:hover { color: var(--ink); }
.cij-card:hover .cij-card__title { color: var(--accent); }
.cij-card__cover { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.cij-card__cover .cij-badge { position: absolute; top: 10px; left: 10px; }
.cij-cover-img { width: 100%; height: 100%; object-fit: cover; }
.cij-cover-fallback { display: flex; align-items: flex-end; width: 100%; height: 100%; padding: 14px; font-family: var(--display); font-weight: 800; font-size: 22px; color: #fff; }
.cij-card__title { font-weight: 600; font-size: 16px; line-height: 1.3; margin-top: 4px; }
.cij-card__meta { font-size: 14px; color: var(--muted); }

/* Stores */
.cij-stores { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cij-store { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.cij-store:hover { border-color: var(--accent); color: var(--ink); }
.cij-store__name { font-weight: 700; }
.cij-store__type { font-size: 13px; color: var(--muted); }
.cij-stores--compact .cij-store { min-height: 44px; padding: 8px 14px; }

.cij-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; border-top: 1px solid var(--line); padding-top: 32px; }
.cij-info > div { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.cij-info h2 { font-size: 22px; }
.cij-info p { margin: 0; color: var(--ink-2); }

/* Store hub */
.cij-featured { display: flex; flex-wrap: wrap; gap: 24px; padding: 20px; border: 1.5px solid var(--accent); border-radius: 14px; background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.cij-featured:hover { color: var(--ink); }
.cij-featured__cover { flex: 0 0 180px; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.cij-featured__body { flex: 1 1 260px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 10px; }
.cij-featured__title { font-family: var(--display); font-weight: 700; font-size: 25px; line-height: 1.2; }
.cij-featured__meta { color: #4B5057; }
.cij-month { font-family: var(--body); font-size: 17px; font-weight: 700; color: #4B5057; margin-top: 8px; }
.cij-archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cij-archive__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; min-height: 44px; }
.cij-archive__item:hover { border-color: var(--accent); color: var(--ink); }
.cij-archive__thumb { flex: none; width: 36px; height: 48px; border-radius: 4px; overflow: hidden; background: var(--surface); }
.cij-archive__thumb .cij-cover-fallback { font-size: 0; padding: 0; }
.cij-faq details { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.cij-faq summary { font-weight: 600; cursor: pointer; }
.cij-faq details p { margin: 10px 0 0; color: #4B5057; }

/* Sidebar */
.cij-box { border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.cij-box p { margin: 0; }
.cij-box__title { font-family: var(--display); font-weight: 700; font-size: 18px; margin: 0 0 4px; }
.cij-side-links { display: flex; flex-direction: column; }
.cij-side-links a { padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }

/* Viewer */
.cij-viewer { display: flex; flex-direction: column; gap: 14px; }
.cij-viewer__stage { display: flex; flex-direction: column; gap: 16px; background: var(--surface); border-radius: 14px; padding: 12px; }
.cij-viewer__page { margin: 0; }
.cij-viewer__page img { width: 100%; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.cij-viewer__page figcaption { font-size: 13px; color: var(--muted); text-align: center; padding-top: 6px; }
.cij-viewer__zoom { display: block; cursor: zoom-in; }
.cij-viewer__bar, .cij-viewer__thumbs { display: none; }

.cij-viewer.is-js .cij-viewer__stage { flex-direction: row; justify-content: center; align-items: flex-start; gap: 12px; padding: 16px; min-height: 300px; }
.cij-viewer.is-js .cij-viewer__page { flex: 0 1 460px; min-width: 0; }
.cij-viewer.is-js .cij-viewer__page[hidden] { display: none; }
.cij-viewer.is-js .cij-viewer__page figcaption { display: none; }
@media (min-width: 900px) { .cij-viewer.is-js .cij-viewer__stage { padding: 24px; } }
.cij-viewer.is-js .cij-viewer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 12px; }
.cij-viewer.is-js .cij-viewer__thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-behavior: smooth; }
.cij-viewer__count { font-weight: 700; min-width: 90px; text-align: center; }
.cij-round { width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid var(--line-2); background: #fff; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cij-round:hover { border-color: var(--ink); }
.cij-viewer__thumbs button { position: relative; flex: none; width: 56px; height: 74px; padding: 0; border: 1px solid var(--line-2); border-radius: 4px; background: #fff; overflow: hidden; cursor: pointer; }
.cij-viewer__thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.cij-viewer__thumbs button span { position: absolute; right: 2px; bottom: 2px; font-size: 11px; background: rgba(21,23,26,.8); color: #fff; padding: 0 4px; border-radius: 3px; }
.cij-viewer__thumbs button[aria-current] { border: 2px solid var(--accent); }

.cij-viewer:fullscreen, .cij-viewer.is-pseudo-full { background: #111; padding: 12px; overflow: auto; }
.cij-viewer.is-pseudo-full { position: fixed; inset: 0; z-index: 1000; }
.cij-viewer:fullscreen .cij-viewer__stage, .cij-viewer.is-pseudo-full .cij-viewer__stage { background: transparent; flex: 1; align-items: center; }
.cij-viewer:fullscreen .cij-viewer__page img { max-height: calc(100vh - 170px); width: auto; margin: 0 auto; }
.cij-viewer:fullscreen .cij-viewer__page.is-zoomed { flex-basis: 100%; }
.cij-viewer:fullscreen .cij-viewer__page.is-zoomed img { max-height: none; width: 100%; cursor: zoom-out; }
.cij-viewer:fullscreen .cij-viewer__count { color: #fff; }

/* Deals */
.cij-deals { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.cij-deal { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.cij-deal__cat { font-size: 13px; color: var(--muted); }
.cij-deal__name { font-weight: 600; }
.cij-deal__price { font-family: var(--display); font-weight: 800; font-size: 20px; color: var(--accent); }
.cij-deal__page { font-size: 14px; font-weight: 600; padding: 6px 0; }

.cij-prose { line-height: 1.65; color: var(--ink-2); }
.cij-prose h2, .cij-prose h3 { color: var(--ink); margin: 1.2em 0 .5em; }
.cij-prose p { margin: 0 0 1em; }

.cij-editions { display: flex; flex-wrap: wrap; gap: 12px; }
.cij-editions a { flex: 1 1 240px; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.cij-editions small { color: var(--muted); font-weight: 400; }
.cij-editions__next { text-align: right; }

/* Ads: keep clear space so they never touch navigation buttons. */
.cij-ad { display: flex; justify-content: center; align-items: center; min-height: 90px; overflow: hidden; }
.cij-ad--spaced { margin-block: 12px; }
.cij-ad--side { min-height: 250px; }
@media (min-width: 1000px) { .cij-ad--side { position: sticky; top: 16px; min-height: 600px; } }
.cij-ad--fullrow { grid-column: 1 / -1; }
.cij-ad--intext { margin: 8px 0 20px; }
.cij-ad--footer { margin: 0 0 32px; }
.cij-ad--dev-desktop { display: none; }
@media (min-width: 900px) {
	.cij-ad--dev-desktop { display: flex; }
	.cij-ad--dev-mobile { display: none; }
}
.cij-ad > ins { width: 100%; }
.cij-ad--empty a { color: inherit; }
.cij-ad--empty { border: 1.5px dashed #B9BDB5; border-radius: 8px; color: var(--muted); font-size: 14px; text-align: center; padding: 16px; flex-direction: column; }

/* Pagination */
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-links .page-numbers { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; padding: 0 14px; justify-content: center; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-weight: 600; }
.nav-links .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* Footer */
.cij-footer { background: var(--ink); color: #C9CCC5; font-size: 14px; }
.cij-footer a { color: #E6E8E3; }
.cij-footer__in { padding-block: 36px; display: flex; flex-direction: column; gap: 20px; }
.cij-footer__brand p { margin: 8px 0 0; max-width: 640px; }
.cij-footer__stores { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cij-footer__stores a { text-decoration: none; padding: 6px 0; }
.cij-footer__menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cij-footer__copy { margin: 0; color: #9DA29A; }
