* {
    box-sizing: border-box;
}

@font-face {
    font-family: 'New Icon';
    src: url('fonts/new-icon-script.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

html {
    scroll-snap-type: y mandatory; /* Enables vertical snapping */
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #333;
    text-align: center;
    background-color: #f9f9f9;
    position: relative;
}

/* Background Image for the entire site */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/background.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    z-index: -2; /* Behind everything */
    pointer-events: none;
    animation: backgroundMove 5s ease-in-out infinite alternate;
}

@keyframes backgroundMove {
    0% {
        transform: scale(1.1) translate(1%, 1%);
    }
    100% {
        transform: scale(1.1) translate(-1%, -1%);
    }
}

/* --- Header Section --- */
header {
    position: relative;
    width: 100%;
    height: 100vh; /* Fallback */
    height: 100svh; /* Modern mobile viewport height */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    overflow: hidden;
    scroll-snap-align: start;
}

header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('images/header.jpg');
    background-size: cover;
    background-position: center center;
    filter: grayscale(100%) brightness(55%);
    z-index: -1;
}

header > * {
    z-index: 1;
}

header h1 {
    font-family: 'New Icon', cursive;
    font-size: 6em;
    margin-bottom: 0.2em;
    font-weight: bold;
    line-height: 1.1;
    padding: 0 10px;
}

header p {
    font-size: 1.5em;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding: 10px 20px;
    display: inline-block;
}

#countdown {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap; /* Allow wrapping on very small screens */
}

.time-box {
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 20px;
    border-radius: 10px;
    width: 100px;
    height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.time-box span:first-child {
    font-size: 2.5em;
    font-weight: bold;
}

.time-box .label {
    font-size: 0.8em;
    text-transform: uppercase;
    margin-top: 5px;
}

/* Scroll Down Indicator */
.scroll-down {
    position: absolute;
    bottom: 20px; /* Position from bottom */
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 10; /* Ensure it's above other elements */
    width: 60px; /* Larger click area width */
    height: 80px; /* Larger click area height */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 20px; /* Push arrows down a bit */
}

.scroll-down span {
    display: block;
    width: 20px;
    height: 20px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg);
    animation: bounce 2s infinite;
    opacity: 0;
    margin: -5px 0; /* Overlap arrows slightly */
}

.scroll-down span:nth-child(2) {
    animation-delay: -0.2s;
}

.scroll-down span:nth-child(3) {
    animation-delay: -0.4s;
}

@keyframes bounce {
    0% {
        opacity: 0;
        transform: rotate(-45deg) translate(-10px, -10px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: rotate(-45deg) translate(10px, 10px);
    }
}


/* --- Navigation --- */
nav {
    background-color: #fff; /* Reverted to solid white */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.nav-brand {
    display: flex;
    align-items: center;
}

.nav-brand img {
    height: 40px;
    width: auto;
}

/* Hamburger Menu Icon */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #333;
    transition: all 0.3s ease;
}

/* Hamburger Animation when Active */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    transition: color 0.3s;
    position: relative;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: #50c878;
    transition: width 0.3s;
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

nav ul li a:hover {
    color: #50c878;
}

/* Desktop/Mobile Link Visibility */
.mobile-link {
    display: none;
}

.desktop-link {
    display: block;
}

/* --- General Section --- */
section {
    padding: 60px 20px;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 100vh;
    scroll-snap-align: start;
    scroll-margin-top: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

h2 {
    font-size: 2.5em;
    margin-bottom: 40px;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- Gallery Section --- */
#gallery {
    max-width: 100%;
    width: 100%;
    height: calc(100vh - 60px);
    padding: 0;
    background-color: transparent; /* Changed from #fff to transparent */
    overflow: hidden;
    position: relative;
}

.gallery-grid {
    display: grid;
    grid-template-rows: 50% 50%; /* Two equal rows */
    grid-auto-flow: column; /* Fill columns first, then add new columns */
    grid-auto-columns: 35vh; /* Base width for columns */
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.gallery-grid::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border: 2px solid #fff;
    cursor: pointer;
}

/*
   Mosaic Pattern Logic (Cycle of 5 items)
   1. Vertical Rectangle (Spans 2 rows)
   2. Square (Row 1)
   3. Square (Row 2)
   4. Horizontal Rectangle (Row 1, Spans 2 cols)
   5. Horizontal Rectangle (Row 2, Spans 2 cols)
*/

/* Item 1: Vertical Rectangle (Tall) */
.gallery-item:nth-child(5n+1) {
    grid-row: span 2;
}

/* Item 2 & 3: Standard Squares (Default behavior fills the column) */

/* Item 4: Wide Horizontal (Top) */
.gallery-item:nth-child(5n+4) {
    grid-column: span 2;
}

/* Item 5: Wide Horizontal (Bottom) */
.gallery-item:nth-child(5n+5) {
    grid-column: span 2;
}


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

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

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2em;
    padding: 15px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.3s;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.prev { left: 20px; }
.next { right: 20px; }

/* --- Ceremony Section --- */
#ceremony {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    min-height: 100vh;
    padding: 60px 20px;
    background-color: rgba(255, 255, 255, 0.85); /* Full page transparency */
}

.ceremony-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1000px;
    align-items: center;
}

.details-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch; /* Ensure equal height */
    width: 100%;
    margin-bottom: 40px;
    position: relative;
    gap: 20px;
}

.event-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 30px;
    background-color: transparent; /* Transparent inner blocks */
    border-radius: 0;
    box-shadow: none;
}

.event-block:hover {
    transform: none;
}

.event-block h3 {
    font-family: 'New Icon', cursive;
    font-size: 3em;
    color: #333;
    margin-bottom: 15px;
    font-weight: normal;
}

.info-text h4 {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
}

.address-container {
    margin-bottom: 20px;
}

.address-container p {
    font-size: 1.1em;
    color: #666;
    margin: 5px 0;
    line-height: 1.4;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

.map-btn, .uber-btn, .waze-btn {
    display: inline-block;
    padding: 10px 25px;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    width: 200px; /* Fixed width for consistency */
    text-align: center;
}

.map-btn {
    border: 1px solid #333;
    color: #333;
    background-color: transparent;
}

.map-btn:hover {
    background-color: #333;
    color: #fff;
}

.uber-btn {
    background-color: #000;
    color: #fff;
    border: 1px solid #000;
}

.uber-btn:hover {
    background-color: #333;
    border-color: #333;
}

.uber-btn i {
    margin-right: 8px;
}

.waze-btn {
    background-color: #33ccff; /* Waze Blue */
    color: #fff;
    border: 1px solid #33ccff;
}

.waze-btn:hover {
    background-color: #00aadd;
    border-color: #00aadd;
}

.waze-btn i {
    margin-right: 8px;
}

.divider {
    width: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 0;
    align-self: stretch;
}

/* --- Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
}

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    max-height: 80vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    z-index: 1001;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px;
    color: white;
    font-weight: bold;
    font-size: 40px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    z-index: 1001;
}

.lightbox-next { right: 0; border-radius: 3px 0 0 3px; }
.lightbox-prev { left: 0; border-radius: 3px 0 0 3px; }
.lightbox-prev:hover, .lightbox-next:hover { background-color: rgba(0, 0, 0, 0.8); }

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    /* Header */
    header::before {
        background-image: url('images/header-2.jpg');
    }

    header h1 {
        font-size: 3.5em;
    }
    header p {
        font-size: 1em;
        padding: 5px 10px;
    }
    #countdown {
        gap: 10px;
    }
    .time-box {
        width: 70px;
        height: 70px;
        padding: 10px;
    }
    .time-box span:first-child {
        font-size: 1.5em;
    }
    .time-box .label {
        font-size: 0.6em;
    }

    /* Nav */
    nav {
        padding: 0 20px;
        justify-content: space-between; /* Keep brand and hamburger apart */
    }

    .nav-brand {
        display: flex; /* Show brand on mobile */
        order: 1; /* Logo on the left */
    }

    .nav-brand img {
        height: 30px;
    }

    .hamburger {
        display: flex; /* Show hamburger on mobile */
        z-index: 101; /* Ensure it's above the menu */
        order: 2; /* Hamburger on the right */
    }

    nav ul {
        position: fixed;
        top: 0; /* Full screen */
        left: 0;
        width: 100%;
        height: 0; /* Hidden by default */
        background-color: #fff; /* Reverted to solid white */
        flex-direction: column;
        justify-content: center; /* Center links vertically */
        align-items: center;
        overflow: hidden;
        transition: height 0.3s ease;
        z-index: 100;
    }

    nav ul.active {
        height: 100vh; /* Full screen height */
        padding: 0;
    }

    nav ul li {
        margin: 20px 0; /* Increased margin for full screen */
        opacity: 0;
        transform: translateY(-10px);
        transition: all 0.3s ease;
    }

    nav ul.active li {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0.2s; /* Stagger animation */
    }

    nav ul.active li:nth-child(2) {
        transition-delay: 0.3s;
    }

    nav ul.active li:nth-child(3) {
        transition-delay: 0.4s;
    }

    nav ul li a {
        font-size: 1.5em; /* Larger font for full screen menu */
    }

    /* Menu Visibility */
    .mobile-link {
        display: block;
    }
    .desktop-link {
        display: none;
    }

    /* Gallery */
    .gallery-grid {
        grid-auto-columns: 50vw; /* Wider columns on mobile */
    }

    .gallery-item {
        /* On mobile, maybe simplify? Or keep the mosaic?
           Let's keep the mosaic but ensure widths are good. */
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 1.5em;
        padding: 10px;
    }

    /* Ceremony */
    #ceremony {
        display: block; /* Stack vertically */
        height: auto;
        min-height: auto;
        padding: 0;
        background-color: transparent; /* Transparent wrapper */
        scroll-snap-align: none; /* Let children handle snap */
    }
    .ceremony-content {
        flex-direction: column;
        height: auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
    .details-container {
        flex-direction: column;
        align-items: center;
        gap: 0;
        width: 100%;
        margin: 0;
    }
    .divider {
        display: none; /* Hide divider on mobile */
    }
    .event-block {
        width: 100%;
        margin: 0;
        padding: 80px 20px 40px 20px; /* Top padding for nav, bottom for breathing room */
        min-height: 100vh;
        min-height: 100svh;
        display: flex;
        flex-direction: column;
        justify-content: center;
        scroll-snap-align: start;
        background-color: rgba(255, 255, 255, 0.85); /* Background on blocks */
    }
    .info-text {
        padding: 10px;
    }

    /* Lightbox */
    .lightbox-content {
        width: 95%;
    }
    .lightbox-prev, .lightbox-next {
        font-size: 30px;
        padding: 10px;
    }
    .close {
        right: 20px;
        top: 20px;
    }
}
