:root {
    --primary-font: 'Cinzel Decorative', cursive;
    --secondary-font: 'Playfair Display', serif;
    --accent-font: 'Tangerine', cursive;
    
    --bg-color: #fdfbf7; /* Parchment */
    --text-color: #2c241b; /* Dark Brown */
    --primary-color: #4a0404; /* Deep Burgundy */
    --accent-color: #c5a059; /* Gold */
    --muted-green: #556b2f;
    
    --border-style: 3px double var(--accent-color);
    --shadow: 0 10px 20px rgba(0,0,0,0.15);
}

body {
    font-family: var(--secondary-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    text-align: center;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
}

header {
    padding: 4rem 1rem;
    background: linear-gradient(to bottom, rgba(74, 4, 4, 0.05), transparent);
    border-bottom: 1px solid var(--accent-color);
    position: relative;
}

header::before, header::after {
    content: "❧";
    font-size: 2rem;
    color: var(--accent-color);
    display: block;
    margin: 1rem 0;
}

h1 {
    font-family: var(--primary-font);
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    line-height: 1.2;
}

.ornament-divider {
    font-size: 2rem;
    color: var(--accent-color);
    margin: 1rem 0;
}

p {
    font-size: 1.2rem;
    color: #4a4a4a;
    font-style: italic;
}

/* Buttons */
.btn-primary, .cloudinary-button {
    background-color: var(--primary-color);
    color: var(--accent-color);
    border: 2px solid var(--accent-color);
    padding: 1rem 2.5rem;
    font-size: 1.3rem;
    font-family: var(--primary-font);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover, .cloudinary-button:hover {
    background-color: var(--accent-color);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border: 8px solid #fff;
    outline: 2px solid var(--accent-color);
    box-shadow: var(--shadow);
    transition: transform 0.4s ease;
    background: #fff;
    cursor: pointer;
}

.gallery-item:hover {
    transform: scale(1.02);
    z-index: 10;
    outline: 2px solid var(--primary-color);
}

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

.gallery-item:hover img {
    filter: sepia(20%);
}

/* Upload Page */
.upload-container {
    padding: 4rem 1rem;
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, rgba(197, 160, 89, 0.1), transparent);
}

.back-link {
    color: var(--primary-color);
    text-decoration: none;
    margin-top: 2rem;
    font-family: var(--primary-font);
    font-size: 1.2rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s;
}

.back-link:hover {
    border-bottom-color: var(--primary-color);
}

footer {
    padding: 3rem;
    margin-top: 3rem;
    border-top: 1px solid var(--accent-color);
    font-family: var(--accent-font);
    font-size: 2rem;
    color: var(--primary-color);
}

.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* Lightbox */
.lightbox {
    display: none; 
    position: fixed; 
    z-index: 1000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background-color: rgba(0,0,0,0.95); 
    backdrop-filter: blur(8px);
    
    /* Flexbox for centering */
    align-items: center;
    justify-content: center;
    
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {opacity: 0} 
    to {opacity: 1}
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border: 4px solid var(--accent-color);
    box-shadow: 0 0 60px rgba(197, 160, 89, 0.4);
    animation-name: zoomIn;
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1.275); /* Bouncy effect */
}

@keyframes zoomIn {
    from {transform: scale(0.8); opacity: 0;} 
    to {transform: scale(1); opacity: 1;}
}

/* Navigation Buttons */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 40px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1001;
    background-color: rgba(0,0,0,0.3);
    font-family: var(--secondary-font);
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
    border-radius: 0 3px 3px 0;
}

.prev:hover, .next:hover {
    background-color: rgba(197, 160, 89, 0.2);
    color: #fff;
    transform: scale(1.1);
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    font-family: var(--secondary-font);
    z-index: 1002;
    line-height: 1;
}

.close-lightbox:hover,
.close-lightbox:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
    transform: rotate(90deg);
}

/* Gallery Item Animation */
.gallery-item {
    /* ... existing styles ... */
    animation: fadeInUp 0.6s ease backwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animations (up to 10 items) */
.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.15s; }
.gallery-item:nth-child(3) { animation-delay: 0.2s; }
.gallery-item:nth-child(4) { animation-delay: 0.25s; }
.gallery-item:nth-child(5) { animation-delay: 0.3s; }
.gallery-item:nth-child(6) { animation-delay: 0.35s; }
.gallery-item:nth-child(7) { animation-delay: 0.4s; }
.gallery-item:nth-child(8) { animation-delay: 0.45s; }
.gallery-item:nth-child(9) { animation-delay: 0.5s; }
.gallery-item:nth-child(10) { animation-delay: 0.55s; }

/* Contact Section */
.contact-section {
    padding: 4rem 1rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid var(--accent-color);
    margin-bottom: 4rem;
    box-shadow: var(--shadow);
}

.contact-section h2 {
    font-family: var(--primary-font);
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-family: var(--primary-font);
    font-size: 1.2rem;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    padding: 1rem;
    font-family: var(--secondary-font);
    font-size: 1rem;
    border: 1px solid var(--accent-color);
    background-color: #fff;
    border-radius: 2px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(74, 4, 4, 0.2);
}

.contact-form button {
    align-self: center;
    margin-top: 1rem;
    width: 100%;
    max-width: 300px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
        padding: 1rem;
    }
    
    .gallery-item {
        border-width: 4px;
    }

    .lightbox-content {
        width: 95%;
    }
}