/*
 * Global styles for the wedding invitation.  
 * The palette is soft and romantic with beige and blush tones.  
 * Typography combines elegant script fonts with clean sans-serifs.
 */

:root {
    --primary-color: #9D8B73;
    --secondary-color: #F9F6F1;
    --accent-color: #BFA28D;
    --dark-color: #4A3F35;
    --light-color: #FFFFFF;
    --font-script: 'Great Vibes', cursive;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Montserrat', sans-serif;
    /* Section background variations to distinguish continuous sections */
    --section-bg-collage: #F7F2EB;
    --section-bg-parents: #F5EEE8;
    --section-bg-gifts: #F4ECE7;
    --section-bg-dress: #F3E9E2;
    --section-bg-photoshare: #F2E6DE;
}

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

body {
    font-family: var(--font-body);
    color: var(--dark-color);
    background-color: var(--secondary-color);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}


/* Shared Section Title */

.section-title {
    text-align: center;
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}


/* Hero Section */


/* Hero section now occupies the full viewport height so it is the only thing visible on load */

.hero {
    position: relative;
    background-image: url('images/home.jpg');
    background-size: cover;
    background-position: center;
    height: 100vh;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--light-color);
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-overlay {
    position: relative;
    z-index: 1;
}


/* Larger typography for hero section */

.couple-name {
    font-family: var(--font-script);
    font-size: 6rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
}

.hero-date {
    font-family: var(--font-heading);
    font-size: 1.5rem;
}


/* Countdown styling in hero section */


/*
 * Display the countdown as a row of time boxes. Each box shows a number and its
 * corresponding label. A subtle left border separates each unit except the
 * first. Colors are kept light to contrast against the dark overlay in the
 * hero, while borders use a semi-transparent white. See mobile adjustments
 * below for responsive scaling.
 */

.countdown {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.time-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.25rem 0.75rem;
    color: var(--light-color);
}

.time-box:not(:first-child) {
    border-left: 1px solid rgba(255, 255, 255, 0.6);
    padding-left: 1.25rem;
}

.time-number {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    line-height: 1.1;
}

.time-label {
    font-family: var(--font-body);
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 0.2rem;
}


/* Style for the message displayed when the countdown reaches zero */

.countdown-finish {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--light-color);
}


/* Names Section */

.names-section {
    text-align: center;
    padding: 3rem 1rem;
    background-color: var(--secondary-color);
}

.names-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.script-name {
    font-family: var(--font-script);
    font-size: 3rem;
    color: var(--primary-color);
}

.ampersand {
    font-family: var(--font-script);
    font-size: 4rem;
    color: var(--accent-color);
}

.quote {
    margin-top: 1rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--dark-color);
}


/* Gallery Intro Section */

.gallery-intro {
    padding: 3rem 1rem;
    text-align: center;
    background-color: var(--secondary-color);
}


/* Caption styling inside gallery-intro */

.gallery-intro .gallery-caption {
    font-family: var(--font-heading);
    color: var(--dark-color);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
}


/* Responsive gallery grid for our history section */

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    width: 90%;
    max-width: 900px;
    margin: 0 auto;
}

.gallery-grid img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}


/* Events Section (Ceremony & Reception) */


/* Updated Events Section (Ceremony & Reception) */

.events-section {
    padding: 3rem 1rem;
    background-color: var(--secondary-color);
}

.events-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    max-width: 900px;
    margin: 0 auto;
}

.event-card {
    background: var(--light-color);
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.event-card-photo img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.event-card-details {
    padding: 1.5rem;
    text-align: left;
}

.event-card-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.event-detail {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.icon {
    font-size: 1.1rem;
    color: var(--accent-color);
}

.event-card-details .map-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--accent-color);
    text-decoration: underline;
}

.event-card-details .map-link:hover {
    text-decoration: none;
}


/* Timeline Section */


/* Redesigned timeline inspired by the reference invitation */

.timeline-section {
    padding: 3rem 1rem;
    background-color: var(--secondary-color);
}

.timeline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 2rem auto;
    list-style: none;
    padding: 0;
}


/* General timeline item styling */

.timeline-item {
    background: var(--light-color);
    border-radius: 8px;
    padding: 1rem 2rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 320px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s forwards;
}


/* Staggered animation delays using nth-child selectors */

.timeline-item:nth-of-type(1) {
    animation-delay: 0.2s;
}

.timeline-item:nth-of-type(3) {
    animation-delay: 0.4s;
}

.timeline-item:nth-of-type(5) {
    animation-delay: 0.6s;
}

.timeline-item:nth-of-type(7) {
    animation-delay: 0.8s;
}

.timeline-item:nth-of-type(9) {
    animation-delay: 1.0s;
}


/* Styling for the time and title */

.timeline-time {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    display: block;
}

.timeline-title {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--dark-color);
    margin: 0;
}


/* Icon container for each timeline event */

.timeline-icon {
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    /* Set text color so SVG paths using currentColor are filled/stroked in light color */
    color: var(--light-color);
    border-radius: 50%;
    margin: 0 auto 0.5rem auto;
}

.timeline-icon svg {
    width: 1.5rem;
    height: 1.5rem;
    fill: var(--light-color);
}


/* Decorative separator between events using a greca (ornamental wave) */

.timeline-separator {
    width: 60%;
    max-width: 260px;
    margin: 0.5rem auto;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s forwards;
}

.timeline-separator svg.greca-divider {
    width: 100%;
    height: 0.8rem;
    color: var(--accent-color);
}


/* Set delays for separators to appear between the items */

.timeline-separator:nth-of-type(2) {
    animation-delay: 0.3s;
}

.timeline-separator:nth-of-type(4) {
    animation-delay: 0.5s;
}

.timeline-separator:nth-of-type(6) {
    animation-delay: 0.7s;
}

.timeline-separator:nth-of-type(8) {
    animation-delay: 0.9s;
}


/* Keyframes for the fade up animation */

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Photo Collage Section */

.collage-section {
    padding: 3rem 1rem;
    background-color: var(--section-bg-collage);
    text-align: center;
}


/* History Section (names and gallery combined) */

.history-section {
    padding: 4rem 1rem;
    text-align: center;
    background-color: var(--secondary-color);
}

.history-header {
    font-family: var(--font-script);
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.history-subtitle {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--dark-color);
    margin-bottom: 2rem;
}

.collage-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
}

.polaroid {
    width: 200px;
    padding: 1rem;
    background: var(--light-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    transform: rotate(var(--rotation));
}

.polaroid img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}


/* Parents and Godparents Section */

.parents-section {
    padding: 3rem 1rem;
    background-color: var(--section-bg-parents);
    text-align: center;
}

.parents-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    max-width: 900px;
    margin: 0 auto 2rem;
}

.parent-card,
.godparent-card {
    background: var(--light-color);
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.parent-card img,
.godparent-card img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin: 0 auto 1rem;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    background-color: var(--secondary-color);
    padding: 0.5rem;
}

.parent-card h3,
.godparent-card h3 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.parent-card p,
.godparent-card p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--dark-color);
}

.padrinos-title {
    margin-top: 2rem;
}

.godparents-grid {
    display: flex;
    justify-content: center;
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}


/* Gifts Section (Mesa de Regalos) */

.gifts-section {
    padding: 3rem 1rem;
    background-color: var(--section-bg-gifts);
    text-align: center;
}


/* Redesigned gift section styles */

.gift-background {
    position: relative;
    overflow: hidden;
    max-width: 900px;
    margin: 2rem auto 0;
    padding: 3rem 1rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* Light background and border to distinguish the gift section as a framed card */
    background-color: var(--secondary-color);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}


/* Illustration of the gift as an SVG */

.gift-svg {
    width: 220px;
    max-width: 80%;
    height: auto;
    margin-bottom: 1.5rem;
    animation: giftFloat 8s ease-in-out infinite;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.15));
}

.gift-text {
    max-width: 600px;
}

.gift-description {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
}

.gift-button {
    display: inline-block;
    padding: 0.8rem 2.2rem;
    background: var(--primary-color);
    color: var(--light-color);
    border-radius: 5px;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 1.05rem;
    transition: background 0.3s ease, transform 0.3s ease;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.gift-button:hover {
    background: var(--accent-color);
    transform: translateY(-2px);
}


/* Animation for the floating gift icon */

@keyframes giftFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}


/* Subtle animation for the ribbon loops of the SVG gift icon */

.gift-svg .bow-loop {
    transform-origin: center 30px;
    animation: bowBounce 6s ease-in-out infinite;
}

@keyframes bowBounce {
    0%,
    100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(5deg);
    }
}


/* Dress Code Section */

.dress-code-section {
    padding: 3rem 1rem;
    background-color: var(--section-bg-dress);
    text-align: center;
}

.dress-content {
    background: var(--light-color);
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-top: 5px solid var(--accent-color);
}

.dress-content p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--dark-color);
}


/* Photo Share Section */


/* Photo Share Section with a soft gradient background */


/* Photo Share Section */

.photo-share-section {
    padding: 3rem 1rem;
    background: var(--section-bg-photoshare);
    text-align: center;
}


/* Container for image and content */

.photo-share-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.photo-share-button-container {
    text-align: center;
}


/* Decorative image */

.photo-share-image img {
    width: 250px;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: photoFloat 8s ease-in-out infinite;
}


/* Apply similar styles to inline SVGs in the photo share section */

.photo-share-image svg {
    width: 250px;
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    animation: photoFloat 8s ease-in-out infinite;
}


/* Animate the heart inside the custom photo-share icon */

.photoshare-icon .lens-heart {
    transform-origin: center;
    animation: lensPulse 3s infinite ease-in-out;
}

@keyframes lensPulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes photoFloat {
    0%,
    100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}


/* Text area for the photo share section */

.photo-share-content {
    max-width: 500px;
    text-align: left;
}

.photo-share-content .section-title {
    margin-bottom: 0.5rem;
}

.photo-share-content .photo-share-text {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--dark-color);
    margin-bottom: 1rem;
    text-align: justify;
}


/* Share button styling (reusing existing styles) */

.share-button {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--primary-color);
    color: var(--light-color);
    border-radius: 4px;
    text-decoration: none;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: background 0.3s ease;
    margin-top: 1.5rem;
}

.share-button:hover {
    background: var(--accent-color);
}


/* Dress code icon styling */

.dress-icon {
    width: 120px;
    height: auto;
    display: block;
    margin: 0 auto 1rem;
}


/* RSVP Section */

.rsvp-section {
    position: relative;
    background-image: url('images/hero.jpg');
    background-size: cover;
    background-position: center;
    padding: 4rem 1rem;
    color: var(--light-color);
    text-align: center;
}

.rsvp-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.rsvp-overlay {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.1);
    padding: 2rem;
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.rsvp-overlay h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--light-color);
}

.rsvp-overlay p {
    font-family: var(--font-body);
    margin-bottom: 1rem;
    font-size: 1rem;
}

#rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#invite-code {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
}

#rsvp-form button {
    padding: 0.75rem 1rem;
    background: var(--primary-color);
    color: var(--light-color);
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

#rsvp-form button:hover {
    background: var(--accent-color);
}

.rsvp-message {
    margin-top: 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
}


/* Footer */

.site-footer {
    text-align: center;
    padding: 1rem;
    background: var(--dark-color);
    color: var(--light-color);
    font-family: var(--font-body);
    font-size: 0.9rem;
}


/* Responsive Design */

@media (max-width: 768px) {
    .couple-name {
        font-size: 3rem;
    }
    .hero-subtitle {
        font-size: 1.4rem;
    }
    .hero-date {
        font-size: 1rem;
    }
    .script-name {
        font-size: 2rem;
    }
    .ampersand {
        font-size: 3rem;
    }
    /* Adjust events grid on small screens */
    .events-grid {
        grid-template-columns: 1fr;
    }
    .event-card-photo img {
        height: 180px;
    }
    /* Timeline responsive adjustments */
    .timeline-item {
        margin-bottom: 1.5rem;
        max-width: 280px;
    }
    .timeline-icon {
        width: 2.5rem;
        height: 2.5rem;
        margin-bottom: 0.4rem;
    }
    .timeline-icon svg {
        width: 1.2rem;
        height: 1.2rem;
    }
    .timeline-separator {
        width: 70%;
        max-width: 200px;
        margin: 0.4rem auto;
    }
    .timeline-time {
        font-size: 1.1rem;
    }
    .timeline-title {
        font-size: 0.9rem;
    }
    .polaroid {
        width: 150px;
    }
    /* Gifts section responsive adjustments */
    .gift-background {
        padding: 2rem 1rem 3rem;
    }
    .gift-svg {
        width: 180px;
        margin-bottom: 1rem;
    }
    .gift-text {
        max-width: 100%;
    }
    #invite-code,
    #rsvp-form button {
        font-size: 0.9rem;
    }
    .countdown {
        gap: 0.6rem;
        margin-top: 1rem;
    }
    .time-number {
        font-size: 1.5rem;
    }
    .time-label {
        font-size: 0.5rem;
        letter-spacing: 1px;
    }
    /* Photo share responsive adjustments */
    .photo-share-container {
        flex-direction: column;
        align-items: center;
    }
    .photo-share-content {
        text-align: center;
    }
    .photo-share-image img {
        width: 200px;
        margin-bottom: 1.5rem;
    }
    .photo-share-image svg {
        width: 200px;
        margin-bottom: 1.5rem;
    }
    .photo-share-content .photo-share-text {
        font-size: 0.9rem;
    }
}