/* ===== صورة الغلاف على الكارت ===== */
.card { cursor: pointer; }
.card:focus-visible, .row:focus-visible { outline: 3px solid var(--accent, var(--brand)); outline-offset: 3px; }
.card.has-cover { padding-top: 0; }
.card .cover {
  display: block; width: calc(100% + 48px); height: 170px; max-width: none;
  margin: 0 -24px 18px; object-fit: cover;
}
.more {
  margin-top: auto; padding-top: 16px;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--accent); font-weight: 700; font-size: .9rem;
  transition: gap .3s var(--ease);
}
.card:hover .more { gap: 10px; }

/* ===== نافذة الشرح ===== */
.detail-box { position: relative; width: min(780px, 100%); padding: 0; overflow: hidden; }
.detail-close {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2;
  background: var(--surface-solid); box-shadow: var(--shadow);
}
.detail-cover { display: block; width: 100%; height: 240px; object-fit: cover; }
.detail { padding: 24px 26px 30px; }
.detail-head { display: flex; gap: 14px; align-items: center; }
.detail-head .icon { flex-shrink: 0; }
.detail-head h2 { font-size: 1.4rem; font-weight: 800; margin-top: 2px; }
.detail-head .type-tag { font-size: .8rem; font-weight: 700; color: var(--accent); }
.detail .desc { margin-top: 14px; }
.detail .steps { margin-top: 14px; }

.guide-title {
  margin: 26px 0 12px; font-size: 1.1rem; font-weight: 800;
  display: flex; align-items: center; gap: 10px;
}
.guide-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.guide { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.guide-step {
  display: grid; grid-template-columns: 40px 1fr; gap: 14px;
  padding: 16px; border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface-solid);
}
.guide-step .num {
  width: 40px; height: 40px; border-radius: 13px;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
}
.guide-body { min-width: 0; }
.guide-body h4 { margin: 2px 0 4px; font-size: 1.02rem; font-weight: 800; }
.guide-body p { color: var(--muted); white-space: pre-line; font-size: .95rem; }
.guide-body img {
  display: block; width: 100%; height: auto; margin-top: 12px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--bg-2);
}

/* ===== لوحة الإدارة: صور ===== */
.row-thumb { width: 50px; height: 50px; border-radius: 15px; object-fit: cover; flex-shrink: 0; }
.media-field { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
img.preview, .preview {
  width: 140px; height: 90px; object-fit: cover; border-radius: 14px;
  border: 1px solid var(--border); background: var(--bg-2);
  display: grid; place-items: center; color: var(--muted); font-size: .85rem;
}
img.preview { display: block; }
.media-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.section-box { border: 1px dashed var(--border); border-radius: 18px; padding: 14px; margin-bottom: 14px; }
.section-box h3 { font-size: 1rem; font-weight: 800; margin-bottom: 10px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.section-head h3 { margin: 0; }
.steps-editor { display: grid; gap: 12px; }
.step-card { border: 1px solid var(--border); border-radius: 16px; padding: 14px; background: var(--bg-2); }
.step-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 800; }
.step-tools { display: flex; gap: 6px; }
.step-tools .btn { padding: 4px 10px; }
.step-tools .btn:disabled { opacity: .35; }
.small-note { font-size: .9rem; margin: 0; }
.step-card .field { margin-bottom: 10px; }
.step-card textarea { background: var(--surface-solid); }
