/* Font Face - نحوه استفاده از فونت Vazirmatn */
@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Regular.ttf') format('TrueType');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Vazirmatn';
    src: url('fonts/Vazirmatn-Bold.ttf') format('TrueType');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: #ffffff;
    margin: 0; 
    color: #626262;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0px 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    font-size: 1.4rem;
}

.pimage {
    margin: 20px auto;
    display: block;
    height: auto;
    max-width: 100%;
}

.audio-player {
    margin: 20px auto;
    width: 90%;
    display: flex;
    justify-content: center;
}

footer {
    background-color: #626262;
    color: #ffffff;
    max-width: 100%;
    padding: 20px;
}

footer p {
    line-height: 1.5rem;
    font-size: 0.9rem;
}

footer a {
    color: #ffffff;
    text-decoration: none;
}

@media (max-width: 768px) {
    .pimage {
        max-width: 90%; 
    }
}

.pimaged {
    margin: 40px auto;
    display: block;
}

p {
    font-size: 1rem;
    text-align: center;
    line-height: 2.5rem;
}

.image-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.image-gallery img {
    width: 100%;
    height: auto;
}

.main-image {
    max-width: 500px;
    margin: 0 auto;
}

.secondary-image {
    max-width: 400px;
    margin: 0 auto;
}

.memorial-btn {
    display: block;
    margin: 20px auto;
    padding: 15px 30px;
    background-color: #e0e0e0;
    color: #424242;
    border: none;
    border-radius: 8px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.memorial-btn:hover {
    background-color: #bdbdbd;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto; 
}

.modal-content {
    background-color: #fff;
    margin: 5% auto; /* کاهش margin برای فضای بیشتر */
    padding: 40px 30px 30px 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh; /* محدودیت ارتفاع */
    overflow-y: auto; /* اسکرول عمودی */
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.close-btn {
    position: static;
    display: block;
    margin: 0 auto 20px auto;
    background: #e0e0e0;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
    width: auto;
}

.close-btn:hover {
    background-color: #bdbdbd;
}

.modal-content p {
    text-align: center;
    font-size: 1rem;
    line-height: 1.8;
    color: #626262;
    margin: 0;
    white-space: pre-line;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0px 15px;
    }
    
    header h1 {
        font-size: 1.2rem;
    }
    
    .memorial-btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
   .modal-content {
        margin: 10% auto;
        padding: 35px 20px 25px 20px;
        max-height: 85vh; /* ارتفاع بیشتر در موبایل */
    }
    
    .modal-content p {
        font-size: 1.1rem;
    }
    
    .close-btn {
        font-size: 0.75rem;
        padding: 5px 10px;
        margin-bottom: 15px;
    }
}


@media (max-width: 480px) {
    header h1 {
        font-size: 1.1rem;
    }
    
    .memorial-btn {
        width: 100%;
        margin: 20px auto;
        }

     .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 30px 15px 20px 15px;
        max-height: 90vh; /* ارتفاع بیشتر در موبایل کوچک */
    }
    
    .close-btn {
        margin-bottom: 12px;
    }
}



/* استایل‌های گالری */
.gallery-section {
    margin: 3rem 0;
    text-align: center;
}

.gallery-section h2 {
    color: #2c3e50;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

.gallery-item {
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* استایل Lightbox */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.lightbox-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    left: 30px;
    color: white;
    font-size: 3rem;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2001;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 4rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    cursor: pointer;
    z-index: 2001;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.lightbox-prev {
    right: 30px;
}

.lightbox-next {
    left: 30px;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lightbox-image-container {
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#lightboxImage {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-caption {
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.8rem;
}

/* ریسپانسیو برای گالری */
@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.5rem;
    }
    
    .lightbox-nav {
        font-size: 3rem;
        width: 50px;
        height: 50px;
    }
    
    .lightbox-prev {
        right: 10px;
    }
    
    .lightbox-next {
        left: 10px;
    }
    
    .lightbox-close {
        top: 10px;
        left: 15px;
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .gallery-section h2 {
        font-size: 1.3rem;
    }
}