/* Portfolio page styles. Loaded on top of home.css. */

.portfolio-page {
    max-width: 820px;
    text-align: left;
}

.portfolio-page h1 {
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Controls bar: search + year filter + sort */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 1.25rem 0 0.5rem;
}

.controls input,
.controls select {
    font-family: inherit;
    font-size: 1rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #000;
}

.controls input[type="search"] {
    flex: 1 1 220px;
    min-width: 0;
}

/* Tag filter bar */
.tag-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.25rem 0 0.5rem;
}

.tag-filter {
    font-family: inherit;
    font-size: 0.82rem;
    color: #444;
    background: #f0f0f0;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    cursor: pointer;
}
.tag-filter:hover { background: #e6e6e6; }
.tag-filter.active {
    background: #222;
    color: #fff;
    border-color: #222;
}
.tag-filter .tag-count {
    opacity: 0.6;
    font-size: 0.8em;
    margin-left: 0.15rem;
}

.result-count {
    color: #666;
    font-size: 0.9rem;
    margin: 0.25rem 0 1rem;
}

/* Project list */
.project-list {
    list-style: none;
    display: block;          /* override home.css inline-block ul */
    padding: 0;
    margin: 0;
    font-size: inherit;
}

.project {
    border-top: 1px solid #e6e6e6;
    padding: 1.25rem 0;
}

.project-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
}

.project-title {
    margin: 0;
    font-size: 1.25rem;
}

.project-year {
    color: #777;
    font-size: 0.95rem;
    white-space: nowrap;
}

.project-collaborators {
    color: #555;
    font-size: 0.9rem;
    margin: 0.2rem 0 0;
}

.project-desc {
    margin: 0.5rem 0 0;
    line-height: 1.45;
}

.project-tags {
    margin: 0.6rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag {
    font-size: 0.78rem;
    color: #555;
    background: #f0f0f0;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    cursor: pointer;
}
.tag:hover { background: #e2e2e2; }

/* Focused single-project view */
.project-detail .detail-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.detail-title {
    margin: 0;
    font-size: 1.6rem;
}
.detail-desc {
    margin: 0.75rem 0 0;
    line-height: 1.55;
    font-size: 1.05rem;
}
.detail-link {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 1rem;
}
.copy-link {
    font-family: inherit;
    font-size: 0.8rem;
    color: #555;
    background: #f0f0f0;
    border: 1px solid #e2e2e2;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    cursor: pointer;
    white-space: nowrap;
}
.copy-link:hover { background: #e6e6e6; }
.copy-link.copied {
    background: #1c7c3c;
    color: #fff;
    border-color: #1c7c3c;
}

.project-detail .project-media img,
.project-detail .project-media video,
.project-detail .project-media iframe {
    width: 320px;
    height: 200px;
}

/* Media gallery */
.project-media {
    margin: 0.75rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-media img,
.project-media video,
.project-media iframe {
    width: 220px;
    max-width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e6e6e6;
    background: #f6f6f6;
}

.project-media .media-img { cursor: zoom-in; }

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
.lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    font-size: 2.5rem;
    line-height: 1;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
}

.empty-state {
    color: #777;
    padding: 2rem 0;
    text-align: center;
}

@media (max-width: 600px) {
    .portfolio-page { font-size: 1.05rem; }
    .project-media img,
    .project-media video,
    .project-media iframe {
        width: 100%;
        height: auto;
    }
}
