/* «تجربة الروشان التفصيلية» nested mode — v2 layout (2026-10-21).
 * Everything here is scoped to the Roshan mode (.rdm / .is-rdm). It re-fits the reused Explore studio (3d/studio.css)
 * into the workshop stage; it does not change the studio on any other page. Tokens = the site's own (app.css). */

/* ---------------------------------------------------------------- the workshop stage while the Roshan mode is open
   The stage spans the whole workshop grid (the step panel beside it is hidden only while the mode is open) and fills the
   screen under the sticky header + rail (--rdm-top, measured by the script). Closing restores both. */
.ws-studio .studio__grid:has(> .ws-3d.is-rdm) { grid-template-columns: 1fr; }
.ws-studio .studio__grid:has(> .ws-3d.is-rdm) > :not(.ws-3d) { display: none; }
.ws-studio .stage.ws-3d.is-rdm { height: calc(100svh - var(--rdm-top, 60px) - 12px); min-height: 520px; max-height: 980px;
  scroll-margin-top: var(--rdm-top, 60px); border-radius: 16px; }
.ws-stage.ws-3d.is-rdm .ws-3d__frame { visibility: hidden; pointer-events: none; }

.rdm { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; background: var(--paper, #f6f3ed);
  animation: rdm-in .22s ease-out both; }
@media (prefers-reduced-motion: reduce) { .rdm { animation: none; } }
@keyframes rdm-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------------------------------------------------------------- top bar */
.rdm__bar { flex: none; display: flex; align-items: center; gap: 16px; padding: 10px 14px; background: var(--surface, #fffdf9);
  border-bottom: 1px solid var(--line, #e3ddd2); }
.rdm__back { flex: none; white-space: nowrap; }
.rdm__ttl { display: grid; gap: 0; min-width: 0; }
.rdm__eyebrow { font-size: 12px; color: var(--accent-ink, #4f3a63); font-weight: 650; }
.rdm__ttl strong { font-size: 18px; font-weight: 700; line-height: 1.35; }
.rdm__how { margin-inline-start: auto; font-size: 12.5px; color: var(--muted, #6c655b); white-space: nowrap; }
.rdm__host { flex: 1; min-height: 0; position: relative; }

/* ---------------------------------------------------------------- studio grid: [side column] [model] */
.rdm .studio { height: 100%; }
.rdm .studio__head { display: none; }
.rdm .studio__grid { height: 100%; display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 0; align-items: stretch; }
.rdm__side { min-height: 0; display: flex; flex-direction: column; background: var(--surface, #fffdf9);
  border-inline-end: 1px solid var(--line, #e3ddd2); }

/* model area: canvas above, docked control bar below — nothing floats over the model except the hover label */
.ws-studio .rdm .stage, .rdm .stage { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.rdm .stage__canvas { bottom: 58px; }
.rdm .stage__toolbar, .rdm .stage__sel { display: none !important; }
.rdm .stage__hint { top: 12px; inset-inline-start: 12px; transition: opacity .3s; }
.rdm .stage__hint.is-gone { opacity: 0; }
@media (min-width: 1281px) { .rdm .stage__hint { display: none; } }   /* the bar already says how to use the model */
.ws-stage .rdm .stage__note { top: 12px; inset-inline-start: 12px; inset-inline-end: auto; max-width: min(360px, calc(100% - 24px)); }

.rdm__dock { position: absolute; inset-inline: 0; bottom: 0; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--surface, #fffdf9); border-top: 1px solid var(--line, #e3ddd2); overflow-x: auto; scrollbar-width: thin; }
.rdm-g { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 10px; background: var(--paper, #f6f3ed);
  border: 1px solid var(--line, #e3ddd2); flex: none; }
.rdm-g--tour { margin-inline-start: auto; background: none; border: 0; padding: 0; }
.rdm-c { border: 0; background: transparent; color: var(--ink-2, #4a443c); font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1;
  padding: 9px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.rdm-c:hover { background: var(--stone, #e9e1d2); color: var(--ink, #1f1c18); }
.rdm-c:focus-visible { outline: 2px solid var(--accent-ink, #4f3a63); outline-offset: 1px; }
.rdm-c[aria-pressed="true"] { background: var(--accent-soft, #efe8f4); color: var(--accent-ink, #4f3a63); box-shadow: inset 0 0 0 1px var(--accent-line, #cdbcd9); }
.rdm-c--icon { width: 36px; padding-inline: 0; font-size: 18px; }
.rdm-c--primary { background: var(--accent-ink, #4f3a63); color: #fff; padding-inline: 16px; }
.rdm-c--primary:hover, .rdm-c--primary[aria-pressed="true"] { background: var(--ink, #1f1c18); color: #fff; box-shadow: none; }

/* ---------------------------------------------------------------- guided tour: a card at the top of the side column */
.rdm .stage__tour.rdm__tour { position: static; width: auto; inset: auto; margin: 14px 14px 0; box-shadow: none; z-index: auto;
  border: 1px solid var(--accent-line, #cdbcd9); border-inline-start: 4px solid var(--accent-ink, #4f3a63); background: var(--accent-soft, #efe8f4);
  padding: 12px 14px 12px; display: grid; gap: 4px; flex: none; }
.rdm .rdm__tour .tour__k { order: -2; font-size: 12px; font-weight: 700; color: var(--accent-ink, #4f3a63); }
.rdm .rdm__tour .tour__dots { order: -1; display: flex; gap: 3px; margin: 2px 0 6px; }
.rdm .rdm__tour .tour__dots span { flex: 1; width: auto; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--accent-ink, #4f3a63) 18%, transparent); }
.rdm .rdm__tour .tour__dots span.on { background: var(--accent-ink, #4f3a63); }
.rdm .rdm__tour .tour__t { font-size: 17px; margin: 0; }
.rdm .rdm__tour .tour__p { margin: 0 0 6px; font-size: 14.5px; line-height: 1.8; color: var(--ink-2, #4a443c); }
.rdm .rdm__tour .tour__nav { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rdm .rdm__tour .tour__skip { margin-inline-start: auto; font-size: 13px; }
.rdm .stage__tour.rdm__tour[hidden] { display: none; }
.rdm .rdm__tour .tour__skip { border: 1px solid var(--accent-line, #cdbcd9); border-radius: 8px; padding: 5px 10px; text-decoration: none; background: var(--raised, #fff); }
.rdm__side.is-touring .p3d { border-top: 0; }

/* ---------------------------------------------------------------- information panel: clear Arabic hierarchy */
.ws-studio .rdm .p3d, .rdm .p3d { position: static; top: auto; flex: 1; min-height: 0; max-height: none; height: auto; overflow: auto;
  border: 0; border-radius: 0; box-shadow: none; background: transparent; padding: 16px 18px 22px; overscroll-behavior: contain; }
.rdm .p3d__back { font-size: 13px; margin-bottom: 12px; }
.rdm .p3d__eyebrow { font-size: 12px; color: var(--accent-ink, #4f3a63); font-weight: 700; }
.rdm .p3d__title { font-size: 24px; line-height: 1.3; margin: 2px 0 10px; }
.rdm .p3d__title--home { font-size: 20px; }
.rdm .p3d__gloss { font-size: 15.5px; line-height: 1.85; margin: 4px 0 6px; }
.rdm .p3d__row { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line, #e3ddd2); }
.rdm .p3d__row > p { margin: 0; font-size: 14.5px; line-height: 1.8; }
.rdm .p3d__k { font-size: 12px; font-weight: 700; color: var(--muted, #6c655b); letter-spacing: 0; }
.rdm .p3d__flag { font-size: 12.5px; color: var(--muted, #6c655b); margin: 0 0 6px; }
.rdm .p3d__wherebox { display: grid; gap: 10px; }
.rdm .p3d__wherebox .btn { justify-self: start; }
.rdm .p3d__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0 2px; }
.rdm .p3d__sec + .p3d__sec { margin-top: 16px; padding-top: 16px; }
.rdm .p3d__h { font-size: 15px; font-weight: 700; color: var(--ink, #1f1c18); }
.rdm .p3d__more { margin-top: 10px; border: 1px solid var(--line, #e3ddd2); border-radius: 10px; padding: 0 12px; background: var(--raised, #fff); }
.rdm .p3d__more > summary { cursor: pointer; padding: 10px 0; font-size: 13.5px; font-weight: 650; color: var(--accent-ink, #4f3a63); }
.rdm .p3d__more[open] { padding-bottom: 8px; }
.rdm .lenslist .lbtn { padding: 9px 12px; font-size: 14px; }
.rdm .studio__model-note { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line, #e3ddd2); }

/* concise by default: long paragraphs are clamped; «المزيد» opens them */
.rdm .rdm-clamp:not(.is-open) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.rdm-more { border: 0; background: none; padding: 0; margin: 2px 0 4px; font: inherit; font-size: 13px; font-weight: 650; color: var(--accent-ink, #4f3a63);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: start; }

/* ---------------------------------------------------------------- laptops: narrower panel, compact dock */
@media (max-width: 1280px) {
  .rdm .studio__grid { grid-template-columns: minmax(280px, 320px) minmax(0, 1fr); }
  .rdm__how { display: none; }
  .rdm-c { padding: 9px 10px; font-size: 13px; }
}

/* ---------------------------------------------------------------- tablets & phones: model first, then tour card + panel */
@media (max-width: 900px) {
  .ws-studio .stage.ws-3d.is-rdm { min-height: 480px; border-radius: 12px; }
  .rdm__bar { padding: 8px 10px; gap: 10px; }
  .rdm__eyebrow { display: none; }
  .rdm__ttl strong { font-size: 15px; }
  .rdm__host { overflow: auto; -webkit-overflow-scrolling: touch; }
  .rdm .studio, .rdm .studio__grid { height: auto; }
  .rdm .studio__grid { grid-template-columns: 1fr; grid-template-rows: auto auto; }
  .rdm__side { order: 2; border-inline-end: 0; border-top: 1px solid var(--line, #e3ddd2); }
  .ws-studio .rdm .stage, .rdm .stage { order: 1; height: calc(100svh - var(--rdm-top, 60px) - 12px - 52px - 56px); min-height: 340px; max-height: 620px; }
  .rdm .stage__canvas { bottom: 56px; }
  /* one scrollable row of controls (no second row eating into the model) */
  .rdm__dock { height: 56px; gap: 6px; padding: 0 8px; overflow-x: auto; overscroll-behavior-x: contain;
    mask-image: linear-gradient(to left, #000 88%, transparent); -webkit-mask-image: linear-gradient(to left, #000 88%, transparent); }
  .rdm-g--tour { margin-inline-start: 0; }
  /* phones: the studio's own selection chip (name · التفاصيل ↓ · ×) stays, compact, at the top of the model */
  .rdm .stage__sel:not([hidden]) { display: flex !important; position: absolute; top: 8px; inset-inline: 8px auto; z-index: 3; align-items: center; gap: 6px;
    max-width: calc(100% - 16px); background: var(--surface, #fffdf9); border: 1px solid var(--accent-line, #cdbcd9); border-radius: 999px;
    padding: 4px 6px 4px 12px; font-size: 13px; box-shadow: 0 2px 8px rgba(30,20,10,.12); }
  .rdm .stage__sel-t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rdm .stage__sel button { border: 0; background: var(--accent-soft, #efe8f4); color: var(--accent-ink, #4f3a63); border-radius: 999px; padding: 3px 9px; font: inherit; font-size: 12.5px; font-weight: 650; }
  .rdm .stage__hint { display: none; }
  /* during the tour the model shrinks so the model AND the tour card are on screen together */
  .rdm__host:has(.rdm__side.is-touring) .stage { height: max(280px, 42svh); min-height: 0; }
  .rdm-c { padding: 8px 9px; font-size: 12.5px; }
  .rdm-c--icon { width: 32px; }
  .rdm .p3d { overflow: visible; padding: 14px 16px 20px; }
  .rdm .p3d__title { font-size: 21px; }
  .rdm .stage__tour.rdm__tour { margin: 12px 12px 0; }
}
