/* Z model photo galleries: the public grid and lightbox on /z, and the manager in the admin. */

/* ---------------------------------------------------------------- public grid */

.z-gallery {
    border-top: 1px solid rgba(15, 23, 42, .08);
    margin-top: 2rem;
    padding-top: 1.5rem;
}

.z-gallery-heading {
    align-items: baseline;
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    margin-bottom: 1rem;
}

.z-gallery-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
}

.z-gallery-count {
    color: #6c757d;
    font-size: .8rem;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* ---------------------------------------------------------------- year filter */

.z-gallery-years {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: 1.25rem;
}

.z-gallery-year {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 999px;
    color: #343a40;
    display: inline-flex;
    font-size: .85rem;
    gap: .4rem;
    line-height: 1.2;
    padding: .4rem .9rem;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
    white-space: nowrap;
}

.z-gallery-year:hover,
.z-gallery-year:focus-visible {
    border-color: rgba(13, 110, 253, .55);
    color: #0d6efd;
}

.z-gallery-year.is-active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.z-gallery-year-count {
    font-size: .72rem;
    font-variant-numeric: tabular-nums;
    opacity: .7;
}

/* ---------------------------------------------------------------- paging */

/* Set by the server on everything past the first page, and by the script from then on. */
.z-gallery-tile.is-beyond-page,
.z-gallery-tile.is-filtered-out {
    display: none;
}

.z-gallery-more {
    align-items: center;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: 1.25rem;
}

.z-gallery-more[hidden] {
    display: none;
}

.z-gallery-more-button {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .18);
    border-radius: 999px;
    color: #0d6efd;
    font-size: .9rem;
    font-weight: 600;
    padding: .5rem 1.4rem;
    transition: background .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.z-gallery-more-button:hover,
.z-gallery-more-button:focus-visible {
    background: rgba(13, 110, 253, .06);
    border-color: rgba(13, 110, 253, .55);
    box-shadow: 0 .25rem .75rem rgba(15, 23, 42, .08);
}

.z-gallery-showing {
    color: #6c757d;
    font-size: .78rem;
    letter-spacing: .04em;
    margin: 0;
    text-transform: uppercase;
}

.z-gallery-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

@media (min-width: 768px) {
    .z-gallery-grid {
        gap: 1rem;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.z-gallery-tile {
    aspect-ratio: 4 / 3;
    background: #f1f3f5;
    border: 0;
    border-radius: .85rem;
    cursor: zoom-in;
    display: block;
    overflow: hidden;
    padding: 0;
    position: relative;
    transition: box-shadow .2s ease, transform .2s ease;
    width: 100%;
}

.z-gallery-tile:hover,
.z-gallery-tile:focus-visible {
    box-shadow: var(--site-elevation-shadow);
    transform: translateY(-2px);
}

.z-gallery-tile img {
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    width: 100%;
}

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

.z-gallery-tile-year {
    backdrop-filter: blur(4px);
    background: rgba(12, 14, 18, .6);
    border-radius: 999px;
    color: #fff;
    font-size: .7rem;
    font-variant-numeric: tabular-nums;
    left: .5rem;
    letter-spacing: .04em;
    line-height: 1;
    padding: .25rem .55rem;
    position: absolute;
    top: .5rem;
}

/* The caption rides in on hover, and sits permanently on touch devices that cannot hover. */
.z-gallery-tile-caption {
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
    bottom: 0;
    color: #fff;
    font-size: .78rem;
    left: 0;
    line-height: 1.35;
    opacity: 0;
    padding: 1.75rem .7rem .6rem;
    position: absolute;
    right: 0;
    text-align: left;
    transition: opacity .2s ease;
}

.z-gallery-tile:hover .z-gallery-tile-caption,
.z-gallery-tile:focus-visible .z-gallery-tile-caption {
    opacity: 1;
}

@media (hover: none) {
    .z-gallery-tile-caption {
        opacity: 1;
    }
}

/* ---------------------------------------------------------------- lightbox */

.z-lightbox {
    background: rgba(12, 14, 18, .94);
    border: 0;
    height: 100%;
    max-height: 100%;
    max-width: 100%;
    padding: 0;
    width: 100%;
}

.z-lightbox::backdrop {
    background: rgba(12, 14, 18, .94);
}

.z-lightbox-body {
    display: grid;
    grid-template-rows: 1fr auto;
    height: 100%;
    place-items: center;
}

.z-lightbox-stage {
    align-items: center;
    display: flex;
    height: 100%;
    justify-content: center;
    padding: 3.5rem 1rem 0;
    width: 100%;
}

.z-lightbox-image {
    border-radius: .5rem;
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.z-lightbox-footer {
    color: rgba(255, 255, 255, .85);
    padding: 1rem 1.25rem 1.5rem;
    text-align: center;
    width: min(760px, 100%);
}

.z-lightbox-caption {
    font-size: .95rem;
    line-height: 1.5;
    margin: 0;
}

.z-lightbox-credit {
    font-size: .8rem;
    margin: .35rem 0 0;
    opacity: .75;
}

.z-lightbox-counter {
    font-size: .78rem;
    letter-spacing: .06em;
    opacity: .7;
    text-transform: uppercase;
}

.z-lightbox-control {
    align-items: center;
    background: rgba(255, 255, 255, .12);
    border: 0;
    border-radius: 50%;
    color: #fff;
    display: inline-flex;
    font-size: 1.25rem;
    height: 2.75rem;
    justify-content: center;
    position: absolute;
    transition: background .2s ease;
    width: 2.75rem;
    z-index: 2;
}

.z-lightbox-control:hover,
.z-lightbox-control:focus-visible {
    background: rgba(255, 255, 255, .28);
    color: #fff;
}

.z-lightbox-close {
    right: 1rem;
    top: 1rem;
}

.z-lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.z-lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* ---------------------------------------------------------------- admin manager */

.z-manage-dropzone {
    background: rgba(248, 250, 252, .9);
    border: 2px dashed rgba(13, 110, 253, .35);
    border-radius: 1rem;
    cursor: pointer;
    display: block;
    padding: 2rem 1rem;
    text-align: center;
    transition: background .2s ease, border-color .2s ease;
    width: 100%;
}

.z-manage-dropzone:hover,
.z-manage-dropzone:focus-within,
.z-manage-dropzone.is-dragover {
    background: rgba(13, 110, 253, .06);
    border-color: rgba(13, 110, 253, .7);
}

.z-manage-list {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.z-manage-item {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: .85rem;
    display: flex;
    gap: 1rem;
    padding: .75rem;
    transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.z-manage-item:hover {
    border-color: rgba(13, 110, 253, .35);
    box-shadow: 0 .25rem .75rem rgba(15, 23, 42, .08);
}

.z-manage-item.is-dragging {
    opacity: .45;
}

.z-manage-item.is-drop-target {
    border-color: rgba(13, 110, 253, .9);
    box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .15);
}

.z-manage-item.is-busy {
    opacity: .6;
    pointer-events: none;
}

.z-manage-handle {
    color: #adb5bd;
    cursor: grab;
    font-size: 1.25rem;
    line-height: 1;
    padding: .25rem;
}

.z-manage-handle:active {
    cursor: grabbing;
}

.z-manage-thumb {
    background: #f1f3f5;
    border-radius: .6rem;
    flex: 0 0 auto;
    height: 72px;
    object-fit: cover;
    width: 96px;
}

.z-manage-fields {
    flex: 1 1 auto;
    min-width: 0;
}

.z-manage-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.z-manage-year {
    flex: 0 0 auto;
    width: 6.5rem;
}

.z-manage-meta > input[type="text"] {
    flex: 1 1 12rem;
    min-width: 0;
}

.z-manage-defaults {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
}

.z-manage-defaults > span {
    padding-bottom: .4rem;
}

.z-manage-filename {
    color: #6c757d;
    font-size: .75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.z-manage-empty {
    border: 1px dashed rgba(15, 23, 42, .15);
    border-radius: .85rem;
    color: #6c757d;
    padding: 2rem 1rem;
    text-align: center;
}

.z-manage-uploading {
    align-items: center;
    display: flex;
    gap: .75rem;
}
