/* ── STUDENT PROJECTS: showcase, homepage block, project page, portal tab ── */

/* Cards (shared) */
.pj-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.pj-card { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,.08); display: flex; flex-direction: column; color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; min-width: 0; }
.pj-card:hover { transform: translateY(-4px); box-shadow: 0 10px 28px rgba(0,0,0,.13); color: inherit; }
.pj-card.is-featured { box-shadow: 0 0 0 2px #f5c542, 0 6px 20px rgba(245,197,66,.25); }
.pj-thumb { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, #0f2d1a, #1a7a3c); }
.pj-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-star { position: absolute; top: 12px; left: 12px; background: #f5c542; color: #3d2c00; font-size: 12px; font-weight: 800; padding: 5px 11px; border-radius: 50px; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.pj-star-inline { position: static; display: inline-block; margin-bottom: 12px; box-shadow: none; }
.pj-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pj-body h3 { font-size: 18px; font-weight: 800; color: var(--dark); line-height: 1.3; overflow-wrap: anywhere; }
.pj-body > p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.pj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-chips span { background: var(--accent); color: var(--green); font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 50px; }
.pj-by { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid #f1f3f2; min-width: 0; }
.pj-by span { display: flex; flex-direction: column; min-width: 0; }
.pj-by b { font-size: 14px; color: var(--dark); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-by small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-av { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--green), var(--green-light)); color: #fff; font-weight: 800; }

/* Showcase page */
.pj-hero { background: linear-gradient(135deg, #0f2d1a, #1a5c30); color: #fff; padding: 64px 0 52px; text-align: center; }
.pj-hero-tag { display: inline-block; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.22); padding: 6px 16px; border-radius: 50px; font-size: 13px; font-weight: 600; }
.pj-hero h1 { font-size: clamp(28px, 5vw, 46px); font-weight: 800; margin: 14px 0 10px; letter-spacing: -.5px; }
.pj-hero p { opacity: .85; font-size: 16px; max-width: 560px; margin: 0 auto; line-height: 1.6; }
.pj-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.pj-filter a { padding: 9px 16px; border-radius: 50px; background: #fff; border: 1px solid #e5e7eb; font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; }
.pj-filter a:hover { border-color: var(--green); color: var(--green); }
.pj-filter a.active { background: var(--green); border-color: var(--green); color: #fff; }
.pj-pages { margin-top: 36px; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.pj-pages .page-numbers { padding: 9px 14px; border-radius: 10px; background: #fff; border: 1px solid #e5e7eb; color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; }
.pj-pages .current { background: var(--green); border-color: var(--green); color: #fff; }
.pj-empty { text-align: center; background: #fff; border-radius: 16px; padding: 56px 24px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.pj-empty-icon { font-size: 44px; margin-bottom: 10px; }
.pj-empty h3 { font-size: 20px; font-weight: 800; color: var(--dark); margin-bottom: 8px; }
.pj-empty p { color: var(--muted); margin-bottom: 18px; }

/* Single project page */
.pj-single { padding: 36px 0 72px; background: #f8faf9; }
.pj-single-inner { max-width: 1080px; }
.pj-back { display: inline-block; color: var(--green); font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 22px; }
.pj-single-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 26px; flex-wrap: wrap; }
.pj-single-head h1 { font-size: clamp(26px, 4.4vw, 40px); font-weight: 800; color: var(--dark); line-height: 1.2; margin-bottom: 14px; letter-spacing: -.5px; overflow-wrap: anywhere; }
.pj-by-lg { border: 0; padding: 0; margin: 0; }
.pj-by-lg b { font-size: 15px; }
.pj-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pj-cover { margin: 0 0 32px; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 36px rgba(0,0,0,.12); background: #0f2d1a; }
.pj-cover img { width: 100%; max-height: 620px; object-fit: cover; display: block; }
.pj-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.pj-desc h2, .pj-more h2 { font-size: 20px; font-weight: 800; color: var(--dark); margin: 0 0 12px; }
.pj-desc p { font-size: 16px; line-height: 1.8; color: var(--text); margin-bottom: 14px; overflow-wrap: anywhere; }
.pj-desc h2 + p { margin-top: 0; }
.pj-desc p + h2 { margin-top: 28px; }
.pj-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pj-gallery img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; display: block; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.pj-side-card { background: #fff; border-radius: 16px; padding: 6px 20px; box-shadow: 0 2px 12px rgba(0,0,0,.06); }
.pj-side-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid #f1f3f2; font-size: 14px; }
.pj-side-row:last-child { border-bottom: 0; }
.pj-side-row span { color: var(--muted); }
.pj-side-row b { color: var(--dark); text-align: right; }
.pj-side-col { flex-direction: column; }
.pj-more { margin-top: 56px; }

@media (max-width: 960px) {
  .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pj-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .pj-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .pj-hero { padding: 44px 0 36px; }
  .pj-filter { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 24px; padding: 0 16px 4px; scrollbar-width: none; }
  .pj-filter a { white-space: nowrap; flex-shrink: 0; }
  .pj-single { padding-top: 24px; }
  .pj-actions { width: 100%; flex-direction: column; }
  .pj-actions .btn { width: 100%; text-align: center; justify-content: center; }
  .pj-gallery { grid-template-columns: minmax(0, 1fr); }
  .pj-cover { border-radius: 14px; margin-bottom: 24px; }
}

/* ── Portal: My Projects tab ── */
.pp-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.pp-head .section-heading { margin-bottom: 0; }
.pp-intro { color: var(--muted); font-size: 14px; margin: 6px 0 18px; line-height: 1.6; }
.pp-intro a { color: var(--green); font-weight: 600; }
.pp-new-btn, .pp-submit { background: var(--green); color: #fff; border: 0; border-radius: 10px; padding: 11px 18px; font: 700 14px 'Inter', sans-serif; cursor: pointer; }
.pp-new-btn:hover, .pp-submit:hover { background: var(--green-dark); }
.pp-hidden { display: none !important; }
.pp-notice { border-radius: 12px; padding: 13px 16px; font-size: 14px; margin-bottom: 16px; line-height: 1.5; }
.pp-ok { background: #ecfdf3; border: 1px solid #86efac; color: #14532d; }
.pp-err { background: #fef2f2; border: 1px solid #fca5a5; color: #991b1b; }
.pp-note { background: #fef3c7; border: 1px solid #fcd34d; color: #92400e; border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.5; margin: 8px 0; overflow-wrap: anywhere; }

.pp-form { background: #fff; border-radius: 14px; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.06); margin-bottom: 22px; display: flex; flex-direction: column; gap: 16px; }
.pp-form h3 { font-size: 17px; font-weight: 800; color: var(--dark); }
.pp-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--dark); min-width: 0; }
.pp-field b { color: #dc2626; }
.pp-field small { font-weight: 400; color: var(--muted); font-size: 12px; }
.pp-field input[type=text], .pp-field input[type=url], .pp-field select, .pp-field textarea { width: 100%; border: 1px solid #d1d5db; border-radius: 10px; padding: 11px 12px; font: 400 15px 'Inter', sans-serif; color: var(--text); background: #fff; }
.pp-field textarea { resize: vertical; line-height: 1.6; }
.pp-field input:focus, .pp-field select:focus, .pp-field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(26,122,60,.12); }
.pp-field input[type=file] { font-size: 13px; font-weight: 400; max-width: 100%; }
.pp-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pp-cover-prev { width: 160px; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; }
.pp-gal-edit { display: flex; flex-wrap: wrap; gap: 10px; }
.pp-gal-edit label { display: flex; flex-direction: column; gap: 4px; font-weight: 400; font-size: 12px; }
.pp-gal-edit img { width: 90px; height: 64px; object-fit: cover; border-radius: 8px; }
.pp-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text); line-height: 1.5; }
.pp-check input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; }
.pp-form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pp-cancel { background: none; border: 0; color: var(--muted); font: 600 14px 'Inter', sans-serif; cursor: pointer; text-decoration: none; padding: 10px; }

.pp-list { display: flex; flex-direction: column; gap: 12px; }
.pp-item { display: flex; gap: 16px; background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.06); min-width: 0; }
.pp-thumb { width: 150px; flex-shrink: 0; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, #0f2d1a, #1a7a3c); }
.pp-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.pp-info h4 { font-size: 16px; font-weight: 700; color: var(--dark); overflow-wrap: anywhere; }
.pp-info small { color: var(--muted); font-size: 12px; }
.pp-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-badge { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 50px; }
.pp-badge-pub { background: #dcfce7; color: #166534; }
.pp-badge-rev { background: #e0f2fe; color: #075985; }
.pp-badge-chg { background: #fef3c7; color: #92400e; }
.pp-badge-feat { background: #f5c542; color: #3d2c00; }
.pp-actions { display: flex; gap: 16px; margin-top: 6px; font-size: 13px; font-weight: 600; }
.pp-actions a { color: var(--green); text-decoration: none; }
.pp-actions .pp-del { color: #b91c1c; }

@media (max-width: 768px) {
  .pp-form { padding: 18px 16px; border-radius: 14px; }
  .pp-row { grid-template-columns: minmax(0, 1fr); }
  .pp-new-btn { width: 100%; }
  .pp-submit { flex: 1; padding: 13px 18px; }
  .pp-item { flex-direction: column; gap: 12px; }
  .pp-thumb { width: 100%; }
}

/* ── Project demo video ── */
.pj-video { position: relative; width: 100%; border-radius: 14px; overflow: hidden; background: #0f1c14; box-shadow: 0 2px 12px rgba(0,0,0,.1); margin-bottom: 28px; aspect-ratio: 16 / 9; }
.pj-video iframe, .pj-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; background: #0f1c14; }
.pp-video em { font-style: normal; font-weight: 400; color: var(--muted); }
.pp-video-cur { display: flex; flex-direction: column; gap: 6px; max-width: 420px; }
.pp-video-cur .pj-video { margin-bottom: 0; }
.pp-video-rm { font-weight: 400; font-size: 13px; display: flex; align-items: center; gap: 6px; }
.pp-vprog { display: flex; flex-direction: column; gap: 6px; }
.pp-vprog[hidden] { display: none; }
.pp-vbar { height: 8px; border-radius: 6px; background: #e5e7eb; overflow: hidden; }
.pp-vbar i { display: block; height: 100%; width: 0; background: var(--green, #1a7a3c); transition: width .2s; }
.pp-vtxt { font-weight: 500; font-size: 13px; color: var(--text); }
.pp-vprog.is-ok .pp-vtxt { color: #166534; }
.pp-vprog.is-err .pp-vbar i { background: #dc2626; }
.pp-vprog.is-err .pp-vtxt { color: #b91c1c; }
.pp-submit:disabled { opacity: .55; cursor: wait; }
