/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Songti SC", "Noto Serif SC", serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Daytime Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.carousel-container {
    width: 100%;
    max-width: 600px;
    height: 400px;
    margin-bottom: 40px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.carousel-image {
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: opacity 1s ease-in-out;
    opacity: 1;
}

.carousel-quote {
    margin-top: 20px;
    font-size: 1.2rem;
    font-style: italic;
    text-align: center;
    color: #555;
    min-height: 3em; /* Prevent layout shift */
    transition: opacity 1s ease-in-out;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.overlay-message {
    text-align: center;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.overlay-message p {
    font-size: 1.1rem;
    color: #888;
    margin-bottom: 10px;
}

.overlay-message .sub-message {
    font-size: 0.9rem;
    color: #aaa;
}

/* Letter Content Styles */
.letter-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 60px 20px;
}

.letter {
    width: 100%;
    max-width: 800px; /* Optimal reading width for desktops */
    background-color: #fff;
    padding: 60px 80px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.letter-header {
    margin-bottom: 40px;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.letter-header h1 {
    font-size: 2rem;
    font-weight: normal;
    margin-bottom: 10px;
    letter-spacing: 2px;
}

.letter-header .date {
    font-size: 0.9rem;
    color: #999;
}

.letter-body p {
    margin-bottom: 2em;
    text-indent: 2em;
    text-align: justify;
    font-size: 1.1rem;
}

.letter-footer {
    margin-top: 60px;
    text-align: right;
    font-style: italic;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Responsive Design */

/* Large Screens (2K/4K) */
@media (min-width: 1920px) {
    .letter {
        max-width: 1000px;
        padding: 80px 100px;
    }
    .letter-body p {
        font-size: 1.25rem;
    }
}

/* Tablets (iPad Pro/Air/Mini) */
@media (max-width: 1024px) {
    .letter {
        padding: 50px 40px;
        max-width: 90%;
    }
}

/* Mobile Devices (iPhone 16/Pro Max) */
@media (max-width: 768px) {
    .letter-container {
        padding: 0;
    }
    
    .letter {
        box-shadow: none;
        padding: 40px 20px;
    }

    .letter-header h1 {
        font-size: 1.5rem;
    }

    .letter-body p {
        font-size: 1rem;
        text-indent: 0; /* Modern mobile style often drops indent */
        margin-bottom: 1.5em;
    }

    .carousel-container {
        height: 300px;
    }
}
