body {
    font-family: 'Segoe UI', Arial, sans-serif;
    margin: 0;
    background: linear-gradient(120deg, #222 80%, #e63946 100%);
    color: #fff;
}

.section {
    background: #181818;
    border-radius: 18px;
    box-shadow: 0 4px 24px #0004;
    padding: 48px 32px;
    margin: 48px auto;
    max-width: 1100px;
}

.section h2 {
    color: #e63946;
    text-align: center;
    font-size: 2em;
    margin-bottom: 32px;
    letter-spacing: 1px;
}

.back-link {
    text-align: left;
    margin: 20px 0 0 0;
    display: block;
    color: #e63946;
    text-decoration: none;
    font-weight: bold;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

/* کارت‌ها */
.gallery-item {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    background: #000; /* نمایش کارت سیاه قبل از لود عکس */
}

.gallery-item figure {
    margin: 0;
    width: 100%;
    height: 0;
    padding-bottom: 70%; /* نسبت تصویر کارت */
    position: relative;
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: fill; /* حفظ نسبت تصویر و پر کردن کارت */
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.25s ease-in-out, box-shadow 0.25s ease-in-out;
}

.gallery-item img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* کپشن پایین عکس با افکت شیشه‌ای */
.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8px 0;
    text-align: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.4); /* شیشه‌ای مشکی */
    backdrop-filter: blur(6px);
    opacity: 0;
    transform: translateY(100%);
    transition: all 0.35s ease;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}

/* وقتی کارت hover شود کپشن ظاهر شود */
.gallery-item:hover .gallery-caption {
    opacity: 1;
    transform: translateY(0);
}

/* ریسپانسیو موبایل */
@media (max-width: 600px) {
    .gallery-item figure {
        padding-bottom: 60%;
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
}

.lightbox img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 4px 32px #000a;
}

.lightbox.active {
    display: flex;
}
