/* =============================================================
   NOVIN ZEHN — نمونه‌کار دانش‌آموزان
   Shared by projects.html (the index) and projects/*.html (detail pages).
   Generated pages are built by tools/gen_projects.py.
   ============================================================= */

/* ===== نوار جست‌وجو و فیلتر ===== */
.pj-toolbar {
  position: sticky;
  top: 72px;
  z-index: 20;
  background: rgba(250, 249, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 0.85rem 1rem;
  margin-bottom: 1.75rem;
  max-width: 780px;
  margin-inline: auto;
}
.pj-search-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.pj-search-wrap { position: relative; flex: 1 1 240px; }
.pj-search-wrap svg {
  position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--text-light); pointer-events: none;
}
.pj-search {
  width: 100%;
  padding: 9px 38px 9px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}
.pj-search::placeholder { color: var(--text-light); }
.pj-search:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(91, 71, 168, 0.12);
}
.pj-clear {
  background: none; border: none; cursor: pointer; font-size: 0.8rem;
  color: var(--text-muted); font-family: inherit; padding: 6px 8px; border-radius: var(--radius-sm);
}
.pj-clear:hover { color: var(--primary); background: var(--primary-50); }

.pj-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.7rem; }
.pj-chip {
  font-family: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--text-muted);
  border: 1.5px solid var(--border); transition: all .18s;
}
.pj-chip:hover { border-color: var(--primary-200); color: var(--primary); }
.pj-chip[aria-pressed="true"] {
  background: var(--primary); color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(61, 43, 122, 0.20);
}
.pj-count { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 1.5rem; text-align: center; }
.pj-count b { color: var(--primary); }

/* ===== شبکهٔ کارت‌ها ===== */
.pj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}
.pj-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.pj-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}

/* ویدیوی معرفی */
.pj-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  overflow: hidden;
}
.pj-media video, .pj-media img, .pj-media iframe {
  width: 100%; height: 100%; object-fit: cover; display: block; border: 0;
}
.pj-media-empty {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.5rem; color: rgba(255,255,255,0.85); font-size: 0.9rem; font-weight: 600;
}
.pj-media-empty span:first-child { font-size: 2.25rem; }
.pj-media-label {
  position: absolute; top: 12px; inset-inline-start: 12px;
  background: rgba(26, 21, 48, 0.72); color: #fff;
  font-size: 0.72rem; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.pj-type-badge {
  position: absolute; top: 12px; inset-inline-end: 12px;
  font-size: 0.72rem; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  background: var(--accent); color: #241a05;
}
.pj-type-badge.solo { background: rgba(255,255,255,0.92); color: var(--primary); }

/* بدنهٔ کارت */
.pj-body { padding: 1.5rem; display: flex; flex-direction: column; gap: 0.85rem; flex: 1; }
.pj-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; font-size: 0.75rem; color: var(--text-muted); }
.pj-meta span {
  background: var(--surface-2); padding: 4px 10px; border-radius: 999px; font-weight: 600;
}
.pj-title { font-size: 1.2rem; font-weight: 800; color: var(--text); line-height: 1.5; margin: 0; }
.pj-summary { font-size: 0.92rem; color: var(--text-muted); line-height: 1.9; margin: 0; }

/* اعضا */
.pj-team-name {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem; font-weight: 700; color: var(--primary);
  background: var(--primary-50); padding: 6px 12px; border-radius: 999px;
  align-self: flex-start;
}
.pj-students { display: flex; flex-direction: column; gap: 0.5rem; }
.pj-student { display: flex; align-items: center; gap: 0.7rem; }
.pj-avatar {
  width: 34px; height: 34px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}
.pj-student-name { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.pj-student-role { font-size: 0.78rem; color: var(--text-light); }
mark.pj-hit { background: var(--accent-100); color: var(--text); border-radius: 4px; padding: 0 3px; }

.pj-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.pj-tag { font-size: 0.72rem; font-weight: 600; color: var(--primary-light); background: var(--primary-50); padding: 4px 10px; border-radius: var(--radius-sm); }

.pj-actions { margin-top: auto; padding-top: 0.5rem; }
.pj-actions .btn { width: 100%; justify-content: center; }

/* ===== حالت خالی ===== */
.pj-empty {
  text-align: center; padding: 5rem 1.5rem;
  background: var(--surface); border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}
.pj-empty .pj-empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.pj-empty h3 { font-size: 1.25rem; margin-bottom: 0.6rem; color: var(--text); }
.pj-empty p { color: var(--text-muted); max-width: 460px; margin: 0 auto 1.5rem; line-height: 2; }

/* ===== مودال جزئیات ===== */
.pj-modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none; align-items: flex-start; justify-content: center;
  padding: 3vh 1rem;
  background: rgba(26, 21, 48, 0.62);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
}
.pj-modal.open { display: flex; }
.pj-modal-box {
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: min(920px, 100%);
  overflow: hidden;
  animation: pjIn .25s ease;
}
@keyframes pjIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pj-modal-box { animation: none; } }
.pj-modal-head {
  display: flex; align-items: flex-start; gap: 1rem;
  padding: 1.5rem 1.75rem; border-bottom: 1.5px solid var(--border); background: var(--surface);
}
.pj-modal-head h2 { font-size: 1.35rem; margin: 0 0 0.4rem; }
.pj-modal-close {
  margin-inline-start: auto; flex: none;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-2); border: 1.5px solid var(--border);
  font-size: 1.1rem; color: var(--text-muted); cursor: pointer; line-height: 1;
}
.pj-modal-close:hover { background: var(--primary-50); color: var(--primary); }
.pj-modal-body { padding: 1.75rem; display: flex; flex-direction: column; gap: 2rem; }
.pj-block h3 {
  font-size: 1rem; font-weight: 800; color: var(--primary);
  margin: 0 0 1rem; display: flex; align-items: center; gap: 8px;
}
.pj-work-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.pj-work-item {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.pj-work-item video, .pj-work-item img, .pj-work-item iframe {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; border: 0; background: #1A1530;
}
.pj-work-item figcaption { padding: 0.75rem 1rem; font-size: 0.85rem; color: var(--text-muted); }
.pj-work-link {
  display: flex; align-items: center; gap: 10px; padding: 1rem;
  font-size: 0.9rem; font-weight: 700; color: var(--primary); text-decoration: none;
}
.pj-work-link:hover { background: var(--primary-50); }
.pj-modal-students { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0.85rem; }
.pj-modal-student {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1rem;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius);
}

@media (max-width: 640px) {
  .pj-toolbar { top: 64px; padding: 0.75rem; }
  .pj-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .pj-modal-body { padding: 1.25rem; }
  .pj-modal-head { padding: 1.25rem; }
}

/* =============================================================
   صفحهٔ جزئیات پروژه — projects/<id>.html
   ============================================================= */
.pd-hero-meta { justify-content: center; margin-top: 1.25rem; }
.pd-wrap { max-width: 880px; }

.pd-block { margin-bottom: 3rem; }
.pd-block h2 {
  font-size: 1.15rem; font-weight: 800; color: var(--primary);
  margin: 0 0 1.1rem; display: flex; align-items: center; gap: 8px;
}
.pd-block > p {
  font-size: 1rem; line-height: 2.15; color: var(--text-muted); margin: 0;
}
.pd-note { font-size: 0.9rem; color: var(--text-light); line-height: 2; margin: 0 0 1rem; }

.pd-hero-media {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1.5px solid var(--border); box-shadow: var(--shadow);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  position: relative; aspect-ratio: 16 / 9;
}
.pd-hero-media video, .pd-hero-media img, .pd-hero-media iframe {
  width: 100%; height: 100%; object-fit: cover; display: block; border: 0;
}

/* اجرای زندهٔ پروژه */
.pd-live-frame {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1.5px solid var(--border-strong); box-shadow: var(--shadow);
  background: var(--surface); margin-bottom: 1.25rem;
}
.pd-live-frame iframe {
  width: 100%; height: 520px; border: 0; display: block; background: #fff;
}
@media (max-width: 640px) { .pd-live-frame iframe { height: 380px; } }

.pd-back { margin-top: 3.5rem; text-align: center; }
