/* =========================================================
   projects.css — عرض المشاريع
   ١) «في الواجهة»  ٢) المعرض (قائمة + معاينة)  ٣) عارض الصورة
   كل صور المشاريع تنعرض كاملة (بدون قص)
   ========================================================= */

/* ================= ١. في الواجهة ================= */
.stack { display: grid; gap: 40px; margin-top: 60px; }
.feature {
  position: sticky; top: calc(var(--header-h) + 16px + var(--i, 0) * 18px);
  display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(24px, 4vw, 56px); align-items: center;
  padding: clamp(24px, 3.4vw, 48px); border-radius: 30px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -40px rgb(11 16 52 / 35%);
  transform-origin: center top;
}
.feature--dark { background: var(--ink); color: #fff; border-color: transparent; }
.feature--dark .feature__desc { color: rgb(255 255 255 / 72%); }
.feature--sand { background: var(--bg-2); }
.feature__num { font-size: 13px; letter-spacing: .14em; color: var(--gold-3); font-weight: 600; }
.feature--dark .feature__num { color: var(--gold-1); }
.feature__logo { height: 60px; display: flex; align-items: center; margin-block: 20px 14px; }
.feature__logo img { max-height: 60px; width: auto; max-width: 220px; object-fit: contain; }
.feature__name { font-size: clamp(28px, 3.2vw, 44px); font-weight: 500; line-height: 1.45; }
.feature__name--word { font-size: clamp(48px, 6vw, 84px); margin-top: 18px; }
.feature__tag { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 600; padding: 4px 14px; border-radius: 99px; background: var(--gold-soft); color: var(--gold-3); }
.feature--dark .feature__tag { color: var(--gold-1); }
.feature__desc { color: var(--muted); margin-block: 16px 24px; max-width: 460px; }
.feature__badge { margin-top: 16px; font-size: 13px; color: #3f6ae6; font-weight: 600; }

/* الصورة كاملة داخل إطار متصفح */
.feature__media {
  display: block; width: 100%; padding: 0; border-radius: 16px; overflow: hidden; cursor: zoom-in;
  background: #fff; box-shadow: 0 24px 60px -28px rgb(11 16 52 / 55%); border: 1px solid var(--line);
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
.feature__media:hover { transform: translateY(-6px); box-shadow: 0 34px 70px -28px rgb(11 16 52 / 60%); }
.feature__media img { display: block; width: 100%; height: auto; }
.feature__browser { display: flex; gap: 6px; align-items: center; height: 28px; padding-inline: 14px; background: #f3f0ea; border-bottom: 1px solid var(--line); direction: ltr; }
.feature__browser i { width: 9px; height: 9px; border-radius: 50%; background: #dcd5c7; }
.feature__browser i:first-child { background: #e8a598; }

/* ================= ٢. المعرض ================= */
.showcase { padding-top: 40px; }
.showcase__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 30px; }
.showcase__count { color: var(--muted); font-size: 14px; margin-top: 4px; }
.showcase__count b { color: var(--gold-3); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters button { padding: 9px 18px; border-radius: 99px; border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--muted); background: var(--surface); transition: all .35s var(--ease); }
.filters button:hover { color: var(--ink); border-color: var(--gold-1); }
.filters button.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.showcase__body { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 28px; align-items: start; }

/* القائمة */
.plist { display: grid; gap: 6px; }
.pitem[hidden] { display: none; }
.pitem__btn {
  width: 100%; display: grid; grid-template-columns: 34px 1fr 84px; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: 16px; text-align: right; border: 1px solid transparent;
  transition: background .35s var(--ease), border-color .35s, transform .35s var(--ease);
}
.pitem__btn:hover { background: var(--surface); border-color: var(--line); transform: translateX(-4px); }
.pitem__n { font-size: 12px; font-weight: 600; color: var(--gold-3); }
.pitem__t { display: grid; line-height: 1.4; }
.pitem__t b { font-size: 16px; font-weight: 500; }
.pitem__t small { font-size: 12px; color: var(--muted); }
.pitem__logo { height: 46px; display: grid; place-items: center; background: #fff; border-radius: 10px; padding: 4px 6px; border: 1px solid var(--line); }
.pitem__logo img { max-height: 36px; max-width: 100%; width: auto; object-fit: contain; }
.pitem__word { font-size: 12px; font-weight: 600; color: var(--gold-3); }
.pitem__btn.is-active { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: var(--shadow); }
.pitem__btn.is-active .pitem__t small { color: rgb(255 255 255 / 65%); }
.pitem__btn.is-active .pitem__n { color: var(--gold-1); }
.pitem__slot:empty { display: none; }

/* شاشة المعاينة */
.viewer {
  position: sticky; top: calc(var(--header-h) + 16px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 18px;
  box-shadow: 0 30px 80px -40px rgb(11 16 52 / 30%);
}
.viewer__frame { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-2); }
.viewer__bar { display: flex; align-items: center; gap: 6px; height: 34px; padding-inline: 14px; background: #f3f0ea; border-bottom: 1px solid var(--line); direction: ltr; }
.viewer__bar i { width: 10px; height: 10px; border-radius: 50%; background: #dcd5c7; }
.viewer__bar i:first-child { background: #e8a598; }
.viewer__bar span { margin-inline: auto; font-size: 12px; color: var(--muted); background: #fff; padding: 2px 16px; border-radius: 99px; border: 1px solid var(--line); max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer__media { margin: 0; display: grid; place-items: center; }
.viewer__media.is-logo { min-height: 240px; }
.viewer__zoom { display: block; width: 100%; padding: 0; cursor: zoom-in; background: #fff; }
/* الصورة كاملة: عرض كامل، وإذا كانت طويلة تصغر لتبان كلها */
.viewer__zoom img { display: block; width: 100%; height: auto; max-height: 60vh; object-fit: contain; margin-inline: auto; }
.viewer__logobox {
  width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; align-content: center; gap: 18px;
  background: radial-gradient(circle at 50% 40%, #fff 0%, var(--bg) 70%, var(--bg-2) 100%);
}
.viewer__logobox img { max-width: 46%; max-height: 220px; width: auto; height: auto; object-fit: contain; filter: drop-shadow(0 18px 30px rgb(11 16 52 / 14%)); }
.viewer__word { font-size: clamp(42px, 6vw, 72px); font-weight: 600; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.viewer__cat { font-size: 12px; font-weight: 600; letter-spacing: .06em; color: var(--gold-3); border: 1px solid var(--gold-1); border-radius: 99px; padding: 3px 14px; }

.viewer__thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 2px; }
.viewer__thumbs[hidden] { display: none; }
.viewer__thumb { flex: none; width: 86px; height: 56px; padding: 3px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg-2); opacity: .7; transition: all .3s; }
.viewer__thumb img { width: 100%; height: 100%; object-fit: contain; }
.viewer__thumb:hover { opacity: 1; }
.viewer__thumb.is-active { border-color: var(--gold-2); opacity: 1; }

.viewer__info { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.viewer__logo { flex: none; width: 72px; height: 72px; border-radius: 18px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; padding: 8px; }
.viewer__logo[hidden] { display: none; }
.viewer__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer__tag { font-size: 13px; font-weight: 600; color: var(--gold-3); }
.viewer__text h3 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 500; line-height: 1.5; }
.viewer__en { direction: ltr; text-align: right; font-size: 12px; letter-spacing: .16em; color: var(--muted); }
.viewer__desc { color: var(--muted); margin-block: 12px 18px; max-width: 640px; }

/* ================= ٣. عارض الصورة ================= */
.lightbox { position: fixed; inset: 0; z-index: 85; display: grid; place-items: center; padding: 56px 20px 20px; background: rgb(11 16 52 / 86%); backdrop-filter: blur(6px); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox__fig { margin: 0; max-width: min(1400px, 100%); }
.lightbox__fig img { display: block; max-width: 100%; max-height: calc(100vh - 90px); width: auto; height: auto; object-fit: contain; border-radius: 12px; box-shadow: 0 40px 120px -20px rgb(0 0 0 / 60%); background: #fff; }
.lightbox__close { position: absolute; top: 14px; left: 14px; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--ink); font-size: 16px; }

/* ================= دليل الشركات المحتضنة ================= */
.dir__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px 40px; flex-wrap: wrap; margin-bottom: 36px; }
.dir__count { margin-top: 10px; color: var(--muted); font-size: 15px; }
.dir__count b { color: var(--gold-3); font-weight: 500; }
.dir__tools { display: grid; gap: 12px; justify-items: end; flex: 0 1 520px; }
.dir__search { width: 100%; }
.dir__search input {
  width: 100%; height: 48px; padding: 0 18px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  font: inherit; font-size: 15px; color: var(--ink); transition: border-color .3s, box-shadow .3s;
}
.dir__search input:focus { outline: none; border-color: var(--gold-2); box-shadow: 0 0 0 4px var(--gold-soft); }
.dir__chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.dir__chips button { font: inherit; font-size: 14px; padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: all .3s; }
.dir__chips button:hover { color: var(--ink); border-color: var(--gold-2); }
.dir__chips button.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.dir__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.co { display: flex; flex-direction: column; gap: 14px; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); transition: transform .4s var(--ease), box-shadow .4s, border-color .4s; }
.co:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgb(196 149 90 / 40%); }
.co[hidden] { display: none; }
.co__head { display: flex; align-items: center; gap: 14px; }
.co__logo { flex: none; width: 92px; height: 64px; display: grid; place-items: center; padding: 8px; border-radius: 14px; background: var(--bg); border: 1px solid var(--line); }
.co__logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.co__word { font-size: 18px; font-weight: 500; background: var(--gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.co__names h3 { font-size: 19px; font-weight: 500; line-height: 1.5; }
.co__en { font-family: "Jost", sans-serif; font-size: 12px; letter-spacing: .12em; color: var(--muted); direction: ltr; text-align: right; }
.co__meta { display: flex; flex-wrap: wrap; gap: 6px; }
.co__meta li { font-size: 12.5px; padding: 4px 11px; border-radius: 99px; background: var(--gold-soft); color: var(--gold-3); }
.co__meta .co__cat { background: rgb(11 16 52 / 6%); color: var(--muted); }
.co__meta .co__stage { background: var(--ink); color: #fff; }
.co__desc { font-size: 15px !important; line-height: 1.85 !important; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.co__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.co__host { font-family: "Jost", sans-serif; font-size: 12px; color: var(--muted); direction: ltr; }
.dir__empty { text-align: center; padding: 40px 0; color: var(--muted); }
@media (max-width: 1100px) { .dir__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .dir__tools { justify-items: stretch; width: 100%; }
  .dir__search input { width: 100%; }
  .dir__chips { justify-content: flex-start; }
}
@media (max-width: 620px) { .dir__grid { grid-template-columns: 1fr; } .co { padding: 20px; } }
