/* ========================================
   Main Stylesheet (THEME PREVIEW)
   Wedding of Simple Aiko & Jeru
   ======================================== */

/* ========================================
   TABLE OF CONTENTS
   ========================================
   1. General Body & Typography
   2. Header & Masthead
   3. Header Ornaments
   4. Desktop Navigation
   5. Mobile Navigation
   6. Page-Specific & Reusable Styles
      - Reusable Content Block
      - Front Page Hero & Scroll Effect
      - Countdown Timer
      - Front Page Teasers
      - Itinerary Timeline
      - Revelations Page Story
      - Photo Gallery
      - Specifics Page
   7. Form Styles (RSVP Page)
   8. Modal (Pop-up) Styles
   9. Footer & Back-to-Top Button
   10. Interactive & Animation Styles
   11. Responsive Styles for Mobile
       - Mobile Timeline Styles
       - Mobile Revelations Page
       - Mobile Specifics Page
   ======================================== */

/* ========================================
   1. General Body & Typography
   ======================================== */
:root {
    /* === THEME UPDATE: NEW FONTS & COLORS === */
    --font-primary: 'Lora', serif;
    --font-headings: 'Cinzel', serif;
    --font-special: 'Great Vibes', cursive;
    --font-title: 'UnifrakturMaguntia', cursive;
    --font-dropcap: 'Lavishly Yours', cursive;

    --color-background-page: #fdfaf2;
    --color-background-body: #f5f1e8;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #ddd;
    --color-border-dark: #bcae9b;
    --color-accent: #800020;
    --color-accent-navy: #0b0b45;
    --color-accent-gold: #c5a15a;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    background-color: var(--color-background-page); 
    scroll-behavior: smooth;
}

.newspaper-title a { text-decoration: none; color: inherit; }

body {
    background-color: var(--color-background-body); 
    font-family: var(--font-primary);
    color: var(--color-text);
    max-width: 1100px;
    margin: 10px auto;
    padding: 0 40px 40px 40px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

main {
    position: relative;
}

h1, h2, h3 {
    font-family: var(--font-headings);
}

/* Add these new rules to style the h2 headings */

/* First, make the h2 a positioning context for its underline */
.content-block h2,
.story-content h2 {
    position: relative;
    padding-bottom: 20px;
}

/* Create the underline using a pseudo-element */
.content-block h2::after,
.story-content h2::after {
    content: '';
    position: absolute;
    bottom: 0; /* Position it at the bottom of the padding */
    left: 50%; /* Center the rule */
    transform: translateX(-50%);
    width: 60px; /* The width of the rule */
    height: 2px;  /* The thickness of the rule */
    background-color: var(--color-border-dark);
}

/* ========================================
   2. Header & Masthead
   ======================================== */

.header-date {
    position: absolute;
    top: 15px;      /* Aligns vertically with the ornaments */
    right: 20px;    /* Positions it in the top-right corner */

    /* Keep the classic newspaper date styling */
    font-family: var(--font-headings);
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-light);
    font-weight: 600;
}

header {
    text-align: center;
    padding: 10px 5px;
    border-top: 0px solid var(--color-border);
    border-bottom: 1px solid transparent;
    position: relative; 
}

.newspaper-title {
    font-family: var(--font-title);
    font-size: 3em;
    font-weight: 400;
    margin: 0;
    color: #222;
    font-style: normal;
}


/* ========================================
   3. Header Ornaments
   ======================================== */
header::before, header::after {
    content: ''; 
    position: absolute;
    top: 15px; 
    width: 30px; 
    height: 15px;
    border-top: 1px solid var(--color-border-dark);
}

header::before { left: 15px; border-left: 2px solid var(--color-border-dark); }
header::after { right: 15px; border-right: 2px solid var(--color-border-dark); }

/* ========================================
   4. Desktop Navigation
   ======================================== */
nav {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: var(--color-background-body);
    padding: 1px 0;
    transition: padding 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 2px solid var(--color-border-dark);
}

nav.scrolled {
    padding: 10px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

nav ul {
    list-style-type: none; 
    padding: 0; 
    margin: 0;
    display: flex; 
    justify-content: center;
    gap: 25px; 
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1px;
    overflow: hidden; /* This clips the background as it animates */
}

nav a {
    /* 1. Setup for positioning the pseudo-element */
    position: relative;
    z-index: 1; /* Ensures text is above the pseudo-element */
    display: block;
    text-decoration: none;
    color: var(--color-text);
    font-family: var(--font-headings);
    font-size: 1.1em;
    font-weight: 600;
    color: var(--color-accent);
    padding: 5px 15px 5px 15px;
    background-color: transparent; /* The link itself has no background now */
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

/* 2. The pseudo-element that will act as the background */
nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -10%;
    width: 120%;
    height: 100%;
    background-color: var(--color-accent-navy);
    z-index: -1; /* Place it behind the text */
    /* Initially scaled to zero width (invisible) */
    transform: scaleX(0);
    transform-origin: center; /* Animates from the middle */
    
    /* The smooth animation for the expansion effect */
    transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
}

/* 3. The hover effect remains, but simplified */
nav li:hover a:not(.active) {
    color: var(--color-accent-gold);
    border-bottom-color: var(--color-accent-gold);
}

/* 4. The active state now only changes the text styles */
nav a.active {
    color: #fff; /* White text for the active link */
    font-family: var(--font-special);
    font-size: 1.4em;
    font-weight: 400
}

/* 5. THE KEY: When a link is active, scale the ::before pseudo-element to full width */
nav a.active::before {
    transform: scaleX(1);
}


/* ========================================
   5. Mobile Navigation
   ======================================== */
.mobile-menu-toggle { display: none; }


/* ========================================
   6. Page-Specific & Reusable Styles
   ======================================== */
/* --- Reusable Content Block --- */
.content-block {
    text-align: center;
}

.content-block p {
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
}

.has-dropcap::first-letter {
    font-size: 2.8em;
    font-family: var(--font-dropcap);
    line-height: 0.8;
    float: left;
    margin: 5px 5px 0 0;
    color: var(--color-background-page);
    background-color: var(--color-accent-navy);
    padding: 2px 8px;
    border-radius: 3px;
}

/* --- Front Page Hero & Scroll Effect --- */

#hero-animation-container {
    position: relative;
    padding-top: 50px; /* Creates space for the headline to start above the image */
    margin-top: 5px;
}

.hero-image-container {
    background-color: var(--color-background-page);
    border: 1px solid var(--color-border-dark);
    padding: 5px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
    line-height: 0;
    will-change: transform, opacity; /* Add this line */
}

#hero-image {
    width: 100%; 
    height: auto;
    display: block;
    object-fit: cover;
    border: 1px solid var(--color-border);
}

.hero-headline {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2;
    text-align: center;
    padding: 0;
    will-change: transform;
}

.extra-extra {
    font-family: var(--font-headings);
    font-weight: 700; 
    text-transform: uppercase;
    font-size: 2em; 
    margin: 0;
}

.main-headline {
    margin: 5px 0 0 0;
    font-size: 2.5em;
    color: var(--color-text);
}

.main-headline .headline-names {
    font-family: var(--font-special);
    color: var(--color-accent);
    font-weight: normal; 
    font-size: 2em; 
}


#welcome-message {
    padding-top: 40px;
    will-change: transform;
}


/* --- Grand Countdown Timer (THEME UPDATE) --- */
.countdown-container {
    text-align: center;
    padding: 30px 40px;
    margin: 40px auto;
    width: 100%;
    max-width: 700px;
    background-color: var(--color-background-page);
    border: 1px solid var(--color-accent-gold);
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}

.countdown-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.08);
}

.countdown-title {
    font-family: var(--font-headings);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    margin-bottom: 20px;
    font-weight: 700;
}
.countdown-title .fancy-word {
    font-family: var(--font-special);
    font-size: 1.8em;
    font-weight: normal;
    color: var(--color-accent);
    margin-right: 10px;
    line-height: 1;
}

#countdown-timer {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 0;
}

.timer-unit {
    padding: 0 30px;
    border-right: 1px solid var(--color-border);
}
.timer-unit:last-child {
    border-right: none;
}

.timer-unit .number {
    font-family: var(--font-headings);
    font-size: 4em;
    font-weight: 700;
    color: var(--color-accent);
    line-height: 1.1;
}

.timer-unit .label {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9em; 
    color: var(--color-text-light);
    margin-top: 5px;
}

/* --- Front Page Teasers --- */
.page-teasers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 50px;
}

.teaser-card {
    border: 1px solid var(--color-border);
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: var(--color-text);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.teaser-card:hover {
    border-color: var(--color-accent-gold); 
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transform: translateY(-5px);
}

.teaser-card h3 { margin-top: 0; }
.teaser-card p {line-height: 1.5;
    float: left;
    text-align: left;
}
.teaser-card span {
    font-family: var(--font-headings);
    font-style: italic;
    color: var(--color-accent);
    line-height: 2;
}

/* --- Itinerary Timeline --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 50px auto;
    padding: 40px 0;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: var(--color-border-dark);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    cursor: pointer;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: var(--color-background-body);
    border: 3px solid var(--color-border-dark);
    top: 35px;
    border-radius: 50%;
    z-index: 1;
    transition: border-color 0.3s ease;
}

.timeline-item:hover::after {
    border-color: var(--color-accent-gold);
}

.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }
.timeline-item:nth-child(odd)::after { right: -10px; }
.timeline-item:nth-child(even)::after { left: -10px; }

.timeline-content {
    padding: 20px 30px;
    background-color: var(--color-background-page);
    border: 1px solid var(--color-border);
    position: relative;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.timeline-icon {
    width: 50px;
    height: 50px;
    object-fit: contain;
}

.event-details h3 {
    margin-top: 0;
    color: var(--color-accent);
}

.event-details p {
    margin: 5px 0 0;
    font-size: 0.9em;
    color: var(--color-text-light);
}

.event-details .event-time {
    font-weight: bold;
    color: var(--color-text);
}

.timeline-content::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 32px;
    width: 0;
    z-index: 1;
    border: medium solid var(--color-background-page);
}
.timeline-item:nth-child(odd) .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--color-border);
}
.timeline-item:nth-child(even) .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--color-border) transparent transparent;
}

/* --- Revelations Page Story --- */
.story-section, .profile-item {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 50px;
}

.profiles-section {
    margin-top: 80px;
    border-top: 1px solid var(--color-border);
    padding-top: 50px;
}

.profile-item:nth-child(even) {
    grid-template-columns: 1.5fr 1fr;
}

.story-image, .profile-image {
    background-color: var(--color-background-page);
    border: 1px solid var(--color-border);
    padding: 10px;
}

.story-image img, .profile-image img {
    width: 100%;
    height: auto;
    display: block;
}

.story-content p, .profile-content p {
    line-height: 1.8;
}

.profile-content h3 {
    color: var(--color-accent);
}

/* --- Photo Gallery --- */
.photo-gallery-container {
    text-align: center;
    margin-top: 80px;
    padding-top: 50px;
    border-top: 1px solid var(--color-border);
}

.photo-gallery {
    margin: 30px auto 0;
}

.gallery-item {
    width: calc(33.333% - 10px);
    margin-bottom: 15px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid var(--color-border);
    padding: 5px;
    background-color: #fff;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- Specifics Page (UPDATED) --- */
.specifics-grid {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    justify-content: center; /* Center the items, including the last row */
    gap: 30px; /* Adjust the gap slightly for a better fit */
    margin-top: 50px;
    border-top: 1px solid var(--color-border);
    padding-top: 40px;
}

.specifics-item {
    background-color: var(--color-background-page);
    border: 1px solid var(--color-border);
    padding: 30px 25px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-align: center;
    flex: 1 1 300px; /* Add this line to control item sizing */
    max-width: 400px; /* Optional: prevents cards from getting too wide on large screens */
    background-color: var(--color-background-page);
}

.specifics-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: var(--color-accent-gold);
}

.specifics-icon-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    background-color: #ede7da;
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.specifics-item:hover .specifics-icon-wrapper {
    background-color: var(--color-accent-navy);
    border-color: var(--color-accent-gold);
}

.specifics-icon {
    width: 40px;
    height: 40px;
    opacity: 0.8;
    transition: filter 0.3s ease;
}

.specifics-item:hover .specifics-icon {
    filter: brightness(0) invert(1);
}

.specifics-item h3 {
    color: var(--color-accent);
    margin-top: 0;
    margin-bottom: 10px;
}

.specifics-item p {
    line-height: 1.7;
    color: #666; /* Lighter text for the description */
    margin: 0;
}

.locale-section h2 {
    position: relative; /* Needed to position the ornaments */
    display: table; margin: 0 auto 20px auto;
    padding: 0 50px 10px 50px; /* Adds space for the ornaments */
    border-bottom: 3px double var(--color-border-dark); /* A classic double rule */
    margin-bottom: 20px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 40px;
    text-align: center;
}

.locale-section h2::before,
.locale-section h2::after {
    content: '❦';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    color: var(--color-border-dark);
}

.locale-section h2::before { left: 0; }
.locale-section h2::after { right: 0; }
/* Remove the default link styles (blue color, underline) */
.locale-section h2 a {
    text-decoration: none;
    color: inherit; /* Makes the link inherit the heading's color */
    transition: color 0.3s ease;
}

/* Add a beautiful hover effect */
.locale-section h2 a:hover {
    color: var(--color-accent-gold);
}

/* Styles for the interactive map */
#interactive-map {
    position: relative;
    height: 450px; /* CRITICAL: The map must have a defined height */
    width: 100%;
    margin-top: 30px;
    border: 1px solid var(--color-border-dark);
    padding: 10px;
    background-color: var(--color-background-page);
}

#interactive-map::before,
#interactive-map::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    border-color: var(--color-border-dark);
    border-style: solid;
}

/* Position the top-left ornament */
#interactive-map::before {
    top: 0;
    left: 0;
    border-width: 2px 0 0 2px;
}

/* Position the bottom-right ornament */
#interactive-map::after {
    bottom: 0;
    right: 0;
    border-width: 0 2px 2px 0;
}

.leaflet-popup-content h4 {
    font-family: var(--font-headings);
    color: var(--color-accent);
    margin: 0 0 5px 0;
    font-size: 1.2em;
}

/* Style the descriptive text inside the popup */
.leaflet-popup-content p {
    font-family: var(--font-primary);
    margin: 0;
    line-height: 1.6;
}

/* ========================================
   7. Form Styles (RSVP Page)
   ======================================== */
.rsvp-form { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 20px;
    margin-top: 40px;
    border-top: 1px solid var(--color-border);
    padding-top: 40px;
}
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { 
    display: block; 
    margin-bottom: 5px; 
    font-family: var(--font-headings); 
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%; 
    padding: 12px;
    border: 1px solid var(--color-border); 
    border-radius: 3px;
    font-family: var(--font-primary); 
    font-size: 1em;
    background-color: #fff;
}
.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.attendance-options {
    border: none;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.attendance-options legend {
    grid-column: 1 / -1;
    margin-bottom: 5px;
    font-family: var(--font-headings);
    padding: 0;
}
.attendance-choice input[type="radio"] {
    display: none;
}
.attendance-choice label {
    display: block;
    text-align: center;
    padding: 20px 15px;
    border: 1px solid var(--color-border-dark);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-headings);
    font-size: 1.2em;
    color: var(--color-text-light);
}
.attendance-choice label:hover {
    background-color: var(--color-background-hover);
    border-color: var(--color-accent);
    color: var(--color-text);
}
.attendance-choice input#attending-yes:checked + label {
    background-color: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
    font-family: var(--font-special);
    font-size: 1.6em;
    font-weight: bold;
    padding: 18px 15px;
}

.attendance-choice input#attending-no:checked + label {
    background-color: var(--color-text-light);
    color: #fff;
    border-color: var(--color-text-light);
    font-family: var(--font-headings);
    font-style: italic;
    font-size: 1.2em;
}

.dietary-options {
    border: 1px solid var(--color-border);
    padding: 20px;
    border-radius: 3px;
    margin-top: 10px;
}
.dietary-options legend {
    padding: 0 10px;
    margin-left: -10px;
    font-family: var(--font-headings);
}
.checkbox-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.checkbox-item input[type="checkbox"] {
    width: auto;
}
.checkbox-item label {
    margin-bottom: 0;
    font-family: var(--font-primary);
}

.submit-btn {
    background-color: var(--color-accent-navy);
    color: #fff;
    border: none; 
    padding: 15px 30px;
    font-family: var(--font-headings); 
    font-size: 1.1em;
    cursor: pointer; 
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.submit-btn:hover { 
    background-color: var(--color-accent); 
    transform: translateY(-2px);
}

/* ========================================
   8. Modal (Pop-up) Styles
   ======================================== */
.modal-overlay {
    position: fixed; 
    top: 0; left: 0;
    width: 100%; 
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex; 
    justify-content: center; 
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s 0.3s;
}

.modal-overlay.visible { 
    opacity: 1; 
    visibility: visible;
    transition-delay: 0s;
}

.modal-content {
    background-color: var(--color-background-body); 
    padding: 30px 40px;
    border-radius: 5px; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    position: relative; 
    max-width: 600px; 
    width: 90%;
    max-height: 80vh; 
    overflow-y: auto;
    transform: scale(0.95); 
    transition: transform 0.3s ease;
}

.modal-overlay.visible .modal-content { transform: scale(1); }

.modal-close {
    position: absolute; 
    top: 10px; 
    right: 15px;
    background: none; 
    border: none; 
    font-size: 2.5em;
    color: #999; 
    cursor: pointer;
    transition: color 0.2s ease;
}
.modal-close:hover { color: var(--color-text); }

/* ========================================
   9. Footer & Back-to-Top Button
   ======================================== */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

#back-to-top-btn {
    position: fixed; 
    bottom: 20px; 
    right: 20px;
    background-color: var(--color-text); 
    color: #fff;
    border: none; 
    border-radius: 50%;
    width: 50px; 
    height: 50px; 
    font-size: 1.5em;
    cursor: pointer; 
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    display: flex; 
    align-items: center; 
    justify-content: center;
    transition: opacity 0.3s ease, visibility 0.3s ease, background-color 0.3s ease;
}

#back-to-top-btn.visible { 
    opacity: 0.8;
    visibility: visible;
}

#back-to-top-btn:hover { 
    opacity: 1; 
    background-color: var(--color-accent); 
}

/* ========================================
   10. Interactive & Animation Styles
   ======================================== */
.fade-in-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* This container enables the 3D perspective for the flip effect */
.number-container {
    perspective: 300px;
    margin-bottom: 5px; /* Adjust spacing as needed */
}

/* Make the number element transformable */
.timer-unit .number {
    display: inline-block; 
}

/* The class that triggers the animation */
.number-flip {
    animation: flip-down 0.5s ease-in-out;
}

/* The animation keyframes */
@keyframes flip-down {
    0% {
        transform: rotateX(90deg);
        opacity: 0;
    }
    50% {
        transform: rotateX(-10deg);
    }
    100% {
        transform: rotateX(0deg);
        opacity: 1;
    }
}

/* ========================================
   11. Responsive Styles for Mobile
   ======================================== */
@media (max-width: 768px) {
    body {
        margin: 0; 
        padding: 70px 15px 20px 15px;
        box-shadow: none;
    }

/* Use this rule instead if you want to hide the date on mobile */
    .header-date {
    display: none;
    }
    
    header {
        position: fixed; 
        top: 0; 
        left: 0; 
        right: 0;
        z-index: 1001; 
        background-color: var(--color-background-body);
        padding: 15px 20px; 
        margin-bottom: 0;
        transition: padding 0.3s ease;
        border-bottom: 1px solid var(--color-border);
    }

    header.scrolled {
        padding: 10px 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    }

    header .newspaper-title { font-size: 1.8em;
    font-weight: 400;
    }
    
    
    nav {
        position: fixed; 
        top: 0; 
        left: -100%;
        width: 100%; 
        height: 100%; 
        padding: 0;
        background-color: var(--color-background-body);
        display: flex; 
        flex-direction: column;
        justify-content: center; 
        align-items: center;
        transition: left 0.4s ease; 
        z-index: 1000;
    }

    .mobile-menu-open nav { left: 0; }
    nav.scrolled { box-shadow: none; }
    nav ul {
        flex-direction: column; 
        gap: 15px;
        border-bottom: none; 
        padding-bottom: 0;
        text-align: center;
    }

    nav a, nav a.active {
        font-size: 1.5em; 
        color: var(--color-text);
        background-color: transparent; 
        transform: none;
        padding: 5px 10px;
        font-family: var(--font-headings); /* Using variable */
    }

    nav li:hover a:not(.active) {
        background-color: transparent; 
        color: var(--color-accent);
    }
    
    nav a.active::before {
    display: none; /* Hides the expanding background element on mobile */
    }

    /*Apply fancy font to active mobile nav link */
    nav a.active {
        font-family: var(--font-special);
        font-weight: normal;
        font-size: 2.2em;
        color: var(--color-accent);
        border-bottom: none;
    }

    .mobile-menu-toggle {
        display: block; 
        position: absolute;
        top: 50%; 
        right: 20px;
        transform: translateY(-50%);
        background: none; 
        border: none;
        width: 30px; 
        height: 22px;
        cursor: pointer; 
        z-index: 1002;
    }

    .mobile-menu-toggle span {
        display: block; 
        width: 100%; 
        height: 3px; 
        background-color: var(--color-text); 
        margin-bottom: 6px;
        /* THEME REFINEMENT: New transition for more flair */
        transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), opacity 0.2s ease;
        border-radius: 3px; 
    }

    .mobile-menu-toggle span:last-child { margin-bottom: 0; }
    
    /* THEME REFINEMENT: Smoother transform to 'X' */
    .mobile-menu-open .mobile-menu-toggle span:nth-child(1) { 
        transform: translateY(9px) rotate(45deg); 
    }
    .mobile-menu-open .mobile-menu-toggle span:nth-child(2) { 
        opacity: 0;
        transform: scaleX(0);
    }
    .mobile-menu-open .mobile-menu-toggle span:nth-child(3) { 
        transform: translateY(-9px) rotate(-45deg);
    }

    .hero-headline { padding: 0px 0;}
    .main-headline { font-size: 1.5em; }
    .main-headline .headline-names { font-size: 1.5em; }
    .extra-extra {font-size: 1.5em;}
    #welcome-message {margin-top: -80px; /* Pulls the message up */}

    .has-dropcap::first-letter {
    font-size: 2.4em; /* Slightly smaller font size */
    margin-right: 4px; /* Tighter margin to the right */
    padding: 1px 6px;  /* Tighter internal padding */
}

    /* UPDATED: Mobile Hero Image Sizing */
    #hero-animation-container {
        padding-top: 30px; /* Less padding on mobile */
    }
    .hero-image-container {
    min-height: 60vh;
    position: relative; /* CRITICAL: This makes it a positioning context */
    }
    #hero-image {
    /* CRITICAL: We now position the image absolutely inside its frame */
    position: absolute;
    top: 15px; /* This accounts for the frame's top padding */
    left: 15px; /* This accounts for the frame's left padding */
    /* These calculations make the image fill the space INSIDE the padding */
    width: calc(100% - 30px);
    height: calc(100% - 30px);
    object-fit: cover; /* This remains to prevent distortion */
    }
    
    .page-teasers, .rsvp-form { grid-template-columns: 1fr; }

    #countdown-timer {
        display: grid; /* Use CSS Grid for a more robust 2x2 layout */
        grid-template-columns: repeat(2, 1fr); /* Creates two equal-width columns */
        gap: 15px; /* Defines the space between the cards */
        flex-wrap: initial;
        justify-content: initial;
    }

    .timer-unit {
        border: 1px solid var(--color-border); /* Creates the individual "card" feel */
        padding: 15px 10px; /* Add breathing room inside the cards */
        text-align: center;
        flex-basis: initial;
    }

    .timer-unit .number {
        font-size: 2.8em; /* Slightly adjusted for the new card layout */
    }

    .timer-unit .label {
        font-size: 0.8em;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px; /* Make space for the axis and marker */
        padding-right: 15px;
    }
    .timer-unit:last-child {
        border-right: 1px solid var(--color-border);
    }
    
    /* Force all items into a single column */
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    /* Position the marker on the left axis for all items */
    .timeline-item::after {
        left: 30px;
        margin-left: 0; /* Removes the old centering margin */
    }
    .timeline::after {
    left: 30px;
    margin-left: 0;
    }
    /* Ensure the connector arrow always points from the left */
    .timeline-content::before {
        left: -10px;
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--color-border) transparent transparent;
    }

    /* --- Mobile Revelations Page --- */
    .story-section, 
    .profile-item,
    .profile-item:nth-child(even) {
        grid-template-columns: 1fr; /* Stack columns on mobile */
        gap: 25px; /* Reduce the gap between image and text */
        margin-bottom: 40px; /* Tighten up vertical spacing between sections */
    }

    .story-content h2 {
        font-size: 1.6em; /* Make headline more manageable */
    }

    .profile-content h3 {
        font-size: 1.3em; /* Adjust profile titles */
    }

    /* On mobile, make sure the image always comes before the text in the grid flow */
    .profile-item .profile-image {
        grid-row: 1;
    }

    .gallery-item {
        width: calc(50% - 8px); /* 2 columns on mobile */
    }

    /* --- Mobile Specifics Page --- */
    .specifics-grid {
        grid-template-columns: 1fr; /* Stack into a single column */
        gap: 0;
        padding: 0;
    }

    .section-divider {
        margin: 40px auto; /* Adjusted margin for mobile */
    }
    
    /* --- Mobile Countdown Styles --- */
    .countdown-container {
        padding: 20px 10px;
    }
    .countdown-title {
        font-size: 1.2em;
    }
    .countdown-title .fancy-word {
        font-size: 1.5em;
    }
    .timer-unit {
        padding: 0 10px;
    }
    .timer-unit .number {
        font-size: 2.5em;
    }
    .timer-unit .label {
        font-size: 0.7em;
        letter-spacing: 1px;
    }

    .attendance-options {
        grid-template-columns: 1fr; /* Stack on mobile */
    }
}