/* ================================================================
   STICKY STORY — product visual persists while steps scroll through.
   Adalo-style. The pinned side stays visible, content on the other
   side advances step-by-step.
   ================================================================ */
.story {
  position: relative;
  background: var(--adah-surface-mist);
  padding: 80px 0 120px;
}
/* story-hd now lives inside the sticky left column */
.story-hd {
    text-align: start; /* RTL = visually right-aligned */
    margin: 65px 0 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(var(--adah-tertiary-rgb),.06);
}
.story-hd .eyebrow { font: var(--adah-t-eyebrow); letter-spacing: .12em; color: var(--adah-primary); text-transform: uppercase; }
.story-hd h2 { font: var(--adah-t-h2); color: var(--adah-tertiary); letter-spacing: -0.01em; margin: 10px 0 10px; font-size: clamp(22px, 2.8vw, 30px); }
.story-hd p { font: var(--adah-t-body); color: var(--adah-ink-soft); margin: 0; }

.story-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }

/* Left column: sticky wrapper that pins header + visual together */
.story-left {
  position: sticky;
  top: 86px;
}

/* Visual pane — no longer sticky itself, parent handles it */
.story-sticky {
  position: relative;
  top: auto;
  aspect-ratio: 5/4;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 30px 60px -24px rgba(var(--adah-tertiary-rgb),.22), 0 0 0 1px rgba(var(--adah-tertiary-rgb),.04);
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
.story-frame {
  position: absolute; inset: 0;
  opacity: 0; transform: translateY(16px) scale(.985);
  transition: opacity .65s cubic-bezier(.2,.7,.2,1), transform .65s cubic-bezier(.2,.7,.2,1);
  display: flex; align-items: center; justify-content: center;
}
.story-frame.active { opacity: 1; transform: none; }

/* Each story frame = a mini product state */
.sf1 { background: linear-gradient(160deg, #F4FFFC 0%, #EAF9F6 100%); }
.sf1 .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 40px; width: 100%; max-width: 380px; }
.sf1 .tpl { aspect-ratio: 3/4; border-radius: 12px; background: #fff; box-shadow: 0 10px 22px -10px rgba(var(--adah-tertiary-rgb),.18); padding: 10px; position: relative; }
.sf1 .tpl::before { content:""; position:absolute; inset: 8px 8px auto 8px; height: 50%; background: linear-gradient(135deg, var(--adah-wave-4), var(--adah-wave-2)); border-radius: 8px; }
.sf1 .tpl.picked { outline: 3px solid var(--adah-primary); outline-offset: 2px; }
.sf1 .tpl::after { content:""; position: absolute; bottom: 10px; inset-inline-start: 10px; width: 60%; height: 4px; background: #E4E7E7; border-radius: 4px; box-shadow: 0 8px 0 -2px #EEF1F1; }

.sf2 { background: #fff; }
.sf2 .editor { position: relative; width: 80%; height: 75%; border-radius: 16px; background: #F7FAFA; padding: 20px; box-shadow: inset 0 0 0 1px rgba(var(--adah-tertiary-rgb),.05); }
.sf2 .editor .block { background: #fff; border: 1.5px solid var(--adah-primary); border-radius: 10px; padding: 14px; margin-bottom: 10px; position: relative; }
.sf2 .editor .block::before { content:""; position:absolute; top:-8px; inset-inline-end: 10px; background: var(--adah-primary); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 4px; content: "نصّ"; color: #fff; }
.sf2 .editor .block .ln { height: 7px; background: #E4E7E7; border-radius: 4px; margin-bottom: 6px; }
.sf2 .editor .block .ln.sm { width: 60%; }
.sf2 .caret { position: absolute; width: 18px; height: 24px; inset-inline-end: 30%; top: 38%; }
.sf2 .caret svg { color: var(--adah-primary-ink); filter: drop-shadow(0 4px 6px rgba(var(--adah-tertiary-rgb),.2)); }

.sf3 { background: linear-gradient(160deg, #0F3D44 0%, #082F35 100%); color: #fff; }
.sf3 .shared {
  width: 80%; max-width: 340px; padding: 24px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 16px; backdrop-filter: blur(12px);
  text-align: center;
}
.sf3 .shared .url { font: var(--adah-t-caption); background: rgba(255,255,255,.08); padding: 8px 14px; border-radius: 999px; margin-bottom: 16px; display: inline-block; color: var(--adah-wave-4); direction: ltr; }
.sf3 .shared .qr { width: 120px; height: 120px; background: #fff; border-radius: 10px; margin: 0 auto 14px; position: relative; padding: 10px; box-sizing: border-box; }
.sf3 .shared .qr::before, .sf3 .shared .qr::after {
  content:""; position: absolute; width: 24px; height: 24px; border: 4px solid var(--adah-ink-deep);
}
.sf3 .shared .qr::before { top: 10px; inset-inline-start: 10px; border-radius: 4px 0 0 0; border-width: 4px 0 0 4px;}
.sf3 .shared .qr::after { top: 10px; inset-inline-end: 10px; border-radius: 0 4px 0 0; border-width: 4px 4px 0 0;}
.sf3 .shared .qr-grid { position: absolute; inset: 24px; background-image:
  linear-gradient(90deg, transparent 50%, var(--adah-ink-deep) 50%),
  linear-gradient(var(--adah-ink-deep) 50%, transparent 50%);
  background-size: 12% 12%; opacity: .85; border-radius: 2px; }
.sf3 .shared h4 { font: var(--adah-t-h4); margin: 0 0 4px; color: #fff; }
.sf3 .shared p { font: var(--adah-t-caption); margin: 0; opacity: .7; }

/* Steps column */
.story-steps { display: flex; flex-direction: column; gap: 24px; padding-block: 20px; }
.step {
  padding: 28px 28px 28px 28px;
  background: transparent;
  border-inline-start: 2px solid rgba(var(--adah-tertiary-rgb),.1);
  padding-inline-start: 28px;
  position: relative;
  transition: border-color .4s, opacity .4s;
  opacity: .45;
  min-height: 55vh;
  display: flex; flex-direction: column; justify-content: center;
}
.step.active { opacity: 1; border-inline-start-color: var(--adah-primary); }
.step .num {
  position: absolute; inset-inline-start: -19px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; color: var(--adah-muted);
  display: flex; align-items: center; justify-content: center;
  font: var(--adah-t-label); font-weight: 700;
  border: 2px solid rgba(var(--adah-tertiary-rgb),.1);
  transition: all .4s;
}
.step.active .num { background: var(--adah-primary); color: #fff; border-color: var(--adah-primary); box-shadow: 0 6px 14px -4px rgba(var(--adah-primary-rgb),.5); }
.step h3 { font: var(--adah-t-h2); color: var(--adah-tertiary); margin: 0 0 12px; letter-spacing: -0.01em; }
.step p { font: var(--adah-t-lead); color: var(--adah-ink-soft); margin: 0; line-height: 1.7; }

@media (max-width: 991.98px) {
  .story-grid { grid-template-columns: 1fr; gap: 40px; }
  .story-left { position: relative; top: auto; }
  .story-sticky { aspect-ratio: 4/3; }
  .step { min-height: auto; padding-block: 24px; }
}

.story-frame {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.99);
  transition: opacity .45s ease, transform .45s ease;
}

.story-frame.active {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.story-product-window {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: #F8FBFC;
}

.story-toolbar {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 12px;
  border-bottom: 1px solid #DEE9EA;
  background: #FAFCFC;
}

.story-project {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.story-project b {
  min-width: 0;
  overflow: hidden;
  color: #667A80;
  font: 800 11px/1 var(--adah-font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.story-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  color: #95A7AC;
  flex: 0 0 auto;
}

.story-toolbar-tools {
  display: inline-flex;
  align-items: center;
  height: 26px;
  gap: 6px;
  padding: 3px 7px;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(var(--adah-tertiary-rgb), .08);
}

.story-kebab {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}

.story-kebab i {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #A7B8BC;
}

.story-color-dots {
  display: inline-flex;
  gap: 4px;
}

.story-color-dots i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--adah-primary);
}

.story-color-dots i:nth-child(2) { background: var(--adah-secondary); }
.story-color-dots i:nth-child(3) { background: #2E5960; }
.story-color-dots i:nth-child(4) { background: #111E22; }

.story-device {
  width: 20px;
  height: 16px;
  border: 2px solid var(--adah-primary);
  border-radius: 4px;
  box-shadow: 0 6px 0 -4px var(--adah-primary);
}

.story-toolbar button {
  height: 24px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(95deg, var(--adah-primary), var(--adah-secondary));
  color: #fff;
  font: 900 9px/1 var(--adah-font);
}

.story-window-body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 24px;
  background:
    linear-gradient(#D8E5E8 1px, transparent 1px),
    linear-gradient(90deg, #D8E5E8 1px, transparent 1px),
    #EEF5F6;
  background-size: 34px 34px;
}

.story-window-body::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(220px 150px at 18% 72%, rgba(158, 180, 174, .22), transparent 70%),
    radial-gradient(190px 170px at 82% 20%, rgba(255, 255, 255, .86), transparent 62%),
    linear-gradient(90deg, rgba(255, 255, 255, .54), transparent 54%);
  filter: blur(2px);
  opacity: .85;
}

.story-window-body > * {
  position: relative;
  z-index: 1;
}


/* Step 1: templates */
.story-template-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.story-visual-label {
  display: inline-flex;
  align-self: flex-start;
  padding: 7px 12px;
  border: 1px solid rgba(var(--adah-primary-rgb), .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  color: var(--adah-primary);
  font: 900 12px/1 var(--adah-font);
  box-shadow: 0 12px 24px -20px rgba(var(--adah-tertiary-rgb), .34);
}

.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-chips span {
  padding: 7px 11px;
  border-radius: 999px;
  background: #fff;
  color: #557076;
  font: 800 11px/1 var(--adah-font);
  box-shadow: 0 0 0 1px rgba(var(--adah-tertiary-rgb), .06);
}

.template-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.story-template-card {
  position: relative;
  min-height: 180px;
  padding: 9px;
  border: 1px solid rgba(var(--adah-tertiary-rgb), .06);
  border-radius: 15px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 18px 36px -30px rgba(var(--adah-tertiary-rgb), .32);
}

.story-template-card.is-selected {
  border-color: rgba(var(--adah-primary-rgb), .65);
  box-shadow:
    0 20px 40px -30px rgba(var(--adah-primary-rgb), .55),
    0 0 0 2px rgba(var(--adah-primary-rgb), .18);
}

.tpl-hero {
  height: 82px;
  margin-bottom: 12px;
  border-radius: 11px;
  background:
    radial-gradient(circle at 24% 34%, rgba(255, 255, 255, .62) 0 18%, transparent 19%),
    linear-gradient(135deg, rgba(var(--adah-primary-rgb), .85), rgba(var(--adah-secondary-rgb), .8));
}

.story-template-card:nth-child(2) .tpl-hero {
  background: linear-gradient(135deg, #DDE9E6, #F7F3EB);
}

.story-template-card:nth-child(3) .tpl-hero {
  background: linear-gradient(135deg, #E9F7F4, #D4EEF0);
}

.story-template-card:nth-child(4) .tpl-hero {
  background: linear-gradient(135deg, #F2F4F4, #D8E7E8);
}

.story-template-card span,
.story-template-card strong {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #DFEAEB;
}

.story-template-card span + span {
  width: 62%;
  margin-top: 7px;
}

.story-template-card strong {
  width: 48%;
  height: 18px;
  margin-top: 14px;
  background: rgba(var(--adah-primary-rgb), .16);
}

/* Step 2: editing */
.story-edit-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 145px;
  gap: 18px;
  align-items: center;
}

.story-canvas {
  position: relative;
  min-height: 284px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .54);
  box-shadow:
    inset 0 0 0 1px rgba(var(--adah-primary-rgb), .12),
    0 18px 42px -34px rgba(var(--adah-tertiary-rgb), .5);
}

.story-page {
  position: absolute;
  inset: 28px 34px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, .72)),
    radial-gradient(150px 120px at 80% 18%, rgba(var(--adah-secondary-rgb), .18), transparent 70%);
  box-shadow: 0 0 0 1px rgba(var(--adah-primary-rgb), .14);
}

.story-guide {
  position: absolute;
  inset-inline: 18px;
  border-top: 1px dashed rgba(75, 128, 135, .28);
}

.story-guide-a { top: 46px; }
.story-guide-b { top: 132px; }

.story-mini-toolbar {
  position: absolute;
  top: 34px;
  inset-inline-start: 50%;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 3px 6px;
  border-radius: 8px;
  background: #fff;
  color: #6C7D82;
  font: 800 8px/1 var(--adah-font);
  box-shadow:
    0 10px 22px -16px rgba(var(--adah-tertiary-rgb), .55),
    0 0 0 1px rgba(var(--adah-tertiary-rgb), .09);
  transform: translateX(-50%);
}

.story-mini-toolbar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #F4F8F8;
}

.story-selected-title {
  position: relative;
  z-index: 3;
  width: min(88%, 270px);
  margin: 78px auto 0;
  padding: 7px 8px;
  outline: 1.5px solid var(--adah-primary);
  background: rgba(255, 255, 255, .52);
  color: #2B4146;
  font: 300 26px/1.1 var(--adah-font);
  text-align: center;
  white-space: nowrap;
}

.story-handle {
  position: absolute;
  width: 7px;
  height: 7px;
  border: 1.5px solid #fff;
  border-radius: 1px;
  background: var(--adah-primary);
}

.story-handle.tl { top: -3px; inset-inline-start: -3px; }
.story-handle.tr { top: -3px; inset-inline-end: -3px; }
.story-handle.bl { bottom: -3px; inset-inline-start: -3px; }
.story-handle.br { bottom: -3px; inset-inline-end: -3px; }

.story-page p {
  width: min(84%, 230px);
  margin: 14px auto 0;
  color: #7C8B8F;
  font: 800 11px/1.5 var(--adah-font);
  text-align: center;
}

.story-style-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border: 1px solid rgba(var(--adah-tertiary-rgb), .06);
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 18px 36px -30px rgba(var(--adah-tertiary-rgb), .34);
}

.story-style-panel strong {
  color: var(--adah-tertiary);
  font: 900 13px/1 var(--adah-font);
}

.story-style-panel div {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 9px;
  border-radius: 9px;
  background: #F2F7F7;
  color: #6E7F84;
  font: 800 10px/1 var(--adah-font);
}

.story-style-panel i {
  width: 26px;
  height: 8px;
  border-radius: 999px;
  background: #111E22;
}

.story-style-panel i.teal {
  background: var(--adah-primary);
}

.story-style-panel em {
  color: #334A50;
  font-style: normal;
}

/* Step 3: publish */
.story-publish-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 154px;
  gap: 18px;
  align-items: center;
}

.published-site-card {
  min-height: 240px;
  padding: 26px;
  border: 1px solid rgba(var(--adah-primary-rgb), .14);
  border-radius: 22px;
  background:
    radial-gradient(180px 150px at 18% 82%, rgba(149, 167, 162, .22), transparent 68%),
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .78));
  box-shadow: 0 22px 46px -34px rgba(var(--adah-tertiary-rgb), .5);
}

.publish-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #E8F7ED;
  color: #2F8F4F;
  font: 900 11px/1 var(--adah-font);
}

.publish-status::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}

.published-site-card h4 {
  max-width: 320px;
  margin: 0 0 14px;
  color: var(--adah-tertiary);
  font: var(--adah-t-h4);
  font-size: 24px;
  line-height: 1.24;
  letter-spacing: 0;
}

.published-url {
  display: inline-flex;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--adah-primary);
  font: 900 12px/1 var(--adah-font);
  box-shadow: 0 0 0 1px rgba(var(--adah-tertiary-rgb), .06);
}

.published-site-card p {
  margin: 0;
  color: #647A80;
  font: 800 13px/1.6 var(--adah-font);
}

.story-qr-card {
  display: grid;
  place-items: center;
  min-height: 188px;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow:
    0 18px 40px -30px rgba(var(--adah-tertiary-rgb), .38),
    0 0 0 1px rgba(var(--adah-tertiary-rgb), .06);
}

.story-qr {
  position: relative;
  width: 118px;
  height: 118px;
  padding: 12px;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(var(--adah-primary-rgb), .18);
}


.story-qr::before {
  inset-inline-start: 13px;
  border-width: 5px 0 0 5px;
  border-radius: 5px 0 0 0;
}

.story-qr::after {
  inset-inline-end: 13px;
  border-width: 5px 5px 0 0;
  border-radius: 0 5px 0 0;
}

.story-qr-grid {
  position: absolute;
  inset: 31px 24px 22px;
  border-radius: 3px;
  background-image:
    linear-gradient(90deg, transparent 50%, var(--adah-ink-deep) 50%),
    linear-gradient(var(--adah-ink-deep) 50%, transparent 50%);
  background-size: 13% 13%;
  opacity: .82;
}

.story-qr .qr-svg {
    display: block;
    width: 100px;
    height: 100px;
    padding: 14px;
    background: #fff;
    position: relative;
}

.story-qr .qr-brand img {
    height: 25px;
}
.story-qr .qr-brand {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 25px;
    height: 25px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--adah-wave-1), var(--adah-wave-4));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 22px;
    box-shadow: 0 4px 12px rgba(var(--adah-primary-rgb),.35), inset 0 0 0 3px #fff;
    z-index: 2;
}