/* ===== المدونة: الغلاف، البطاقات، ومحتوى المقالة (كتل) ===== */
:root {
  --success: #3e8e6d;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --success: #5bb18f;
  }
}
:root[data-theme="dark"] {
  --success: #5bb18f;
}

.icon {
  width: 24px;
  height: 24px;
  display: block;
  flex-shrink: 0;
}

a.cs-card {
  display: block;
  color: inherit;
}
.cs-cover {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--accent-soft);
}
.cs-cover picture {
  display: block;
  width: 100%;
  height: 100%;
}
.cs-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.cs-card:hover .cs-cover img {
  transform: scale(1.03);
}
.cs-date {
  display: block;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--muted);
}

.post {
  padding: 56px 0 80px;
}
.post-head {
  max-width: 820px;
  margin-inline: auto;
  padding-bottom: 28px;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.85rem;
}
.post-meta .tag {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 14px;
  border-radius: 999px;
}
.post-head h1 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  line-height: 1.35;
  margin-bottom: 16px;
}
.post-lead {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.9;
}

.post-cover {
  aspect-ratio: 16/9;
  border-radius: 24px;
  overflow: hidden;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.post-cover picture {
  display: block;
  width: 100%;
  height: 100%;
}
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-content {
  padding-top: 24px;
}
.post-content > * {
  margin-inline: auto;
}

.prose {
  max-width: 70ch;
  font-size: 1.08rem;
  line-height: 1.95;
  margin-top: 8px;
}
.prose > *:first-child {
  margin-top: 0;
}
.prose p {
  margin-bottom: 1.2em;
}
.prose h2 {
  font-size: 1.65rem;
  margin: 2em 0 0.6em;
  line-height: 1.4;
}
.prose h3 {
  font-size: 1.3rem;
  margin: 1.7em 0 0.5em;
  line-height: 1.4;
}
.prose ul,
.prose ol {
  margin: 0 0 1.3em;
  padding-inline-start: 1.5em;
}
.prose li {
  margin-bottom: 0.5em;
}
.prose a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose blockquote {
  margin: 1.6em 0;
  padding: 0.4em 1.3em;
  border-inline-start: 4px solid var(--accent);
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 0 12px 12px 0;
}
.prose blockquote p:last-child {
  margin-bottom: 0;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2.4em 0;
}
.prose img {
  border-radius: 16px;
}
.prose code {
  background: var(--bg-alt);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.92em;
}

.blk {
  margin-top: 40px;
  margin-bottom: 40px;
  max-width: 980px;
}
.blk-title {
  font-family: "ThmanyahSerifDisplay", "Cairo", sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  margin-bottom: 16px;
}
.blk-source,
.blk figcaption {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: start;
}
.chart-frame {
  position: relative;
  height: 340px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}
.chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}
@media (max-width: 640px) {
  .chart-frame {
    height: 280px;
    padding: 14px;
  }
}

.blk-image.w-normal {
  max-width: 70ch;
}
.blk-image.w-wide {
  max-width: 980px;
}
.blk-image.w-full {
  max-width: 1072px;
}
.blk-image-frame {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}
.blk-image-frame picture {
  display: block;
}
.blk-image-frame img {
  display: block;
  width: 100%;
  height: auto;
}
.blk-image figcaption {
  text-align: center;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.blk-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 480px;
}
.blk-table th {
  background: var(--accent-soft);
  color: var(--text);
  font-weight: 800;
  text-align: start;
  padding: 14px 18px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.blk-table td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.blk-table tbody tr:last-child td {
  border-bottom: none;
}
.blk-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.4em 0;
  font-size: 0.95rem;
}
.prose th,
.prose td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: start;
}
.prose th {
  background: var(--accent-soft);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}
.kpi-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}
.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon .icon {
  width: 26px;
  height: 26px;
}
.kpi-value {
  font-family: "ThmanyahSerifDisplay", "Cairo", sans-serif;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.kpi-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.88rem;
  margin-top: 4px;
  line-height: 1.5;
}
.kpi-note {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.blk-callout {
  --c: var(--accent);
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid color-mix(in srgb, var(--c) 35%, var(--border));
  border-inline-start: 5px solid var(--c);
  background: color-mix(in srgb, var(--c) 9%, var(--surface));
}
.blk-callout.v-info {
  --c: var(--primary);
}
.blk-callout.v-warning {
  --c: var(--gold);
}
.blk-callout.v-success {
  --c: var(--success);
}
.callout-icon {
  color: var(--c);
  margin-top: 2px;
}
.callout-title {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}
.callout-body p {
  margin: 0 0 0.6em;
  line-height: 1.85;
}
.callout-body p:last-child {
  margin-bottom: 0;
}

.iconlist {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}
.iconlist li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
}
.il-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.il-icon .icon {
  width: 22px;
  height: 22px;
}
.iconlist strong {
  display: block;
  margin-bottom: 4px;
}
.iconlist p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.8;
}

.post-back {
  margin-top: 56px;
  max-width: 70ch;
}

@media (max-width: 640px) {
  .post {
    padding-top: 36px;
  }
  .post-cover {
    border-radius: 18px;
  }
  .kpi-item {
    padding: 18px;
  }
  .blk {
    margin-top: 32px;
    margin-bottom: 32px;
  }
}
