:root {
    --bg-color: #cdc0ba;
    --text-color: #ffffff;
    --dark-text: #352d27;
    --accent-color: #8a7062;
    --font-main: 'Cormorant', serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--dark-text);
    line-height: 1.7;
    overflow-x: hidden;
    font-weight: 500;
}

/* Selection styling */
::selection {
    background-color: var(--accent-color);
    color: white;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    text-transform: uppercase;
}

.section-title {
    font-size: 30px;
    margin-bottom: 40px;
    color: var(--dark-text);
}

.section-title.small {
    font-size: 24px;
}

.section-descr {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 40px;
    color: var(--dark-text);
}

.section-descr.italic {
    font-style: italic;
}

.text-block {
    font-size: 20px;
    font-weight: 500;
    max-width: 800px;
    margin: 0 auto;
    color: var(--dark-text);
    line-height: 1.8;
}

.text-block.small-width {
    max-width: 600px;
}

/* Cover Section */
.cover {
    position: relative;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height - учитывает адресную строку на мобильных */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #ffffff;
    overflow: hidden;
}

.cover-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/cover.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
}

.cover-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(205,192,186,0), rgba(205,192,186,1));
}

.cover-content {
    z-index: 1;
    margin-top: -50px; /* Adjust for visual balance */
}

.cover .title {
    font-size: 60px;
    line-height: 1.1;
    margin-bottom: 30px;
    font-weight: 300;
    text-transform: none;
}

.cover .title em {
    font-style: normal;
}

.cover .description {
    font-size: 24px;
    font-weight: 400;
}

.cover .description strong {
    font-size: 28px;
    font-weight: 600;
}

.arrow-down {
    position: absolute;
    bottom: 30px;
    bottom: calc(20px + env(safe-area-inset-bottom)); /* Для iPhone с чёлкой */
    animation: bounce 2s infinite;
    cursor: pointer;
    z-index: 1;
}

@media (max-width: 767px) {
    .arrow-down {
        bottom: 80px; /* Выше на мобильных, чтобы не перекрывалась адресной строкой */
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* Location Section */
.location {
    padding: 60px 0;
    background-color: var(--bg-color);
}

/* Photo Gallery - горизонтальная прокрутка, фото без обрезки */
.photo-gallery {
    display: flex;
    gap: 20px;
    margin-top: 40px;
    padding: 20px 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
    -webkit-overflow-scrolling: touch;
}

.photo-gallery::-webkit-scrollbar {
    height: 8px;
}

.photo-gallery::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.photo-gallery::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 10px;
}

.photo-card {
    flex: 0 0 auto;
    scroll-snap-align: center;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.photo-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.photo-card img {
    display: block;
    height: 400px;
    width: auto;
    max-width: none;
}

@media (max-width: 768px) {
    .photo-gallery {
        gap: 15px;
        margin: 30px -20px 0;
        padding: 15px 20px;
    }
    
    .photo-card {
        border-radius: 12px;
    }
    
    .photo-card img {
        height: 280px;
    }
}


/* History Section */
.history {
    padding: 60px 0;
    background-color: var(--bg-color);
}

.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #ffffff, transparent);
    margin: 30px auto;
    width: 50%;
    opacity: 0.8;
}

.divider-section {
    height: 1px;
    background: linear-gradient(to right, transparent, #ffffff, transparent);
    margin: 0 auto;
    width: 50%;
    opacity: 0.8;
}

/* Slider Section */
.slider-section {
    padding: 40px 0;
    background-color: var(--bg-color);
}

.slider-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-track-container {
    overflow: hidden;
    width: 100%;
}

.slider-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    list-style: none;
}

.slide {
    min-width: 100%;
    box-sizing: border-box;
    padding: 0 10px;
}

.slide img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.slider-arrow {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 15px;
    z-index: 10;
    transition: all 0.3s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.4);
    tap-highlight-color: rgba(255, 255, 255, 0.4);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    box-shadow: none;
    touch-action: manipulation;
}

.slider-arrow svg polyline {
    stroke: var(--dark-text);
    stroke-width: 2;
}

.slider-arrow:active {
    opacity: 0.7;
}

.slider-arrow:focus {
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .slider-arrow:hover svg polyline {
        stroke: var(--accent-color);
    }
}

.slider-nav {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #9a8a7b;
    border: none;
    margin: 0 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.slider-dot:hover {
    transform: scale(1.2);
    background-color: #7a6a5b;
}

.slider-dot.current-slide {
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* На ПК активный кружок тёмный */
@media (min-width: 769px) {
    .slider-dot.current-slide {
        background-color: var(--dark-text);
        box-shadow: none;
    }
}

/* Slider mobile - на всю ширину */
@media (max-width: 768px) {
    .slider-section {
        padding: 30px 0;
    }
    
    .slider-container {
        max-width: 100%;
        position: relative;
    }
    
    .slide {
        padding: 0;
    }
    
    .slide img {
        border-radius: 0;
    }
    
    .slider-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        padding: 10px;
    }
    
    .slider-arrow.prev {
        left: 10px;
    }
    
    .slider-arrow.next {
        right: 10px;
    }
    
    .slider-arrow svg {
        width: 12px;
        height: 22px;
    }
    
    .slider-arrow svg polyline {
        stroke: rgba(255, 255, 255, 0.9);
        stroke-width: 3;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    }
}

/* Dress Code */
.dresscode {
    padding: 60px 0;
    background-color: var(--bg-color);
}

.palette-img {
    max-width: 100%;
    margin: 20px 0;
}

/* Timeline Section */
.timeline {
    position: relative;
    padding: 100px 0;
    color: #ffffff;
    overflow: hidden;
    min-height: 500px;
}

.timeline-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.timeline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(205,192,186,0.95), rgba(205,192,186,0.9));
    z-index: -1;
}

.timeline-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.timeline-title {
    font-size: 36px;
    margin-bottom: 80px;
    letter-spacing: 2px;
    font-weight: 400;
    color: var(--dark-text);
}

/* Horizontal Timeline (Desktop) */
.timeline-horizontal {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-top: 20px;
}

/* Линия создаётся динамически через JS */
.timeline-line {
    position: absolute;
    background-color: #6d564b;
    z-index: 0;
}

.timeline-item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    padding: 0 15px;
}

.timeline-time {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 20px;
    height: 40px;
    display: flex;
    align-items: center;
    color: var(--dark-text);
}

.timeline-dot {
    width: 18px;
    height: 18px;
    background-color: #6d564b;
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--bg-color), 0 0 0 6px #6d564b;
    margin-bottom: 30px;
    flex-shrink: 0;
}

.timeline-info {
    text-align: center;
    max-width: 280px;
}

.timeline-event-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--dark-text);
}

.timeline-desc {
    font-size: 20px;
    line-height: 1.6;
    font-weight: 500;
    color: var(--dark-text);
}

/* Mobile Responsive (Vertical) */
@media (max-width: 900px) {
    .timeline {
        padding: 60px 0;
    }
    
    .timeline-title {
        font-size: 24px;
        margin-bottom: 50px;
    }

    .timeline-horizontal {
        flex-direction: column;
        align-items: stretch;
        padding-left: 40px;
        position: relative;
    }

    /* Вертикальная линия на мобильном */
    .timeline-line {
        width: 2px;
        height: auto;
        top: auto;
        left: 30px;
    }

    .timeline-item {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
        margin-bottom: 50px;
        width: 100%;
        padding: 0 0 0 10px;
        position: relative;
    }
    
    .timeline-item:last-child {
        margin-bottom: 0;
    }

    .timeline-dot {
        position: absolute;
        left: -19px;
        top: 0;
        margin: 0;
    }
    
    .timeline-time {
        display: flex;
        align-items: center;
        position: static;
        height: 18px;
        line-height: 1;
        margin-bottom: 15px;
        margin-top: -2px;
        font-size: 26px;
        font-weight: 600;
        color: #6d564b;
        text-shadow: none;
    }
    
    .timeline-time::before {
        content: '—';
        margin-right: 10px;
    }
    
    .timeline-time::after {
        content: '—';
        margin-left: 10px;
    }
    
    .timeline-info {
        text-align: left;
        max-width: 100%;
    }
    
    .timeline-event-title {
        font-size: 22px;
        margin-bottom: 10px;
    }
    
    .timeline-desc {
        font-size: 16px;
        text-shadow: none;
        opacity: 0.9;
    }
}

/* Contacts */
.contacts {
    padding: 60px 0;
    background-color: var(--bg-color);
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.social-link svg {
    width: 48px;
    height: 48px;
    transition: all 0.3s ease;
}

.social-link:hover svg {
    transform: scale(1.15) rotate(5deg);
}

.social-link svg path {
    transition: fill 0.3s ease;
}

.social-link:hover svg path {
    fill: var(--accent-color);
}

/* Countdown Section */
.countdown {
    padding: 80px 0;
    background-color: var(--bg-color);
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
}

.countdown-number {
    font-size: 72px;
    font-weight: 300;
    color: var(--dark-text);
    line-height: 1;
    transition: transform 0.3s ease;
}

.countdown-number:hover {
    transform: scale(1.1);
}

.countdown-label {
    font-size: 18px;
    color: var(--dark-text);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 10px;
}

.calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background-color: var(--dark-text);
    color: white;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid var(--dark-text);
}

.calendar-btn:hover {
    background-color: transparent;
    color: var(--dark-text);
}

.calendar-btn svg {
    transition: transform 0.3s ease;
}

.calendar-btn:hover svg {
    transform: rotate(10deg);
}

/* Calendar Modal */
.calendar-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.calendar-modal.active {
    display: flex;
}

.calendar-modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 320px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calendar-modal-content h3 {
    text-align: center;
    color: var(--dark-text);
    font-size: 22px;
    margin-bottom: 25px;
    font-weight: 600;
}

.calendar-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.calendar-modal-close:hover {
    color: #333;
}

.calendar-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.calendar-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f5f5f5;
    border-radius: 12px;
    text-decoration: none;
    color: var(--dark-text);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.calendar-option:hover {
    background: #eee;
    transform: translateX(5px);
}

.calendar-option svg {
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .countdown-timer {
        gap: 20px;
    }
    
    .countdown-item {
        min-width: 70px;
    }
    
    .countdown-number {
        font-size: 48px;
    }
    
    .countdown-label {
        font-size: 14px;
    }
}

/* Responsive Typography */
@media (max-width: 767px) {
    .cover .title { font-size: 40px; }
    .cover .description { font-size: 18px; }
}

/* Animations */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, visibility;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: none;
}
