/* =========================
   GALLERY LAYOUT NORMALIZATION
========================= */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
}

.gallery-item {
    height: 100%;
}

.gallery-item img {
    flex-shrink: 0;
}


/* =========================
   GALLERY PAGE
========================= */

.gallery-section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-intro {
    text-align: center;
    margin-bottom: 3rem;
}

.gallery-intro h2 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 1rem;
}

.gallery-intro p {
    max-width: 700px;
    margin: 0 auto;
    color: #555;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    overflow: hidden;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.gallery-label {
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e3a8a;
    background: linear-gradient(to right, #ffffff, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.gallery-item img {
    width: 100%;
    height: 260px;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.08);
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* =========================
   GALLERY MODAL
========================= */

.gallery-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.gallery-modal-content {
    background: #ffffff;
    max-width: 1000px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    padding: 2rem;
    position: relative;
}

.modal-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.modal-images img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #1e3a8a;
}
