/* ===== أثلة — الهوية البصرية ===== */
:root {
  --purple: #4c1b52;
  --purple-dark: #3a1240;
  --yellow: #e3e436;
  --yellow-soft: #fefeb9;
  --yellow-bg: #f5f469;
  --yellow-strip: #d0cf31;
  --cream: #fff4e1;
  --cream-card: #f7e6c9;
  --pink: #d1206a;
  --white: #fff;
  --radius: 18px;
  --container: 1310px;
  --font: 'Dubai', 'Tajawal', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--purple);
  background: var(--cream);
  font-size: 18px;
  line-height: 1.7;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
body { overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; font-weight: 700; }
p { margin: 0; }
button, input, textarea { font-family: inherit; }

.container { width: min(var(--container), calc(100% - 40px)); margin-inline: auto; }
.section { padding: 80px 0; }

/* ===== الأزرار ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--yellow); color: var(--purple);
  border: 0; border-radius: 999px; padding: 6px 28px; min-height: 44px;
  font-size: 18px; font-weight: 500; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(76, 27, 82, .18); }
.btn:active { transform: translateY(0); }
.btn-sm { min-height: 34px; padding: 2px 18px; font-size: 15px; }
.btn-purple { background: var(--purple); color: var(--white); }
.btn-soft { background: var(--yellow-soft); }
.btn-wide { min-width: 220px; }

/* ===== الهيدر ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--yellow-soft);
  border-bottom: 19px solid var(--yellow);
}
.nav-inner {
  padding-inline: clamp(20px, 9.2vw, 139px) clamp(20px, 5vw, 75px);
  height: 98px; display: flex; align-items: center; gap: 40px;
}
.brand { display: flex; align-items: center; }
.brand img { height: 71px; width: auto; display: block; } /* بحجم الشعار في التصميم (84×71) */
.nav-links { display: flex; gap: clamp(24px, 6.4vw, 96px); flex: 1; justify-content: center; }
.nav-links a { font-size: clamp(18px, 1.6vw, 24px); font-weight: 500; transition: color .15s; }
.nav-links a:hover { opacity: .75; }
.nav-links a.active { color: #c9c92a; }
.nav-icons { display: flex; align-items: center; gap: 34px; }
.nav-icons a, .menu-btn { width: 30px; height: 30px; color: var(--purple); }
.nav-icons a.active { color: #c9c92a; }
.menu-btn { display: none; background: none; border: 0; padding: 0; cursor: pointer; }
/* زر تبديل اللغة: كبسولة بإطار بنفسجي بنفس روح أزرار الموقع */
.lang-btn {
  min-width: 46px; height: 30px; padding: 0 10px; border-radius: 999px;
  border: 2px solid var(--purple); background: none; color: var(--purple);
  font: 700 14px/1 var(--font); letter-spacing: .04em; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.lang-btn:hover, .lang-btn:focus-visible { background: var(--purple); color: var(--yellow-soft); outline: none; }
.lang-btn[lang="ar"] { font-size: 15px; letter-spacing: 0; padding-bottom: 2px; }
/* الشاشات المتوسطة: نقلل المسافات حتى لا تنكسر روابط القائمة لسطرين بعد إضافة زر اللغة */
@media (max-width: 1200px) {
  .nav-icons { gap: 20px; }
  .nav-inner { gap: 28px; }
  .nav-links a { white-space: nowrap; }
}

/* ===== الفوتر ===== */
.site-footer { background: var(--yellow-bg) url(../img/footer-bg.jpg) center / cover; margin-top: auto; }
.footer-inner {
  width: min(var(--container), calc(100% - 40px)); margin-inline: auto;
  display: flex; align-items: flex-start; gap: 60px; padding: 50px 0 40px; position: relative;
}
.footer-logo { width: 120px; }
.footer-cols { display: flex; gap: 70px; flex: 1; }
.footer-cols h4 { font-size: 17px; margin-bottom: 14px; }
.footer-cols a { display: block; font-size: 15px; line-height: 2; }
.footer-cols a:hover { text-decoration: underline; }
.socials { display: flex; gap: 16px; align-self: flex-end; }
.socials a { width: 28px; height: 28px; color: var(--purple); transition: transform .15s; }
.socials a:hover { transform: scale(1.12); }
.copyright { background: var(--yellow-strip); text-align: center; font-size: 13px; padding: 4px; }

/* ===== عناصر مشتركة ===== */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: rgba(230, 220, 200, .85); border-radius: 999px; padding: 0 18px; height: 44px;
}
.search-bar svg { width: 18px; height: 18px; flex: none; }
.search-bar input { border: 0; background: none; outline: none; flex: 1; font-size: 16px; color: var(--purple); }
.search-bar input::placeholder { color: rgba(76, 27, 82, .55); }

.page-title { text-align: center; font-size: clamp(32px, 4vw, 52px); margin-bottom: 10px; }
.page-sub { text-align: center; font-size: clamp(18px, 2vw, 26px); }

.row-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 6px solid var(--purple); padding-bottom: 6px; margin-bottom: 24px; }
.row-head h2 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; }

.tile-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 26px; }
.tile {
  aspect-ratio: 1; background: var(--white); border-radius: 4px; overflow: hidden; position: relative;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.tile img { width: 100%; height: 100%; object-fit: contain; }
.tile.photo img, .tile.pattern img { object-fit: cover; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 10px 22px rgba(76, 27, 82, .18); }
.tile .tile-name {
  position: absolute; inset: auto 0 0 0; background: rgba(76, 27, 82, .88); color: var(--white);
  font-size: 14px; padding: 4px 10px; transform: translateY(100%); transition: transform .2s;
}
.tile:hover .tile-name { transform: none; }
/* خلفية الحلم الزرقاء كما في التصميم */
.tile.hulm-bg { background: #cbe8f6; }
.tile.hulm-bg img { mix-blend-mode: multiply; }

.work-card { background: var(--purple); border-radius: 2px; overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.work-card:hover { transform: translateY(-4px); box-shadow: 0 12px 26px rgba(76, 27, 82, .3); }
.work-card img { width: 100%; aspect-ratio: 246 / 334; object-fit: cover; }
.work-card .work-meta { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; color: var(--white); font-size: 14px; border-bottom: 8px solid #3a1240; }
.work-card .work-meta .avatar { width: 40px; height: 40px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--yellow); color: var(--purple); display: grid; place-items: center; flex: none; }
.avatar svg { width: 70%; height: 70%; }

/* نافذة منبثقة */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(40, 10, 45, .7); display: none; align-items: center; justify-content: center; padding: 20px; }
.modal.open { display: flex; animation: fade .2s; }
.modal-box { background: var(--cream); border-radius: var(--radius); max-width: 760px; width: 100%; max-height: 90vh; overflow: auto; position: relative; }
.modal-close { position: absolute; top: 12px; left: 12px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--yellow); color: var(--purple); font-size: 22px; cursor: pointer; z-index: 2; }

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: var(--purple); color: var(--white); padding: 12px 26px; border-radius: 999px; z-index: 200;
  transition: all .25s; font-size: 16px; box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.back-link { display: inline-flex; width: 36px; height: 36px; color: var(--purple); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
.reveal { opacity: 0; }
.reveal.visible { animation: rise .7s ease forwards; }

/* ===== الجوال ===== */
@media (max-width: 900px) {
  body { font-size: 16px; }
  .section { padding: 50px 0; }
  .nav-inner { height: 64px; gap: 16px; justify-content: space-between; padding-inline: 20px; }
  .brand img { height: 46px; }
  .site-header { border-bottom-width: 12px; }
  .menu-btn { display: block; }
  .nav-links {
    display: none; position: absolute; top: 83px; inset-inline: 0; flex-direction: column; gap: 0;
    background: var(--yellow-soft); border-bottom: 6px solid var(--yellow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 24px; border-top: 1px solid rgba(76, 27, 82, .1); }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .footer-inner { flex-direction: column; gap: 24px; }
  .footer-cols { gap: 30px; flex-wrap: wrap; }
  .socials { align-self: flex-start; }
  .nav-icons { gap: 18px; }
}

/* ===== النسخة الإنجليزية (اتجاه من اليسار لليمين) ===== */
[dir="ltr"] body { direction: ltr; }
[dir="ltr"] .modal-close { left: auto; right: 12px; }
/* أيقونة الرجوع تشير لليسار في الإنجليزية */
[dir="ltr"] .back-link svg { transform: scaleX(-1); }
/* عناصر تظهر حسب اللغة */
.en-only { display: none !important; }
[lang="en"] .en-only { display: revert !important; }
[lang="en"] .ar-only { display: none !important; }
