/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* Main container - split layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Fixed image section (left side) */
.image-section {
    position: fixed;
    left: 0;
    top: 0;
    width: 50%;
    height: 100vh;
    overflow: hidden;
    z-index: 1;
}

.wedding-image {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.1s ease-out;
}

.main-image {
    z-index: 1;
}

.opening-words-image {
    z-index: 2;
    opacity: 0;
}

.silence-image {
    z-index: 3;
    opacity: 0;
}

.song-image {
    z-index: 4;
    opacity: 0;
}

.vows-image {
    z-index: 5;
    opacity: 0;
}

.rings-image {
    z-index: 6;
    opacity: 0;
}

.kiss-image {
    z-index: 7;
    opacity: 0;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%
    );
    z-index: 2;
}

/* Scrollable content section (right side) */
.content-section {
    margin-left: 50%;
    width: 50%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f6f3 0%, #ffffff 100%);
    position: relative;
    z-index: 3;
}

.content-wrapper {
    padding: 3rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Header styles */
.content-header {
    text-align: center;
    padding: 0;
    min-height: 100vh;
    margin: 0 0 50vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.content-header h1 {
    font-size: 2.5rem;
    color: #5a4a3a;
    margin-bottom: 0.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: #8b7a6b;
    font-style: italic;
    font-weight: 300;
}

/* Main content styles */
.content-main {
    margin-bottom: 0; /* Remove margin since header now handles its own spacing */
}

.content-main section {
    padding: 0;
    min-height: 100vh; /* Each section takes at least full viewport height */
    margin: 50vh 0; /* Add full viewport height spacing between sections */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Ceremony sections styling */
.vows-section,
.rings-section,
.declaration-section {
    background: rgba(255, 255, 255, 0.4);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 3rem;
}

.content-main h2 {
    font-size: 1.8rem;
    color: #5a4a3a;
    margin-bottom: 1rem;
    font-weight: 400;
    border-bottom: 1px solid #e0d5cc;
    padding-bottom: 0.5rem;
}

.content-main h3 {
    font-size: 1.3rem;
    color: #6b5b4b;
    margin-bottom: 0.8rem;
    font-weight: 400;
}

/* Speaker references - script-style */
.story-section h3,
.vows-section h3,
.rings-section h3,
.declaration-section h3 {
    font-size: 0.95rem;
    font-weight: 400;
    font-style: italic;
    color: #8b7a6b;
    text-align: right;
    margin: 1.5rem 0 1rem 0;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    position: relative;
}

.story-section h3::before,
.vows-section h3::before,
.rings-section h3::before,
.declaration-section h3::before {
    content: "— ";
    opacity: 0.6;
}

/* First speaker in vows section needs different spacing */
.vows-section h3:first-of-type {
    margin-top: 2rem;
}

.content-main p {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    color: #4a4a4a;
    text-align: justify;
    line-height: 1.7;
}

/* Ceremony audio section styles */
.ceremony-audio-section {
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 100vh !important; /* Full viewport height to hide Opening Words - override general section spacing */
    position: relative;
    min-height: 100vh; /* Ensure bridal chorus section is full height too */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.audio-player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.audio-description {
    text-align: center;
    color: #6b5b4b;
    font-style: italic;
}

.audio-description p {
    margin: 0;
    font-size: 1rem;
}

.youtube-audio-player {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.custom-audio-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(224, 213, 204, 0.5);
}

.audio-control-btn {
    background: #5a4a3a;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.audio-control-btn:hover {
    background: #6b5b4b;
    transform: scale(1.05);
}

.audio-control-btn:active {
    transform: scale(0.95);
}

.audio-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.audio-status {
    font-size: 0.9rem;
    color: #6b5b4b;
    font-weight: 500;
}

/* HTML5 Audio Player Styles */
.audio-player-wrapper {
    margin: 1.5rem 0 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(224, 213, 204, 0.3);
}

.ceremony-audio {
    width: 100%;
    height: 50px;
    border-radius: 8px;
    outline: none;
}

/* Custom audio player styling */
.ceremony-audio::-webkit-media-controls-panel {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
}

.ceremony-audio::-webkit-media-controls-play-button,
.ceremony-audio::-webkit-media-controls-pause-button {
    background-color: #5a4a3a;
    border-radius: 50%;
    margin-left: 10px;
}

.ceremony-audio::-webkit-media-controls-timeline {
    background-color: rgba(224, 213, 204, 0.5);
    border-radius: 4px;
    margin: 0 10px;
}

.ceremony-audio::-webkit-media-controls-current-time-display,
.ceremony-audio::-webkit-media-controls-time-remaining-display {
    color: #6b5b4b;
    font-family: 'Georgia', 'Times New Roman', serif;
    font-size: 0.9rem;
}

.ceremony-audio::-webkit-media-controls-volume-slider {
    background-color: rgba(224, 213, 204, 0.5);
    border-radius: 4px;
}

/* Firefox audio player styling */
.ceremony-audio::-moz-range-track {
    background-color: rgba(224, 213, 204, 0.5);
    border-radius: 4px;
}

.ceremony-audio::-moz-range-thumb {
    background-color: #5a4a3a;
    border-radius: 50%;
    border: none;
}

/* Silence section styles */
.silence-section {
    height: 300vh; /* Keep special tall height for silence effect */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300vh; /* Ensure it maintains its special height */
    margin-bottom: 100vh !important; /* Override general section spacing - silence has its own height management */
}

.silence-section h2 {
    position: fixed;
    text-align: center;
    font-size: 2.5rem;
    color: #5a4a3a;
    font-weight: 300;
    letter-spacing: 3px;
    z-index: 10;
    transition: transform 0.1s ease-out;
    will-change: transform;
}

/* Blockquote styles */
blockquote {
    font-size: 1.2rem;
    font-style: italic;
    color: #6b5b4b;
    border-left: 4px solid #e0d5cc;
    padding-left: 1.5rem;
    margin: 2rem 0;
    background: rgba(255, 255, 255, 0.5);
    padding: 1.5rem;
    border-radius: 5px;
}

/* Footer styles */
.content-footer {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #e0d5cc;
    color: #8b7a6b;
    font-size: 0.9rem;
}

footer a {
    color: black;
    text-decoration: none;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .image-section {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 50vh;
        z-index: 10;
    }
    
    .content-section {
        margin-left: 0;
        width: 100%;
        padding-top: 50vh;
        min-height: 100vh;
    }
    
    .content-wrapper {
        padding: 2rem 1.5rem;
    }
    
    .content-header {
        min-height: 50vh; /* Fit within visible mobile content area */
        margin: 0; /* Remove margins to center in viewport */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .content-header h1 {
        font-size: 2rem;
    }
    
    .ceremony-audio-section {
        padding: 1.5rem;
        margin-bottom: 25vh !important; /* Reduced spacing for mobile layout */
    }
    
    .custom-audio-controls {
        padding: 0.8rem 1.5rem;
        gap: 0.8rem;
    }
    
    .audio-control-btn {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .audio-player-wrapper {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .ceremony-audio {
        height: 45px;
    }
    
    .scroll-instruction {
        margin-top: 2rem;
    }
    
    .content-main section {
        min-height: 100vh; /* Maintain full height on tablets */
        margin-bottom: 25vh; /* Reduced spacing for mobile layout */
        padding: 1.5rem 0;
    }
}

@media (max-width: 480px) {
    .image-section {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 50vh;
        z-index: 10;
    }
    
    .content-section {
        margin-left: 0;
        width: 100%;
        padding-top: 50vh;
        min-height: 100vh;
    }
    
    .content-wrapper {
        padding: 1.5rem 1rem;
    }
    
    .content-header {
        min-height: 50vh; /* Fit within visible mobile content area */
        margin: 0; /* Remove margins to center in viewport */
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .content-header h1 {
        font-size: 1.8rem;
    }
    
    .content-main h2 {
        font-size: 1.5rem;
    }
    
    .content-main p {
        font-size: 1rem;
    }
    
    .audio-player-wrapper {
        padding: 0.8rem;
        margin: 1rem 0;
    }
    
    .ceremony-audio {
        height: 40px;
    }
    
    .ceremony-audio-section {
        margin-bottom: 20vh !important; /* Reduced spacing for mobile layout */
    }
    
    .scroll-instruction {
        margin-top: 1.5rem;
    }
    
    .scroll-instruction h3 {
        font-size: 0.85rem;
        margin: 1rem 0 0.5rem 0;
        padding: 0.4rem 0.8rem;
    }
    
    .content-main section {
        min-height: 100vh; /* Maintain full height on mobile */
        margin-bottom: 20vh; /* Reduced spacing for mobile layout */
        padding: 1rem 0;
    }
    
    .silence-section {
        min-height: 200vh; /* Reduce silence section height on mobile */
        height: 200vh;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
.content-section::-webkit-scrollbar {
    width: 8px;
}

.content-section::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.content-section::-webkit-scrollbar-thumb {
    background: #8b7a6b;
    border-radius: 4px;
}

.content-section::-webkit-scrollbar-thumb:hover {
    background: #5a4a3a;
}