/* -------------- gallery css - for the gallery page -------------- */

.gallery-page{
    max-width: 78rem;
}

.gallery-head h2{
    margin-top: .25rem;
}

.gallery{
    display: grid;
    grid-template-columns: 15rem 1fr;
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: start;
    width: 100%;
    margin-top: clamp(1.5rem, 5vh, 3rem);
    text-align: left;
}



/* -------------- the days (vertical selector) -------------- */

.days{
    position: sticky;
    top: 5rem;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--rule);
}

.day{
    display: flex;
    flex-direction: column;
    gap: .2rem;
    width: 100%;
    padding: 1rem .25rem 1rem 1rem;
    text-align: left;
    background: none;
    border: 0;
    border-bottom: 1px solid var(--rule);
    border-left: 2px solid transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease);
}

.day:hover{
    color: var(--fg);
    background: var(--soft);
}

.day[aria-selected="true"]{
    color: var(--fg);
    border-left-color: var(--accent);
}

.day-name{
    font-size: 1.2rem;
}

.day .day-date{
    letter-spacing: .25em;
    font-size: .7rem;
}



/* -------------- the chosen day -------------- */

.day-panel{
    min-width: 0;
}

.panel-head{
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--rule);
}

.panel-head h3{
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
    line-height: 1.2;
}

/* canon / panasonic switch */
.cameras{
    display: inline-flex;
    padding: .2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.cameras button{
    padding: .45rem 1.1rem;
    font-size: .75rem;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    background: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: color .3s var(--ease), background .3s var(--ease);
}

.cameras button[aria-pressed="true"]{
    background: var(--accent);
    color: var(--bg);
}

.cameras .count{
    opacity: .7;
}

.empty{
    margin-top: 2.5rem;
    font-style: italic;
}

/* masonry - portrait and landscape photos sit together without cropping */
.photos{
    columns: 3 15rem;
    column-gap: .75rem;
    margin-top: 1.5rem;
}

.photo{
    display: block;
    width: 100%;
    margin-bottom: .75rem;
    padding: 0;
    border: 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--soft);
    break-inside: avoid;
    cursor: zoom-in;
}

.photo img{
    display: block;
    width: 100%;
    height: auto;
    transition: transform .6s var(--ease), opacity .6s var(--ease);
}

.photo img:not(.loaded){
    opacity: 0;
}

.photo:hover img{
    transform: scale(1.02);
}



/* -------------- phones: days stacked on top -------------- */

@media (max-width: 760px){
    .gallery{
        grid-template-columns: 1fr;
    }

    .days{
        position: static;
    }

    .day{
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        padding: .85rem .5rem .85rem .9rem;
    }

    .day-name{
        font-size: 1.05rem;
    }

    .panel-head{
        flex-direction: column;
        align-items: flex-start;
    }

    .photos{
        columns: 2;
        column-gap: .5rem;
    }

    .photo{
        margin-bottom: .5rem;
        border-radius: 4px;
    }
}



/* -------------- full-screen photo -------------- */

.lightbox{
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 245, 239, .97);
    animation: fade .3s var(--ease) both;
}

.lightbox[hidden]{
    display: none;
}

.lightbox img{
    max-width: calc(100vw - 2rem);
    max-height: calc(100svh - 7rem);
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 12px 40px rgba(29, 27, 23, .15);
}

.lb-btn{
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
    line-height: 1;
    color: var(--fg);
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    border: 1px solid var(--rule);
    border-radius: 999px;
    cursor: pointer;
}

.lb-close{
    top: max(1rem, env(safe-area-inset-top));
    right: 1rem;
}

.lb-prev{ left: 1rem; }
.lb-next{ right: 1rem; }

.lb-count{
    position: absolute;
    bottom: max(1.25rem, env(safe-area-inset-bottom));
    font-size: .75rem;
    letter-spacing: .25em;
    color: var(--muted);
}

/* on phones you swipe instead, so the arrows move out of the way */
@media (max-width: 640px){
    .lb-prev,
    .lb-next{
        display: none;
    }
}

@keyframes fade{
    from{ opacity: 0; }
}
