/* WEDDING STYLE: Modern Luxury
   Palette: Milk, Champagne, Graphite, Black, Nude
*/

:root {
    --bg-color: #f7f5f2;
    --text-color: #2c2c2c;
    --accent-color: #a69f95;
    --white: #ffffff;
    --envelope-back: #dbd8d2;
    --envelope-flap: #dedbd7;
    --envelope-front: #e9e6e2;
}

/* Base Styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 3px;
}

/* --- SECTION 1: ENVELOPE (HERO) --- */

.envelope-screen {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    perspective: 1500px;
    background: var(--bg-color);
}

.envelope {
    width: 320px;
    height: 220px;
    background: var(--envelope-back);
    position: relative;
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(0,0,0,0.06);
    transition: transform 0.3s ease;
}

/* Top Flap (Клапан) */
.flap {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--envelope-flap);
    clip-path: polygon(0 0, 100% 0, 50% 55%);
    z-index: 10; /* Поверх всего в закрытом виде */
    transform-origin: top;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.1s 0.4s;
}

/* Front Pocket (Кармашек конверта) */
.envelope::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--envelope-front);
    clip-path: polygon(0 40%, 50% 100%, 100% 40%, 100% 100%, 0 100%);
    z-index: 5; /* Над письмом, но под клапаном */
}

/* The Letter (Письмо) */
.letter {
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 10px;
    height: 190px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    z-index: 2; /* Внутри конверта */
    opacity: 0;
    transform: translateY(0);
    transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
    text-align: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.03);
}

.letter h1 {
    font-size: 1.1rem;
    margin: 0 0 10px 0;
    letter-spacing: 2px;
}

.letter-sub {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--accent-color);
}

/* Animation State: Open */
.envelope.open .flap {
    transform: rotateX(160deg);
    z-index: 1; /* Уходит назад после открытия */
}

.envelope.open .letter {
    opacity: 1;
    transform: translateY(-130px); /* Письмо эффектно выезжает */
    z-index: 15; /* Теперь оно поверх всего */
}

.hint {
    margin-top: 50px;
    font-size: 10px;
    letter-spacing: 5px;
    opacity: 0.5;
    text-transform: uppercase;
}

/* --- MAIN CONTENT --- */

.content {
    animation: fadeInPage 1.5s ease;
}

@keyframes fadeInPage {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section {
    padding: 100px 24px;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hidden { display: none; }

.divider {
    height: 1px;
    width: 50px;
    background: var(--accent-color);
    margin: 30px auto;
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 40px;
}

.photo {
    background: #eee;
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Timeline */
.timeline {
    list-style: none;
    padding: 0;
    margin: 40px auto;
    max-width: 400px;
}

.timeline li {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    text-align: left;
}

.time {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    min-width: 80px;
    border-right: 1px solid var(--accent-color);
    margin-right: 20px;
}

/* Dress Code Colors */
.colors {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
}

.color-circle {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.05);
}

/* RSVP Buttons */
.rsvp-buttons {
    margin-top: 30px;
}

.btn {
    padding: 16px 35px;
    background: var(--text-color);
    color: var(--white);
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    margin: 5px;
    transition: all 0.3s ease;
}

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

.btn.secondary {
    background: transparent;
    border: 1px solid var(--text-color);
    color: var(--text-color);
}

.footer {
    padding: 80px 20px;
    text-align: center;
    background: var(--white);
}

/* Mobile Adaptation */
@media (max-width: 600px) {
    .gallery { grid-template-columns: 1fr; }
    .section { padding: 70px 20px; }
    .envelope { width: 290px; height: 200px; }
    .time { font-size: 1.1rem; min-width: 70px; }
}
.interactive-map {
    width: 100%;
    height: 450px;
    margin: 30px 0;
    border: 1px solid #e0ddd8;
    filter: grayscale(0.8) contrast(1.1); /* Благородный приглушенный тон */
    transition: all 0.6s ease;
}

.interactive-map:hover {
    filter: grayscale(0); /* Оживает при наведении */
}

/* Стилизация кнопки навигатора */
.btn.secondary {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    font-size: 10px;
    padding: 14px 30px;
}
/* --- GALLERY UPGRADE --- */

/* Стили для контейнера фото, чтобы картинка заполняла его полностью */
.photo {
    background: #e9e6e2;
    aspect-ratio: 3/4; 
    overflow: hidden; /* Чтобы картинка не вылезала за скругления или границы */
    position: relative;
    display: block; /* Убираем лишние отступы инлайновых элементов */
}

.photo img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Фото подстраивается под размер блока, обрезая лишнее */
    display: block;
    filter: sepia(0.1) contrast(1.05); /* Легкий эффект для сочности и стиля */
    transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Эффект легкого приближения при наведении */
.photo:hover img {
    transform: scale(1.05);
}

/* Плавное появление фото (по желанию) */
.photo img {
    opacity: 0;
    animation: fadeInPhoto 1s ease forwards;
}

@keyframes fadeInPhoto {
    to { opacity: 1; }
}