/*
 * تحسينات الصفحة الرئيسية — منصة عمل حر ليبية
 * يُحمّل بعد styles.css، لذلك تبقى هذه القواعد إضافية ولا تغيّر صفحات الموقع الأخرى.
 */

:root {
  --home-green: #214f45;
  --home-green-deep: #163d34;
  --home-sage: #dce9dd;
  --home-sage-soft: #eef4ed;
  --home-lavender: #e9e3f0;
  --home-cream: #fbf8ef;
  --home-ink: #172d27;
  --home-muted: #6b7771;
  --home-line: #e5e9e3;
  --home-shadow: 0 18px 48px rgba(33, 62, 50, .09);
}

/* الرأس: مساحات متوازنة حتى لا تتزاحم الروابط على الشاشات المتوسطة */
.site-header .header-inner { min-width: 0; }
.site-header .desktop-nav,
.site-header .header-actions { flex-shrink: 1; }

@media (max-width: 1200px) {
  .site-header .header-inner { gap: 16px; }
  .site-header .desktop-nav { gap: 18px; font-size: 14px; }
  .site-header .header-actions { gap: 12px; }
  .site-header .brand { font-size: 18px; }
  .site-header .header-actions .btn { padding-inline: 16px; font-size: 14px; }
}

/* كل ما يلي محسوب للرئيسية فقط */
body:has(.hero) {
  background:
    radial-gradient(circle at 8% 4%, rgba(220, 233, 221, .52), transparent 27rem),
    var(--bg);
}

body:has(.hero) .hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(115deg, #f6f7f1 0%, #f8faf7 56%, #edf3ec 100%);
  border-bottom: 1px solid rgba(33, 79, 69, .07);
}

body:has(.hero) .hero::before {
  content: "";
  position: absolute;
  width: 36rem;
  height: 36rem;
  left: -18rem;
  top: -20rem;
  border-radius: 50%;
  background: rgba(220, 233, 221, .4);
  pointer-events: none;
}

body:has(.hero) .hero-grid {
  position: relative;
  z-index: 1;
  min-height: 620px;
  align-items: center;
  gap: clamp(42px, 7vw, 110px);
}

body:has(.hero) .hero-copy {
  max-width: 580px;
  padding-block: 70px 76px;
}

body:has(.hero) .hero-copy .eyebrow { margin-bottom: 18px; }
body:has(.hero) .hero-copy h1 {
  max-width: 570px;
  margin-bottom: 22px;
  color: var(--home-green);
  font-size: 45px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -1.2px;
}
body:has(.hero) .hero-copy h1 span { color: var(--home-green-deep); }
body:has(.hero) .hero-copy > p {
  max-width: 510px;
  margin-bottom: 27px;
  color: var(--home-muted);
  font-size: 17px;
  line-height: 1.9;
}

body:has(.hero) .search-box {
  min-height: 64px;
  padding: 7px 8px 7px 12px;
  border: 1px solid rgba(33, 79, 69, .12);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(33, 79, 69, .1);
}
body:has(.hero) .search-box input { min-width: 0; font-size: 15px; }
body:has(.hero) .search-box .btn { min-height: 48px; padding-inline: 26px; border-radius: 10px; }
body:has(.hero) #search-kind {
  min-height: 42px;
  margin-inline: 7px;
  padding: 5px 28px 5px 10px;
  border: 1px solid var(--home-line);
  border-radius: 9px;
  background: var(--home-sage-soft);
  color: var(--home-green);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
body:has(.hero) #search-kind:focus { border-color: var(--home-green); }
body:has(.hero) .search-hints { gap: 9px; margin-top: 13px; color: var(--home-muted); font-size: 12px; }
body:has(.hero) .search-hints a { color: var(--home-green); font-weight: 700; }
body:has(.hero) .search-hints a:hover { text-decoration: underline; text-underline-offset: 4px; }
body:has(.hero) .hero-trust { gap: 19px; margin-top: 30px; color: var(--home-muted); font-size: 12px; }
body:has(.hero) .hero-trust svg { width: 17px; height: 17px; color: var(--home-green); }

/* لا نعيد رسم hero-art: نحافظ على العمل الفني الحالي ونضبط موضعه فقط. */
body:has(.hero) .hero-art { min-height: 510px; }
body:has(.hero) .hero-index {
  position: absolute;
  top: 28px;
  right: 0;
  z-index: 3;
  color: rgba(33, 79, 69, .55);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .15em;
}

body:has(.hero) > #main-content > .container > .pathways,
body:has(.hero) .pathways {
  position: relative;
  z-index: 2;
  margin-top: -34px;
  box-shadow: var(--home-shadow);
}
body:has(.hero) .pathway { transition: transform .2s ease, box-shadow .2s ease; }
body:has(.hero) .pathway:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(33, 79, 69, .1); }

/* الشريط الصغير الخاص بالمعاينة */
body:has(.hero) .demo-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 28px auto 0;
  padding: 12px 17px;
  border: 1px solid #e2e8df;
  border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  color: var(--home-muted);
  font-size: 12px;
}
body:has(.hero) .demo-strip strong { color: var(--home-green); }

body:has(.hero) .section { padding-top: 76px; }
body:has(.hero) .section-heading { align-items: end; margin-bottom: 25px; }
body:has(.hero) .section-heading h2 { margin-bottom: 5px; color: var(--home-green); }
body:has(.hero) .section-heading p { color: var(--home-muted); font-size: 14px; }

/* ثمانية مجالات: أربعة أعمدة سطح مكتب وعمودان للهاتف */
body:has(.hero) .category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
body:has(.hero) .category-card {
  min-height: 145px;
  padding: 22px 20px;
  border: 1px solid var(--home-line);
  border-radius: 18px;
  background: rgba(255,255,255,.76);
  box-shadow: 0 5px 20px rgba(33, 62, 50, .035);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
body:has(.hero) .category-card:nth-child(3n) { background: var(--home-cream); }
body:has(.hero) .category-card:nth-child(4n) { background: #f3eef7; }
body:has(.hero) .category-card:hover { transform: translateY(-4px); border-color: #b7cdbb; box-shadow: var(--home-shadow); }
body:has(.hero) .category-card svg { width: 25px; height: 25px; margin-bottom: 17px; color: var(--home-green); }
body:has(.hero) .category-card b { display: block; margin-bottom: 5px; font-size: 16px; }
body:has(.hero) .category-card span { display: block; color: var(--home-muted); font-size: 12px; }

body:has(.hero) .services-grid { gap: 20px; }
body:has(.hero) .service-card { overflow: hidden; border-radius: 20px; box-shadow: 0 8px 28px rgba(33, 62, 50, .06); }
body:has(.hero) .service-card:hover { box-shadow: var(--home-shadow); }
body:has(.hero) .service-detail-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 13px;
  color: var(--home-green);
  font-size: 12px;
  font-weight: 800;
}
body:has(.hero) .service-detail-link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* القسم القادم: ثلاثة فوائد، بطاقات هادئة بزاوية 24px */
body:has(.hero) .benefits-section { padding: 88px 0 16px; }
body:has(.hero) .benefits-section .section-heading { margin-bottom: 30px; }
body:has(.hero) .benefits-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
body:has(.hero) .benefit-card {
  min-height: 245px;
  padding: 28px 26px;
  border: 1px solid var(--home-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(33, 62, 50, .05);
}
body:has(.hero) .benefit-card:nth-child(2) { background: var(--home-sage-soft); }
body:has(.hero) .benefit-card:nth-child(3) { background: var(--home-lavender); }
body:has(.hero) .benefit-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  place-items: center;
  border-radius: 15px;
  background: var(--home-sage);
  color: var(--home-green);
}
body:has(.hero) .benefit-icon svg { width: 23px; height: 23px; }
body:has(.hero) .benefit-card:nth-child(2) .benefit-icon { background: #d8e6d5; }
body:has(.hero) .benefit-card:nth-child(3) .benefit-icon { background: #ddd3e8; }
body:has(.hero) .step-label {
  display: block;
  margin-bottom: 6px;
  color: var(--home-muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}
body:has(.hero) .benefit-card h3 { margin-bottom: 8px; color: var(--home-green); font-size: 19px; }
body:has(.hero) .benefit-card p { margin-bottom: 0; color: var(--home-muted); font-size: 14px; line-height: 1.85; }

@media (max-width: 760px) {
  .site-header .header-inner { height: 72px; }
  .site-header .desktop-nav,
  .site-header .header-actions { display: none; }
  .site-header .menu-toggle { display: inline-flex; }
  .site-header .brand small { display: none; }
  .site-header .mobile-menu { padding: 14px 20px 20px; }
  .site-header .mobile-menu a { display: block; padding: 11px 3px; border-bottom: 1px solid var(--home-line); }
  .site-header .mobile-menu .btn { width: 100%; margin-top: 13px; }

  body:has(.hero) .hero-grid { display: block; min-height: auto; }
  body:has(.hero) .hero-copy { padding: 53px 0 30px; }
  body:has(.hero) .hero-copy h1 { font-size: clamp(32px, 9vw, 40px); letter-spacing: -.8px; }
  body:has(.hero) .hero-copy > p { font-size: 15px; line-height: 1.8; }
  body:has(.hero) .search-box { flex-wrap: wrap; padding: 8px; }
  body:has(.hero) .search-box input { flex: 1 1 145px; }
  body:has(.hero) #search-kind { flex: 0 1 auto; margin-inline: 2px; }
  body:has(.hero) .search-box .btn { flex: 1 0 100%; margin-top: 5px; }
  body:has(.hero) .hero-trust { flex-wrap: wrap; gap: 10px 16px; margin-top: 23px; }
  body:has(.hero) .hero-art { min-height: 390px; transform: scale(.9); transform-origin: top center; }
  body:has(.hero) .hero-index { top: 15px; right: 14px; }
  body:has(.hero) .pathways { margin-top: -7px; }
  body:has(.hero) .demo-strip { align-items: flex-start; flex-direction: column; margin-top: 20px; }
  body:has(.hero) .section { padding-top: 55px; }
  body:has(.hero) .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body:has(.hero) .category-card { min-height: 128px; padding: 17px 15px; }
  body:has(.hero) .category-card svg { margin-bottom: 11px; }
  body:has(.hero) .benefits-section { padding-top: 60px; }
  body:has(.hero) .benefits-grid { grid-template-columns: 1fr; gap: 13px; }
  body:has(.hero) .benefit-card { min-height: 0; padding: 23px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.hero) .category-card,
  body:has(.hero) .pathway,
  body:has(.hero) .service-card { transition: none; }
}

/* ضبط نهائي للواجهة والمكونات المشتركة الجديدة */
.site-header .header-inner{gap:20px}.site-header .desktop-nav{gap:21px;font-size:14px;white-space:nowrap}.site-header .header-actions{gap:16px;white-space:nowrap}.site-header .brand{font-size:18px}.site-header .login-link,.signup-link{font-size:13px}.signup-link{color:var(--primary);font-weight:700}.site-header .header-actions .btn{font-size:13px;padding-inline:16px}
body:has(.hero) .hero-grid{min-height:560px;gap:60px;padding-block:50px 65px}body:has(.hero) .hero-copy{padding:8px 0 20px}body:has(.hero) .hero-art{min-height:397px}body:has(.hero) .hero-copy h1{font-size:43px;line-height:1.45;letter-spacing:-1px}body:has(.hero) .hero-copy h1 span:after{width:42%;height:5px;bottom:-4px}body:has(.hero) .hero-trust{font-size:10px;gap:13px;margin-top:21px}body:has(.hero) .search-box{max-width:100%}body:has(.hero) .search-box .btn{padding-inline:18px}body:has(.hero) #search-kind{padding:6px;font-size:12px;margin:0;max-width:106px;flex-shrink:0}body:has(.hero) .demo-strip{margin:0;padding:7px 20px;border-radius:0;border:0;background:#e9eee4;justify-content:center;gap:10px;font-size:11px;color:#61715f}body:has(.hero) .section{padding-top:0}body:has(.hero) .benefits-section{padding-top:12px}body:has(.hero) .category-card{min-height:132px;padding:19px 12px}.project-category{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--primary);margin:12px 0}.project-category svg{width:13px;height:13px}.service-detail-link{display:inline-flex;align-items:center;gap:6px;margin-top:12px;color:var(--primary);font-size:12px;font-weight:700}.service-detail-link svg{width:15px;height:15px}.freelancer-search{margin-bottom:22px}.video-preview{height:100%;background:#29483f;color:#e5ecc9;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:9px}.video-preview small{font-size:9px;letter-spacing:2px}.video-preview>span{border:1px solid #b9caaa88;border-radius:50%;padding:8px 17px;font-size:21px}.video-preview b{font-size:17px}.video-preview i{font-size:9px;font-style:normal}
@media(min-width:761px) and (max-width:1100px){.site-header .desktop-nav{display:none}.site-header .menu-toggle{display:inline-flex}.hero-grid{gap:30px!important}body:has(.hero) .hero-copy h1{font-size:36px}body:has(.hero) .hero-trust{flex-wrap:wrap}.hero-art{transform:scale(.9);transform-origin:center}}
@media(max-width:760px){.site-header .header-actions{display:flex;gap:8px}.site-header .header-actions>.login-link,.site-header .header-actions>.signup-link,.site-header .header-actions>a.btn{display:none}.site-header .menu-toggle{display:inline-flex}.site-header .brand{font-size:16px}.site-header .brand-mark{padding:9px}.site-header .mobile-menu:not([hidden]){display:grid;grid-template-columns:1fr 1fr}.site-header .mobile-menu a{font-size:14px}body:has(.hero) .hero-grid{padding-block:32px 35px}body:has(.hero) .hero-copy{padding:5px 0 15px}body:has(.hero) .hero-copy h1{font-size:clamp(28px,7.6vw,38px);line-height:1.5}body:has(.hero) .hero-art{min-height:340px;height:340px;transform:scale(.85);margin-top:12px}body:has(.hero) .demo-strip{flex-direction:row;text-align:center;gap:5px;font-size:9px;padding:7px 12px}body:has(.hero) .hero-trust{font-size:10px}body:has(.hero) .hero-copy>.eyebrow{font-size:11px}body:has(.hero) .pathways{margin-top:18px}body:has(.hero) .section{padding-top:0}body:has(.hero) .section-heading{align-items:start}body:has(.hero) .section-heading h2{font-size:23px}body:has(.hero) .search-box input{flex:1 1 110px}body:has(.hero) .hero-art .art-main{width:225px;left:0}body:has(.hero) .hero-art .art-app{width:200px;right:-6px}.benefits-section .eyebrow{font-size:12px}}
