﻿/* ====== Gallery grid (consistent cards) ====== */
.proj-imgs__thumb-grid {
    --min: 220px; /* min card width */
    --radius: 16px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--min), 1fr));
    gap: 16px;
    padding: 10px 6px;
    align-items: start;
}

/* Each tile */
.proj-imgs__thumb-wrap {
    position: relative;
}

/* Card button */
.proj-imgs__thumb {
    width: 100%;
    aspect-ratio: 16 / 9; /* looks great for room photos; try 4/3 if you want taller */
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: linear-gradient(180deg, rgba(15,23,42,.04), rgba(15,23,42,.01));
    box-shadow: 0 10px 24px rgba(15,23,42,.10), 0 2px 6px rgba(15,23,42,.06);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
    /* button reset */
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    display: block;
}

    .proj-imgs__thumb:hover {
        transform: translateY(-2px);
        border-color: rgba(37, 99, 235, 0.22);
        box-shadow: 0 16px 36px rgba(15,23,42,.14), 0 2px 10px rgba(15,23,42,.08);
    }

    .proj-imgs__thumb:focus-visible {
        outline: none;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22), 0 16px 36px rgba(15,23,42,.14), 0 2px 10px rgba(15,23,42,.08);
    }

/* Image fill */
.proj-imgs__thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Subtle overlay on hover (makes delete button feel intentional) */
.proj-imgs__thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background .14s ease;
    pointer-events: none;
}

.proj-imgs__thumb-wrap:hover .proj-imgs__thumb::after {
    background: rgba(0,0,0,.06);
}

/* ====== Delete button (cleaner, only on hover) ====== */
.proj-imgs__thumb-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(15, 23, 42, 0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
    line-height: 0;
    box-shadow: 0 10px 22px rgba(15,23,42,.18);
    opacity: 0.92;
    transform: translateY(-2px) scale(.96);
    transition: opacity .14s ease, transform .14s ease, background .14s ease;
}

.proj-imgs__thumb-wrap:hover .proj-imgs__thumb-delete,
.proj-imgs__thumb-wrap:focus-within .proj-imgs__thumb-delete {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.proj-imgs__thumb-delete:hover {
    background: rgba(255,255,255,.92);
    transform: translateY(0) scale(1.05);
}

.proj-imgs__thumb-delete:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive tuning */
@media (max-width: 640px) {
    .proj-imgs__thumb-grid {
        --min: 170px;
        gap: 12px;
    }

    .proj-imgs__thumb {
        aspect-ratio: 4 / 3;
    }
}




/* Modal overlay */
.proj-imgs__imgmodal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

/* Modal container */
.proj-imgs__imgmodal {
    position: relative;
    width: min(960px, 96vw);
    max-height: 90dvh;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,.35);
}

/* Close button */
.proj-imgs__imgmodal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.14);
    background: rgba(255,255,255,.92);
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* Large image */
.proj-imgs__imgmodal-img {
    width: 100%;
    height: auto;
    max-height: 90dvh;
    object-fit: contain;
    display: block;
    background: #0b1220; /* makes letterboxing look intentional */
}


.proj-imgs__confirm-preview {
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,.10);
    background: rgba(0,0,0,.02);
}

    .proj-imgs__confirm-preview img {
        width: 100%;
        height: auto;
        display: block;
    }