/* Captioned screenshot gallery (Projects page, GalleryShots) + lightbox caption.
   Builds on .project-gallery / .project-gallery-item / .gallery-lightbox in site.css. */

.project-title-icon {
    width: 1.6em;
    height: 1.6em;
    margin-right: 0.5rem;
    vertical-align: -0.35em;
    border-radius: 8px;
    background: #0e1116;
    padding: 2px;
}

.project-gallery--shots .shots-strip {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.shots-strip-cell {
    min-width: 0;
}

.shot-card {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.project-gallery-item.shot-card-button {
    grid-column: auto;
    width: 100%;
    aspect-ratio: 360 / 762;
}

.shot-card-button img {
    object-fit: cover;
    object-position: top center;
}

.shot-card figcaption {
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--text-color);
    opacity: 0.8;
}

.shots-note {
    margin: 1rem 0 0;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* Phones: a swipeable strip with scroll snapping instead of a tall grid. */
@media (max-width: 576px) {
    .project-gallery--shots .shots-strip {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 0.75rem;
        padding-bottom: 0.75rem;
        -webkit-overflow-scrolling: touch;
    }

    .shots-strip-cell {
        flex: 0 0 62%;
        scroll-snap-align: start;
    }

    .project-gallery--shots .project-gallery-item.shot-card-button {
        grid-column: auto;
        aspect-ratio: 360 / 762;
    }
}

/* Lightbox: figure + caption (applies to every gallery). */
.gallery-lightbox-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    max-height: 100%;
}

.gallery-lightbox-figure .gallery-lightbox-image {
    max-height: calc(85vh - 3rem);
}

.gallery-lightbox-caption {
    max-width: min(420px, 90vw);
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
}

.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.gallery-lightbox-nav[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .project-gallery-item,
    .project-gallery-item img {
        transition: none;
    }
}

/* Challenges and Solutions: one paragraph per challenge/solution pair. */
.project-details .challenge-pair {
    margin-bottom: 0.75rem;
}

/* Home "Selected work" card with an image icon (Jib) and a link to its project. */
.feature-icon-img img {
    width: 26px;
    height: 26px;
    display: block;
}

.highlight-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--primary-color);
    text-decoration: none;
}

.highlight-link:hover,
.highlight-link:focus-visible {
    text-decoration: underline;
}

/* Theme-matched screenshots: show the light variant only on the light site. */
.shot-card-button .shot-light,
body.light-theme .shot-card-button .shot-dark {
    display: none;
}

body.light-theme .shot-card-button .shot-light {
    display: block;
}
