/* College Projects (templates/projects/*) */

.pj-page, .pj-mobile-bar { --pj-card: #fff; --pj-line: #edf2f7; --pj-soft: var(--t-50, #eef2ff); }
.pj-muted { color: var(--text-muted); font-size: 14px; }
.pj-page-title { font-size: 28px; font-weight: 800; color: var(--text-main); margin: 0 0 4px; }

.pj-btn-primary { background: var(--primary-gradient); color: #fff; font-weight: 700; border: 0; border-radius: 10px; padding: 10px 18px; }
.pj-btn-primary:hover, .pj-btn-primary:focus { color: #fff; filter: brightness(1.05); }
.pj-btn-primary.is-loading { opacity: .75; cursor: progress; }
.pj-btn-outline { background: var(--pj-card); color: var(--primary-dark); border: 1px solid var(--border); font-weight: 600; border-radius: 10px; }
.pj-btn-outline:hover { border-color: var(--primary); color: var(--primary-dark); background: var(--pj-soft); }

/* Hero */
.pj-hero {
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: center;
    background: var(--pj-card); border: 1px solid var(--pj-line); border-radius: var(--radius-xl, 20px);
    padding: 32px 36px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.03); position: relative; overflow: hidden;
}
.pj-hero::after { content: ''; position: absolute; right: -90px; top: -90px; width: 280px; height: 280px; background: radial-gradient(circle, rgba(var(--t-500-rgb, 99, 102, 241), .14) 0%, transparent 70%); pointer-events: none; }
.pj-eyebrow { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 700; color: var(--primary-dark); background: var(--pj-soft); border-radius: 999px; padding: 5px 12px; }
.pj-hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-main); margin: 12px 0 8px; }
.pj-hero p { color: var(--text-muted); font-size: 15px; line-height: 1.6; margin: 0 0 18px; max-width: 640px; }
.pj-search { position: relative; display: flex; gap: 8px; max-width: 620px; z-index: 1; }
.pj-search > i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; }
.pj-search input { flex: 1; min-width: 0; height: 50px; border: 1px solid var(--border); border-radius: 14px; padding: 0 14px 0 44px; font-size: 14px; background: var(--pj-card); color: var(--text-main); }
.pj-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(var(--t-500-rgb, 99, 102, 241), .15); }
.pj-hero-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.pj-hero-points li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--pj-soft); }
.pj-hero-points i { font-size: 22px; color: var(--primary); }
.pj-hero-points b { display: block; font-size: 14px; color: var(--text-main); }
.pj-hero-points span { font-size: 12.5px; color: var(--text-muted); }

/* Category chips + toolbar */
.pj-cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.pj-cat { flex-shrink: 0; display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--pj-card); color: var(--text-muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.pj-cat small { font-size: 11px; opacity: .75; }
.pj-cat:hover { color: var(--primary-dark); border-color: var(--primary); }
.pj-cat.active { background: var(--primary-gradient); color: #fff; border-color: transparent; }
.pj-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pj-toolbar .form-select { width: auto; min-width: 160px; border-radius: 10px; font-size: 14px; }
.pj-seg { display: flex; gap: 4px; padding: 4px; background: var(--pj-soft); border-radius: 12px; }
.pj-seg label { margin: 0; position: relative; }
.pj-seg input { position: absolute; opacity: 0; pointer-events: none; }
.pj-seg span { display: block; padding: 6px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; }
.pj-seg input:checked + span { background: var(--pj-card); color: var(--primary-dark); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.pj-seg input:focus-visible + span { outline: 2px solid var(--primary); }
.pj-count { font-size: 13px; color: var(--text-muted); }
.pj-section-title { font-size: 17px; font-weight: 700; color: var(--text-main); margin: 0 0 14px; display: flex; gap: 8px; align-items: center; }
.pj-section-title i { color: #f59e0b; }

/* Cards */
.pj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.pj-card { display: flex; flex-direction: column; background: var(--pj-card); border: 1px solid var(--pj-line); border-radius: 16px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.pj-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0, 0, 0, .07); }
.pj-card-cover { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--pj-soft); }
.pj-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.pj-card-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 46px; color: var(--primary); background: linear-gradient(135deg, var(--t-50, #eef2ff), rgba(var(--t-500-rgb, 99, 102, 241), .18)); }
.pj-price-tag { position: absolute; left: 12px; bottom: 12px; font-size: 13px; font-weight: 800; padding: 5px 10px; border-radius: 8px; background: #fff; color: var(--text-main); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
.pj-price-tag s { font-weight: 500; color: #94a3b8; font-size: 12px; }
.pj-price-tag.is-free { background: #059669; color: #fff; }
.pj-featured { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: #f59e0b; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; }
.pj-card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.pj-card-meta { display: flex; gap: 8px; font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.pj-card-meta span + span::before { content: '·'; margin-right: 8px; }
.pj-card-title { font-size: 16.5px; font-weight: 700; line-height: 1.35; margin: 0 0 6px; }
.pj-card-title a { color: var(--text-main); text-decoration: none; }
.pj-card-title a:hover { color: var(--primary-dark); }
.pj-card-sum { font-size: 13.5px; color: var(--text-muted); line-height: 1.55; margin: 0 0 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.pj-chips span { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 6px; background: var(--pj-soft); color: var(--primary-dark); }
.pj-chips-lg span { font-size: 13px; padding: 5px 12px; }
.pj-card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--pj-line); }
.pj-includes { display: flex; gap: 8px; color: var(--text-muted); font-size: 16px; }
.pj-dl { font-size: 12.5px; color: var(--text-muted); }

/* Detail */
.pj-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-main); margin: 10px 0 8px; line-height: 1.25; }
.pj-lead { font-size: 16px; color: var(--text-muted); line-height: 1.6; margin: 0 0 16px; }
.pj-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-badge { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--pj-soft); color: var(--primary-dark); display: inline-flex; gap: 5px; align-items: center; }
.pj-badge.is-free { background: #dcfce7; color: #166534; }
.pj-badge.is-paid { background: #fef3c7; color: #92400e; }
.pj-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 20px; }
.pj-facts div { background: var(--pj-card); border: 1px solid var(--pj-line); border-radius: 12px; padding: 10px 14px; }
.pj-facts span { display: block; font-size: 11.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.pj-facts b { font-size: 14px; color: var(--text-main); }

.pj-gallery-main { display: block; width: 100%; padding: 0; border: 1px solid var(--pj-line); border-radius: 16px; overflow: hidden; background: var(--pj-soft); cursor: zoom-in; }
.pj-gallery-main img { width: 100%; max-height: 460px; object-fit: contain; display: block; }
.pj-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.pj-thumbs button { flex-shrink: 0; width: 96px; height: 60px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; }
.pj-thumbs button:hover, .pj-thumbs button:focus-visible { border-color: var(--primary); }
.pj-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pj-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .85); color: #111; font-size: 20px; }
.pj-prev { left: 12px; } .pj-next { right: 12px; }

.pj-tabs { position: sticky; top: 70px; z-index: 5; display: flex; gap: 4px; overflow-x: auto; padding: 6px; margin-bottom: 20px; background: var(--pj-card); border: 1px solid var(--pj-line); border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .04); }
.pj-tabs a { flex-shrink: 0; padding: 8px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); text-decoration: none; }
.pj-tabs a:hover { background: var(--pj-soft); color: var(--primary-dark); }

.pj-section { background: var(--pj-card); border: 1px solid var(--pj-line); border-radius: 16px; padding: 24px; margin-bottom: 20px; scroll-margin-top: 140px; }
.pj-section h2 { font-size: 19px; font-weight: 700; color: var(--text-main); margin: 0 0 14px; display: flex; gap: 8px; align-items: center; }
.pj-section h2 i { color: var(--primary); }
.pj-prose { font-size: 15px; line-height: 1.75; color: var(--text-main); }
.pj-prose h2 { font-size: 18px; margin-top: 1.2em; }
.pj-prose h3 { font-size: 16px; font-weight: 700; margin: 1.2em 0 .5em; }
.pj-prose img { max-width: 100%; border-radius: 10px; }
.pj-prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 14px; }
.pj-prose th, .pj-prose td { border: 1px solid var(--border); padding: 8px 10px; }
.pj-prose th { background: var(--pj-soft); }
.pj-prose blockquote { border-left: 4px solid var(--primary); background: var(--pj-soft); padding: 10px 16px; border-radius: 0 10px 10px 0; }
.pj-prose .note-box { background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 10px; padding: 12px 16px; margin: 1em 0; }
.pj-prose code { background: var(--pj-soft); color: #be185d; padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.pj-prose pre { position: relative; background: #0f172a; color: #e2e8f0; padding: 14px 16px; border-radius: 10px; font-size: 13.5px; white-space: pre-wrap; word-break: break-word; }
.pj-prose pre code { background: none; color: inherit; padding: 0; }
.pj-copy { position: absolute; top: 8px; right: 8px; font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 1px solid #334155; background: #1e293b; color: #cbd5e1; }
.pj-copy:hover { background: #334155; color: #fff; }

.pj-checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 20px; }
.pj-checks li { display: flex; gap: 10px; font-size: 14.5px; color: var(--text-main); line-height: 1.5; }
.pj-checks i { color: #10b981; margin-top: 2px; }
.pj-modules { display: grid; gap: 10px; }
.pj-module { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--pj-line); border-radius: 12px; }
.pj-module-n { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; background: var(--primary-gradient); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.pj-module b { color: var(--text-main); font-size: 15px; }
.pj-module p { margin: 2px 0 0; font-size: 13.5px; color: var(--text-muted); }
.pj-req { height: 100%; padding: 16px; border-radius: 12px; background: var(--pj-soft); }
.pj-req h3 { font-size: 15px; font-weight: 700; color: var(--text-main); margin: 0 0 8px; display: flex; gap: 8px; }
.pj-req ul { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-main); line-height: 1.8; }
.pj-toc { columns: 2; column-gap: 32px; padding-left: 20px; margin: 0 0 12px; font-size: 14.5px; color: var(--text-main); line-height: 1.9; }
.pj-video { border-radius: 12px; overflow: hidden; }

.pj-files { display: flex; flex-direction: column; gap: 10px; }
.pj-file { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--pj-line); border-radius: 12px; background: var(--pj-card); }
.pj-file-ic { width: 44px; height: 44px; flex-shrink: 0; border-radius: 10px; background: var(--pj-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.pj-file.is-locked .pj-file-ic { background: #f1f5f9; color: #94a3b8; }
.pj-file-body { flex: 1; min-width: 0; }
.pj-file-body b { display: block; color: var(--text-main); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-file-body small { color: var(--text-muted); font-size: 12.5px; }
.pj-free { color: #059669; font-weight: 700; }

/* Sidebar */
.pj-buy, .pj-side-card { background: var(--pj-card); border: 1px solid var(--pj-line); border-radius: 16px; padding: 22px; box-shadow: 0 10px 30px rgba(0, 0, 0, .05); margin-bottom: 20px; }
.pj-buy { position: sticky; top: 90px; scroll-margin-top: 100px; }
.pj-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.pj-price b { font-size: 32px; font-weight: 800; color: var(--text-main); }
.pj-price s { color: #94a3b8; font-size: 16px; }
.pj-off { font-size: 12px; font-weight: 800; color: #059669; background: #dcfce7; padding: 3px 8px; border-radius: 6px; }
.pj-owned { margin-top: 8px; font-size: 13.5px; font-weight: 600; color: #059669; }
.pj-buy h3, .pj-side-card h3 { font-size: 14px; font-weight: 700; color: var(--text-main); margin: 20px 0 10px; text-transform: uppercase; letter-spacing: .04em; }
.pj-side-card h3 { margin-top: 0; }
.pj-get { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: var(--text-main); }
.pj-get i { color: #10b981; margin-right: 6px; }
.pj-dl-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
.pj-dl-list dt { color: var(--text-muted); font-weight: 500; }
.pj-dl-list dd { margin: 0; color: var(--text-main); font-weight: 600; text-align: right; }
.pj-mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 16px; background: var(--pj-card); border-top: 1px solid var(--pj-line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08); }
.pj-mobile-bar b { font-size: 20px; color: var(--text-main); }
.pj-mobile-bar s { color: #94a3b8; }

.pj-empty { text-align: center; padding: 56px 16px; color: var(--text-muted); }
.pj-empty i { font-size: 40px; display: block; margin-bottom: 10px; }
.pj-sandbox { max-width: 460px; margin: 0 auto; background: var(--pj-card); border: 1px solid var(--pj-line); border-radius: 16px; padding: 28px; }
.pj-sandbox-flag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em; padding: 4px 10px; border-radius: 6px; background: #fef3c7; color: #92400e; }

.sn-pay-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 1090; max-width: min(520px, calc(100vw - 32px)); background: #111827; color: #fff; font-size: 14px; padding: 12px 18px; border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }
.sn-pay-toast.error { background: #b91c1c; }

@media (max-width: 991.98px) {
    .pj-hero { grid-template-columns: 1fr; padding: 24px; }
    .pj-buy { position: static; }
    .pj-page { padding-bottom: 80px !important; }
}
@media (max-width: 575.98px) {
    .pj-hero h1, .pj-head h1 { font-size: 24px; }
    .pj-search { flex-direction: column; }
    .pj-search > i { top: 25px; }
    .pj-section { padding: 18px; }
    .pj-toc { columns: 1; }
    .pj-toolbar .form-select { flex: 1; min-width: 0; }
    .pj-file { flex-wrap: wrap; }
    .pj-file .btn { width: 100%; }
    .pj-tabs { top: 60px; }
}

/* Dark mode */
[data-bs-theme="dark"] .pj-page, html.dark-theme .pj-page, [data-bs-theme="dark"] .pj-mobile-bar, html.dark-theme .pj-mobile-bar { --pj-card: var(--dark-2, #161b22); --pj-line: var(--dark-border, #30363d); --pj-soft: rgba(var(--t-500-rgb, 99, 102, 241), .12); }
[data-bs-theme="dark"] .pj-eyebrow, [data-bs-theme="dark"] .pj-chips span, [data-bs-theme="dark"] .pj-badge, [data-bs-theme="dark"] .pj-btn-outline,
html.dark-theme .pj-eyebrow, html.dark-theme .pj-chips span, html.dark-theme .pj-badge, html.dark-theme .pj-btn-outline { color: var(--t-300, #a5b4fc); }
[data-bs-theme="dark"] .pj-badge.is-free, html.dark-theme .pj-badge.is-free, [data-bs-theme="dark"] .pj-off, html.dark-theme .pj-off { background: rgba(16, 185, 129, .15); color: #6ee7b7; }
[data-bs-theme="dark"] .pj-badge.is-paid, html.dark-theme .pj-badge.is-paid { background: rgba(245, 158, 11, .15); color: #fcd34d; }
[data-bs-theme="dark"] .pj-price-tag:not(.is-free), html.dark-theme .pj-price-tag:not(.is-free) { background: #0d1117; color: #f0f6fc; }
[data-bs-theme="dark"] .pj-file.is-locked .pj-file-ic, html.dark-theme .pj-file.is-locked .pj-file-ic { background: #21262d; color: #6e7681; }
[data-bs-theme="dark"] .pj-prose .note-box, html.dark-theme .pj-prose .note-box { background: rgba(16, 185, 129, .1); border-color: rgba(16, 185, 129, .3); }
[data-bs-theme="dark"] .pj-prose code, html.dark-theme .pj-prose code { color: #f9a8d4; }
[data-bs-theme="dark"] .pj-search input, html.dark-theme .pj-search input,
[data-bs-theme="dark"] .pj-toolbar .form-select, html.dark-theme .pj-toolbar .form-select { background-color: var(--dark-2, #161b22); border-color: var(--dark-border, #30363d); color: var(--text-main); }
