/*
Theme Name: Wazayf Jobs Theme
Description: قالب عرض الوظائف لموقع wazayf4u.com. العرض فقط؛ البيانات من إضافة Wazayf Jobs Core.
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.0
Author: Sheko
Text Domain: wazayf-jobs-theme
License: GPL-2.0-or-later
*/

/* ---------- Tokens (light mode only) ---------- */
:root {
	--wzt-primary: #0f5e5a;
	--wzt-primary-dark: #0a4643;
	--wzt-accent: #c97a0a;
	--wzt-text: #1d2430;
	--wzt-muted: #5b6573;
	--wzt-bg: #f6f7f9;
	--wzt-surface: #fff;
	--wzt-border: #e3e6ea;
	--wzt-radius: 10px;
	--wzt-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
	--wzt-font: "IBM Plex Sans Arabic", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
	--wzt-w: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--wzt-font); font-size: 1rem; line-height: 1.75; color: var(--wzt-text); background: var(--wzt-bg); }
img { max-width: 100%; height: auto; }
a { color: var(--wzt-primary); text-underline-offset: 3px; }
a:hover { color: var(--wzt-primary-dark); }
:focus-visible { outline: 3px solid var(--wzt-accent); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.35; margin-block: 0 .6em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.wzt-skip { position: absolute; inset-inline-start: 1rem; top: -100px; background: var(--wzt-surface); padding: .5rem 1rem; z-index: 100; border-radius: var(--wzt-radius); }
.wzt-skip:focus { top: 1rem; }
.wzt-container { max-width: var(--wzt-w); margin-inline: auto; padding-inline: 1rem; }
.wzt-main { min-height: 60vh; padding-block: 1.25rem 3rem; }
.wzt-main:focus { outline: none; }

/* ---------- Buttons & badges ---------- */
.wzt-btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .5rem 1.1rem; border: 1px solid var(--wzt-primary); border-radius: var(--wzt-radius); background: var(--wzt-surface); color: var(--wzt-primary); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.wzt-btn:hover { background: #eef6f5; }
.wzt-btn--primary { background: var(--wzt-primary); color: #fff; }
.wzt-btn--primary:hover { background: var(--wzt-primary-dark); color: #fff; }
.wzt-btn--ghost { border-color: var(--wzt-border); color: var(--wzt-text); }
.wzt-btn--block { width: 100%; }

.wzt-badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eceff3; color: #3d4652; }
.wzt-badge--active { background: #e3f4ea; color: #146c3a; }
.wzt-badge--expiring_soon { background: #fdf0dc; color: #8a5300; }
.wzt-badge--expired, .wzt-badge--withdrawn { background: #eceff3; color: #555e6b; }
.wzt-badge--suspicious { background: #fde8e8; color: #a11d1d; }
.wzt-badge--unverified, .wzt-badge--under_review { background: #e8eef8; color: #284a7e; }

.wzt-count { min-width: 2rem; padding: 0 .45rem; border-radius: 999px; background: #eef1f4; color: var(--wzt-muted); font-size: .8rem; text-align: center; }

.wzt-alert { margin-block: 1rem; padding: .8rem 1rem; border-radius: var(--wzt-radius); background: #e8eef8; color: #1f3b66; }
.wzt-alert--warn { background: #fde8e8; color: #7d1515; }
.wzt-alert--muted { background: #eceff3; color: #3d4652; }

/* ---------- Header / footer ---------- */
.wzt-header { background: var(--wzt-surface); border-bottom: 1px solid var(--wzt-border); position: sticky; top: 0; z-index: 50; }
.admin-bar .wzt-header { top: 32px; }
.wzt-header__inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; }
.wzt-brand__name { font-weight: 800; font-size: 1.25rem; color: var(--wzt-text); text-decoration: none; }
.wzt-brand img { max-height: 44px; width: auto; }
.wzt-nav { margin-inline-start: auto; }
.wzt-nav__list { display: flex; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.wzt-nav__list a { display: block; padding: .5rem .75rem; color: var(--wzt-text); text-decoration: none; border-radius: 8px; }
.wzt-nav__list a:hover, .wzt-nav__list .current-menu-item > a { background: #eef6f5; color: var(--wzt-primary); }
.wzt-nav__list .sub-menu { display: none; }
.wzt-menu-toggle { display: none; margin-inline-start: auto; min-width: 44px; min-height: 44px; border: 1px solid var(--wzt-border); border-radius: 8px; background: var(--wzt-surface); font-size: 1.25rem; cursor: pointer; }

.wzt-footer { background: #12202b; color: #cdd5de; padding-block: 2rem; font-size: .92rem; }
.wzt-footer a { color: #fff; }
.wzt-footer__menu { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; list-style: none; padding: 0; margin: 1rem 0; }
.wzt-footer__trust { max-width: 70ch; }

.wzt-breadcrumbs { font-size: .88rem; color: var(--wzt-muted); margin-block-end: 1rem; }

/* ---------- Ads (space reserved, no CLS) ---------- */
.wzt-ad { display: flex; align-items: center; justify-content: center; margin-block: 1.25rem; overflow: hidden; }
.wzt-cards > .wzt-ad { grid-column: 1 / -1; }

/* ---------- Hero & sections ---------- */
.wzt-hero { background: linear-gradient(180deg, #e9f3f2 0%, var(--wzt-bg) 100%); padding-block: 2.25rem 1.5rem; margin-block-start: -1.25rem; }
.wzt-hero h1 { max-width: 30ch; }
.wzt-hero__search { display: flex; gap: .5rem; flex-wrap: wrap; background: var(--wzt-surface); padding: .6rem; border-radius: calc(var(--wzt-radius) + 4px); box-shadow: var(--wzt-shadow); max-width: 820px; }
.wzt-hero__search input, .wzt-hero__search select, .wzt-filters__search input { flex: 1 1 220px; min-height: 44px; padding: .4rem .8rem; border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); font: inherit; background: #fff; }
.wzt-hero__search select { flex: 0 1 180px; }
.wzt-section { margin-block: 2rem; }
.wzt-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }

.wzt-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; list-style: none; padding: 0; margin: 0; }
.wzt-tiles a { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .9rem 1rem; background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); color: var(--wzt-text); text-decoration: none; font-weight: 600; }
.wzt-tiles a:hover { border-color: var(--wzt-primary); }

.wzt-logostrip { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .75rem; list-style: none; padding: 0; margin: 0; }
.wzt-logostrip a { display: flex; align-items: center; justify-content: center; padding: .75rem; background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); height: 88px; }
.wzt-logostrip img { max-height: 56px; width: auto; object-fit: contain; }

/* ---------- Listing ---------- */
.wzt-listing-head { margin-block-end: 1rem; }
.wzt-listing-head__count { color: var(--wzt-muted); margin: 0; }
.wzt-listing-tools { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-block-start: .75rem; }
.wzt-filters-toggle { display: none; }
.wzt-viewtoggle { display: inline-flex; border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); overflow: hidden; margin-inline-start: auto; }
.wzt-viewtoggle a { padding: .4rem .9rem; color: var(--wzt-text); text-decoration: none; background: var(--wzt-surface); }
.wzt-viewtoggle a[aria-current] { background: var(--wzt-primary); color: #fff; }

.wzt-listing { display: grid; grid-template-columns: 280px 1fr; gap: 1.5rem; align-items: start; }
.wzt-filters { background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); padding: 1rem; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.wzt-filters__head { display: flex; justify-content: space-between; align-items: baseline; }
.wzt-filters__head h2 { font-size: 1.05rem; }
.wzt-filters__search { display: flex; gap: .4rem; flex-wrap: wrap; margin-block-end: .75rem; }
.wzt-facet { border-top: 1px solid var(--wzt-border); padding-block: .5rem; }
.wzt-facet summary { cursor: pointer; font-weight: 700; padding-block: .3rem; }
.wzt-facet ul { list-style: none; margin: .25rem 0 0; padding: 0; }
.wzt-facet a, .wzt-facet__toggle a { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: 8px; color: var(--wzt-text); text-decoration: none; min-height: 36px; }
.wzt-facet a:hover, .wzt-facet__toggle a:hover { background: #f1f4f6; }
.wzt-facet a.is-active, .wzt-facet__toggle a.is-active { background: #e6f2f1; color: var(--wzt-primary); font-weight: 700; }

.wzt-cards { display: grid; gap: 1rem; }
.wzt-cards--grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.wzt-cards--list { grid-template-columns: 1fr; }
.wzt-card { display: flex; flex-direction: column; gap: .6rem; background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); padding: 1rem; box-shadow: var(--wzt-shadow); }
.wzt-card:hover { border-color: #b9d7d4; }
.wzt-card__head { display: flex; gap: .75rem; align-items: flex-start; }
.wzt-card__title { margin: 0; font-size: 1.02rem; }
.wzt-card__company { margin: 0; color: var(--wzt-muted); font-size: .9rem; }
.wzt-card__meta { display: flex; flex-wrap: wrap; gap: .25rem 1rem; list-style: none; margin: 0; padding: 0; color: var(--wzt-muted); font-size: .9rem; }
.wzt-ico { margin-inline-end: .25rem; }
.wzt-card__foot { display: flex; align-items: center; gap: .6rem; margin-block-start: auto; padding-block-start: .5rem; border-top: 1px solid var(--wzt-border); }
.wzt-card__date { color: var(--wzt-muted); font-size: .82rem; }
.wzt-card__foot .wzt-btn { margin-inline-start: auto; min-height: 40px; }
.wzt-cards--list .wzt-card { flex-direction: row; flex-wrap: wrap; align-items: center; }
.wzt-cards--list .wzt-card__head { flex: 1 1 320px; }
.wzt-cards--list .wzt-card__foot { border: 0; padding: 0; margin: 0; }

.wzt-logo { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--wzt-border); }
.wzt-logo--letter { display: inline-flex; align-items: center; justify-content: center; background: #e6f2f1; color: var(--wzt-primary); font-weight: 800; font-size: 1.2rem; }

.wzt-empty { padding: 2rem 1rem; text-align: center; }

.nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem; margin-block: 1.5rem; }
.nav-links .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding-inline: .6rem; border: 1px solid var(--wzt-border); border-radius: 8px; background: var(--wzt-surface); text-decoration: none; }
.nav-links .current { background: var(--wzt-primary); color: #fff; border-color: var(--wzt-primary); }

/* ---------- Single job ---------- */
.wzt-job { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.wzt-job__main, .wzt-article, .wzt-page { background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); padding: clamp(1rem, 2.5vw, 2rem); min-width: 0; }
.wzt-job__head { display: flex; gap: 1rem; align-items: flex-start; margin-block-end: 1rem; }
.wzt-job__head .wzt-logo { width: 64px; height: 64px; flex-basis: 64px; }
.wzt-job__sub { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin: 0; }
.wzt-facts dl, .wzt-infocard dl { margin: 0; }
.wzt-facts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .5rem; padding: 1rem; background: #f4f8f8; border: 1px solid #d9e8e6; border-radius: var(--wzt-radius); }
.wzt-facts dt, .wzt-infocard dt { font-size: .82rem; color: var(--wzt-muted); }
.wzt-facts dd, .wzt-infocard dd { margin: 0; font-weight: 600; }
.wzt-content { overflow-wrap: anywhere; }
.wzt-content table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.wzt-content td, .wzt-content th { border: 1px solid var(--wzt-border); padding: .4rem .6rem; }
.wzt-howto { margin-block: 1.5rem; padding: 1rem; border: 1px dashed #b9d7d4; border-radius: var(--wzt-radius); }
.wzt-provenance { border-top: 1px solid var(--wzt-border); padding-block-start: 1rem; color: var(--wzt-muted); font-size: .9rem; }
.wzt-provenance p { margin: .25rem 0; }
.wzt-job__side { position: sticky; top: 80px; }
.wzt-infocard { background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); padding: 1rem; display: grid; gap: .8rem; }
.wzt-infocard dl { display: grid; gap: .5rem; }
.wzt-infocard__company { font-weight: 600; }
.wzt-related { margin-block-start: 2rem; }
.wzt-applybar { display: none; }

/* ---------- Company ---------- */
.wzt-company-head { display: flex; gap: 1rem; align-items: center; background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); padding: 1.25rem; margin-block-end: 1.25rem; }
.wzt-company-head .wzt-logo { width: 88px; height: 88px; flex-basis: 88px; }
.wzt-company-head__links { display: flex; gap: 1rem; margin: 0; }
.wzt-companies { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; list-style: none; padding: 0; }
.wzt-companies a { display: flex; align-items: center; gap: .75rem; padding: .75rem; background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); color: var(--wzt-text); text-decoration: none; font-weight: 600; }

/* ---------- Articles ---------- */
.wzt-article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
.wzt-article-layout:has(.wzt-article-side) { grid-template-columns: minmax(0, 1fr) 300px; }
.wzt-article { max-width: 820px; }
.wzt-article__meta { color: var(--wzt-muted); font-size: .9rem; }
.wzt-article__thumb { margin: 0 0 1rem; }
.wzt-author { display: flex; gap: 1rem; margin-block-start: 2rem; padding: 1rem; background: #f4f8f8; border-radius: var(--wzt-radius); }
.wzt-author img { border-radius: 50%; }
.wzt-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.wzt-post-card { background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); overflow: hidden; }
.wzt-post-card img { display: block; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.wzt-post-card h3 { margin: .75rem 1rem .25rem; }
.wzt-post-card h3 a { color: var(--wzt-text); text-decoration: none; }
.wzt-post-card__date { margin: 0 1rem .9rem; color: var(--wzt-muted); font-size: .85rem; }
.wzt-comments { margin-block-start: 2rem; background: var(--wzt-surface); border: 1px solid var(--wzt-border); border-radius: var(--wzt-radius); padding: 1.25rem; }
.wzt-comments textarea, .wzt-comments input[type="text"], .wzt-comments input[type="email"], .wzt-comments input[type="url"] { width: 100%; padding: .5rem; border: 1px solid var(--wzt-border); border-radius: 8px; font: inherit; }

/* ---------- Mobile ---------- */
@media (max-width: 960px) {
	.wzt-listing, .wzt-job, .wzt-article-layout:has(.wzt-article-side) { grid-template-columns: 1fr; }
	.wzt-filters { display: none; position: static; max-height: none; }
	.wzt-filters.is-open { display: block; }
	.wzt-filters-toggle { display: inline-flex; }
	.wzt-job__side { position: static; }
	.wzt-job__side .wzt-infocard .wzt-btn--primary { display: none; }
	.wzt-applybar { display: flex; align-items: center; gap: .75rem; position: fixed; inset-inline: 0; bottom: 0; z-index: 60; padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom)); background: var(--wzt-surface); border-top: 1px solid var(--wzt-border); box-shadow: 0 -2px 8px rgba(16, 24, 40, .08); }
	.wzt-applybar__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
	.single-job .wzt-footer { padding-block-end: 5rem; }
}
@media (max-width: 782px) {
	.admin-bar .wzt-header { top: 46px; }
	.wzt-menu-toggle { display: inline-flex; align-items: center; justify-content: center; }
	.wzt-nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--wzt-surface); border-bottom: 1px solid var(--wzt-border); margin: 0; }
	.wzt-nav.is-open { display: block; }
	.wzt-nav__list { flex-direction: column; padding: .5rem 1rem 1rem; }
	.wzt-header__inner { position: relative; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print { .wzt-header, .wzt-footer, .wzt-ad, .wzt-applybar, .wzt-filters, .wzt-related { display: none !important; } }
