/*
Theme Name: DX
Author: DX
Description: Bilingual (English / Arabic, RTL) one-page theme skeleton: header, footer, language switch, page loader and a settings-driven control panel (DX Theme in the WordPress admin). Home-page sections are added as template parts.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: dx
*/
/* ==========================================================================
   DX — styles
   Colours below are fallbacks: the saved ones are printed inline from DX Theme → Theme Settings → General.
   Uses logical properties throughout so the same CSS serves LTR (EN) and RTL (AR).
   ========================================================================== */

:root {
  --accent: #2DD4BF;
  --accent-ink: #0D9488;        /* accent for large text on light backgrounds */
  --accent-soft: #E6FAF6;
  --ink: #0B0C0A;
  --ink-2: #141513;
  --ink-3: #1C1D1A;
  --text: #0B0C0A;
  --muted: #5E6570;
  --line: #E7E8EC;
  --soft: #F7F8FA;
  --white: #fff;

  --f-body: "Inter", "Cairo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-head: "Montserrat", "Cairo", "Inter", system-ui, sans-serif;

  --r: 18px;
  --wrap: 1200px;
  --gut: clamp(20px, 4vw, 40px);
  --header-h: 76px;
  --sec-y: clamp(72px, 9vw, 128px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

:lang(ar) { --f-body: "Cairo", "Inter", system-ui, sans-serif; --f-head: "Cairo", "Montserrat", sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-body); font-size: 1rem; line-height: 1.65; color: var(--text); background: var(--white); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body.no-scroll { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, figure, blockquote, ul { margin: 0; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: calc(var(--wrap) + var(--gut) * 2); margin-inline: auto; padding-inline: var(--gut); }
.skip { position: fixed; inset-inline-start: 12px; top: -60px; z-index: 200; background: var(--accent); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip:focus { top: 12px; }

.ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.hl { color: var(--accent-ink); }

/* Arabic must never be letter-spaced or upper-cased (breaks letter joining). */
:lang(ar) * { letter-spacing: 0 !important; text-transform: none !important; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 22px; border-radius: 999px; border: 2px solid transparent; font-weight: 600; font-size: .95rem; line-height: 1.2; transition: transform .2s var(--ease), background .2s, color .2s, border-color .2s, box-shadow .2s; white-space: nowrap; }
.btn .ic { width: 1.1em; height: 1.1em; transition: transform .25s var(--ease); }
.btn-primary { background: var(--accent); color: var(--ink); box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent), #fff 18%); transform: translateY(-2px); }
.btn-primary:hover .ic { transform: translateX(3px); }
[dir="rtl"] .btn-primary:hover .ic { transform: scaleX(-1) translateX(3px); }
.btn-ghost { border-color: rgba(255,255,255,.28); color: #fff; }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-lg { padding: 15px 28px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header { position: fixed; inset-inline: 0; top: 0; z-index: 100; height: var(--header-h); background: color-mix(in srgb, var(--ink) 72%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255,255,255,.06); transition: background .3s, box-shadow .3s; }
.site-header.scrolled { background: color-mix(in srgb, var(--ink) 94%, transparent); box-shadow: 0 10px 30px -18px rgba(0,0,0,.6); }
.header-in { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { height: 38px; width: auto; }
.brand-word { height: 36px; width: auto; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); margin-inline-start: auto; color: rgba(255,255,255,.82); font-size: .93rem; font-weight: 500; }
.nav a:not(.btn) { position: relative; padding: 6px 0; transition: color .2s; }
.nav a:not(.btn)::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
[dir="rtl"] .nav a:not(.btn)::after { transform-origin: right; }
.nav a:not(.btn):hover, .nav a.active { color: #fff; }
.nav a:not(.btn):hover::after, .nav a.active::after { transform: scaleX(1); }
.nav-cta { padding: 10px 20px; margin-inline-start: 6px; }
.header-tools { display: flex; align-items: center; gap: 10px; }
.lang-btn { background: transparent; border: 1.5px solid rgba(255,255,255,.28); color: #fff; padding: 7px 16px; border-radius: 999px; font-weight: 600; font-size: .88rem; transition: border-color .2s, color .2s; }
.lang-btn:hover { border-color: var(--accent); color: var(--accent); }
.burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; background: transparent; border: 1.5px solid rgba(255,255,255,.28); color: #fff; border-radius: 12px; }
.burger .ic { width: 22px; height: 22px; }
.burger .ic-close { display: none; }
.burger[aria-expanded="true"] .ic-menu { display: none; }
.burger[aria-expanded="true"] .ic-close { display: block; }

/* ---------- Eyebrow / headings ---------- */
.eyebrow { display: flex; align-items: center; gap: 14px; font-size: .78rem; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: #8B919C; margin-bottom: 14px; }
.eyebrow::before { content: ""; width: 44px; height: 3px; border-radius: 2px; background: var(--accent); flex: none; }
.eyebrow-light { color: rgba(255,255,255,.62); }
:lang(ar) .eyebrow { font-size: .95rem; font-weight: 600; }
.h2 { font-family: var(--f-head); font-size: clamp(2.1rem, 4.6vw, 3.5rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
:lang(ar) .h2 { line-height: 1.3; }
.h2-xl { font-size: clamp(2.2rem, 5vw, 3.9rem); }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 46ch; }

/* ---------- Sections ---------- */
.section { position: relative; padding-block: var(--sec-y); }
.section-soft { background: var(--soft); }
.section-dark { background: var(--ink); color: #fff; overflow: hidden; isolation: isolate; }
.section-dark .h2 { color: #fff; }
.section-dark .hl { color: var(--accent); }
.sec-head { margin-bottom: clamp(36px, 5vw, 60px); }
.sec-head-split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }

/* ---------- Cards / icons ---------- */
.ico { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); flex: none; transition: background .25s, color .25s, transform .3s var(--ease); }
.ico .ic { width: 26px; height: 26px; }
.ico-sm { width: 46px; height: 46px; border-radius: 13px; background: #fff; box-shadow: 0 6px 18px -8px rgba(0,0,0,.18); }
.ico-sm .ic { width: 22px; height: 22px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 26px; box-shadow: 0 1px 2px color-mix(in srgb, var(--ink) 3%, transparent); transition: transform .3s var(--ease), box-shadow .3s, border-color .3s; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 22px 40px -24px color-mix(in srgb, var(--ink) 25%, transparent); }
.card h3 { font-size: 1.15rem; font-weight: 700; line-height: 1.3; }
.card p { color: var(--muted); margin-top: 4px; font-size: .96rem; }
.card-row { display: flex; align-items: flex-start; gap: 20px; }

/* ---------- Footer ---------- */
.site-footer { background: color-mix(in srgb, var(--ink), #000 45%); color: rgba(255,255,255,.62); padding-block: 40px; border-top: 1px solid rgba(255,255,255,.06); }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 18px 32px; flex-wrap: wrap; }
.foot-tag { font-family: var(--f-head); font-weight: 700; font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.foot-copy { font-size: .88rem; }
.to-top { font-size: .88rem; font-weight: 600; color: #fff; padding: 8px 16px; border: 1.5px solid rgba(255,255,255,.2); border-radius: 999px; transition: border-color .2s, color .2s; }
.to-top:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Bilingual text: both languages are in the HTML, the active one is shown ---------- */
.l-ar { display: none !important; }
html[lang="ar"] .l-en { display: none !important; }
html[lang="ar"] .l-ar { display: inline !important; }

/* Switching language: the old and new version cross-fade (started from main.js, in browsers with view transitions). */
::view-transition-old(root) { animation: lang-out .55s var(--ease) both; mix-blend-mode: plus-lighter; }   /* plus-lighter: no flash of the page background mid-fade */
::view-transition-new(root) { animation: lang-in .55s var(--ease) both; mix-blend-mode: plus-lighter; }
@keyframes lang-out { to { opacity: 0; transform: scale(1.04); filter: blur(6px); } }
@keyframes lang-in { from { opacity: 0; transform: scale(1.04); filter: blur(6px); } }

/* ---------- Misc (WordPress) ---------- */
body.admin-bar .site-header { top: 32px; }
body.admin-bar .nav { top: calc(var(--header-h) + 32px); }
@media (max-width: 782px) {
  body.admin-bar .site-header { top: 46px; }
  body.admin-bar .nav { top: calc(var(--header-h) + 46px); }
}
@media (max-width: 600px) {
  body.admin-bar .site-header { top: 0; }   /* the admin bar scrolls away on small screens */
  body.admin-bar .nav { top: var(--header-h); }
}
.brand-text { color: #fff; font-family: var(--f-head); font-weight: 800; font-size: 1.15rem; }
.page-wrap { padding: calc(var(--header-h) + clamp(48px, 7vw, 96px)) 0 var(--sec-y); min-height: 60vh; }
.entry { margin-bottom: 56px; }
.entry-title { margin-bottom: 20px; }
.entry-title a:hover { color: var(--accent-ink); }
.entry-content { max-width: 74ch; font-size: 1.05rem; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content a { color: var(--accent-ink); text-decoration: underline; }
.entry-content img { height: auto; border-radius: 10px; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.alignwide, .alignfull { max-width: 100%; }
.alignleft { float: left; margin: 0 1.2em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.2em; }
.aligncenter { display: block; margin-inline: auto; }

/* ---------- Scroll reveal (only when JS is on) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* ---------- Page loader (home page, only when JS is on): --p is the loaded share, set by main.js ---------- */
.preloader { display: none; }
.js .preloader { position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center; gap: 22px; background: var(--ink); transition: opacity .6s var(--ease), visibility .6s; }
.js .preloader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.js body:has(> .preloader:not(.done)) { overflow: hidden; }
.pl-logo { position: relative; width: clamp(130px, 26vw, 220px); }
.pl-base, .pl-fill { display: grid; gap: 10px; }
.pl-logo img { width: 100%; height: auto; }
.pl-base { opacity: .14; }
.pl-fill { position: absolute; inset: 0; clip-path: inset(calc(100% - var(--p, 0%)) 0 0 0); }
.pl-num { font-family: var(--f-head); font-weight: 700; font-size: 1.2rem; letter-spacing: .08em; color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .burger { display: inline-flex; }
  .nav { position: fixed; inset: var(--header-h) 0 0 0; flex-direction: column; align-items: stretch; gap: 0; padding: 18px var(--gut) 32px; background: color-mix(in srgb, var(--ink) 98%, transparent); transform: translateY(-12px); opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility .25s; overflow-y: auto; margin: 0; }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a:not(.btn) { padding: 18px 4px; font-size: 1.2rem; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,.08); }
  .nav a:not(.btn)::after { display: none; }
  .nav-cta { margin: 24px 0 0; padding: 16px; font-size: 1rem; }
  .header-tools { margin-inline-start: auto; }
}
@media (max-width: 640px) {
  :root { --header-h: 68px; }
  .brand-word { height: 30px; }
  .brand-mark { height: 32px; }
  .foot-in { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
