/* Demo notice (when all sections use fallback) */
.proj-demo-banner {
  background: linear-gradient(90deg, var(--theme), var(--theme2));
  color: #fff;
  padding: 12px 0;
  font-size: 14px;
  text-align: center;
}

.proj-demo-banner i {
  margin-inline-end: 8px;
}

/* Single Project Page */
.proj-features-sec {
  padding: 80px 0 40px;
}

.proj-feature-card {
  background: #fff;
  box-shadow: 0 4px 28px rgba(0, 0, 0, 0.08);
  padding: 32px 28px;
  height: 100%;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.proj-feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
}

.proj-feature-card .proj-feature-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 5px 5px var(--theme2);
  border: 1px solid var(--theme);
  padding: 10px;
}

.proj-feature-card .proj-feature-icon img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.proj-feature-card h3 {
  font-size: 22px;
  margin-bottom: 12px;
}

.proj-feature-card p {
  font-size: 16px;
  color: #555;
  margin: 0;
}

/* Detail section: text left, images right (RTL-friendly) */
.proj-detail-sec {
  padding: 60px 0 80px;
}

.proj-detail-content .section-title {
  margin-bottom: 20px;
}

.proj-detail-content .proj-detail-text {
  font-size: 16px;
  line-height: 1.8;
}

.proj-detail-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.proj-detail-images .proj-detail-img-item:first-child {
  grid-column: 1 / -1;
}

.proj-detail-images .proj-detail-img-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 8px;
}

.proj-detail-images .proj-detail-img-item:first-child img {
  height: 280px;
}

html[dir="ltr"] .proj-detail-row {
  flex-direction: row-reverse;
}

/* Gallery */
.proj-gallery-sec {
  padding: 60px 0 80px;
  background: #f8f8f8;
}

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

.proj-gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  aspect-ratio: 1;
}

.proj-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.proj-gallery-item:hover img {
  transform: scale(1.08);
}

.proj-gallery-item .proj-gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  color: #fff;
  font-size: 28px;
}

.proj-gallery-item:hover .proj-gallery-overlay {
  opacity: 1;
}

/* Timeline — alternating right / left (grid, works without html[dir]) */
.proj-timeline-sec {
  padding: 60px 0 100px;
}

.proj-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 56px;
  max-width: 1000px;
  margin: 50px auto 0;
  padding: 0 20px;
}

/* Center vertical line */
.proj-timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--theme);
  opacity: 0.25;
  transform: translateX(-50%);
  z-index: 0;
}

/*
 * 3 columns: [يسار 1fr] [خط 32px] [يمين 1fr]
 * is-right  → البطاقة في العمود الأيمن
 * is-left   → البطاقة في العمود الأيسر
 * النقطة دائماً في الوسط
 */
.proj-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  align-items: start;
  width: 100%;
  z-index: 1;
}

.proj-timeline-item.is-right .proj-timeline-card {
  grid-column: 3;
  grid-row: 1;
}

.proj-timeline-item.is-left .proj-timeline-card {
  grid-column: 1;
  grid-row: 1;
}

.proj-timeline-item .proj-timeline-dot {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: start;
  position: relative;
  top: 14px;
  width: 20px;
  height: 20px;
  background: var(--theme);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--theme2);
  z-index: 2;
}

.proj-timeline-item.is-right .proj-timeline-card {
  text-align: right;
}

.proj-timeline-item.is-left .proj-timeline-card {
  text-align: left;
}

html[dir="rtl"] .proj-timeline-item.is-right .proj-timeline-card,
html[lang="ar"] .proj-timeline-item.is-right .proj-timeline-card {
  text-align: right;
}

html[dir="rtl"] .proj-timeline-item.is-left .proj-timeline-card,
html[lang="ar"] .proj-timeline-item.is-left .proj-timeline-card {
  text-align: left;
}

.proj-timeline-card {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 24px;
  border-radius: 8px;
}

.proj-timeline-date {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--theme);
  background: var(--theme2);
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.proj-timeline-card h4 {
  font-size: 20px;
  margin-bottom: 8px;
}

.proj-timeline-card p {
  font-size: 15px;
  color: #666;
  margin: 0;
}

@media (max-width: 991px) {
  .proj-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  html[dir="ltr"] .proj-detail-row {
    flex-direction: column-reverse;
  }

  .proj-detail-images {
    margin-bottom: 30px;
  }
}

@media (max-width: 767px) {
  .proj-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .proj-timeline::before {
    left: 24px;
    transform: none;
  }

  html[dir="rtl"] .proj-timeline::before,
  html[lang="ar"] .proj-timeline::before {
    left: auto;
    right: 24px;
  }

  .proj-timeline-item {
    grid-template-columns: 48px 1fr;
    gap: 0 16px;
  }

  .proj-timeline-item.is-right .proj-timeline-card,
  .proj-timeline-item.is-left .proj-timeline-card {
    grid-column: 2;
    text-align: start;
  }

  .proj-timeline-item .proj-timeline-dot {
    grid-column: 1;
    justify-self: center;
    top: 10px;
  }

  html[dir="rtl"] .proj-timeline-item .proj-timeline-dot,
  html[lang="ar"] .proj-timeline-item .proj-timeline-dot {
    grid-column: 1;
  }
}
