/* ملف: sections.css
   تنسيقات الأقسام المخصّصة التي تُضاف من الداشبورد (بطولات، شهادات،
   خبرات...). يعتمد كلياً على متغيّرات theme.css فيتبع أي تغيير للألوان.

   يدعم RTL عبر الخصائص المنطقية (inline-start/end) بدل left/right. */

.custom-section .section-subtitle {
  max-width: 760px;
  margin: -22px auto 44px;
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ---------- بطاقات ---------- */

.custom-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
  max-width: 1200px;
  margin: 0 auto;
}

.custom-card {
  background: color-mix(in srgb, var(--nav-bg) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
  border-radius: 12px;
  padding: 30px 26px;
  text-align: center;
  transition: transform .25s ease, border-color .25s ease;
}

.custom-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

.custom-card > i {
  font-size: 2.1rem;
  color: var(--accent);
  margin-bottom: 16px;
  display: block;
}

.custom-card h3 {
  margin: 0 0 10px;
  color: var(--text-light);
  font-size: 1.15rem;
}

.custom-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.75;
}

.custom-meta {
  display: inline-block;
  margin-top: 14px;
  padding: 4px 12px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--primary) 30%, transparent);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 600;
}

/* ---------- خط زمني ---------- */

.custom-timeline {
  list-style: none;
  max-width: 820px;
  margin: 0 auto;
  padding: 0;
  position: relative;
}

/* الخط الرأسي يمتد بين النقاط */
.custom-timeline::before {
  content: '';
  position: absolute;
  inset-block: 12px;
  inset-inline-start: 19px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--accent),
    color-mix(in srgb, var(--accent) 18%, transparent)
  );
}

.timeline-item {
  position: relative;
  display: flex;
  gap: 22px;
  padding-bottom: 34px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-marker {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--nav-bg);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 1rem;
  z-index: 1;
}

.timeline-body {
  flex: 1;
  background: color-mix(in srgb, var(--nav-bg) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: 10px;
  padding: 18px 22px;
}

.timeline-date {
  display: block;
  color: var(--accent);
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.timeline-body h3 {
  margin: 0 0 8px;
  color: var(--text-light);
  font-size: 1.1rem;
}

.timeline-body p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* ---------- معرض ---------- */

.custom-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 18px;
  max-width: 1200px;
  margin: 0 auto;
}

.custom-gallery figure {
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--nav-bg);
  border: 1px solid color-mix(in srgb, var(--accent) 12%, transparent);
}

.custom-gallery img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.custom-gallery figcaption {
  padding: 12px 14px;
  color: var(--text-secondary);
  font-size: .9rem;
  line-height: 1.6;
}

/* ---------- نص ---------- */

.custom-text {
  max-width: 780px;
  margin: 0 auto;
}

.custom-text p {
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 18px;
}

/* ---------- شاشات صغيرة ---------- */

@media (max-width: 768px) {
  .timeline-item { gap: 14px; }
  .custom-timeline::before { inset-inline-start: 15px; }
  .timeline-marker { width: 32px; height: 32px; font-size: .85rem; }
}

/* من يفضّل تقليل الحركة لا يرى تأثير الرفع عند المرور */
@media (prefers-reduced-motion: reduce) {
  .custom-card { transition: none; }
  .custom-card:hover { transform: none; }
}
