﻿.gallery-header { margin-bottom: clamp(2rem, 5vw, 4rem); }
.gallery-grid { columns: 3 260px; column-gap: 1.25rem; }
.gallery-item { position: relative; margin-bottom: 1.25rem; break-inside: avoid; overflow: hidden; border-radius: var(--radius-lg); background: var(--color-surface-muted); box-shadow: var(--shadow-sm); }
.image-link { position: relative; display: block; overflow: hidden; color: #fff; text-decoration: none; }
.image-link img { display: block; width: 100%; height: auto; min-height: 220px; max-height: 560px; object-fit: cover; transition: transform 520ms ease, filter 520ms ease; }
.gallery-overlay { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; padding: 1.25rem; background: linear-gradient(180deg, transparent 45%, rgba(36, 26, 23, .74)); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .08em; opacity: 0; text-transform: uppercase; transition: opacity var(--transition); }
.gallery-overlay i { font-size: 1.1rem; }
.image-link:hover img { filter: saturate(.88); transform: scale(1.035); }
.image-link:hover .gallery-overlay, .image-link:focus-visible .gallery-overlay { opacity: 1; }
.delete-form { position: absolute; top: .7rem; right: .7rem; z-index: 2; }
.delete-form .btn { border: 1px solid rgba(255,255,255,.45); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.gallery-empty { column-span: all; }
.gallery-empty > i { margin-bottom: 1rem; color: var(--color-gold); font-size: 2rem; }
.gallery-empty h2 { margin-bottom: .4rem; }
.gallery-empty p { margin: 0; }
.gallery-modal .modal-dialog { max-width: min(92vw, 1280px); }
.gallery-modal .modal-content { overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius-lg); background: #211817; color: #fff; box-shadow: 0 24px 70px rgba(0,0,0,.38); }
.gallery-modal .modal-header, .gallery-modal .modal-footer { border-color: rgba(255,255,255,.13); }
.gallery-modal .modal-title { color: #fff; font-size: 1.45rem; }
.gallery-modal .modal-body { display: grid; min-height: 55vh; place-items: center; padding: 0; background: #130e0d; }
.gallery-modal .modal-body img { display: block; width: auto; max-width: 100%; height: auto; max-height: 76vh; object-fit: contain; }
.gallery-modal .modal-footer { justify-content: center; gap: .75rem; }
.gallery-modal .btn-outline-secondary { border-color: rgba(255,255,255,.45); color: #fff; }
.gallery-modal .btn-outline-secondary:hover { border-color: #fff; background: #fff; color: var(--color-text); }
.gallery-position { min-width: 3.5rem; color: #cbbdb3; font-size: .8rem; text-align: center; }
@media (max-width: 575.98px) {
    .gallery-grid { columns: 1; }
    .gallery-modal .modal-dialog { max-width: calc(100vw - 1rem); margin: .5rem; }
    .gallery-modal .modal-footer { display: grid; grid-template-columns: 1fr auto 1fr; }
    .gallery-modal .modal-footer .btn { padding-inline: .65rem; }
    .gallery-modal #modalDeleteForm { grid-column: 1 / -1; }
    .gallery-modal #modalDeleteForm .btn { width: 100%; }
}

/* Stage 4 refinements */
.gallery-item { transition: box-shadow var(--transition), transform var(--transition); }
.gallery-item:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.gallery-modal.fade .modal-dialog { transform: translateY(10px) scale(.985); transition: transform 220ms ease, opacity 220ms ease; }
.gallery-modal.show .modal-dialog { transform: translateY(0) scale(1); }
.gallery-modal .modal-footer .btn { min-width: 108px; }
.upload-card > p { margin-inline: auto; }
.upload-form { margin-top: 1.5rem; }
.upload-form > p { display: grid; gap: .45rem; margin: 0; text-align: left; }
.upload-form .dialog-actions { margin-bottom: 0; }
