/* styles.css - Elegant & Accessible Wedding Website Stylesheet */

/* --- Google Fonts Import --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

/* --- Design Tokens / CSS Variables --- */
:root {
    /* Color Palette */
    --color-bg-primary: #FDFBF7;      /* Warm Warm Ivory */
    --color-bg-secondary: #FFFFFF;    /* Pure White for Alternating Sections */
    --color-bg-tertiary: #F7F4EB;     /* Soft Sage/Ivory Shadow */
    --color-text-main: #2C3531;       /* Deep Charcoal for high contrast readability */
    --color-text-muted: #626B66;      /* Slate/Muted Grey */
    --color-accent-primary: #D4AF37;  /* Soft Warm Gold */
    --color-accent-secondary: #8A9A86;/* Elegant Sage Green */
    --color-accent-hover: #73826F;    /* Sage Green Darkened for Interactive Hovers */
    --color-focus-outline: #3B82F6;   /* Accessible Keyboard Focus Highlight */

    /* Typography */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing & Layout */
    --nav-height: 70px;
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --container-max-width: 900px;
}

/* --- Base Resets & Accessibility Setup --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Ensure smooth scrolling when JS is disabled */
html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--nav-height);
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--color-text-main);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Keyboard Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--color-focus-outline);
    outline-offset: 4px;
}

/* --- Typography Defaults --- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--color-text-main);
    font-weight: 600;
    line-height: 1.3;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 1rem;
}

/* Decorative divider line for H2 */
h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: var(--color-accent-primary);
}

p {
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
    font-weight: 300;
}

/* --- Header & Navigation --- */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background-color: rgba(253, 251, 247, 0.95); /* Opaque background with blur */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.03);
}

nav {
    max-width: var(--container-max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 2.5rem;
}

nav a {
    text-decoration: none;
    color: var(--color-text-main);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    position: relative;
    padding: 0.5rem 0;
    transition: color var(--transition-speed) ease;
}

nav a:hover,
nav a.active {
    color: var(--color-accent-secondary);
}

/* Navigation Hover Indicator Link */
nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1.5px;
    background-color: var(--color-accent-secondary);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--transition-speed) ease;
}

nav a:hover::after,
nav a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* --- Main Layout & Sections --- */
main {
    margin-top: 0;
}

section {
    padding: 6.5rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - var(--nav-height));
    position: relative;
}

/* Alternating Section Backgrounds */

#story {
    background-color: var(--color-bg-tertiary);
    position: relative;
    overflow: hidden;
}

#story::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Image fallbacks for older browsers */
    background-image: url('images/vintage-bio.png'), url('images/vintage-piccolo.jpg');
    background-repeat: no-repeat;
    background-position: left 15% bottom 5%, right 5% top 15%;
    background-size: 250px auto;
    opacity: 0.03; /* Extremely low opacity to ensure high contrast safety (WCAG compliant) */
    z-index: -1;
    pointer-events: none;
}

/* Override with WebP for supporting browsers to save bandwidth */
@supports (background-image: url('images/vintage-bio.webp')) {
    #story::before {
        background-image: url('images/vintage-bio.webp'), url('images/vintage-piccolo.webp');
    }
}

/* Responsive adjustment: hide background watermarks on mobile viewports to protect legibility */
@media (max-width: 767px) {
    #story::before {
        display: none;
    }
}

#details {
    background-color: var(--color-bg-tertiary);
}

#rsvp {
    background-color: var(--color-bg-secondary);
}

/* Inner Container for Readable Text Bounds */
section > * {
    max-width: 650px;
    width: 100%;
}

/* --- Home / Hero Section --- */
#home {
    background: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.55)), url('images/venue-1.jpg') no-repeat center center;
    background-size: cover;
    color: #FFFFFF;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    text-align: center;
    padding: calc(var(--nav-height) + 2rem) 2rem 2rem 2rem;
    box-sizing: border-box;
}

@supports (background-image: url('images/venue-1.webp')) {
    #home {
        background-image: linear-gradient(rgba(0,0,0,0.45), rgba(0,0,0,0.55)), url('images/venue-1.webp');
    }
}

#home h1 {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

#home p {
    font-size: 1.25rem;
    font-style: italic;
    color: #F3F4F6;
    margin-top: 1rem;
    font-family: var(--font-heading);
}

#home .hero-date {
    font-family: var(--font-body);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent-primary);
    font-weight: 400;
    font-style: normal;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

#home .hero-subtitle {
    font-size: 1.15rem;
    color: #E5E7EB;
    font-style: italic;
    margin-top: 0.5rem;
    line-height: 1.6;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

/* Elegant decorative element on home */
#home::before {
    content: '✿';
    font-size: 1.5rem;
    color: var(--color-accent-primary);
    margin-bottom: 1.5rem;
    display: block;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.4);
}

/* --- Our Story Section --- */
#story .story-container {
    max-width: 750px;
    width: 100%;
    margin: 0 auto;
    text-align: left;
}

#story .story-intro {
    font-size: 1.05rem;
    color: var(--color-accent-hover);
    font-style: italic;
    text-align: center;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

#story .story-intro::after {
    content: '🎥';
    display: block;
    font-size: 1.5rem;
    margin-top: 0.75rem;
}

.documentary-script {
    background-color: var(--color-bg-secondary);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(212, 175, 55, 0.15);
    position: relative;
}


/* Elegant script ribbon on top */
.documentary-script::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.scene {
    margin-bottom: 2.5rem;
    border-bottom: 1px dashed rgba(138, 154, 134, 0.25);
    padding-bottom: 2rem;
}

.scene:last-of-type {
    border-bottom: none;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
}

.scene-number {
    display: block;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-accent-hover);
    margin-bottom: 1.25rem;
}

.narration {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--color-text-main);
    margin-bottom: 1.25rem;
    font-weight: 300;
}

.narration:last-child {
    margin-bottom: 0;
}

.scene-conclusion {
    background-color: var(--color-bg-tertiary);
    padding: 2.5rem;
    border-radius: calc(var(--border-radius) - 2px);
    border-left: 4px solid var(--color-accent-primary);
    margin-top: 2rem;
}

.narration.conclusion {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-text-main);
    line-height: 1.8;
}

.production-note {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
}

.narration.narrator-signoff {
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--color-accent-hover);
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
    line-height: 1.4;
}

/* --- Details Section --- */
#details p {
    font-size: 1.1rem;
}

/* --- RSVP Section --- */
#rsvp p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Styling for Interactive RSVP form elements */
.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    text-align: left;
    background: var(--color-bg-primary);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background-color: #FFF;
    transition: border-color var(--transition-speed) ease;
}

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

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--color-accent-secondary);
    outline: none;
}

.form-group input.invalid,
.form-group select.invalid,
.form-group textarea.invalid {
    border-color: #EF4444;
}

.error-message {
    color: #EF4444;
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.hidden {
    display: none !important;
}

.rsvp-thankyou {
    text-align: center;
    background: var(--color-bg-primary);
    padding: 3.5rem 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    animation: rsvpFadeIn 0.5s ease;
}

.rsvp-thankyou .success-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.rsvp-thankyou h3 {
    font-size: 1.75rem;
    color: var(--color-accent-secondary);
    margin-bottom: 1rem;
}

.rsvp-thankyou p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin: 0;
}

@keyframes rsvpFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.rsvp-button {
    background-color: var(--color-accent-secondary);
    color: #FFF;
    border: none;
    padding: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color var(--transition-speed) ease;
}

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

/* --- Footer --- */
footer {
    padding: 3rem 1.5rem;
    background-color: var(--color-bg-primary);
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    text-align: center;
}

footer p {
    margin: 0;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Details Section Styling --- */
.details-what-to-bring {
    text-align: left;
    margin-bottom: 1.5rem;
    width: 100%;
}

.details-what-to-bring h3,
.details-container h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--color-text-main);
    text-align: left;
}

.details-container {
    max-width: var(--container-max-width) !important; /* Override section > * max-width: 650px */
    width: 100%;
    margin-top: 2rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 3rem;
    row-gap: 2rem;
    text-align: left;
    align-items: start;
}

.details-venue,
.details-dress-code,
.details-schedule {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Position direct children inside the 2-column grid layout on desktop */
.details-venue {
    grid-column: 1;
    grid-row: 1;
}

.details-map {
    grid-column: 2;
    grid-row: 1 / span 3;
}

.details-dress-code {
    grid-column: 1;
    grid-row: 2;
}

.details-schedule {
    grid-column: 1;
    grid-row: 3;
}

.venue-name {
    font-size: 1.35rem;
    color: var(--color-text-main);
    font-family: var(--font-heading);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
}

.venue-address {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: var(--color-text-main);
}

.venue-address .icon {
    margin-right: 0.5rem;
}

.venue-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.venue-rules,
.what-to-bring {
    padding-left: 2.25rem;
    margin-bottom: 1.5rem;
    color: var(--color-text-muted);
    font-weight: 300;
    font-size: 1.1rem;
}

.venue-rules li,
.what-to-bring li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

.venue-rules li:last-child,
.what-to-bring li:last-child {
    margin-bottom: 0;
}

/* --- Footnotes Styling --- */
.footnote-ref {
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
    margin-left: 2px;
}

.footnote-ref a {
    color: var(--color-accent-secondary);
    text-decoration: none;
    font-weight: 500;
}

.footnote-ref a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

.details-footnotes {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(138, 154, 134, 0.3);
    width: 100%;
    text-align: left;
}

.footnote {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-style: italic;
    line-height: 1.5;
}

.footnote sup {
    color: var(--color-accent-secondary);
    font-weight: bold;
    margin-right: 2px;
}

/* --- Schedule / Timeline Styling --- */
.schedule-heading {
    font-size: 1.5rem;
    margin-top: 1rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-main);
    text-align: left;
    font-family: var(--font-heading);
}

.schedule-date {
    font-size: 1rem;
    color: var(--color-text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.schedule-date .icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.calendar-icon {
    width: 24px;
    height: 24px;
    display: block;
    flex-shrink: 0;
}

.timeline {
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid rgba(212, 175, 55, 0.25);
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.timeline-item {
    position: relative;
}

/* Elegant dot on the vertical timeline line */
.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-1.5rem - 6px); /* Align perfectly with the 2px border */
    top: 6px;
    width: 10px;
    height: 10px;
    background-color: var(--color-accent-primary);
    border-radius: 50%;
    border: 2px solid var(--color-bg-tertiary);
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease;
}

.timeline-item:hover::before {
    background-color: var(--color-accent-secondary);
    transform: scale(1.2);
}

.timeline-time {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent-secondary);
    margin-bottom: 0.25rem;
}

.timeline-title {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    color: var(--color-text-main);
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.timeline-desc {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0;
    color: var(--color-text-muted);
}

.details-map {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.map-wrapper {
    position: relative;
    width: 100%;
}

.map-wrapper iframe {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.map-wrapper small {
    display: block;
    margin-top: 0.5rem;
    text-align: right;
}

.map-wrapper small a {
    color: var(--color-accent-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.map-wrapper small a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}


/* --- Elegant Story Illustrations & Banners --- */
.story-illustration {
    display: flex;
    justify-content: center;
    margin: 2.5rem 0;
    width: 100%;
}

.story-illustration picture {
    display: block;
    max-width: 220px;
    width: 100%;
    opacity: 0.85;
    transition: transform var(--transition-speed) ease, opacity var(--transition-speed) ease;
}

.story-illustration img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.story-illustration picture:hover {
    transform: scale(1.05);
    opacity: 1;
}

.story-illustration .illustration-card-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.story-illustration .illustration-credit {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-style: italic;
    text-align: center;
}

.story-illustration .illustration-credit a {
    color: var(--color-accent-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed) ease;
}

.story-illustration .illustration-credit a:hover {
    color: var(--color-accent-hover);
    text-decoration: underline;
}

/* Give the VLA and Piccolo photographs a lovely rounded border and subtle shadow */
.story-illustration img[src*="vla"],
.story-illustration img[src*="piccolo"] {
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* --- Scenic Grounds Section Divider --- */
.grounds-divider {
    height: 400px;
    width: 100%;
    background: url('images/venue-2.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed; /* Parallax effect for desktop */
}

@supports (background-image: url('images/venue-2.webp')) {
    .grounds-divider {
        background-image: url('images/venue-2.webp');
    }
}

/* --- Responsive Media Queries --- */
@media (max-width: 768px) {
    :root {
        --nav-height: 60px;
    }

    h1 {
        font-size: 2.5rem;
    }

    #home h1 {
        font-size: 2.75rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    section {
        padding: 4.5rem 1rem;
    }

    nav ul {
        gap: 1.25rem;
    }

    nav a {
        font-size: 0.8rem;
        letter-spacing: 0.08em;
    }

    .details-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .details-venue,
    .details-map,
    .details-dress-code,
    .details-schedule {
        grid-column: auto;
        grid-row: auto;
    }
    

    /* Documentary story section mobile adaptations */
    .documentary-script {
        padding: 1.5rem;
    }
    
    .scene-conclusion {
        padding: 1.5rem;
    }
    
    .narration.narrator-signoff {
        font-size: 1.25rem;
    }

    /* Illustration layout adaptations on mobile */
    .story-illustration picture {
        max-width: 160px;
    }
    .grounds-divider {
        background-attachment: scroll;
        height: 250px;
    }
}

@media (max-width: 480px) {
    nav ul {
        gap: 0.75rem;
    }

    nav a {
        font-size: 0.75rem;
    }
}

/* Desktop Margin Positioning on Wide Viewports */
@media (min-width: 1150px) {
    .scene {
        position: relative;
    }

    .story-illustration {
        position: absolute;
        width: 180px;
        margin: 0;
        z-index: 10;
    }

    .story-illustration picture {
        max-width: 180px;
    }

    /* Biology (Left Margin, Near Top of Scene II) */
    .illustration-bio {
        left: -240px;
        top: 1.5rem;
    }

    /* Astrophysics (Right Margin, Near Bottom of Scene II) */
    .illustration-astro {
        right: -240px;
        bottom: 1.5rem;
    }

    /* Piccolo (Left Margin, Center of Scene III) */
    .illustration-piccolo {
        left: -240px;
        top: 50%;
        transform: translateY(-50%);
    }

    /* VLA Photo Card (Right Margin, Center of Scene III) */
    .illustration-vla {
        right: -240px;
        top: 50%;
        transform: translateY(-50%);
    }
}
