/* المحتوى الغني القادم من محرر لوحة التحكم */
body { font-family: 'Plus Jakarta Sans', 'Tajawal', sans-serif; }
.rich-content { color: rgb(203 213 225); font-size: 0.95rem; line-height: 1.95; }
.rich-content h1 { font-size: 1.9rem; font-weight: 900; color: #fff; margin: 2rem 0 1rem; line-height: 1.3; }
.rich-content h2 { font-size: 1.5rem; font-weight: 800; color: #fff; margin: 1.75rem 0 .8rem; line-height: 1.35; }
.rich-content h3 { font-size: 1.2rem; font-weight: 700; color: #fff; margin: 1.5rem 0 .6rem; }
.rich-content p { margin: 0 0 1.1rem; }
.rich-content strong { color: #fff; font-weight: 700; }
.rich-content a { color: rgb(56 189 248); text-decoration: underline; text-underline-offset: 3px; }
.rich-content ul, .rich-content ol { margin: 0 0 1.1rem; padding-inline-start: 1.4rem; }
.rich-content ul { list-style: disc; } .rich-content ol { list-style: decimal; }
.rich-content li { margin-bottom: .35rem; }
.rich-content blockquote { border-inline-start: 3px solid rgb(14 165 233); padding: .25rem 1rem; margin: 1.5rem 0; color: rgb(148 163 184); font-style: italic; }
.rich-content code { background: rgb(15 23 42); padding: .1rem .35rem; border-radius: .3rem; font-size: .85em; }
.rich-content pre { background: rgb(15 23 42); padding: 1rem; border-radius: .75rem; overflow-x: auto; margin: 1.25rem 0; direction: ltr; }
.rich-content hr { border-color: rgb(30 41 59); margin: 2rem 0; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .85rem; }
.rich-content th, .rich-content td { border: 1px solid rgb(30 41 59); padding: .55rem .75rem; text-align: start; }
.rich-content th { background: rgb(15 23 42); color: #fff; }
.rich-content::after { content: ""; display: block; clear: both; }

/* أحجام الصور ومواضعها — كلمة في خانة عنوان الصورة داخل المحرر */
.rich-content figure { margin: 1.75rem auto; }
.rich-content figure img { width: 100%; height: auto; border-radius: 1rem; border: 1px solid rgb(30 41 59); }
.rich-content figcaption { text-align: center; font-size: .75rem; color: rgb(100 116 139); margin-top: .6rem; }
.rich-content .img-wide  { width: 100%; }
.rich-content .img-half  { width: 100%; max-width: 50%; }
.rich-content .img-small { width: 100%; max-width: 33%; }
.rich-content .img-full  { width: calc(100% + 4rem); max-width: none; margin-inline: -2rem; }
.rich-content .img-start { width: 45%; float: inline-start; margin: .4rem 0 1rem; margin-inline-end: 1.5rem; }
.rich-content .img-end   { width: 45%; float: inline-end;   margin: .4rem 0 1rem; margin-inline-start: 1.5rem; }
@media (max-width: 640px) {
  .rich-content .img-half, .rich-content .img-small { max-width: 100%; }
  .rich-content .img-start, .rich-content .img-end { width: 100%; float: none; margin-inline: 0; }
  .rich-content .img-full { width: calc(100% + 3rem); margin-inline: -1.5rem; }
}

/* ===== معرض المشروع: كولاج + صور بجانب النصوص (تبادل يمين/يسار) ===== */
.gal { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 640px) { .gal { gap: 1.5rem; } }
.gal > * { min-width: 0; margin: 0; }
.gal-wide, .gal-medium, .gal-side { grid-column: 1 / -1; }
.gal-img { display: block; overflow: hidden; border-radius: 1rem; border: 1px solid rgb(30 41 59); background: rgb(15 23 42); }
.gal-img img { width: 100%; height: auto; display: block; transition: transform .5s; }
.gal-img:hover img { transform: scale(1.02); }
.gal-cap { margin-top: .5rem; text-align: center; font-size: .72rem; color: rgb(148 163 184); }
.gal-medium .gal-img { max-width: 36rem; margin-inline: auto; }
.gal-title { color: #fff; font-weight: 800; font-size: 1rem; line-height: 1.4; }
.gal-title::before { content: ""; display: block; width: 2rem; height: 3px; border-radius: 3px; background: rgb(14 165 233); margin-bottom: .6rem; }
.gal-text { margin-top: .75rem; }
.gal-text.rich-content { font-size: .85rem; line-height: 1.85; }
.gal-title-below { margin-top: 1rem; }
.gal-text.cols ol, .gal-text.cols ul { columns: 2; column-gap: 1.25rem; font-size: .72rem; line-height: 1.6; }
.gal-text.cols li { break-inside: avoid; margin-bottom: .45rem; }
@media (min-width: 768px) { .gal-text.cols ol, .gal-text.cols ul { columns: 3; column-gap: 2rem; font-size: .8rem; } }

/* صورة بجانب نص: على الهاتف الصورة والعنوان متجاوران والنص تحتهما، وعلى الشاشات الأكبر النص كاملاً بجانب الصورة */
.gal-side { display: grid; grid-template-columns: 1fr 1fr; grid-template-areas: "img head" "body body"; gap: .75rem 1rem; align-items: center; margin-block: .5rem; }
.gal-side.rev { grid-template-areas: "head img" "body body"; }
.gal-side .gs-img { grid-area: img; }
.gal-side .gs-head { grid-area: head; }
.gal-side .gs-body { grid-area: body; }
.gal-side .gs-body .gal-text { margin-top: 0; }
@media (min-width: 768px) {
  .gal-side { grid-template-columns: 7fr 5fr; grid-template-areas: "img head" "img body"; grid-template-rows: auto 1fr; column-gap: 2.25rem; row-gap: .5rem; align-items: start; }
  .gal-side.rev { grid-template-columns: 5fr 7fr; grid-template-areas: "head img" "body img"; }
  .gal-side .gs-head { align-self: end; padding-top: 1rem; }
  .gal-side .gal-title { font-size: 1.25rem; }
}

/* قسم نصي بلا صورة */
.gal-textonly { max-width: 46rem; margin-inline: auto; padding: 1.25rem 0; }
@media (min-width: 768px) { .gal-textonly .gal-title { font-size: 1.25rem; } }

/* ===== العارض ثلاثي الأبعاد ===== */
.m3d { position: relative; border-radius: 1rem; overflow: hidden; border: 1px solid rgb(30 41 59);
  background: radial-gradient(ellipse at 50% 35%, rgb(51 65 85) 0%, rgb(15 23 42) 60%, rgb(2 6 23) 100%); }
.m3d model-viewer { display: block; width: 100%; height: clamp(320px, 62vh, 600px); background: transparent; --poster-color: transparent; }
.m3d-hint { position: absolute; bottom: .75rem; left: 50%; transform: translateX(-50%); padding: .35rem .8rem; border-radius: 999px;
  background: rgba(2, 6, 23, .7); color: rgb(203 213 225); font-size: .7rem; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.m3d-active .m3d-hint { opacity: 0; }
.m3d-progress { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(255,255,255,.08); }
.m3d-progress span { display: block; height: 100%; width: 0; background: rgb(14 165 233); transition: width .2s; }
.m3d-progress.done { opacity: 0; transition: opacity .5s; }

/* ===== لوحة متداخلة (board) — نسب مقاسة من لوحة العرض المطبوعة ===== */
.board { grid-column: 1 / -1; margin-block: 1rem; direction: ltr; }
.board .b-text1, .board .b-text2, .board .b-label { direction: inherit; }
[dir="rtl"] .board .b-text1, [dir="rtl"] .board .b-text2, [dir="rtl"] .board .b-label { direction: rtl; text-align: right; }
.board .b-canvas { position: relative; width: 100%; aspect-ratio: 1500 / 1200; }
.board .b-canvas > * { position: absolute; }
.board .b-strip, .board .b-card { display: block; overflow: hidden; }
.board .b-strip img, .board .b-card img { width: 100%; height: 100%; display: block; }
.board .b-strip { left:1.07%;top:43.92%;width:97.93%;height:37.92%; z-index: 1; border-radius: .35rem; }
.board .b-strip img { object-fit: cover; }
.board .b-card { background: #fff; z-index: 2; border-radius: .35rem; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.board .b-card img { object-fit: contain; }
.board .b-card1 { left:60.00%;top:1.00%;width:35.20%;height:57.75%; }
.board .b-card2 { left:60.00%;top:63.17%;width:35.20%;height:35.83%; }
.board .b-arrow { inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
.board .b-arrow-m { display: block; } .board .b-arrow-d { display: none; }
.board .b-label { left: 1.2%; top: 1%; width: 55%; }
.board .b-label .gal-title { font-size: .95rem; }
.board .b-text1 .gal-title { display: none; }
.board .b-text1 { margin-bottom: 1rem; }
.board .b-text2 { margin-top: 1.25rem; }
@media (min-width: 900px) {
  .board { position: relative; aspect-ratio: 1500 / 1460; }
  .board .b-canvas { position: absolute; inset: 0; aspect-ratio: auto; height: 100%; }
  .board .b-strip { left:1.07%;top:36.10%;width:97.93%;height:31.16%; }
  .board .b-card1 { left:60.00%;top:0.82%;width:35.20%;height:47.47%; }
  .board .b-card2 { left:60.00%;top:51.92%;width:35.20%;height:29.45%; }
  .board .b-arrow-m { display: none; } .board .b-arrow-d { display: block; }
  .board .b-label { display: none; }
  .board .b-text1 .gal-title { display: block; }
  .board .b-text1 { position: absolute; left: 1.2%; top: 1%; width: 53.9%; max-height: 35%; margin: 0; z-index: 2; }
  .board .b-text1 .gal-text, .board .b-text2 .gal-text { font-size: .85rem; line-height: 1.8; }
  .board .b-text2 { position: absolute; left: 1.2%; top: 70%; width: 53.9%; margin: 0; z-index: 2; }
}
