@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700&family=Playfair+Display:wght@700&display=swap');

:root {
    --text-color: #333333;
    --background-color: #fdfcf9;
    --primary-color: #5D4037;
    --secondary-color: #8D6E63;
    --light-blue: #d3e5eb;
    --border-color: #e0e0e0;
    --dark-blue: #607b9b;
    --light-text-color: #f0f0f0;
    --dusty-rose: #b58b76;
    /* Darkened from #DCAE96 for better contrast */
    --white: white;
    --mid-green: #b1cfb7;
    --hover-green: #92cd9d;
    --hover-rose: #c99a82;
    --caption-color: #1b4061;
}

html {
    height: 100%;
}

body {
    font-family: 'Lato', sans-serif;
    line-height: 1.4;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    /* Remove padding to allow header to be full-width */
    background-color: var(--background-color);
    /* A soft, off-white paper color for the page */
    background-image: linear-gradient(rgba(253, 252, 249, 0.8), rgba(253, 252, 249, 0.8)), url("tree_background.jpg");
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

head {
    padding: 0;
    margin: 0;
}

/* Accessibility: Global Focus Styles */
:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

header {
    background-size: cover;
    /* Cover the entire element */
    background-position: center 25%;
    /* Adjust this value to focus on our heads */
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: linear-gradient(rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)), url('ONO07520.webp');
}

h1 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    text-align: center;
}

h2 {
    font-family: 'Playfair Display', serif;
    color: var(--secondary-color);
}

.letter {
    background-color: var(--light-blue);
    padding: 1em;
    margin: 1em;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

.letter h1 {
    font-family: cursive;
    color: var(--dark-blue);
    text-align: center;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25);
    font-size: 2em;
}

.letter h2 {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    color: var(--dark-blue);
}

.p1 {
    font-family: 'Lato', sans-serif;
    font-size: 18px;
    color: var(--text-color);
}

header h2 {
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    color: var(--light-text-color);
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
    margin: 5px;
    /* clamp(min-size, preferred-size, max-size) */
    font-size: clamp(2rem, 3vw, 2.5rem);
}

a {
    color: var(--dusty-rose);
    /* Dusty Rose */
    text-decoration: none;
    font-weight: bold;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -o-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

.playfair-display-sc-bold {
    font-family: "Playfair Display SC", serif;
    font-weight: 400;
    font-style: normal;
    color: var(--white);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    font-size: clamp(3rem, 10vw, 5rem);
    margin: 0;
}

footer {
    text-align: center;
    padding: 1em;
    font-family: "Playfair Display SC", serif;
    font-weight: 400;
    font-size: 2em;
    color: var(--text-color);
}

.border {
    border-bottom: var(--text-color) 1px solid;
    width: 3em;
    margin: auto;
    font-size: 1.5em;
    word-spacing: -0.2em;
}

.p2 {
    padding: 0em;
    margin: 0em;
    font-size: 0.7em;
}

.engagement {
    background-color: var(--mid-green);
    padding: 10px;
    padding-left: 2em;
    padding-right: 2em;
    padding-bottom: 1em;
    margin: 0em;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.engagement h2 {
    font-family: 'Parisienne', cursive;
    font-size: 3em;
    font-weight: 400;
    color: var(--text-color);
    text-align: center;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.25);
}

.engagement-photos {
    display: flex;
    flex-wrap: wrap;
    /* Allows images to stack on smaller screens */
    justify-content: center;
    /* Centers the images */
    gap: 1em;
    /* Adds space between the images */
    margin-top: 1.5em;
    /* Adds some space above the photos */
}

.engagement-photo {
    flex: 1 1 250px;
    /* Flex-grow, flex-shrink, and flex-basis */
    object-fit: cover;
    /* Prevents image distortion */
    border-radius: 8px;
    max-width: 300px;
    /* Prevents images from getting too large */
}

/* Q&A Section Styles */
.qa-section {
    margin: 5px;
}

.qa-title {
    text-align: center;
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    color: var(--primary-color);
    margin-bottom: 1em;
}

.qa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2em;
    align-items: start;
    /* Prevents grid items from stretching to the same height */
    margin: 1em;
}

.qa-item {
    background-color: var(--mid-green);
    /* Padding removed to make the whole card clickable via button */
    border-radius: 8px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    /* Ensures child elements don't spill out of border-radius */
}

.qa-item.is-expanded {
    justify-content: flex-start;
}

.qa-simple {
    padding: 1.5em;
}

.qa-simple h3 {
    cursor: default;
}

.qa-img {
    width: 80%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 1em auto 0 auto;
}


.qa-item h3 {
    font-family: 'Playfair Display', serif;
    display: flex;
    width: 100%;
    cursor: pointer;
    margin: 0;
}

.qa-btn {
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    color: inherit;
    padding: 1.5em;
    text-align: left;
    outline-offset: -3px;
    /* Ensure focus ring is visible inside card */
}

.qa-text {
    flex-grow: 1;
    text-align: center;
}

.qa-details {
    padding: 0 1.5em 1.5em 1.5em;
}

/* Original span selectors can be removed or kept for safety, but we are using .qa-text now. 
   Keeping span:first-child just in case */
.qa-item h3 span:first-child {
    margin-right: 10px;
}

/* Nav Styles */
nav {
    display: flex;
    flex-flow: row wrap;
    justify-content: center;
    padding: 1em;
    gap: 2em;
    border-bottom: 1px solid var(--border-color);
}

nav a {
    background-color: var(--mid-green);
    padding: 1em;
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    font-weight: bold;
    transition: 1s;
}

nav a:hover {
    background-color: var(--hover-green);
    transition: 1s;
}

nav a:hover::after {
    transition: 1s;
}

/* Timeline Styles From*/
/* The actual timeline (the vertical ruler) */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* The actual timeline (the vertical ruler) */
.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--border-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

/* Container around content */
.container {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

/* The circles on the timeline */
.container::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -17px;
    background-color: var(--white);
    border: 4px solid var(--dusty-rose);
    /* Use dusty rose color */
    top: 15px;
    border-radius: 50%;
    z-index: 1;
    transition: background-color 0.3s ease;
}

/* Change the background color of the dot on hover */
.container:hover::after {
    background-color: var(--dusty-rose);
}

/* Place the container to the left */
.left {
    left: 0;
}

/* Place the container to the right */
.right {
    left: 50%;
}

/* Add arrows to the left container (pointing right) */
.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid var(--light-blue);
    /* Use light blue for arrow */
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--light-blue);
}

/* Add arrows to the right container (pointing left) */
.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid var(--light-blue);
    /* Use light blue for arrow */
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--light-blue) transparent transparent;
}

/* Fix the circle for containers on the right side */
.right::after {
    left: -16px;
}

/* The actual content */
.content {
    padding: 20px 30px;
    background-color: var(--light-blue);
    /* Use light blue from .letter */
    position: relative;
    border-radius: 8px;
    /* Match other rounded corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* I added this hover */
.content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.content h2 {
    font-family: 'Playfair Display', serif;
    color: var(--primary-color);
    /* Dark brown */
}

/* Media queries - Responsive timeline on screens less than 600px wide */
@media screen and (max-width: 600px) {

    /* Place the timelime to the left */
    .timeline::after {
        left: 31px;
    }

    /* Full-width containers */
    .container {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    /* Make sure that all arrows are pointing leftwards */
    .container::before {
        left: 60px;
        border: medium solid var(--light-blue);
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--light-blue) transparent transparent;
    }

    /* Make sure all circles are at the same spot */
    .left::after,
    .right::after {
        left: 15px;
    }

    /* Make all right containers behave like the left ones */
    .right {
        left: 0%;
    }
}

* {
    box-sizing: border-box;
}


/* Registry Page */
.registry-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2em clamp(1em, 5vw, 3em);
    text-align: center;
}

.registry-intro {
    max-width: 600px;
    margin: 0 1em 1em 1em;
    font-size: 1.1em;
    line-height: 1.6;
}

.registry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2em;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
    /* Grid takes full width of its flex container */
}

.registry-item {
    background-color: var(--light-blue);
    border-radius: 10px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    border-radius: 10px;
}

.registry-logo {
    border-radius: 10px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    padding: 1em;
    transition: .5s;
}

.registry-logo:hover {
    transform: translateY(-3px);
    transition: transform 0.3s ease;
    text-decoration: none;
}

.registry-button {
    background-color: var(--dusty-rose);
    /*Dusty rose*/
    color: var(--white);
    padding: 1em 1.5em;
    border-radius: 8px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin: 1.5em;
    /* Add margin to space it from the image */
}

.registry-button:hover {
    background-color: var(--hover-rose);
    background-color: var(--hover-rose);
    text-decoration: none;
}

.registry-section h2 {
    color: var(--text-color);
    margin: 0px;
}

.timeline-img {
    max-width: 80%;
    /* You can adjust this value */
    height: auto;
    max-height: 200px;
    border-radius: 8px;
}

.timeline-img_vertical {
    max-width: 60%;
    height: auto;
    max-height: 250px;
    border-radius: 8px;
}

.image-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1em;
    width: 100%;
}

.row-img {
    width: 49%;
    border-radius: 8px;
}

.timeline-p {
    margin: 0px;
    padding: 0px
}

.timeline-caption-p {
    margin-top: 3px;
    margin-bottom: 0px;
    padding-top: 0px;
    font-weight: lighter;
    font-size: .8em;
    color: var(--caption-color);
}

@media screen and (max-width: 600px) {
    .image-row {
        flex-direction: column;
        align-items: center;
    }

    .row-img {
        width: 55%;
        border-radius: 8px;
    }
}

#map {
    height: 400px;
    width: 90%;
    max-width: 800px;
    margin: 1em auto;
    border-radius: 8px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

#venue-tour-map {
    height: 500px;
    /* Taller for a tour */
    width: 90%;
    max-width: 1000px;
    /* A bit wider */
    margin: 1.5em auto;
    border-radius: 8px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
}

/* RSVP Page Styles */
/* RSVP Page Styles */
.rsvp-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 3em clamp(1em, 5vw, 3em);
    text-align: center;
}

.rsvp-intro {
    max-width: 600px;
    margin: 0 1em 2.5em 1em;
    font-family: 'Playfair Display', serif;
    font-size: 1.3em;
    line-height: 1.6;
    color: var(--primary-color);
    font-style: italic;
}

.rsvp-form {
    background-color: var(--light-blue);
    padding: 2.5em;
    border-radius: 4px;
    /* Double border effect for elegance */
    border: 1px solid var(--border-color);
    outline: 4px solid rgba(255, 255, 255, 0.5);
    outline-offset: -10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 550px;
    display: flex;
    flex-direction: column;
    gap: 1.8em;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6em;
}

.form-group label {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.15em;
    letter-spacing: 0.02em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="number"],
.form-group textarea {
    padding: 1em;
    border: 1px solid var(--secondary-color);
    border-radius: 2px;
    font-family: 'Lato', sans-serif;
    font-size: 1em;
    /* Semi-transparent white to blend with blue */
    background-color: rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background-color: var(--white);
    border-color: var(--dusty-rose);
    box-shadow: 0 0 0 3px rgba(220, 174, 150, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.8em;
    padding: 0.5em 0;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.8em;
    cursor: pointer;
    font-family: 'Playfair Display', serif;
    font-size: 1.1em;
    color: var(--text-color);
}

.radio-label input[type="radio"] {
    accent-color: var(--secondary-color);
    width: 1.2em;
    height: 1.2em;
    margin: 0;
}

.submit-btn {
    background-color: var(--dusty-rose);
    color: var(--white);
    padding: 1.2em;
    border: none;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1.5em;
    font-family: 'Lato', sans-serif;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.submit-btn:hover {
    background-color: var(--hover-rose);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.submit-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Honeypot field — hidden from humans, bots fill it in */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* RSVP error banner */
.form-error {
    background-color: #fdecea;
    color: #b71c1c;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 1em 1.5em;
    width: 100%;
    max-width: 550px;
    font-size: 1em;
    text-align: center;
}

/* Map Reset Control */
.reset-map-control {
    background-color: white;
    padding: 5px 10px;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-color);
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s;
}

.reset-map-control:hover {
    background-color: #f4f4f4;
}

/* Countdown Timer */
.countdown {
    display: flex;
    justify-content: center;
    gap: 2em;
    margin-top: 1em;
    text-align: center;
    color: var(--white);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.time-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-segment span:first-child {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    font-weight: bold;
}

.time-segment .label {
    font-family: 'Lato', sans-serif;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media screen and (max-width: 600px) {
    .countdown {
        gap: 0.5em;
        /* Reduced gap significantly */
        margin-top: 0.5em;
    }

    .time-segment {
        min-width: 50px;
        /* Ensure segments don't squish too much */
    }

    .time-segment span:first-child {
        font-size: 1.2em;
        /* Even smaller font on mobile */
    }

    .time-segment .label {
        font-size: 0.5em;
    }
}