/* Reset & Variables */
:root {
    --bg-color: #fdfcf8;
    --text-color: #5d534a;
    --accent-color: #d4a373;
    --accent-light: #faedcd;
    --white: #ffffff;
    --shadow-soft: 0 10px 30px -5px rgba(166, 144, 128, 0.15);
    --shadow-hover: 0 20px 40px -5px rgba(166, 144, 128, 0.25);
    --radius-lg: 30px;
    --radius-md: 20px;
    --radius-sm: 12px;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Poppins', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.nav-container {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 15px 40px;
    border-radius: 50px;
    box-shadow: var(--shadow-soft);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1000px;
    transition: all 0.3s ease;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
    background: radial-gradient(circle at top right, var(--accent-light) 0%, transparent 40%),
                radial-gradient(circle at bottom left, #e9edc9 0%, transparent 40%);
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 20px;
    color: var(--text-color);
    line-height: 1.1;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    color: rgba(93, 83, 74, 0.8);
}

.btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: var(--text-color);
    color: var(--white);
    border-radius: 50px;
    font-weight: 500;
    box-shadow: var(--shadow-soft);
}

.btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Gallery Section */
.gallery-section {
    padding: 100px 50px;
    max-width: 1600px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Masonry Layout */
.gallery-container {
    column-count: 3;
    column-gap: 30px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 30px;
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    background-color: var(--white);
    transform: translateY(50px);
    opacity: 0;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1), 
                opacity 0.8s ease,
                box-shadow 0.3s ease;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    box-shadow: var(--shadow-hover);
    z-index: 10;
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-item.visible {
    transform: translateY(0);
    opacity: 1;
}

/* Overlay Effect */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(93, 83, 74, 0.8), transparent);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* Music Player */
.music-player {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 50px;
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2000;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.music-player:hover {
    transform: scale(1.05);
}

.player-info {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    min-width: 100px;
    text-align: center;
}

.player-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--text-color);
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.control-btn:hover {
    color: var(--accent-color);
    background-color: var(--accent-light);
}

/* Modal (Lightbox) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 3000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: hidden; 
    background-color: rgba(93, 83, 74, 0.95); 
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 80vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    object-fit: contain;
}

.modal.show .modal-content {
    transform: scale(1);
}

#modal-caption {
    margin-top: 20px;
    color: var(--white);
    font-size: 1.2rem;
    font-weight: 500;
    text-align: center;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    line-height: 1;
    z-index: 3001;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }
    .close-modal {
        top: 20px;
        right: 20px;
        font-size: 40px;
    }
}

/* Timeline & Year Grid */
.timeline-year {
    width: 100%;
    text-align: center;
    margin: 60px 0 30px;
    position: relative;
    column-span: all; /* If inside a multi-column container */
}

.timeline-year h3 {
    font-size: 2.5rem;
    color: var(--accent-color);
    background: var(--bg-color);
    display: inline-block;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.year-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-light);
    z-index: 1;
}

.year-grid {
    display: flex;
    gap: 20px;
    width: 100%;
    margin-bottom: 40px;
    align-items: flex-start;
}

.gallery-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Responsive adjustment handled by JS re-rendering, 
   but we ensure container behaves correctly */
@media (max-width: 600px) {
    .year-grid {
        flex-direction: column;
    }
}

/* Adjust original masonry container if used for timeline */
.gallery-container.timeline-mode {
    display: block;
    column-count: 1 !important; /* Force single column so internal flex grids work */
}

.gallery-container.timeline-mode .gallery-item {
    width: 100%;
    margin-bottom: 0; /* Gap handled by column flex gap */
    transform: translateY(30px); /* Reset for animation */
}

/* Footer */
footer {
    text-align: center;
    padding: 80px 20px 40px;
    background-color: #f4f1ea;
    border-top-left-radius: 50px;
    border-top-right-radius: 50px;
}

.footer-content h3 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.socials {
    margin: 30px 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.socials a {
    color: var(--text-color);
    font-weight: 600;
}

.footer-bottom {
    font-size: 0.9rem;
    opacity: 0.6;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1s forwards cubic-bezier(0.2, 0.8, 0.2, 1);
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

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

/* Responsive */
/* Mobile Menu Styles */
.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px;
    transition: all 0.3s ease;
}

@media (max-width: 1024px) {
    .gallery-container {
        column-count: 2;
    }
    .hero h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 100%; /* Below the navbar */
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        gap: 20px;
        transform: translateY(-20px);
        opacity: 0;
        pointer-events: none;
        transition: all 0.3s ease;
        border-radius: 0 0 30px 30px;
        box-shadow: var(--shadow-soft);
    }

    .nav-links.active {
        display: flex; /* Override display:none if set previously */
        transform: translateY(10px); /* Add a little spacing */
        opacity: 1;
        pointer-events: all;
    }
    
    .gallery-container {
        column-count: 1;
    }

    .hero h1 {
        font-size: 2.5rem;
    }
    
    .nav-container {
        padding: 15px 25px;
    }

    /* Hamburger Animation */
    .hamburger.toggle span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .hamburger.toggle span:nth-child(2) {
        opacity: 0;
    }
    .hamburger.toggle span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}
