/* File-based projects gallery (/projects.html) */

.gallery-page {
    background: #f6f6f8;
    padding: 36px 0 96px;
    min-height: 60vh;
}

.gallery-years {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e3e4e8;
}

.gallery-years-label {
    margin-right: 12px;
    color: #7c7f88;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gallery-year {
    appearance: none;
    border: 1px solid #e3e4e8;
    background: #ffffff;
    color: #232730;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    padding: 10px 16px;
    border-radius: var(--ui-radius, 10px);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-year:hover {
    border-color: #111a4a;
    color: #111a4a;
}

.gallery-year.is-active {
    background: #111a4a;
    border-color: #111a4a;
    color: #ffffff;
    box-shadow: rgba(17, 26, 74, 0.1) 0 1px 3px, rgba(17, 26, 74, 0.05) 0 1px 0;
}

.gallery-album {
    margin-bottom: 0;
}

.gallery-album.is-hidden {
    display: none;
}

.gallery-album-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.gallery-album-year {
    margin: 0;
    font-size: 34px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: #111a4a;
}

.gallery-album-year:after {
    display: none;
}

.gallery-album-count {
    font-size: 13px;
    color: #a9acb6;
}

.gallery-grid {
    columns: 4 220px;
    column-gap: 14px;
}

.gallery-card {
    position: relative;
    display: inline-block;
    width: 100%;
    overflow: hidden;
    margin: 0 0 14px;
    border-radius: var(--ui-radius, 10px);
    background: #ffffff;
    box-shadow:
        rgba(18, 22, 30, 0.024) 0 1px 4px,
        rgba(18, 22, 30, 0.05) 0 1px 0,
        rgba(18, 22, 30, 0.024) 0 0 0 1px;
    break-inside: avoid;
    vertical-align: top;
}

.gallery-card img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.45s ease;
}

.gallery-card-veil {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 16px;
    background: linear-gradient(180deg, transparent 45%, rgba(1, 24, 33, 0.55) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-card-label {
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.gallery-card:hover img {
    transform: scale(1.04);
}

.gallery-card:hover .gallery-card-veil {
    opacity: 1;
}

.gallery-empty {
    text-align: center;
    color: #7c7f88;
    padding: 64px 0;
}

/* File-backed project detail pages retain the asymmetric Bootstrap masonry flow. */
.project-gallery-page {
    padding-top: 32px;
    padding-bottom: 72px;
}

.project-gallery-layout {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}

.project-gallery-years {
    position: sticky;
    top: 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
}

.project-gallery-year {
    display: flex;
    width: 68px;
    height: 68px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: var(--ui-radius, 10px);
    background: #f6f6f8;
    color: #cbcccf;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.project-gallery-year:hover {
    background: #f6f6f8;
    color: #7c7f88;
    text-decoration: none;
}

.project-gallery-year.is-active {
    background: #f6f6f8;
    color: #3b3e47;
}

.project-gallery-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.project-gallery-meta h1 {
    margin: 0;
    color: #111a4a;
    font-size: 30px;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.project-gallery-meta h1:after {
    display: none;
}

.project-gallery-meta span {
    color: #a9acb6;
    font-size: 13px;
}

.project-images.card-columns {
    column-count: 3;
    column-gap: 10px;
    margin: 0;
}

.project-images.card-columns .image {
    position: relative;
    overflow: hidden;
    margin: 0 0 10px;
    border-radius: var(--ui-radius, 10px);
    background: #f6f6f8;
    box-shadow: rgba(18, 22, 30, 0.024) 0 1px 4px, rgba(18, 22, 30, 0.05) 0 1px 0;
}

.project-images.card-columns .image img {
    display: block;
    transition: transform 0.45s ease;
}

.project-images.card-columns .image:hover img {
    transform: scale(1.025);
}

@media (max-width: 991px) {
    .gallery-grid {
        columns: 3 200px;
    }

    .project-images.card-columns {
        column-count: 2;
    }
}

@media (max-width: 575px) {
    .gallery-page {
        padding: 32px 0 64px;
    }

    .gallery-grid {
        columns: 2 140px;
        column-gap: 10px;
    }

    .gallery-card {
        margin-bottom: 10px;
    }

    .project-images.card-columns {
        column-count: 2;
        column-gap: 8px;
    }

    .project-images.card-columns .image {
        margin-bottom: 8px;
    }

    .project-gallery-page {
        padding-top: 20px;
    }

    .project-gallery-layout {
        display: block;
    }

    .project-gallery-years {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 0;
        margin-bottom: 18px;
    }

    .project-gallery-year {
        width: 62px;
        height: 62px;
    }

    .gallery-album-year {
        font-size: 22px;
    }

    .gallery-years-label {
        width: 100%;
        margin: 0 0 4px;
    }
}

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