/*
Theme Name: تسجيل
Theme URI: https://tasjeel-sa.com
Description: Saudi & Gulf calculators, payday dates and registration guides.
Version: 1.0.0
Requires PHP: 8.0
Text Domain: tasjeel
*/

:root {
	--bg: #F3F6F4;
	--surface: #FFFFFF;
	--ink: #12201A;
	--muted: #56675F;
	--line: #D6E0DA;
	--green: #0B6B4D;
	--green-ink: #FFFFFF;
	--slip: #08402F;
	--slip-ink: #EAF5EF;
	--slip-muted: #9EC9B4;
	--gold: #D9A21B;
	--gold-soft: #FFF3D3;
	--warn: #B3261E;
	--focus: #1D7FD8;
	--r-s: 6px;
	--r-m: 12px;
	--font-ui: "Readex Pro", system-ui, "Segoe UI", Tahoma, sans-serif;
	--font-text: "Noto Naskh Arabic", "Readex Pro", Tahoma, serif;
	--wrap: 1160px;
	color-scheme: light;
}
@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0E1613;
		--surface: #15201B;
		--ink: #E5EEE9;
		--muted: #9AAFA5;
		--line: #26362F;
		--green: #3DBE8C;
		--green-ink: #062A1E;
		--slip: #0A2F23;
		--slip-ink: #E5F4EC;
		--slip-muted: #8FC2AA;
		--gold: #E8B83A;
		--gold-soft: #2E2711;
		--warn: #FF8A80;
		color-scheme: dark;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 400 1rem/1.7 var(--font-ui);
	-webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.35; font-weight: 600; margin: 0 0 .5em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tj-skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--green); color: var(--green-ink); padding: 8px 14px; border-radius: var(--r-s); z-index: 99; }
.tj-skip:focus { top: 8px; }
.tj-wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 16px; }
.tj-ic { width: 22px; height: 22px; flex: none; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
/* Not sticky: Auto ads sometimes place a unit inside the header, and a sticky
   300px ad would cover the page. Such a unit is moved below the header row. */
.tj-head { background: var(--surface); border-bottom: 1px solid var(--line); }
.tj-head__in { display: flex; align-items: center; gap: 20px; min-height: 64px; flex-wrap: wrap; }
.tj-head__in > .google-auto-placed { order: 99; flex: 0 0 100%; margin: 0 0 12px; }
.tj-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.tj-logo__mark {
	display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
	background: var(--green); color: var(--green-ink); font-weight: 700; font-size: 1.35rem; line-height: 1;
}
.tj-logo__name { font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; }
.tj-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tj-nav::-webkit-scrollbar { display: none; }
.tj-nav a {
	white-space: nowrap; padding: 8px 12px; border-radius: var(--r-s);
	color: var(--ink); text-decoration: none; font-weight: 500; font-size: .95rem;
}
.tj-nav a:hover { background: var(--bg); }
.tj-nav a[aria-current] { background: var(--bg); color: var(--green); }
.tj-search { margin-inline-start: auto; display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding-inline: 14px 4px; }
.tj-search input { border: 0; background: none; font: inherit; color: var(--ink); width: 210px; padding: 8px 0; }
.tj-search input:focus { outline: none; }
.tj-search:focus-within { border-color: var(--green); }
.tj-search button { border: 0; background: none; color: var(--muted); padding: 6px; cursor: pointer; display: grid; }
@media (max-width: 760px) {
	.tj-head__in { gap: 8px 12px; padding-block: 10px; }
	.tj-nav { order: 3; width: calc(100% + 32px); margin-inline: -16px; padding-inline: 12px; }
	.tj-search { flex: 1; min-width: 0; }
	.tj-search input { width: 100%; }
}

/* ---------- home hero + live board ---------- */
.tj-hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.tj-hero__in { display: grid; grid-template-columns: 1fr minmax(0, 470px); gap: 40px; align-items: center; padding-block: 44px; }
.tj-hero h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.75rem); font-weight: 700; letter-spacing: -.015em; max-width: 16ch; margin-bottom: 14px; }
.tj-hero p { color: var(--muted); max-width: 52ch; margin: 0 0 14px; font-size: 1.05rem; }
.tj-hero__today { display: inline-block; background: var(--gold-soft); color: var(--ink); padding: 6px 12px; border-radius: var(--r-s); font-size: .95rem !important; }
.tj-board { background: var(--slip); color: var(--slip-ink); border-radius: var(--r-m); padding: 6px 0; position: relative; }
.tj-board__head { padding: 12px 20px 8px; color: var(--slip-muted); font-size: .9rem; }
.tj-board ol { list-style: none; margin: 0; padding: 0; }
.tj-board li + li { border-top: 1px dashed rgba(255, 255, 255, .16); }
.tj-board a { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name left" "date left"; gap: 0 12px; padding: 12px 20px; color: inherit; text-decoration: none; }
.tj-board a:hover { background: rgba(255, 255, 255, .05); }
.tj-board__name { grid-area: name; font-weight: 600; }
.tj-board__date { grid-area: date; color: var(--slip-muted); font-size: .88rem; }
.tj-board__left { grid-area: left; align-self: center; text-align: center; min-width: 64px; }
.tj-board__left b { display: block; font-size: 1.9rem; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tj-board__left small { color: var(--slip-muted); }
.tj-board li.is-today b { color: var(--gold); font-size: 1.3rem; }
@media (max-width: 860px) {
	.tj-hero__in { grid-template-columns: 1fr; gap: 24px; padding-block: 28px; }
}

/* ---------- link lists (hubs, home, related) ---------- */
.tj-list { list-style: none; margin: 0 0 24px; padding: 0; border-top: 1px solid var(--line); }
.tj-list li { border-bottom: 1px solid var(--line); }
.tj-list a { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 14px 4px; text-decoration: none; color: var(--ink); align-items: start; }
.tj-list a:hover .tj-list__t { color: var(--green); text-decoration: underline; }
.tj-list .tj-ic { grid-row: span 2; color: var(--green); margin-top: 3px; }
.tj-list__t { font-weight: 600; }
.tj-list__d { color: var(--muted); font-size: .9rem; grid-column: 2; }
.tj-list--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 32px; border-top: 0; }
.tj-list--grid li:nth-child(-n+3) { border-top: 1px solid var(--line); }
@media (max-width: 700px) { .tj-list--grid li:nth-child(n+2) { border-top: 0; } }
.tj-list--compact a { padding: 10px 2px; }
.tj-list--compact .tj-list__d { display: none; }
.tj-list--compact .tj-ic { grid-row: auto; width: 18px; height: 18px; }
.tj-list--plain a { grid-template-columns: 1fr; }

.tj-home { padding-block: 36px 20px; }
.tj-home__sec { margin-bottom: 28px; }
.tj-home__sec h2 { font-size: 1.35rem; margin-bottom: 10px; }
.tj-home__sec h2 a { color: var(--ink); text-decoration: none; }
.tj-home__sec h2 a:hover { color: var(--green); }

/* ---------- inner pages ---------- */
.tj-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; padding-block: 24px 48px; }
.tj-page--legacy, .tj-page:not(.tj-page--calc):not(.tj-page--date):not(.tj-page--guide):not(.tj-page--hub) { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 980px) { .tj-page { grid-template-columns: 1fr; gap: 24px; } }
.tj-article { min-width: 0; max-width: 760px; }
.tj-crumbs { font-size: .88rem; color: var(--muted); display: flex; gap: 8px; margin-bottom: 10px; }
.tj-crumbs a { color: var(--muted); text-decoration: none; }
.tj-crumbs a:hover { color: var(--green); }
.tj-article h1 { font-size: clamp(1.6rem, 1.2rem + 1.7vw, 2.25rem); font-weight: 700; letter-spacing: -.01em; }
.tj-lead { font-size: 1.08rem; color: var(--muted); margin: 0 0 20px; max-width: 62ch; }

/* ---------- tool form ---------- */
.tj-tool { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); overflow: hidden; margin-bottom: 20px; }
.tj-form { padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.tj-form:empty { display: none; }
.tj-form > .tj-seg, .tj-form > [data-show], .tj-form > .tj-courses, .tj-form > .tj-row2, .tj-form > .tj-row3, .tj-form > button { grid-column: 1 / -1; }
@media (max-width: 560px) { .tj-form { grid-template-columns: 1fr; padding: 16px; } }
.tj-f { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.tj-f__l { font-size: .9rem; font-weight: 500; color: var(--muted); padding: 0; }
.tj-f__in { display: flex; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); }
.tj-f__in:focus-within, .tj-f select:focus, .tj-f input[type=date]:focus, .tj-hd input:focus { border-color: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); outline: none; }
.tj-f__in input { flex: 1; min-width: 0; border: 0; background: none; outline: none; }
.tj-f input, .tj-f select, .tj-course select, .tj-course input {
	font: 500 1.05rem/1.4 var(--font-ui); color: var(--ink); padding: 10px 12px; font-variant-numeric: tabular-nums;
}
.tj-f select, .tj-f > input[type=date], .tj-hd input, .tj-course select, .tj-course input {
	background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); width: 100%;
}
.tj-f__u { padding-inline: 10px 12px; color: var(--muted); font-size: .9rem; white-space: nowrap; }
.tj-hd { display: grid; grid-template-columns: 70px 1fr 90px; gap: 8px; }
.tj-hd legend { margin-bottom: 6px; }
.tj-seg { display: inline-flex; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-s); padding: 3px; gap: 3px; justify-self: start; flex-wrap: wrap; }
.tj-seg label { position: relative; }
.tj-seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tj-seg span { display: block; padding: 7px 14px; border-radius: 4px; font-weight: 500; font-size: .95rem; color: var(--muted); }
.tj-seg input:checked + span { background: var(--surface); color: var(--green); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.tj-seg input:focus-visible + span { outline: 3px solid var(--focus); }
.tj-row2, .tj-row3 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.tj-row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 560px) { .tj-row3 { grid-template-columns: 1fr; } }
.tj-btn { font: 600 .95rem var(--font-ui); background: var(--green); color: var(--green-ink); border: 0; border-radius: var(--r-s); padding: 10px 16px; cursor: pointer; justify-self: start; }
.tj-btn--ghost { background: none; color: var(--green); border: 1px dashed var(--green); }
.tj-courses { display: grid; gap: 8px; }
.tj-course { display: grid; grid-template-columns: 24px 1fr 76px auto 36px; gap: 8px; align-items: center; }
.tj-course__n { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.tj-course__u { color: var(--muted); font-size: .85rem; }
.tj-course__x { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: var(--r-s); height: 40px; font-size: 1.2rem; cursor: pointer; }
.tj-course__x:hover { color: var(--warn); border-color: var(--warn); }

/* ---------- the result slip: the one bold element ---------- */
.tj-slip {
	background: var(--slip); color: var(--slip-ink); padding: 22px 20px 18px; position: relative;
	/* perforated tear line between the form and the slip */
	background-image: radial-gradient(circle at 8px 0, var(--surface) 5px, transparent 5.5px);
	background-size: 16px 10px; background-repeat: repeat-x;
}
.tj-tool > .tj-form:empty + .tj-slip { background-image: none; }
.tj-slip__label { color: var(--slip-muted); font-size: .92rem; }
.tj-slip__big { font-size: clamp(2.4rem, 1.6rem + 3.6vw, 3.6rem); font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 2px 0 12px; overflow-wrap: anywhere; }
.tj-slip__big small { font-size: 1.05rem; font-weight: 400; color: var(--slip-muted); letter-spacing: 0; }
.tj-slip__rows { margin: 0; display: grid; gap: 0; }
.tj-slip__rows div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px dashed rgba(255, 255, 255, .18); }
.tj-slip__rows dt { color: var(--slip-muted); }
.tj-slip__rows dd { margin: 0; font-weight: 500; text-align: end; font-variant-numeric: tabular-nums; }
.tj-slip__note { margin: 10px 0 0; font-size: .88rem; color: var(--slip-muted); }
.tj-slip.is-warn .tj-slip__note { color: var(--gold); font-weight: 500; }

.tj-page--date .tj-slip__big, .tj-page--date .tj-slip__big small { color: var(--slip-ink); }
.tj-page--date .tj-slip__big { font-size: clamp(3rem, 2rem + 5vw, 5rem); }
.tj-upcoming { overflow-x: auto; }
.tj-upcoming table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tj-upcoming th, .tj-upcoming td { padding: 10px 14px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tj-upcoming td:first-child { white-space: normal; }
.tj-upcoming th { color: var(--muted); font-weight: 500; background: var(--bg); }
.tj-upcoming tr.is-now td { background: var(--gold-soft); font-weight: 600; }
.tj-upcoming small { color: var(--muted); font-weight: 400; }
@media (max-width: 560px) {
	.tj-upcoming th:nth-child(3), .tj-upcoming td:nth-child(3) { display: none; }
	.tj-upcoming th, .tj-upcoming td { white-space: normal; padding: 10px; }
	.tj-upcoming small { display: block; }
	.tj-upcoming td:last-child { white-space: nowrap; }
}

/* ---------- article text ---------- */
.tj-prose { font-family: var(--font-text); font-size: 1.1rem; line-height: 1.95; }
.tj-prose > * { max-width: 68ch; }
.tj-prose h2 { font-family: var(--font-ui); font-size: 1.4rem; margin-top: 1.8em; }
.tj-prose h3 { font-family: var(--font-ui); font-size: 1.15rem; margin-top: 1.5em; }
.tj-prose p { margin: 0 0 1.1em; }
.tj-prose ul, .tj-prose ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.tj-prose li { margin-bottom: .4em; }
.tj-prose ol { list-style: none; counter-reset: s; padding-inline-start: 0; }
.tj-prose ol > li { counter-increment: s; position: relative; padding-inline-start: 2.4em; }
.tj-prose ol > li::before {
	content: counter(s); position: absolute; inset-inline-start: 0; top: .2em;
	width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--green); color: var(--green-ink);
	font: 600 .85rem/1.7em var(--font-ui); text-align: center;
}
.tj-prose table { display: block; overflow-x: auto; max-width: 100%; border-collapse: collapse; font-family: var(--font-ui); font-size: .95rem; margin: 0 0 1.4em; line-height: 1.6; }
.tj-prose th, .tj-prose td { padding: 9px 14px; border: 1px solid var(--line); text-align: start; }
.tj-prose th { background: var(--bg); font-weight: 600; }
.tj-prose--legacy { font-size: 1rem; }

.tj-faq { margin-top: 32px; }
.tj-faq h2 { font-size: 1.4rem; }
.tj-faq details { border-bottom: 1px solid var(--line); }
.tj-faq details:first-of-type { border-top: 1px solid var(--line); }
.tj-faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.tj-faq summary::-webkit-details-marker { display: none; }
.tj-faq summary::after { content: "+"; color: var(--green); font-size: 1.3rem; line-height: 1; }
.tj-faq details[open] summary::after { content: "−"; }
.tj-faq p { margin: 0 0 16px; color: var(--muted); font-family: var(--font-text); font-size: 1.05rem; line-height: 1.9; }
.tj-updated { color: var(--muted); font-size: .88rem; margin-top: 28px; }
.tj-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .92rem; }
.tj-share span { color: var(--muted); }
.tj-share a, .tj-share button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--surface); font: inherit; cursor: pointer; }
.tj-share a:hover, .tj-share button:hover { border-color: var(--green); color: var(--green); }

/* ---------- sidebar ---------- */
.tj-side { min-width: 0; }
.tj-related { margin-bottom: 28px; }
.tj-related h2 { font-size: 1rem; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
@media (min-width: 981px) { .tj-side .tj-ad--side { position: sticky; top: 16px; } }

/* ---------- legacy job ads ---------- */
.tj-expired { background: var(--gold-soft); border-inline-start: 4px solid var(--gold); padding: 14px 16px; border-radius: var(--r-s); margin-bottom: 20px; }

/* ---------- ads: no grey boxes, collapse when unfilled ---------- */
.tj-ad { margin: 24px 0; min-height: 0; text-align: center; }
.tj-ad ins[data-ad-status="unfilled"] { display: none !important; }
.tj-ad--side { margin-top: 0; }
.tj-ad--preview { border: 1px dashed var(--line); color: var(--muted); padding: 30px; font-size: .85rem; }
.tj-ad--result { margin-top: 0; }

/* ---------- footer ---------- */
.tj-foot { background: var(--surface); border-top: 1px solid var(--line); margin-top: 24px; }
.tj-foot__in { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 32px; padding-block: 36px 20px; }
.tj-foot__about p { color: var(--muted); font-size: .92rem; max-width: 36ch; }
.tj-foot__col h2 { font-size: 1rem; }
.tj-foot__col h2 a { color: var(--ink); text-decoration: none; }
.tj-foot__col ul { list-style: none; padding: 0; margin: 0; }
.tj-foot__col li { margin-bottom: 6px; }
.tj-foot__col li a { color: var(--muted); text-decoration: none; font-size: .92rem; }
.tj-foot__col li a:hover { color: var(--green); }
.tj-foot__legal { display: flex; flex-wrap: wrap; gap: 8px 20px; padding-block: 16px 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.tj-foot__legal a { color: var(--muted); }
@media (max-width: 860px) { .tj-foot__in { grid-template-columns: 1fr 1fr; } .tj-foot__about { grid-column: 1 / -1; } }
@media (max-width: 480px) { .tj-foot__in { grid-template-columns: 1fr; } }

.tj-pager .nav-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 20px; }
.tj-pager .page-numbers { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-s); text-decoration: none; }
.tj-pager .current { background: var(--green); color: var(--green-ink); border-color: var(--green); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
