/* --- Google Font Imports & CSS Variables --- */
:root {
    --font-heading: 'Birthstone', cursive;
    --font-body: 'Montserrat', sans-serif;
    --color-bg: #FAF9F6; /* Off-white */
    --color-text: #333333; /* Charcoal */
    --color-primary: #BFA181; /* Muted Gold */
    --color-primary-dark: #A98B6C; /* Darker Gold for hover */
    --container-width: 1100px;
}

/* --- Basic Reset & Body Styles --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

/* --- Login Overlay Styles --- */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg); /* Matches site background */
    z-index: 10000; /* sits on top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

/* Class to hide the overlay */
.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.login-content {
    text-align: center;
    padding: 40px;
    max-width: 400px;
    width: 90%;
}

.login-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    color: var(--color-primary-dark);
    margin-bottom: 10px;
    line-height: 1;
}

.login-subtitle {
    font-family: var(--font-body);
    margin-bottom: 30px;
    font-size: 1rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#password-input {
    padding: 12px 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    text-align: center;
}

#password-input:focus {
    border-color: var(--color-primary);
}

.error-message {
    color: #cc0000;
    font-size: 0.9rem;
    margin-top: 15px;
    min-height: 1.5em; /* reserves space so layout doesn't jump */
}

/* Prevent scrolling when overlay is active */
body.locked {
    overflow: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.7;
    word-spacing: 0.05rem;
}

/* --- Navigation Bar --- */
.main-header {
    background: #fff;
    /* box-shadow: 0 2px 5px rgba(0,0,0,0.1); <-- KEEP THIS, OR change to: */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08); /* A very light grey line */
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
}

.nav-logo {
    font-family: var(--font-heading); /* Use the fancy font */
    font-size: 2rem; /* Make it more prominent */
    color: var(--color-primary-dark); /* Use the dark gold for the name */
    text-decoration: none;
    padding: 10px 0; /* Give it vertical space */
    transition: color 0.3s ease;
}
.nav-logo:hover {
    color: var(--color-text); /* Black/Charcoal on hover */
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--color-text);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: var(--color-primary);
}

.nav-button-desktop {
    background-color: var(--color-primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.nav-button-desktop:hover {
    background-color: var(--color-primary-dark);
    color: #fff;
}

.nav-button-mobile { display: none; }
.hamburger { display: none; cursor: pointer; }
.bar { display: block; width: 25px; height: 3px; margin: 5px auto; background-color: var(--color-text); }


/* --- General Section Styles --- */
.section {
    padding: 80px 0; /* Consistent vertical padding for rhythm */
    max-width: var(--container-width);
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--color-text);
}

.btn {
    display: inline-block;
    background-color: var(--color-primary);
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    margin-top: 20px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-2px);
}

/* --- Hero Section --- */
.hero-section {
    display: grid;
    grid-template-columns: 7fr 3fr;
    min-height: calc(100vh - 70px);
}

.hero-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
}

.ampersand {
    /* Make it slightly smaller and lighter than the main names */
    font-size: 0.8em; 
    font-weight: normal; 
    display: inline-block;
    margin: 0 10px; /* Add horizontal space around it */
    /* Optionally, use a slightly different color if the names are not pure white */
    /* color: rgba(255, 255, 255, 0.8); */
}

.hero-date {
    font-family: var(--font-body);
    font-size: 1.5rem; /* Make the date bigger */
    font-weight: 500;
    letter-spacing: 0.25em; /* Significantly increased spacing for elegance */
    text-transform: uppercase;
    color: #fff;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
    margin-bottom: 5px;
}

.hero-location {
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.1em; /* Slight spacing */
    color: rgba(255, 255, 255, 0.9); /* Subtly lighter color */
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.4);
}

/* 1. New Pre-Title (Thematic Contrast) */
.hero-pre-title {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.3em; /* Wide spacing is key to elegance */
    text-transform: uppercase;
    color: var(--color-primary-dark); /* Use darker gold for a rich accent */
    margin-bottom: 5px;
    opacity: 0.8;
}

/* 2. Names (Dramatic Focal Point) - Replacing old .hero-names */
.hero-names {
    font-family: var(--font-heading);
    font-size: 6.5rem; /* Large and dominant */
    line-height: 0.9;
    margin-top: 5px;
    margin-bottom: 20px;
    color: var(--color-text); /* Black text provides highest contrast */
}

/* 3. Details (Subtle Structure) - Replacing old .hero-subtitle */
.hero-details {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-text);
    margin-bottom: 5px; 
}

.hero-location-detail {
    margin-bottom: 30px; /* Add space before the button */
}


/* --- Details Section (Homepage) --- */
.details-section {
    padding: 80px 20px;
    margin: 0 auto;
    text-align: center;
    max-width: 950px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
    text-align: center;
    margin-bottom: 40px;
}

.detail-item h3 {
    font-size: 1.4rem; /* Match the prominent style */
    font-weight: 600; /* Make it slightly bolder */
    margin-top: 40px; /* Increase vertical rhythm */
    margin-bottom: 10px;
    color: var(--color-primary); /* Use primary color for section sub-headings */
}

.detail-item {
    font-size: 1.1rem;
}

.map-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted var(--color-text);
    transition: color 0.3s ease;
}

.map-link:hover {
    color: var(--color-primary-dark);
}

.detail-content ul {
    list-style: none;
    padding-left: 0;
    margin-top: 10px;
}

.detail-content li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 10px;
}

.detail-content li::before {
    content: '›';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-primary-dark);
    font-weight: bold;
}

.detail-content p {
    margin-bottom: 1.2em;
}

/* --- Story Section --- */
.story-section {
    padding: 80px 20px;
    background-color: #fff;
}

.story-content {
    max-width: 950px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.1rem;
}

.story-content p {
    margin-bottom: 20px;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 40px 20px;
    background-color: #fff;
}


/* --- Details Page Specific Styles --- */
.details-header {
    text-align: center;
    padding: 40px 20px;
}

.back-link {
    display: block;
    margin-bottom: 20px;
    text-decoration: none;
    color: var(--color-primary);
}

.details-page-content {
    /* This is now just a wrapper */
}

.details-page-content section {
    padding: 60px 20px;
    border-top: 1px solid #eee;
}

.details-page-content .detail-content {
    margin: 0 auto;
}

.details-page-content section:nth-of-type(even) {
    background-color: #fff;
}


.detail-content h3 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-top: 30px; 
    margin-bottom: 15px;
}

.detail-content p + ul {
    margin-top: 15px;
}

.program-list {
    list-style: none;
    margin-top: 10px;
    border-left: 2px solid #eee;
    padding-left: 20px;
    margin-left: 40px;
    margin-right: 40px;
}

.program-list .program-item {
    display: flex;
    align-items: baseline;
    position: relative;
    padding-left: 0;
    margin-bottom: 20px;
}

.program-list .program-item::before {
    content: '';
    height: 10px;
    width: 10px;
    background-color: var(--color-primary);
    border-radius: 50%;
    border: 2px solid #fff;
    position: absolute;
    left: -32px;
    top: 5px;
}

.program-time {
    font-weight: 700; /* Increase weight to stand out */
    color: var(--color-primary-dark); /* Color-code the time */
    width: 80px; /* Slightly increase width */
    flex-shrink: 0;
}

.program-event {
    font-size: 1.15rem; /* Make the event description slightly larger */
    font-weight: 500;
    color: var(--color-text);
}

strong {
    color: var(--color-primary-dark);
    font-weight: 600;
}

.rsvp-section {
    background-color: #fff;
    padding-top: 60px;
    padding-bottom: 60px;
    text-align: center;
}

.rsvp-subtitle {
    font-size: 1.2rem;
    margin-top: -30px;
    margin-bottom: 30px;
    text-align: center;
}

/* --- Responsive Design --- */
@media(max-width: 992px) {
    .section-title { font-size: 2.8rem; }
    .hero-title { font-size: 4rem; }
    .hero-names { font-size: 2rem; }

    .hero-section {
        grid-template-columns: 1fr;
    }
    .hero-carousel {
        min-height: 60vh;
    }
    .hero-text {
        min-height: 40vh;
        padding: 30px;
    }
    .details-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .nav-button-desktop { display: none; }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 5px 5px rgba(0,0,0,0.1);
        padding-bottom: 20px;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 1.5rem 0;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .dropdown-content {
        display: none;
        position: static;
        box-shadow: none;
        background-color: #f9f9f9;
        border-radius: 0;
    }
    
    .dropdown.dropdown-active .dropdown-content {
        display: block;
    }
}

/* --- Specific fixes for phones in LANDSCAPE mode --- */
@media (max-width: 992px) and (orientation: landscape) {
    .hero-section {
        /* Use flexbox to correctly position content side-by-side */
        display: flex;
        flex-direction: row;
        min-height: 100vh; /* Set a minimum height for the section */
    }
    
    .hero-carousel {
        flex: 1;
        min-height: auto; /* Allow the image to take up necessary height */
    }

    .hero-text {
        flex: 1;
        min-height: auto;
    }
}

/* --- Specific fixes for phones in PORTRAIT mode --- */
@media (max-width: 768px) {
    .hero-pre-title {
        font-size: 0.9rem;
        letter-spacing: 0.2em;
    }

    .hero-names {
        font-size: 3.5rem; /* Appropriate size for mobile */
        margin-bottom: 15px;
    }

    .hero-details {
        font-size: 0.8rem;
        letter-spacing: 0.08em;
    }

    .ampersand {
        font-size: 0.9em;
        margin: 0 5px;
    }

    .hero-date {
        font-size: 1.1rem;
        letter-spacing: 0.15em;
    }

    .hero-location {
        font-size: 0.9rem;
    }
    
    .dropdown > .nav-link, .dropdown-toggle {
        font-size: 1rem; /* Adjust font size for mobile view */
    }
    
    .dropdown-content {
        position: static; /* Let it sit naturally in the document flow */
        background-color: #f9f9f9;
        box-shadow: none;
    }

    .dropdown-content li {
        width: 100%;
        margin: 0; /* Override any margin set on nav-item */
    }

    .dropdown-content a {
        padding-left: 30px; /* Indent the sublinks */
    }

    /* This rule will be activated by our JavaScript */
    .dropdown.dropdown-active .dropdown-content {
        display: block;
    }

    /* Adjust program/schedule for readability on narrow screens */
    .program-list {
        margin-left: 20px;
        margin-right: 20px;
        padding-left: 15px;
    }
    .program-list .program-item::before {
        left: -25px; /* Adjust dot position to match new padding */
    }
    .program-time {
        width: 65px; /* Slightly reduce width of time column */
        font-size: 0.9rem;
    }
    .program-event {
        font-size: 1rem;
    }
    
    /* Adjust spacing in Getting There section */
    .detail-content h3 {
        font-size: 1.1rem;
    }
    .detail-content, .story-content {
        font-size: 1.1rem; /* Ensure consistent, comfortable reading size */
        margin-top: 20px; /* Add a little space below the title in .detail-content */
    }
}

/* --- Specific fixes for VERY SMALL phones (< 480px) --- */
@media (max-width: 480px) {
    .section-title {
        font-size: 2.2rem;
    }
    .hero-title {
        font-size: 3rem;
    }
    .hero-carousel .caption-script {
        font-size: 3.2rem;
    }
    .details-section, .story-section, .details-page-content section {
        padding-top: 50px;
        padding-bottom: 50px;
    }
}

/* --- Hero Carousel Styles --- */
.hero-carousel {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    position: relative;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

/* --- Caption Styles --- */
.caption-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
}

.hero-image-caption {
    color: #fff;
    z-index: 3;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    line-height: 1.2;
    padding: 15px 25px;
    margin: 40px;
}

.hero-carousel .caption-sans {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 1.3rem;             /* Slightly smaller for support text */
    font-weight: 500;
    letter-spacing: 0.4em;         /* Very wide spacing for high elegance */
    text-transform: uppercase;
    display: inline;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

/* ADD: New style for the focal script text (Italianno) */
.hero-carousel .caption-script {
    font-family: 'Italianno', cursive; /* Use the new delicate script */
    font-size: 4rem;             /* Large size for delicate font to stand out */
    font-weight: 400;
    display: inline;
    margin: 0 5px;                 /* Add small space around the script word */
    line-height: 1;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
    color: #fff;
    text-transform: lowercase;
}

@media(max-width: 768px) {
    .hero-carousel .caption-sans {
        font-size: 0.9rem;
        letter-spacing: 0.2em;
    }
    .hero-carousel .caption-script {
        font-size: 1.8rem;
    }
}

/* --- Dropdown Menu Styles --- */
.dropdown {
    position: relative;
    display: inline-flex; /* Use flexbox to align link and toggle */
    align-items: center;
}

.dropdown-toggle {
    cursor: pointer;
    font-size: 1.2rem;
    padding-left: 5px;
    line-height: 1;
    transition: transform 0.3s ease;
}

.dropdown.dropdown-active .dropdown-toggle {
    transform: rotate(180deg);
}

/* Base styles for the dropdown content (hidden by default) */
.dropdown-content {
    display: none;
    list-style: none; /* Remove bullet points */
}

/* For desktop, show dropdown on hover */
.dropdown:hover > .dropdown-content {
    display: block;
    position: absolute;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 101;
    border-radius: 5px;
    overflow: hidden;
    top: 100%; /* Position it right below the parent link */
    left: 0;
}

.dropdown-content li {
    width: 100%;
}

.dropdown-content a {
    color: var(--color-text);
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
    transition: background-color 0.3s ease;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

/* --- NEW: Story Section Photo Collage Styles --- */

/* Make the section a positioning container */
.story-section {
    position: relative;
    overflow: hidden; /* This keeps the photos contained within the section's bounds */
}

/* Ensure the text content sits on top of the photos */
.story-content {
    position: relative;
    z-index: 2;
}

/* Base style for all photos in the collage */
.story-photo-collage img {
    position: absolute;
    max-width: 220px; /* Control the size of the photos */
    opacity: 0.15; /* Make them subtle */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1; /* Sit behind the text */
}

/* --- Individual Photo Positions & Rotations --- */
/* You can change these top/left/right/bottom and rotate values to your liking! */

.story-photo-1 {
    top: 10%;
    left: 5%;
    transform: rotate(-15deg);
}

.story-photo-2 {
    top: 15%;
    right: 8%;
    transform: rotate(10deg);
}

.story-photo-3 {
    bottom: 45%;
    left: 15%;
    max-width: 180px; /* Example of a smaller photo */
    transform: rotate(8deg);
}

.story-photo-4 {
    bottom: 10%;
    right: 5%;
    transform: rotate(-12deg);
}

.story-photo-5 {
    bottom: 5%;
    left: 2%;
    max-width: 200px;
    transform: rotate(5deg);
}


/* --- Responsive rules for the collage --- */
@media(max-width: 992px) {
    /* Make photos smaller on tablets */
    .story-photo-collage img {
        max-width: 150px;
        opacity: 0.1;
    }
}

@media(max-width: 768px) {
    /* On mobile, show 3 photos and make them smaller */
    .story-photo-3, .story-photo-4 {
        display: none; /* Hide photos 3 and 4 */
    }
    
    .story-photo-collage img {
        max-width: 120px; /* Make photos smaller on phones */
    }

    /* Reposition the remaining photos to be visible on screen */
    .story-photo-1 {
        top: 5%;
        left: 5%; 
    }

    .story-photo-2 {
        top: 30%;
        right: 5%;
    }

    .story-photo-5 {
        bottom: 5%;
        left: 8%;
    }
}