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

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

body {
    font-family: 'Lato', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

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

.memorial-header {
    text-align: center;
    margin-bottom: 3rem;
}

.memorial-header h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3.5rem;
    font-weight: 300;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.divider {
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, transparent, #8e9eab, transparent);
    margin: 1.5rem auto;
}

.memorial-content {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.instructions-section {
    text-align: center;
    margin-bottom: 1rem;
}

.gentle-instructions {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    color: #5a6c7d;
    font-style: italic;
    background: rgba(255, 255, 255, 0.7);
    padding: 1rem 2rem;
    border-radius: 8px;
    margin: 0 auto;
    max-width: 600px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border-left: 3px solid #8e9eab;
}

.audio-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.audio-player {
    background: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.audio-player audio {
    width: 100%;
    min-width: 300px;
    height: 50px;
    border-radius: 25px;
    outline: none;
}

.audio-player audio::-webkit-media-controls-panel {
    background-color: #f8f9fa;
    border-radius: 25px;
}

.gallery-section {
    width: 100%;
}

.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.photo-item:focus {
    outline: 3px solid #007acc;
    outline-offset: 2px;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.photo-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

.photo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.photo-item:hover::before {
    opacity: 1;
}


.memorial-footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
}

.memorial-footer p {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    color: #7f8c8d;
    font-style: italic;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .memorial-header h1 {
        font-size: 2.5rem;
    }
    
    .gentle-instructions {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
        max-width: 90%;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.2rem;
        padding: 0.5rem;
    }
    
    .photo-item {
        margin: 0 auto;
        max-width: 350px;
    }
    
    .photo-item img {
        height: 220px;
    }
    
    .audio-player {
        padding: 1.5rem;
    }
    
    .audio-player audio {
        min-width: 250px;
    }
    
    .modal-content {
        width: 95%;
        margin-top: 5vh;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

@media (max-width: 600px) {
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
    }
    
    .photo-item {
        max-width: none;
    }
    
    .photo-item img {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .memorial-header h1 {
        font-size: 2rem;
    }
    
    .photo-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
        padding: 0.3rem;
    }
    
    .photo-item img {
        height: 160px;
    }
    
    .audio-player {
        padding: 1rem;
    }
    
    .audio-player audio {
        min-width: 200px;
        height: 40px;
    }
}

@media (max-width: 320px) {
    .photo-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .photo-item img {
        height: 140px;
    }
}