/* Aardvark Fotogalerie — mřížky, lightbox, upload zóna. Prefix gal- (veřejný web i admin). */

/* ---------- Mřížka alb ---------- */

.gal-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.gal-album-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f4f6f9;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gal-album-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(76, 87, 125, 0.15);
    color: inherit;
}

.gal-album-cover {
    aspect-ratio: 3 / 2;
    width: 100%;
    object-fit: cover;
    display: block;
    background: #e6e9f0;
}

.gal-album-cover-empty {
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #99a1b7;
    font-size: 2rem;
    background: #e6e9f0;
}

.gal-album-meta {
    padding: 0.65rem 0.85rem;
}

.gal-album-title {
    font-weight: 600;
    line-height: 1.3;
}

.gal-album-count {
    font-size: 0.8rem;
    color: #78829d;
}

/* ---------- Mřížka fotek ---------- */

.gal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.5rem;
}

.gal-item {
    display: block;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #e6e9f0;
}

.gal-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.gal-item:hover img {
    transform: scale(1.04);
}

/* ---------- Lightbox ---------- */

html.gal-lb-locked {
    overflow: hidden;
}

.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    background: rgba(12, 14, 24, 0.94);
}

.gal-lightbox.open {
    display: block;
}

.gal-lb-figure {
    position: absolute;
    inset: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 3.5rem 4.5rem;
}

.gal-lb-figure img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0.25rem;
}

.gal-lb-figure figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0.75rem 1rem 1rem;
    text-align: center;
    color: #cfd3e0;
    font-size: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    justify-content: center;
}

.gal-lb-caption { color: #fff; }
.gal-lb-exif { opacity: 0.8; }
.gal-lb-count { opacity: 0.6; }

.gal-lb-orig {
    color: #9db8ff;
    text-decoration: none;
}

.gal-lb-orig:hover { text-decoration: underline; }

.gal-lightbox button {
    position: absolute;
    z-index: 1;
    border: 0;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease;
}

.gal-lightbox button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.gal-lb-close { top: 1rem; right: 1rem; }
.gal-lb-prev { left: 0.75rem; top: 50%; transform: translateY(-50%); }
.gal-lb-next { right: 0.75rem; top: 50%; transform: translateY(-50%); }

@media (max-width: 575px) {
    .gal-lb-figure { padding: 2.5rem 0.5rem 4.5rem; }
    .gal-lb-prev, .gal-lb-next { display: none; } /* na mobilu swipe */
}

/* ---------- Upload zóna ---------- */

.gal-upload {
    border: 2px dashed #cfd6e4;
    border-radius: 0.75rem;
    padding: 1.25rem;
    text-align: center;
    color: #78829d;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.gal-upload.dragging {
    border-color: var(--aav-primary, #1b6ec2);
    background: color-mix(in srgb, var(--aav-primary, #1b6ec2) 6%, #fff);
}

.gal-upload input[type=file] {
    display: none;
}

.gal-upload-list {
    margin-top: 0.5rem;
    text-align: left;
    font-size: 0.85rem;
}

.gal-upload-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.2rem 0;
}

.gal-upload-row.ok .gal-upload-state { color: #17c653; }
.gal-upload-row.err .gal-upload-state { color: #f8285a; }

.gal-upload-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Admin: fotky v albu ---------- */

.gal-admin-photos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1rem;
}

.gal-admin-photo {
    border: 1px solid #eff2f5;
    border-radius: 0.75rem;
    overflow: hidden;
}

.gal-admin-photo > img {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    display: block;
}

.gal-admin-photo-body {
    padding: 0.75rem;
}

.gal-admin-photo-meta {
    font-size: 0.75rem;
    color: #99a1b7;
    margin-bottom: 0.5rem;
}
