/* ============================================================
   dikr — card studio + design galleries
   ============================================================ */
.ds-body { --ds-card: #fff; --ds-ink: #16242f; --ds-muted: #5f6b76; }
body.dark.ds-body { --ds-card: #1c1c1e; --ds-ink: #f2f2f7; --ds-muted: #a1a1a8; }

.ds-wrap { max-width: 1100px; margin: 0 auto; padding: 18px 16px 48px; }
.ds-crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ds-muted); margin-bottom: 12px; }
.ds-crumbs a { color: var(--ds-muted); text-decoration: none; }
.ds-head { text-align: center; margin-bottom: 24px; }
.ds-head h1 { font-size: clamp(26px, 4.6vw, 38px); line-height: 1.4; color: var(--ds-ink); margin: 0 0 8px; text-wrap: balance; }
.ds-lead { color: var(--ds-muted); font-size: 17px; line-height: 1.9; margin: 0 auto; max-width: 720px; }
.ds-cta { margin-top: 16px; }

/* buttons */
.st-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 14px;
  font: inherit; font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
  color: var(--blue-darker); background: var(--blue-bg); border: 1px solid var(--blue-border); }
body.dark .st-btn { color: var(--blue); }
.st-btn:hover { border-color: var(--blue); }
.st-btn-main { background: linear-gradient(135deg, var(--blue-dark), var(--blue-darker)); color: #fff !important; border: 0; }
.st-btn-soft { background: transparent; }
.st-btn-sm { padding: 7px 12px; font-size: 14px; border-radius: 11px; }
.st-btn-icon { width: 46px; padding: 0; }

/* studio */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 26px; align-items: start; }
.st-preview { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.st-preview canvas { width: 100%; max-height: calc(100vh - 190px); object-fit: contain; border-radius: 16px;
  box-shadow: 0 16px 40px rgba(8, 42, 66, .22); background: #0f3350; aspect-ratio: 1080 / 1350; height: auto; max-width: 100%; }
.studio:not(.is-ready) canvas { opacity: .4; }
.st-actions { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; }
.st-actions .st-btn-main { flex: 1; max-width: 260px; }

.st-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.st-step { background: var(--ds-card); border: 1px solid var(--separator); border-radius: 18px; padding: 16px; min-width: 0; }
.st-step h2 { font-size: 18px; color: var(--ds-ink); margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.st-step h2 span { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-dark); color: #fff; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; }
.st-step h2 small { font-weight: 400; color: var(--ds-muted); font-size: 14px; }
.st-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.st-chips-sm { flex-wrap: wrap; overflow: visible; margin: 8px 0 12px; }
.st-chip { flex: none; font: inherit; font-size: 15px; padding: 6px 14px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--separator); background: var(--sys-bg); color: var(--ds-ink); }
.st-chips-sm .st-chip { font-size: 13.5px; padding: 4px 11px; }
.st-chip.on, .st-chip:hover { border-color: var(--blue); color: var(--blue-darker); background: var(--blue-bg); }
body.dark .st-chip.on { color: var(--blue); }
.st-items { display: grid; gap: 8px; max-height: 330px; overflow-y: auto; margin-top: 10px; padding-inline-end: 4px; }
.st-item { text-align: right; font: inherit; cursor: pointer; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--separator); background: var(--sys-bg); color: var(--ds-ink); display: flex; flex-direction: column; gap: 2px; }
.st-item:hover { border-color: var(--blue-border); }
.st-item.on { border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-glow); background: var(--blue-bg); }
.st-item-text { font-size: 17px; line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.st-item-text.is-q { font-family: var(--font-quran); font-size: 19px; }
.st-item-src { font-size: 13px; color: var(--ds-muted); }
.st-loading { color: var(--ds-muted); margin: 0; }
.st-hint { font-size: 13.5px; color: var(--ds-muted); margin: 10px 0 0; line-height: 1.7; }
.st-hint i { color: var(--blue-dark); }

.st-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 10px; margin-bottom: 14px; }
.st-swatch { aspect-ratio: 1; border-radius: 14px; cursor: pointer; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--separator);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-family: Amiri, serif; font-weight: 700; }
.st-swatch.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-glow); }
.st-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.st-row.is-disabled { opacity: .45; pointer-events: none; }
.st-label { font-size: 15px; color: var(--ds-muted); min-width: 64px; }
.st-seg { display: inline-flex; background: var(--sys-bg); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.st-seg button { font: inherit; font-size: 15px; border: 0; background: transparent; color: var(--ds-ink); padding: 6px 12px; border-radius: 9px; cursor: pointer; }
.st-seg button.on { background: var(--ds-card); color: var(--blue-darker); box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 700; }
body.dark .st-seg button.on { color: var(--blue); }
.st-row input[type=range] { flex: 1; min-width: 140px; accent-color: var(--blue-dark); }
.st-field { display: flex; flex-direction: column; gap: 6px; font-size: 15px; color: var(--ds-muted); }
.st-field input { font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--separator);
  background: var(--sys-bg); color: var(--ds-ink); }
.st-field input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

/* sections */
.ds-section { margin-top: 36px; }
.ds-section h2 { font-size: 22px; color: var(--ds-ink); margin: 0 0 12px; }
.ds-note { background: var(--blue-bg); border: 1px solid var(--blue-border); border-radius: 18px; padding: 18px 20px; }
.ds-note p, .ds-more { margin: 0 0 12px; color: var(--ds-ink); font-size: 16px; line-height: 2; }
.ds-note a, .ds-more a { color: var(--blue-darker); }
body.dark .ds-note a, body.dark .ds-more a { color: var(--blue); }
.ds-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.ds-link-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ds-ink); font-weight: 700; font-size: 16px; }
.ds-link-card img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }

/* gallery */
.ds-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.ds-fig { margin: 0; background: var(--ds-card); border: 1px solid var(--separator); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.ds-fig-img img { display: block; width: 100%; height: auto; }
.ds-fig figcaption { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.ds-fig-text { margin: 0; font-size: 17px; line-height: 1.9; color: var(--ds-ink); }
.ds-fig-text.is-q { font-family: var(--font-quran); font-size: 19px; }
.ds-fig-note { margin: 0; font-size: 14px; color: var(--blue-darker); }
.ds-fig-src { margin: 0; font-size: 13.5px; color: var(--ds-muted); }
.ds-fig-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; }

@media (max-width: 860px) {
  .studio { grid-template-columns: minmax(0, 1fr); }
  .st-preview { position: static; }
  .st-preview canvas { max-height: 62vh; width: auto; }
  .ds-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .ds-fig figcaption { padding: 10px; }
  .ds-fig-text { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .ds-fig-actions { flex-direction: column; }
}

/* floating mini preview (phones) */
.st-mini { display: none; }
@media (max-width: 860px) {
  .st-mini { display: block; position: fixed; left: 14px; bottom: 16px; z-index: 50; padding: 0; border: 2px solid #fff; border-radius: 12px;
    overflow: hidden; box-shadow: 0 10px 28px rgba(0,0,0,.3); background: #000; cursor: pointer;
    opacity: 0; transform: translateY(20px) scale(.9); pointer-events: none; transition: opacity .25s, transform .25s; }
  .st-mini.show { opacity: 1; transform: none; pointer-events: auto; }
  .st-mini canvas { display: block; width: 84px; height: auto; }
}
