/* معرض الأعمال في الملف العام لمنفّذ الخدمة — pages/artisan (بادئة apf-) */

.apf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.apf-card { margin: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid #E5EAEA; border-radius: 14px; overflow: hidden; transition: box-shadow .2s ease, transform .2s ease; }
.apf-card:hover { box-shadow: 0 14px 30px -18px rgba(15,23,42,0.3); transform: translateY(-2px); }

.apf-media { position: relative; display: block; width: 100%; padding: 0; border: 0; aspect-ratio: 4 / 3; background: #F1F5F9; cursor: zoom-in; overflow: hidden; }
.apf-media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.apf-media:hover img { transform: scale(1.04); }
.apf-media:focus-visible { outline: 3px solid rgba(8,148,151,0.45); outline-offset: -3px; }
.apf-badge { position: absolute; top: 10px; inset-inline-start: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; background: rgba(242,169,0,0.95); color: #3B2A00; font-size: 12px; font-weight: 700; }
.apf-zoom { position: absolute; bottom: 10px; inset-inline-end: 10px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(15,23,42,0.6); color: #fff; font-size: 13px; opacity: 0; transition: opacity .2s ease; }
.apf-media:hover .apf-zoom, .apf-media:focus-visible .apf-zoom { opacity: 1; }

.apf-cap { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.apf-cap h4 { margin: 0; font-size: 15.5px; font-weight: 700; color: #1E293B; line-height: 1.5; overflow-wrap: anywhere; }
.apf-cap p { margin: 2px 0 0; font-size: 13.5px; color: #4B5563; line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-line; }
.apf-date { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #64748B; }
.apf-date[hidden], .apf-lb-cap p[hidden] { display: none; }

/* العرض الكامل */
.apf-lb { margin: auto; width: min(920px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 16px; background: #fff; overflow: hidden; box-shadow: 0 30px 70px -20px rgba(0,0,0,0.5); }
.apf-lb::backdrop { background: rgba(15,23,42,0.75); }
.apf-lb-inner { position: relative; display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
/* ارتفاع ثابت للمسرح: الصورة الصغيرة تُكبَّر لتملأه، والأزرار لا تتراكب */
.apf-lb-stage { position: relative; flex: none; height: min(62vh, 560px); background: #0F172A; }
.apf-lb-stage img { display: block; width: 100%; height: 100%; object-fit: contain; }
.apf-lb-close { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.92); color: #1E293B; font-size: 22px; line-height: 1; cursor: pointer; }
.apf-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.88); color: #1E293B; font-size: 15px; cursor: pointer; }
.apf-lb-nav:hover, .apf-lb-close:hover { background: #fff; }
.apf-lb-nav.prev { inset-inline-start: 12px; }
.apf-lb-nav.next { inset-inline-end: 12px; }
[dir='ltr'] .apf-lb-nav i { transform: scaleX(-1); }
.apf-lb-cap { flex: none; max-height: 30vh; overflow-y: auto; padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 6px; }
.apf-lb-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.apf-lb-head h3 { margin: 0; font-size: 18px; font-weight: 700; color: #1E293B; overflow-wrap: anywhere; }
.apf-lb-count { flex: none; font-size: 13px; color: #94A3B8; }
.apf-lb-cap p { margin: 4px 0 0; font-size: 14.5px; color: #334155; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }

@media (max-width: 640px) {
    .apf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .apf-cap { padding: 10px 10px 12px; }
    .apf-cap h4 { font-size: 14px; }
    .apf-cap p { font-size: 12.5px; -webkit-line-clamp: 2; }
    .apf-date { font-size: 11.5px; }
    .apf-lb { width: 100%; max-width: 100%; max-height: 100vh; height: 100%; border-radius: 0; }
    .apf-lb-inner { height: 100%; max-height: 100vh; }
    .apf-lb-stage { height: 58vh; }
    .apf-lb-cap { max-height: none; flex: 1 1 auto; }
    .apf-lb-nav { width: 38px; height: 38px; }
}
