/*
 * The Project Gallery page (v2, 2026-10-28; mockups 1 and 2 approved). Linked by the section loader whenever
 * {{PROJECTGALLERY_SECTION-PAGE}} is on a page. Headings keep the site's own styles (h2.center-underline, h3);
 * this only lays out the projects, the thumbnails and the larger view. No inline styles anywhere (CSP): the larger
 * view is built by assets/js/pages/project-gallery.js from these classes.
 */
.project-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px 10px;
}

.project-gallery-text {
    max-width: 860px;
    margin: 0 auto 30px;
    font-family: 'Open Sans', sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: #333333;
}

.project-gallery .project {
    margin: 0 auto 46px;
}

.project-gallery .project h3 {
    font-family: 'Roboto', sans-serif;
    font-size: 24px;
    margin: 0 0 6px;
    text-align: center;
}

.project-gallery .project-desc {
    max-width: 760px;
    margin: 0 auto 18px;
    text-align: center;
    color: #555555;
    font-family: 'Open Sans', sans-serif;
}

.project-gallery .project-photos {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    /* centered like the headings above it: a project with two photos sits in the middle, not at the left */
    grid-template-columns: repeat(auto-fit, minmax(230px, 280px));
    justify-content: center;
    gap: 18px;
}

.project-gallery .project-photo {
    display: block;
    cursor: zoom-in;
}

.project-gallery .project-photo img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: transform 0.2s;
}

.project-gallery .project-photo:hover img,
.project-gallery .project-photo:focus-visible img {
    transform: scale(1.02);
}

.project-gallery .project-caption {
    display: block;
    padding: 8px 2px 0;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    font-size: 14px;
    color: #444444;
}

/* the larger view */
html.pg-lightbox-open, html.pg-lightbox-open body {
    overflow: hidden;
}

.pg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 70px 30px;
    background: rgba(10, 12, 16, 0.92);
}

/* display:flex above would beat the browser's own [hidden]{display:none}: closing must really hide it */
.pg-lightbox[hidden] {
    display: none;
}

.pg-lightbox figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}

.pg-lightbox img {
    max-width: 86vw;
    max-height: 72vh;
    object-fit: contain;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.pg-lightbox figcaption {
    max-width: 860px;
    margin-top: 16px;
    text-align: center;
    color: #eeeeee;
    font: 16px/1.5 'Open Sans', sans-serif;
    white-space: pre-line;      /* a caption typed on several lines keeps its lines */
}

.pg-lightbox .pg-lb-count {
    margin-top: 6px;
    color: #aaaaaa;
    font: 13px 'Open Sans', sans-serif;
}

.pg-lightbox button {
    position: absolute;
    border: 0;
    background: none;
    color: #ffffff;
    font: 300 44px/1 'Roboto', sans-serif;
    cursor: pointer;
    padding: 8px 12px;
}

.pg-lightbox button:focus-visible {
    outline: 2px solid #f28c28;
}

.pg-lightbox .pg-lb-close { top: 10px; right: 18px; font-size: 38px; }
.pg-lightbox .pg-lb-prev { left: 14px; top: 46%; }
.pg-lightbox .pg-lb-next { right: 14px; top: 46%; }
.pg-lightbox .pg-lb-prev[hidden], .pg-lightbox .pg-lb-next[hidden] { display: none; }

@media screen and (max-width: 760px) {
    .project-gallery .project-photos { grid-template-columns: 1fr; }
    .pg-lightbox { padding: 50px 10px 20px; }
    .pg-lightbox img { max-width: 96vw; max-height: 66vh; }
    .pg-lightbox .pg-lb-prev, .pg-lightbox .pg-lb-next { top: auto; bottom: 14px; }
}
