/* ═══════════════════════════════════════════════════════════
   Sera Pro | سيرة برو — تنسيقات صفحة A4 والقوالب الخمسة
   كل الأبعاد بوحدات mm/pt لضمان تطابق المعاينة مع الطباعة 100%
   ═══════════════════════════════════════════════════════════ */

/* ---------- 1) المتغيرات الديناميكية (يحقنها JS) ---------- */
.resume{
  --accent:#4f46e5;
  --accent-soft:rgba(79,70,229,.10);
  --accent-line:rgba(79,70,229,.28);
  --tint-6:#f4f4fe;   /* درجة فاتحة جداً من اللون الأساسي (يولّدها JS) */
  --tint-8:#ecebfe;
  --ink:#111827;
  --ink-2:#374151;
  --ink-3:#6b7280;
  --paper:#ffffff;
  --sidebar-bg:var(--accent);
  --sidebar-ink:#ffffff;
  --sidebar-ink-2:rgba(255,255,255,.82);
  --pad:15mm;
  --fs:1;              /* معامل حجم الخط العام */
  --lh:1.7;            /* تباعد الأسطر */
  --font-ar:"Cairo","Tajawal","IBM Plex Sans Arabic","Noto Kufi Arabic",sans-serif;
  --font-en:"Inter","Cairo","IBM Plex Sans Arabic",sans-serif;
  --font:"Inter","Cairo","Tajawal",sans-serif;
  --heading-font:var(--font);
}
.resume[dir="rtl"]{ --font:"Cairo","Tajawal","IBM Plex Sans Arabic","Inter",sans-serif; }

/* ---------- 2) الصفحة ---------- */
.resume{
  width:210mm; min-height:297mm;
  padding:var(--pad);
  background:var(--paper); color:var(--ink);
  font-family:var(--font);
  font-size:calc(9.6pt * var(--fs));
  line-height:var(--lh);
  position:relative; overflow:visible;
  -webkit-print-color-adjust:exact; print-color-adjust:exact;
  direction:rtl; text-align:start;
}
.resume *,.resume *::before,.resume *::after{box-sizing:border-box;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.resume p,.resume ul,.resume ol,.resume h1,.resume h2,.resume h3,.resume h4{margin:0}
.resume ul{list-style:none;padding:0;margin:0}
.resume a{color:inherit;text-decoration:none}
.resume img{max-width:100%;display:block}

/* ---------- 3) مكونات عامة ---------- */
.rv-head{display:flex;gap:6mm;align-items:center;padding-bottom:5mm}
.rv-head-info{flex:1;min-width:0}
.rv-head.photo-center{flex-direction:column;text-align:center;gap:4mm}
.rv-photo{flex:none}
.rv-photo img{width:30mm;height:30mm;object-fit:cover;object-position:var(--px,50%) var(--py,50%);background:#f1f5f9}
.rv-photo.sh-circle img{border-radius:50%}
.rv-photo.sh-rounded img{border-radius:4mm}
.rv-photo.sh-square img{border-radius:0}
.rv-name{font-family:var(--heading-font);font-size:calc(23pt * var(--fs));font-weight:800;line-height:1.2;letter-spacing:-.3px;color:var(--ink)}
.rv-title{font-size:calc(11.4pt * var(--fs));font-weight:600;color:var(--accent);margin-top:1mm;line-height:1.45}
.rv-summary{margin-top:3mm;font-size:calc(9.4pt * var(--fs));color:var(--ink-2);text-align:justify;hyphens:none}
.rv-head.photo-center .rv-summary{text-align:center}

/* شريط التواصل */
.rv-contacts{display:flex;flex-wrap:wrap;gap:2mm 5mm;margin-top:3.5mm;font-size:calc(8.6pt * var(--fs));color:var(--ink-2)}
.rv-contacts .c-item{display:flex;align-items:center;gap:1.4mm;min-width:0}
.rv-contacts .c-item svg{width:calc(9.5pt * var(--fs));height:calc(9.5pt * var(--fs));flex:none;color:var(--accent)}
.rv-contacts .c-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;direction:ltr;unicode-bidi:embed}
.rv-contacts .c-item.tel span,.rv-contacts .c-item.date span{direction:inherit;unicode-bidi:normal}

/* عناوين الأقسام */
.rv-sec{margin-top:6mm;break-inside:auto}
.rv-sec-head{display:flex;align-items:center;gap:2.5mm;margin-bottom:3mm;break-after:avoid;break-inside:avoid;page-break-after:avoid;page-break-inside:avoid}
.rv-sec-head .ico{width:calc(11pt * var(--fs));height:calc(11pt * var(--fs));flex:none;color:var(--accent)}
.rv-sec-head .ico svg{width:100%;height:100%;display:block}
.rv-sec-title{font-family:var(--heading-font);font-size:calc(12pt * var(--fs));font-weight:800;letter-spacing:.2px;color:var(--ink);text-transform:none;white-space:nowrap}
.rv-sec-rule{flex:1;height:.35mm;background:var(--accent-line);border-radius:2px}
.rv-sec-body{display:flex;flex-direction:column;gap:4mm}

/* عنصر خبرة/تعليم/مشروع */
.rv-item{break-inside:avoid;page-break-inside:avoid}
.rv-item-head{display:flex;justify-content:space-between;align-items:baseline;gap:4mm}
.rv-role{font-size:calc(10.4pt * var(--fs));font-weight:700;color:var(--ink);line-height:1.4}
.rv-org{font-size:calc(9.4pt * var(--fs));font-weight:600;color:var(--accent);line-height:1.5}
.rv-meta{font-size:calc(8.4pt * var(--fs));color:var(--ink-3);font-weight:600;white-space:nowrap;flex:none;display:flex;align-items:center;gap:1.2mm}
.rv-meta svg{width:calc(8.6pt * var(--fs));height:calc(8.6pt * var(--fs));flex:none}
.rv-loc{font-size:calc(8.4pt * var(--fs));color:var(--ink-3);font-weight:500;display:inline-flex;align-items:center;gap:1.2mm}
.rv-loc svg{width:calc(8.6pt * var(--fs));height:calc(8.6pt * var(--fs));flex:none;color:var(--ink-3)}
.rv-desc{margin-top:1.4mm;font-size:calc(9.2pt * var(--fs));color:var(--ink-2);text-align:justify}
.rv-bullets{margin-top:1.6mm;display:flex;flex-direction:column;gap:1mm}
.rv-bullets li{position:relative;padding-inline-start:4.2mm;font-size:calc(9.2pt * var(--fs));color:var(--ink-2);line-height:var(--lh);break-inside:avoid;page-break-inside:avoid}
.rv-bullets li::before{content:"";position:absolute;inset-inline-start:0;top:calc(2.1mm * var(--lh) - .55mm);width:1.5mm;height:1.5mm;border-radius:50%;background:var(--accent)}
.rv-tags{display:flex;flex-wrap:wrap;gap:1.4mm;margin-top:2mm}
.rv-tag{font-size:calc(7.8pt * var(--fs));font-weight:600;padding:.7mm 2.2mm;border-radius:99px;background:var(--accent-soft);color:var(--accent);white-space:nowrap}
.rv-link{font-size:calc(8.4pt * var(--fs));color:var(--accent);font-weight:600;word-break:break-all;direction:ltr;display:inline-block}

/* المهارات */
.rv-skills{display:grid;grid-template-columns:1fr 1fr;gap:2.6mm 6mm}
.rv-skills.style-tags,.rv-skills.style-dots{grid-template-columns:1fr}
.skill{break-inside:avoid;page-break-inside:avoid}
.skill-top{display:flex;justify-content:space-between;align-items:baseline;gap:3mm;margin-bottom:1mm}
.skill-name{font-size:calc(9.2pt * var(--fs));font-weight:600;color:var(--ink)}
.skill-lvl{font-size:calc(7.8pt * var(--fs));color:var(--ink-3);font-weight:600}
.skill-bar{height:1.5mm;border-radius:99px;background:#e8ebf2;overflow:hidden}
.skill-bar i{display:block;height:100%;border-radius:99px;background:var(--accent)}
.skill-stars{display:flex;gap:.7mm;align-items:center}
.skill-stars svg{width:calc(8.6pt * var(--fs));height:calc(8.6pt * var(--fs));color:var(--accent)}
.skill-stars svg.off{color:#d6dae3}
.skill-dots{display:flex;gap:1.1mm;align-items:center}
.skill-dots i{width:2.1mm;height:2.1mm;border-radius:50%;background:#e2e6ee}
.skill-dots i.on{background:var(--accent)}
.rv-skills.style-tags .skill-row{display:flex;flex-wrap:wrap;gap:1.6mm}
.rv-chip{font-size:calc(8.6pt * var(--fs));font-weight:600;padding:1mm 2.6mm;border-radius:2mm;background:var(--accent-soft);color:var(--accent)}

/* اللغات */
.rv-langs{display:flex;flex-wrap:wrap;gap:2.4mm}
.lang{display:flex;align-items:center;gap:2mm;font-size:calc(9.2pt * var(--fs));break-inside:avoid}
.lang b{font-weight:700;color:var(--ink)}
.lang span{color:var(--ink-3);font-weight:500;font-size:calc(8.4pt * var(--fs))}
.lang-dots{display:flex;gap:.9mm}
.lang-dots i{width:1.9mm;height:1.9mm;border-radius:50%;background:#e2e6ee}
.lang-dots i.on{background:var(--accent)}

/* الشهادات / الجوائز */
.rv-cert{display:flex;gap:2.5mm;align-items:flex-start;break-inside:avoid;page-break-inside:avoid}
.rv-cert .dot{width:2mm;height:2mm;border-radius:50%;background:var(--accent);flex:none;margin-top:calc(1.9mm * var(--lh))}
.rv-cert-txt{flex:1;min-width:0}
.rv-cert-name{font-size:calc(9.6pt * var(--fs));font-weight:700;color:var(--ink)}
.rv-cert-org{font-size:calc(8.6pt * var(--fs));color:var(--ink-3);font-weight:500}

/* التذييل */
.rv-foot{margin-top:auto;break-inside:avoid;page-break-inside:avoid}
.rv-footer{padding-top:4mm;font-size:calc(7.4pt * var(--fs));color:var(--ink-3);display:flex;justify-content:space-between;gap:4mm}

/* ── سطر حقوق الشركة المطوِّرة: 3MH TECHNOLOGIES ── */
.rv-credit{
  margin-top:2.6mm;padding-top:2mm;border-top:.2mm solid #e8eaef;
  font-size:calc(6.6pt * var(--fs));line-height:1.6;color:#9aa1ad;text-align:center;
  display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:1.6mm;
}
.rv-credit a{color:#8b93a1;text-decoration:none;direction:ltr;unicode-bidi:embed}
.rv-credit .c-sep{opacity:.55}
.resume.no-credit .rv-credit{display:none}
.rv-page-num{font-weight:700;color:var(--accent)}

/* الشبكات */
.two-col{display:grid;grid-template-columns:62mm 1fr;gap:7mm;align-items:start;margin-top:5mm}
.two-col.side-start{grid-template-columns:1fr 62mm}
.two-col > .col{min-width:0}
.two-col .col-side{display:flex;flex-direction:column;gap:5mm}
.two-col .col-main{display:flex;flex-direction:column;gap:0}
.two-col .col-main .rv-sec:first-child{margin-top:0}
.two-col .rv-skills{grid-template-columns:1fr}
.two-col .rv-head{display:block}

/* ========== القالب 1: Modern (شريط جانبي ملوّن) ========== */
.tpl-modern{padding:0;display:flex;flex-direction:column}
.tpl-modern .m-head{background:var(--accent);color:#fff;padding:calc(var(--pad) * .95) var(--pad);display:flex;gap:6mm;align-items:center}
.tpl-modern .m-head.photo-center{flex-direction:column;text-align:center}
.tpl-modern .m-head .rv-name{color:#fff}
.tpl-modern .m-head .rv-title{color:rgba(255,255,255,.9)}
.tpl-modern .m-head .rv-summary{color:rgba(255,255,255,.92)}
.tpl-modern .m-head .rv-contacts{color:rgba(255,255,255,.94);margin-top:3mm}
.tpl-modern .m-head .rv-contacts .c-item svg{color:#fff}
.tpl-modern .m-head .rv-photo img{border:.9mm solid rgba(255,255,255,.85);box-shadow:0 2mm 6mm rgba(0,0,0,.18)}
.tpl-modern .m-body{display:flex;flex:1;align-items:stretch;min-height:0}
.tpl-modern .m-side{width:66mm;flex:none;background:var(--tint-8);padding:var(--pad) 6mm;display:flex;flex-direction:column;gap:5.5mm}
.tpl-modern .m-side.has-bg{background:var(--accent);color:#fff}
.tpl-modern .m-side.has-bg .rv-sec-title,.tpl-modern .m-side.has-bg .skill-name,.tpl-modern .m-side.has-bg .lang b,.tpl-modern .m-side.has-bg .rv-cert-name{color:#fff}
.tpl-modern .m-side.has-bg .rv-sec-rule{background:rgba(255,255,255,.35)}
.tpl-modern .m-side.has-bg .skill-lvl,.tpl-modern .m-side.has-bg .lang span,.tpl-modern .m-side.has-bg .rv-cert-org{color:rgba(255,255,255,.8)}
.tpl-modern .m-side.has-bg .skill-bar,.tpl-modern .m-side.has-bg .skill-dots i,.tpl-modern .m-side.has-bg .lang-dots i{background:rgba(255,255,255,.28)}
.tpl-modern .m-side.has-bg .skill-bar i,.tpl-modern .m-side.has-bg .skill-dots i.on,.tpl-modern .m-side.has-bg .lang-dots i.on{background:#fff}
.tpl-modern .m-side.has-bg .rv-chip,.tpl-modern .m-side.has-bg .rv-tag{background:rgba(255,255,255,.18);color:#fff}
.tpl-modern .m-main{flex:1;min-width:0;padding:var(--pad) var(--pad) var(--pad) 7mm;display:flex;flex-direction:column}
.tpl-modern .m-side-start{order:-1}
.tpl-modern .rv-sec{margin-top:0}
.tpl-modern .m-main .rv-sec + .rv-sec{margin-top:6mm}
.tpl-modern .rv-foot{padding:0 var(--pad) var(--pad)}

/* القوالب أحادية العمود: عمود مرن حتى يلتصق التذييل بأسفل الصفحة */
.tpl-classic,.tpl-minimal,.tpl-executive{display:flex;flex-direction:column}

/* ========== القالب 2: Classic (تقليدي أنيق) ========== */
.tpl-classic .rv-head{border-bottom:.5mm solid var(--ink);padding-bottom:4mm}
.tpl-classic .rv-name{font-size:calc(25pt * var(--fs));letter-spacing:.4px}
.tpl-classic .rv-title{color:var(--ink-2);font-weight:500;letter-spacing:1.2px;text-transform:uppercase;font-size:calc(10pt * var(--fs))}
.tpl-classic .rv-contacts{justify-content:center;margin-top:3mm;color:var(--ink-2)}
.tpl-classic .rv-head:not(.photo-center) .rv-contacts{justify-content:flex-start}
.tpl-classic .rv-sec-title{font-size:calc(11.6pt * var(--fs));text-transform:uppercase;letter-spacing:1.1px}
.tpl-classic .rv-sec-rule{background:var(--border-c,#d8dce5);height:.25mm}
.tpl-classic .rv-item{padding-bottom:3.4mm;border-bottom:.2mm dashed #e3e6ee}
.tpl-classic .rv-item:last-child{border-bottom:none;padding-bottom:0}
.tpl-classic .rv-role{font-weight:700}
.tpl-classic .rv-bullets li::before{border-radius:0;width:1.2mm;height:1.2mm;background:var(--ink-3)}

/* ========== القالب 3: Minimal (أبيض/أسود نظيف) ========== */
.tpl-minimal{--accent:#111827;--accent-soft:#f2f3f5;--accent-line:#e2e4ea;--lh:1.65}
.tpl-minimal .rv-name{font-size:calc(21pt * var(--fs));font-weight:700;letter-spacing:-.4px}
.tpl-minimal .rv-title{color:var(--ink-3);font-weight:500;font-size:calc(10.4pt * var(--fs));text-transform:none;letter-spacing:.3px}
.tpl-minimal .rv-head{padding-bottom:4mm;border-bottom:.3mm solid #111827}
.tpl-minimal .rv-photo img{border-radius:0 !important}
.tpl-minimal .rv-sec{margin-top:5.5mm}
.tpl-minimal .rv-sec-head{margin-bottom:2.6mm}
.tpl-minimal .rv-sec-title{font-size:calc(9.4pt * var(--fs));text-transform:uppercase;letter-spacing:2.2px;font-weight:700}
.tpl-minimal.no-icons .rv-sec-head .ico{display:none}
.tpl-minimal .rv-sec-rule{display:none}
.tpl-minimal .rv-bullets li::before{background:var(--ink);width:1.1mm;height:1.1mm}
.tpl-minimal .rv-tag,.tpl-minimal .rv-chip{background:none;border:.2mm solid #dcdfe6;color:var(--ink-2);border-radius:1.2mm}
.tpl-minimal .skill-bar{height:.9mm;background:#eceef2}
.tpl-minimal .rv-org{color:var(--ink-2)}

/* ========== القالب 4: Executive (قيادي) ========== */
.tpl-executive{--font:"Playfair Display","Cairo",serif;--heading-font:"Playfair Display","Cairo",serif}
.tpl-executive[dir="rtl"]{--font:"Noto Kufi Arabic","Cairo","Playfair Display",serif;--heading-font:"Noto Kufi Arabic","Cairo",serif}
.tpl-executive .rv-head{flex-direction:column;text-align:center;border-bottom:.4mm double var(--accent);padding-bottom:5mm}
.tpl-executive .rv-name{font-size:calc(26pt * var(--fs));font-weight:700;letter-spacing:.6px}
.tpl-executive .rv-title{font-size:calc(10.6pt * var(--fs));letter-spacing:2.4px;text-transform:uppercase;color:var(--ink-2);font-weight:500;margin-top:1.6mm}
.tpl-executive .rv-summary{text-align:center;max-width:150mm;margin-inline:auto;margin-top:3.4mm;font-style:italic;color:var(--ink-2)}
.tpl-executive .rv-contacts{justify-content:center;margin-top:3.6mm;font-size:calc(8.4pt * var(--fs))}
.tpl-executive .rv-sec-head{justify-content:center;gap:3mm}
.tpl-executive .rv-sec-title{font-size:calc(11.4pt * var(--fs));letter-spacing:1.8px;text-transform:uppercase}
.tpl-executive .rv-sec-rule{max-width:22mm;flex:none}
.tpl-executive .rv-sec-rule.after{order:3}
.tpl-executive .rv-sec-body{max-width:170mm;margin-inline:auto}
.tpl-executive .rv-item-head{align-items:center}
.tpl-executive .rv-role{font-size:calc(10.8pt * var(--fs));font-weight:700}
.tpl-executive .rv-photo img{border:.6mm solid var(--accent);padding:0}
.tpl-executive .rv-bullets li::before{border-radius:0;transform:rotate(45deg);width:1.4mm;height:1.4mm}

/* ========== القالب 5: Creative (إبداعي) ========== */
.tpl-creative{padding:0}
.tpl-creative{overflow:hidden;display:flex;flex-direction:column}
.tpl-creative .c-band{position:relative;background:var(--accent);color:#fff;padding:calc(var(--pad) * 1.1) var(--pad) calc(var(--pad) * 1.5);overflow:hidden}
.tpl-creative .c-band::after{content:"";position:absolute;inset-inline-end:-30mm;top:-40mm;width:110mm;height:110mm;border-radius:50%;background:rgba(255,255,255,.10)}
.tpl-creative .c-band::before{content:"";position:absolute;inset-inline-start:-25mm;bottom:-55mm;width:90mm;height:90mm;border-radius:50%;background:rgba(0,0,0,.08)}
.tpl-creative .c-inner{position:relative;display:flex;gap:6mm;align-items:center;z-index:1}
.tpl-creative .c-inner.photo-center{flex-direction:column;text-align:center}
.tpl-creative .rv-name{color:#fff;font-size:calc(27pt * var(--fs));font-weight:800;letter-spacing:-.5px}
.tpl-creative .rv-title{color:rgba(255,255,255,.94);font-weight:700;font-size:calc(11.6pt * var(--fs))}
.tpl-creative .rv-summary{color:rgba(255,255,255,.92)}
.tpl-creative .rv-contacts{color:#fff;margin-top:3.4mm}
.tpl-creative .rv-contacts .c-item{background:rgba(255,255,255,.16);padding:.9mm 2.6mm;border-radius:99px}
.tpl-creative .rv-contacts .c-item svg{color:#fff}
.tpl-creative .rv-photo img{border:1mm solid rgba(255,255,255,.9);box-shadow:0 3mm 8mm rgba(0,0,0,.22)}
.tpl-creative .c-body{padding:var(--pad);display:flex;flex-direction:column;flex:1;min-height:0}
.tpl-creative .c-body.is-grid{display:grid;grid-template-columns:1fr 60mm;gap:7mm;align-items:start}
html[dir="rtl"] .tpl-creative .c-body.is-grid{grid-template-columns:1fr 60mm}
.tpl-creative .c-main{min-width:0;display:flex;flex-direction:column}
.tpl-creative .c-side{min-width:0;background:var(--tint-6);border-radius:3mm;padding:5mm 4.5mm;display:flex;flex-direction:column;gap:5mm}
.tpl-creative .rv-sec-head{background:var(--accent-soft);border-radius:2mm;padding:1.6mm 3mm;margin-bottom:3.2mm;border-inline-start:1.1mm solid var(--accent)}
.tpl-creative .rv-sec-rule{display:none}
.tpl-creative .rv-sec-title{color:var(--accent);font-size:calc(11.4pt * var(--fs));font-weight:800}
.tpl-creative .c-side .rv-sec-head{background:#fff}
.tpl-creative .rv-tag{border-radius:99px;background:var(--accent);color:#fff}
.tpl-creative .rv-bullets li::before{border-radius:.4mm;transform:rotate(45deg)}
.tpl-creative .skill-bar{height:2mm;border-radius:99px}
.tpl-creative .rv-role{font-weight:800}
.tpl-creative .rv-org{font-weight:700}
.tpl-creative .rv-foot{padding:0 var(--pad) var(--pad)}

/* ---------- حالات اختيارية ---------- */
.resume svg{vertical-align:middle;max-width:100%}
.resume.no-icons .rv-sec-head .ico,.resume.no-icons .rv-contacts .c-item svg,.resume.no-icons .rv-meta svg,.resume.no-icons .rv-loc svg{display:none}
.resume.no-dividers .rv-sec-rule{display:none}
.resume.no-sec-bg .tpl-creative .rv-sec-head{background:none;padding:0;border-inline-start:none}
.resume.no-sec-bg .tpl-creative .c-side{background:none;padding:0}
.resume.no-contacts-bar .rv-head .rv-contacts{display:none}
.resume.no-summary .rv-summary{display:none}
.resume.no-name-footer .rv-footer .fname{display:none}
.resume.single-col .two-col{display:block}
.resume.single-col .two-col .col-side{margin-top:6mm}
.resume.digits-ar{font-feature-settings:"lnum" 0}

/* ---------- عدّاد الصفحات (يعمل في الطباعة وفي html2canvas) ---------- */
.resume{counter-reset:page}
.resume .rv-page-num::after{content:counter(page)}

/* ---------- قواعد منع التقطيع عند الطباعة ---------- */
.resume .rv-item,.resume .skill,.resume .rv-cert,.resume .lang,.resume .rv-bullets li{break-inside:avoid;page-break-inside:avoid}
.resume .rv-sec{break-inside:auto}
.resume .rv-sec-body > .rv-item:first-child{break-before:auto}
.resume .rv-tags,.resume .rv-langs,.resume .rv-skills{break-inside:auto}
.resume .rv-head,.resume .m-head,.resume .c-band{break-inside:avoid;page-break-inside:avoid}
.resume .rv-footer,.resume .rv-credit{break-before:avoid;page-break-before:avoid}
.resume .rv-sec-head{break-after:avoid;page-break-after:avoid}
.resume .rv-photo img{break-inside:avoid}

@media print{
  .resume{width:210mm;min-height:297mm;margin:0;box-shadow:none;overflow:visible;background:#fff}
  .resume .rv-footer{position:static}
  /* في الطباعة: لا حاجة لقصّ المحتوى */
  .tpl-modern,.tpl-creative{overflow:visible}
  .tpl-modern .m-side,.tpl-creative .c-side{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  a[href^="http"]::after{content:""}
}


/* ═══════════════ طبقة التوافق مع كل الأجهزة والمتصفحات ═══════════════ */

/* بادئات WebKit/Blink (Safari القديم، أندرويد القديم، iOS) */
.resume,.resume *{
  -webkit-print-color-adjust:exact;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
.resume img{-webkit-user-drag:none}

/* بديل الخصائص المنطقية (logical properties) للمتصفحات التي لا تدعمها */
@supports not (inset-inline-start: 0) {
  html[dir="rtl"] .rv-bullets li{padding-right:4.2mm;padding-left:0}
  html[dir="ltr"] .rv-bullets li{padding-left:4.2mm;padding-right:0}
  html[dir="rtl"] .rv-bullets li::before{right:0;left:auto}
  html[dir="ltr"] .rv-bullets li::before{left:0;right:auto}
  html[dir="rtl"] .rv-cert{flex-direction:row-reverse}
  html[dir="rtl"] .tpl-creative .rv-sec-head{border-right:1.1mm solid var(--accent);border-left:none}
  html[dir="ltr"] .tpl-creative .rv-sec-head{border-left:1.1mm solid var(--accent);border-right:none}
  html[dir="rtl"] .tpl-modern .m-side{padding:var(--pad) 7mm var(--pad) 6mm}
  html[dir="ltr"] .tpl-modern .m-side{padding:var(--pad) 6mm var(--pad) 7mm}
  .rv-contacts .c-item span,.rv-credit a{unicode-bidi:bidi-override}
}

/* بديل flex-gap (Safari < 14.1 / Chrome < 84) */
@supports not (inset-inline-start: 0) {
  .rv-contacts{margin:-1mm}
  .rv-contacts .c-item{margin:1mm}
  .rv-head{margin:-3mm}
  .rv-head > *{margin:3mm}
  .rv-langs{margin:-1.2mm}
  .rv-langs .lang{margin:1.2mm}
  .rv-tags{margin:-.7mm}
  .rv-tags .rv-tag{margin:.7mm}
  .rv-skills{margin:-1.3mm}
  .rv-skills .skill{margin:1.3mm}
  .rv-credit{margin-top:2.6mm;gap:0}
  .rv-credit > *{margin:0 .8mm}
  .rv-foot{margin-top:auto}
}

/* aspect-ratio غير مدعوم → بديل آمن (يُستخدم في المعرض والمصغّرات) */
@supports not (aspect-ratio: 1 / 1) {
  .rv-photo img{width:30mm;height:30mm}
}

/* شاشات صغيرة جداً عند الطباعة من الجوال: ضمان عدم تجاوز العرض */
@media print and (max-width: 800px){
  .resume{width:210mm;min-width:210mm}
}
