/* ══════════════════════════════════════════════════════════════════
   GALLERY.CSS — Photogallery Section
   Asymmetric grid + bounding box hover overlays
   ══════════════════════════════════════════════════════════════════ */

/* ── Gallery Grid ────────────────────────────────────────────── */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 110px;
    gap: 2px;
    margin-top: var(--sp-4);
}

/* Asymmetric cell sizing */
.gallery-item:nth-child(1) {
    grid-column: span 7;
    grid-row: span 3;
}

.gallery-item:nth-child(2) {
    grid-column: span 5;
    grid-row: span 2;
}

.gallery-item:nth-child(3) {
    grid-column: span 5;
    grid-row: span 1;
}

.gallery-item:nth-child(4) {
    grid-column: span 4;
    grid-row: span 2;
}

.gallery-item:nth-child(5) {
    grid-column: span 5;
    grid-row: span 2;
}

.gallery-item:nth-child(6) {
    grid-column: span 3;
    grid-row: span 2;
}

.gallery-item:nth-child(7) {
    grid-column: span 6;
    grid-row: span 2;
}

.gallery-item:nth-child(8) {
    grid-column: span 6;
    grid-row: span 2;
}

.gallery-item:nth-child(9) {
    grid-column: span 4;
    grid-row: span 2;
}

.gallery-item:nth-child(10) {
    grid-column: span 8;
    grid-row: span 2;
}

/* ── Individual Gallery Item ─────────────────────────────────── */
.gallery-item {
    position: relative;
    overflow: hidden;
    cursor: crosshair;
    background: var(--pastel-gray);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--dur-xslow) var(--ease-organic),
        filter var(--dur-slow) var(--ease-out);
    filter: grayscale(10%) brightness(0.95);
}

.gallery-item:hover img {
    transform: scale(1.04);
    filter: grayscale(0%) brightness(1);
}

/* ── Bounding Box Overlay ────────────────────────────────────── */
.gallery-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

/* Corner brackets — drawn via pseudo + child elements */
.bbox-corner {
    position: absolute;
    width: 20px;
    height: 20px;
}

.bbox-corner--tl {
    top: 16px;
    left: 16px;
    border-top: 1px solid rgba(214, 212, 181, 0.9);
    border-left: 1px solid rgba(214, 212, 181, 0.9);
}

.bbox-corner--tr {
    top: 16px;
    right: 16px;
    border-top: 1px solid rgba(214, 212, 181, 0.9);
    border-right: 1px solid rgba(214, 212, 181, 0.9);
}

.bbox-corner--bl {
    bottom: 16px;
    left: 16px;
    border-bottom: 1px solid rgba(214, 212, 181, 0.9);
    border-left: 1px solid rgba(214, 212, 181, 0.9);
}

.bbox-corner--br {
    bottom: 16px;
    right: 16px;
    border-bottom: 1px solid rgba(214, 212, 181, 0.9);
    border-right: 1px solid rgba(214, 212, 181, 0.9);
}

/* Animated grow */
.gallery-item:hover .bbox-corner {
    animation: bboxGrow 0.3s var(--ease-out) both;
}

@keyframes bboxGrow {
    from {
        width: 8px;
        height: 8px;
        opacity: 0;
    }

    to {
        width: 20px;
        height: 20px;
        opacity: 1;
    }
}

/* ── Data Labels ─────────────────────────────────────────────── */
.gallery-data {
    position: absolute;
    bottom: 30px;
    left: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: rgba(20, 38, 30, 0.72);
    padding: 7px 10px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-left: 1px solid rgba(214, 212, 181, 0.3);
}

.gallery-data-line {
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: rgba(244, 240, 221, 1);
    letter-spacing: 0.07em;
    display: flex;
    gap: var(--sp-3);
}

.gallery-data-key {
    opacity: 0.55;
}

/* ── Scanline Effect ─────────────────────────────────────────── */
.gallery-scanline {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, transparent, rgba(214, 212, 181, 0.4), transparent);
    top: -100%;
    pointer-events: none;
}

.gallery-item:hover .gallery-scanline {
    animation: scanline 1.2s linear infinite;
}

/* ── Loading Placeholder ─────────────────────────────────────── */
.gallery-placeholder {
    width: 100%;
    height: 100%;
    background: var(--artichoke-10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--artichoke);
    opacity: 0.5;
}

/* ── Gallery Title Label ─────────────────────────────────────── */
.gallery-item-label {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    color: rgba(244, 240, 221, 1);
    letter-spacing: 0.1em;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9), 0 0 16px rgba(0, 0, 0, 0.6);
    opacity: 0;
    transition: opacity var(--dur-base) var(--ease-out);
    word-break: break-word;
}

.gallery-item:hover .gallery-item-label {
    opacity: 1;
}

/* ── Archive Slot Overlay ────────────────────────────────────── */
.gallery-archive-overlay {
    background: rgba(20, 38, 30, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: background 0.3s ease;
}

.gallery-item:hover .gallery-archive-overlay {
    background: rgba(20, 38, 30, 0.78);
}



.gallery-archive-inner {
    position: relative;
    text-align: center;
    padding: var(--sp-4);
}

.gallery-archive-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 0.18em;
    color: rgba(214, 212, 181, 0.7);
    margin-bottom: var(--sp-2);
}

.gallery-archive-sub {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: rgba(244, 240, 221, 1);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

/* ── Empty State ─────────────────────────────────────────────── */
.gallery-empty {
    grid-column: 1 / -1;
    padding: var(--sp-16);
    text-align: center;
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--artichoke);
    border: var(--border-thin);
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: 160px;
    }

    .gallery-item:nth-child(n) {
        grid-column: span 3;
        grid-row: span 2;
    }

    .gallery-item:nth-child(1) {
        grid-column: span 6;
    }
}

@media (max-width: 500px) {
    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: 200px;
    }

    .gallery-item:nth-child(n) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-item:nth-child(1) {
        grid-column: span 2;
        grid-row: span 1;
    }
}