html, body{
    margin: 0;
    font-family: "Playfair", serif;
    background-color: #FAF9F6;
}

* {
    font-family: 'Playfair Display', serif;
}

/* Picture элементы должны быть прозрачными для стилей */
picture {
    display: contents;
    margin: 0;
    padding: 0;
    width: auto;
    height: auto;
}

/* Убеждаемся, что img внутри picture наследует все стили */
picture > img {
    display: block;
}

/* Fallback для браузеров без поддержки display: contents */
@supports not (display: contents) {
    picture {
        display: block;
        width: 100%;
        height: 100%;
    }
    
    picture > img {
        width: 100%;
        height: 100%;
        display: block;
    }
}


section{
    margin: 0;
}

/* Portfolio specific styles */
#portfolio-container {
    margin-top: 80px;
}

.portfolio-item {
}
.portfolio-item .main-event-img{
    max-height: 48vw;
}

.portfolio-item .main-event-video-wrapper{
    max-height: 48vw;
}

.portfolio-item .main-event-text{
    max-width: 42ch;
    text-align: center;
}

.portfolio-item .btn-story-popup{

    width: clamp(160px, 14vw, 300px);
    height: clamp(50px, 3vw, 70px);
    color: #FAF9F6;
    background-color: #4C3B34;
    border: 1.5px solid #FAF9F6;
    border-radius: 30px;
    cursor: pointer;
    font-size: clamp(16px, 1.3vw, 24px);
    margin-bottom: 5vh;

    transition: background-color 0.3s ease, color 0.3s ease;
}
.portfolio-item .btn-story-popup:hover {
    color: #FAF9F6;
    background-color: #817773;
}

.portfolio-item:last-child {
    margin-bottom: 0;
}

/* Pagination styles */
.portfolio-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 5vh 0;
    padding: 20px 0;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 15px;
    border: 1.5px solid #817773;
    background-color: #FAF9F6;
    color: #817773;
    font-family: 'Playfair', serif;
    font-size: clamp(16px, 1.2vw, 20px);
    font-weight: 400;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #4C3B34;
    color: #FAF9F6;
}

.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-btn.active {
    background-color: #4C3B34;
    color: #FAF9F6;
    font-weight: 600;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-ellipsis {
    color: #817773;
    font-family: 'Playfair', serif;
    font-size: clamp(16px, 1.2vw, 20px);
    padding: 0 5px;
}

.portfolio-review-section {
    margin-top: 5vh;
    margin-bottom: 5vh;
}

/*SECTION 1*/
.event-section-1{
     margin-top: 80px;
}

.div-split2{
    display: flex;
}

.div-left{
    width: 40%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.div-main-event-img{
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-event-img{
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.main-event-video-wrapper{
    width: 100%;
    max-width: 100%;
    height: 0;
    position: relative;
    padding-top: 56.25%; /* 16:9 aspect ratio - always horizontal */
    margin: 0 auto;
}

.main-event-video-wrapper-vertical{
    background-color: #000000; /* Black background for letterboxing on sides */
}

.main-event-video-wrapper-vertical .main-event-video-iframe{
    height: 100%;
    width: 31.64%; /* 9:16 aspect ratio: height is 100% (56.25% of container width), width = height * (9/16) = 31.64% of container width */
    left: 50%;
    transform: translateX(-50%);
    max-width: 100%;
}

.main-event-video-iframe{
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.div-right{
    width: 60%;
    background-color: #FAF9F6;
}

.div-main-event-text{
    align-items: center;
    display: flex;
    flex-direction: column;
    padding-top: 5vh;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.main-event-text{
    margin: 0;
    margin-bottom: 3vh;
    font-size: clamp(28px, 2.2vw, 45px);
    color: #4C3B34;
    font-weight: normal;
    text-transform: uppercase;
}

.main-event-subtext-wrapper{
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-event-subtext{
    font-size: clamp(16px, 1.3vw, 24px);
    letter-spacing: 0.15em;
    line-height: 1.8;
    color: #817773;
    max-width: 65ch;
    text-align: justify;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 400;
}

/* Portfolio review text scrollbar styling */
.portfolio-review-text::-webkit-scrollbar {
    width: 6px;
}

.portfolio-review-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.portfolio-review-text::-webkit-scrollbar-thumb {
    background: #817773;
    border-radius: 10px;
}

.portfolio-review-text::-webkit-scrollbar-thumb:hover {
    background: #6b6562;
}

.btn-read-more{
    display: none;
    margin-top: 1vh;
    padding: 0;
    font-size: clamp(16px, 1.3vw, 24px);
    color: #4C3B34;
    background-color: transparent;
    border: none;
    border-radius: 0;
    cursor: pointer;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: transform 0.25s ease, text-shadow 0.25s ease;
    align-self: flex-start;
}

/* Portfolio read more button should be visible when needed */
.main-event-subtext-wrapper .btn-read-more[style*="display: block"] {
    display: block !important;
}

.btn-read-more:hover {
    transform: scale(1.04);
    text-shadow: 0 0 1px currentColor;
}

.event-subtext-italic{
    font-family: 'Playfair';
    font-style: italic;
    font-weight: 400;
}

.event-subtext-bold{
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 900;
}



/* SECTION 2 */
/* ---------- Для слайдера (если нужно) ---------- */

.div-slider {
    margin-top: -5px;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.div-slider-content {
    display: flex;
    transition: transform 0.1s linear; /* плавное движение */
}

.slider-img {
    height: 40vh;
    min-height: 40vh;
    max-height: 40vh;
    width: 25%;
    flex-shrink: 0;
    object-fit: cover;
}

/* Убеждаемся, что picture в слайдерах не влияет на размеры */
.div-slider-content picture.slider-img,
.div-slider-content picture > img.slider-img {
    height: 40vh !important;
    min-height: 40vh !important;
    max-height: 40vh !important;
    width: 25% !important;
    flex-shrink: 0 !important;
    object-fit: cover !important;
    display: block !important;
}

/* SECTION 3 */
.event-section-3 .div-split2{
    flex-direction: row-reverse;
}

/* SECTION 4 */

.event-section-4{
    margin-bottom: 10vh;
}

.div-container-wed-section4{
    align-items: center;
    justify-content: center;
    display: flex;
}

.div-col-in-container{
    display: flex;
    flex-direction: column;
    width: 33.33%;
    justify-content: center;
    align-items: center;
    text-align: center;
}

#event-portfolio-link {
    text-decoration: none;
    color: inherit;
}

.div-text-in-container{
    max-width: 48ch;
    line-height: 1.7;
    letter-spacing: 0.15em;
    margin: 6.5vh 0 4vh 0;
}

.text-in-container{
    font-size: clamp(16px, 1.5vw, 30px);
    color: #817773;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 600;
}

.btn-second-non-active{
    width: clamp(160px, 12vw, 300px);
    height: clamp(50px, 3.5vw, 70px);
    color: #FAF9F6;
    background-color: #4C3B34;
    border: 1.5px solid #FAF9F6;
    border-radius: 30px;
    cursor: pointer;
    font-size: clamp(22px, 1.8vw, 34px);

    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-second-non-active:hover {
    color: #FAF9F6;
    background-color: #817773;
}


/* POPUP */
.popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .4s ease;
    z-index: 10000;
}

.popup.active {
    opacity: 1;
    pointer-events: auto;
}

.popup-content {
    width: 90%;
    height: 90%;
    border-radius: 16px;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    transform: scale(.9);
    transition: .4s ease;
    background: #FAF9F6;
}

.popup.active .popup-content {
    transform: scale(1);
}

/* Close button */
.popup-close {
    position: absolute;
    top: 18px;
    right: 25px;
    font-size: 32px;
    cursor: pointer;
    color: #000;
    z-index: 20;
}

.popup .review-text {
    color: #FAF9F6;
    font-size: clamp(8px, 0.9vw, 18px);
    letter-spacing: 0.15em;
    line-height: 1.85;
    font-style: italic;
    font-weight: 300;
    text-transform: uppercase;
}

.story-popup-content{
    display: flex;
    flex-direction: column;
    padding: 5vh 0;
    align-items: center;
    overflow-y: auto;
    overflow-x: hidden;
}

.story-popup-text {
    width: 90%;
    max-width: 100%;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 400;
    font-size: clamp(16px, 1.4vw, 24px);
    line-height: 1.85;
    letter-spacing: 0.15em;
    color: #817773;
    text-align: justify;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

/* SLIDER BASE */
.slides-container {
    width: 100%;
    height: 100%;
    display: flex;
    position: relative;
    overflow: visible;
    transition: transform 0.5s ease-in-out;
}

.slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    opacity: 0;
    transition: opacity 0.4s ease;
    position: absolute;
    inset: 0;
    transform: translateX(100%); /* старт за экраном */
    transition: transform 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

.slide.active {
    opacity: 1;
    transform: translateX(0);
}

.slide.prev {
    opacity: 0;
    transform: translateX(-100%);
}

.slide.active {
    opacity: 1;
    position: absolute;
}

/* LEFT PHOTO */
.slide-left {
    width: 30%;
    overflow: hidden;
    position: relative;
}

.slide-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* On desktop/tablet: show only main image directly */
.slide-main-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Image Carousel - hidden on desktop/tablet, shown only on mobile */
.image-carousel {
    display: none;
}

@media (max-width: 480px) {
    /* Hide direct image on mobile, show carousel instead */
    .slide-main-image {
        display: none;
    }
    
    .image-carousel {
        display: block;
        width: 100%;
        height: 100%;
        position: relative;
        overflow: hidden;
    }
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Hide carousel controls - no arrows or dots needed */
.carousel-arrow {
    display: none !important;
}

.carousel-dots {
    display: none !important;
}

/* RIGHT TEXT + MINI PHOTOS */
.slide-right {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    max-height: 100%; /* чтобы текст не выходил за границы */
    overflow-y: auto;
    overflow-x: hidden;
}

.slide-title{
    margin: 0;
    margin-bottom: 1vh;
    text-transform: uppercase;
    font-size: clamp(24px, 1.8vw, 32px);
    color: #4C3B34;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 700;
}

.slide-text {
    display: inline;
    font-size: clamp(16px, 1.4vw, 24px);
    line-height: 1.85;
    letter-spacing: 0.15em;
    margin-top: 10px;
    color: #817773;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 400;
}

.read-more-text {
  display: inline;
  font-size: clamp(16px, 1.4vw, 24px);
  margin-left: 4px;
  color: #4C3B34;
  line-height: 1.85;
letter-spacing: 0.15em;
  cursor: pointer;
  font-family: 'Playfair';
    font-style: normal;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}


.slide-text-wrapper {
    display: inline;         /* сколько строк показывать */
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.slide-text-wrapper.expanded {
    -webkit-line-clamp: unset;
    max-height: 55%;
    overflow-y: auto;
}

/* THUMBS */
.slide-thumbs {
    display: flex;
    gap: 10px;
    height: 40%;
}

.slide-thumbs img {
    width: calc(33.33% - 6px);
    border-radius: 8px;
    object-fit: cover;
}


/* ARROWS */
.slider-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    font-size: 38px;
    background: rgba(250, 249, 246, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10015;
    transition: .3s;
    color: #4C3B34;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-arrow:hover {
    background: rgba(250, 249, 246, 1);
    transform: translateY(-50%) scale(1.1);
}

.slider-arrow.left {
    left: calc(0.5vw + 20px);
}

.slider-arrow.right {
    right: calc(0.5vw + 20px);
}

/* Hide image carousel on desktop/tablet, show only on mobile */
.image-carousel {
    display: none;
}

@media (max-width: 480px) {
    .image-carousel {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .slider-arrow {
        font-size: clamp(32px, 8vw, 42px);
        width: clamp(40px, 10vw, 50px);
        height: clamp(40px, 10vw, 50px);
    }
    
    .slider-arrow.left {
        left: clamp(15px, 4vw, 25px);
    }
    
    .slider-arrow.right {
        right: clamp(15px, 4vw, 25px);
    }
}
.slide-left {
    position: relative;
    overflow: hidden;
}

/* Отзыв занимает всё изображение при открытии */
.review-content {
    position: absolute;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: #4C3B34;
    padding: 2.5vw;
    box-sizing: border-box;
    transition: bottom 0.5s ease;
    z-index: 1;
    overflow-y: auto;
}

/* Overlay с кнопкой */
.bottom-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 10%;
    text-align: center;
    cursor: pointer;
    background: linear-gradient(360deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    color: #FAF9F6;
    transition: all 0.5s ease;
    z-index: 2;
}

/* Pulse animation from top to bottom for text - using translate3d for hardware acceleration */
@keyframes pulseTopToBottom {
    0% {
        transform: translate3d(0, 0, 0);
    }
    50% {
        transform: translate3d(0, -10px, 0); /* Move up more */
    }
    100% {
        transform: translate3d(0, 3px, 0); /* Move down less */
    }
}

/* Pulse animation for arrow - using translate3d for hardware acceleration */
@keyframes pulseTopToBottomArrow {
    0% {
        transform: translate3d(0, 0, 0) rotate(90deg);
    }
    50% {
        transform: translate3d(0, -10px, 0) rotate(90deg); /* Move up more */
    }
    100% {
        transform: translate3d(0, 3px, 0) rotate(90deg); /* Move down less */
    }
}

/* Стрелка */
.review-arrow{
    transform: rotate(90deg);
    width: clamp(15px, 1.4vw, 25px);
    height: auto;
    fill: none;
    transition: transform 0.5s ease;
    display: inline-block;
    transform-origin: center center;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Класс при открытии */
.bottom-open .review-content {
    bottom: 0;
}

/* Поворот стрелки и скрытие текста */
.bottom-open .review-arrow {
    transform: rotate(270deg); /* исходно 90, при открытии 270 = 180° поворот */
}

.bottom-open .review-text {
    opacity: 0;
    visibility: hidden;
}

/* Стрелка перемещается наверх при открытии */
.bottom-open .bottom-overlay {
    top: 0;
    bottom: auto;
    background: none;
}

/* Apply pulse animation to text only - only when closed */
.slide-left:not(.bottom-open) .bottom-overlay .review-text {
    animation: pulseTopToBottom 3s ease-in-out infinite;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Apply pulse animation to arrow only - only when closed */
.slide-left:not(.bottom-open) .bottom-overlay .review-arrow {
    animation: pulseTopToBottomArrow 3s ease-in-out infinite;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Stop animation when open */
.bottom-open .review-arrow,
.bottom-open .review-text {
    animation: none;
}

.review-open-text{
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 400;
    font-size: clamp(12px, 1.2vw, 20px);
    line-height: 1.8;
    letter-spacing: 0.1em;
    color: #FAF9F6;
}

.read-more-text-review{
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 700;
    font-size: clamp(12px, 1.5vw, 20px);
    line-height: 180%;
    letter-spacing: 0.1em;
    color: #FAF9F6;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

@media (max-width: 1024px) {
    .div-left{
        width: 50%;
    }
    .div-right{
        width: 50%;
    }
    .div-main-event-text{
        padding-top: 1vh;
    }
    .main-event-text{
        font-size: clamp(25px, 3vw, 35px);
        margin-bottom: 1vh;
    }
    .main-event-subtext br{
        display: none;
    }
    .main-event-subtext-wrapper{
        padding-left: 15px;
    }
    .main-event-subtext{
        font-size: clamp(16px, 1.9vw, 24px);
        line-height: 1.4;
        padding: 0 2vh;
    }
    .btn-read-more{
        display: none;
    }
    .event-section-4{
        margin-bottom: 2vh;
    }
    .div-text-in-container{
        margin: 2vh 0;
    }
    .text-in-container{
        font-size: clamp(16px, 1.9vw, 24px);
        line-height: 1.4;
    }
    .portfolio-pagination {
        margin: 3vh 0;
        padding: 15px 0;
    }
    .pagination-btn {
        min-width: 35px;
        height: 35px;
        padding: 0 10px;
        font-size: clamp(14px, 1.5vw, 18px);
    }
}

@media (min-width: 481px) and (max-width: 1023px) {
    .div-split2{
        flex-direction: column;
    }
    .event-section-3 .div-split2{
        flex-direction: column;
    }
    .div-left{
        display: none;
    }
    .div-right{
        width: 100%;
    }
    .main-event-text{
        font-size: clamp(28px, 5vw, 50px);
        margin: 1vh 0;
    }
    .main-event-subtext-wrapper{
        padding: 0 4vw;
        max-width: 100%;
        align-items: flex-start;
    }
    .main-event-subtext{
        font-size: clamp(25px, 3.5vw, 40px);
        display: -webkit-box;
        -webkit-line-clamp: 6;
        line-clamp: 6;
        -webkit-box-orient: vertical;
        overflow: hidden;
        transition: all 0.3s ease;
        padding: 0;
    }
    .main-event-subtext.expanded{
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
    }
    .btn-read-more{
        display: block;
        margin-left: 0;
        margin-bottom: 1vh;
        font-size: clamp(25px, 3.5vw, 40px);
    }
    .slider-img{
        width: 50%;
        height: 70vh;
        min-height: 70vh;
        max-height: 70vh;
        object-fit: cover;
    }
    
    /* Убеждаемся, что picture в слайдерах на мобильных работает правильно */
    .div-slider-content picture.slider-img,
    .div-slider-content picture > img.slider-img {
        width: 50% !important;
        height: 70vh !important;
        min-height: 70vh !important;
        max-height: 70vh !important;
        object-fit: cover !important;
    }
    .portfolio-pagination {
        margin: 3vh 0;
        padding: 15px 0;
        flex-wrap: wrap;
    }
    .pagination-btn {
        min-width: 35px;
        height: 35px;
        padding: 0 10px;
        font-size: clamp(14px, 2vw, 18px);
    }
    .pagination-numbers {
        gap: 3px;
    }
    .slide {
        flex-direction: column;
        position: relative;
        height: auto;
        min-height: 100vh;
        inset: auto;
    }
    
    /* Make slide-left contents become direct children of slide */
    .slide-left {
        display: contents;
        position: static !important;
    }
    
    /* Reorder blocks in column mode */
    .slide-right {
        flex: 0;
        order: 1;
        display: flex;
        flex-direction: column;
        width: 100%;
        padding: 20px;
        overflow: visible;
        justify-content: flex-start;
    }
    
    .slide-text-wrapper {
        order: 1;
    }
    
    .slide-thumbs {
        order: 2;
    }
    
    /* Review content as separate block (third) */
    .slide-left .review-content {
        order: 3;
        position: static !important;
        bottom: auto !important;
        left: auto !important;
        width: 100%;
        height: auto;
        background: #817773;
        padding: 20px;
        box-sizing: border-box;
        display: block;
        overflow: visible;
        transition: none;
        margin: 0;
        z-index: auto;
    }
    
    .slide-left .review-content.expanded {
        overflow: visible;
    }
    
    /* Hide the overlay button */
    .slide-left .review-overlay {
        display: none;
    }
    
    /* Make review text visible with read more functionality */
    .slide-left .review-open-text {
        display: inline;
        color: #FAF9F6;
        font-size: clamp(16px, 1.4vw, 24px);
        line-height: 1.85;
        letter-spacing: 0.15em;
        font-family: 'Playfair';
        font-style: normal;
        font-weight: 400;
    }
    
    /* Read more button for review - styled like slide-text read more */
    .slide-left .read-more-text-review {
        display: inline;
        margin-left: 4px;
        font-size: clamp(16px, 1.4vw, 24px);
        color: #FAF9F6;
        line-height: 1.85;
        letter-spacing: 0.15em;
        cursor: pointer;
        font-family: 'Playfair';
        font-style: normal;
        font-weight: 700;
        text-decoration: underline;
        text-decoration-thickness: 1px;
        text-underline-offset: 0.2em;
    }
    
    /* Slide-left image (fourth block) - now carousel */
    .image-carousel {
        order: 4;
        width: 100%;
        height: auto;
        min-height: 300px;
        margin: 0;
    }

    .carousel-container {
        width: 100%;
        height: 300px;
        min-height: 300px;
    }

    .carousel-slide {
        position: absolute;
        width: 100%;
        height: 100%;
    }

    .carousel-slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
}

/* ---------- MOBILE DEVICES (max-width: 480px) ---------- */
@media (max-width: 480px) {
  /* общий контроль */
  html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  br {
    display: none;
  }

  section {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  /* ---------- SECTION 1 ---------- */
  .event-section-1 {
    margin-top: 0;
    padding-top: clamp(80px, 14vh, 100px);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  .div-split2 {
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .div-left {
    width: 100%;
    max-width: 100%;
    display: none;
  }

  .div-right {
    width: 100%;
    max-width: 100%;
    padding: 2vh 4vw;
    box-sizing: border-box;
  }

  .div-main-event-text {
    padding-top: 0;
    align-items: flex-start;
    width: 100%;
  }

  .main-event-text {
    font-size: clamp(28px, 7vw, 40px);
    margin: 0 0 clamp(15px, 2vh, 25px) 0;
    text-align: left;
    line-height: 1.3;
  }

  .main-event-subtext-wrapper {
    width: 100%;
    padding: 0;
    align-items: flex-start;
  }

  .main-event-subtext {
    font-size: clamp(16px, 4vw, 24px);
    line-height: 1.6;
    letter-spacing: 0.1em;
    text-align: left;
    max-width: 100%;
    padding: 0;
    margin: 0;
  }

  .btn-read-more {
    display: block;
    margin-top: clamp(10px, 1.5vh, 15px);
    font-size: clamp(16px, 4vw, 24px);
    align-self: flex-start;
  }

  /* ---------- SECTION 2 (Slider) ---------- */
  .event-section-2 {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    margin: 0;
  }

  .div-slider {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    margin-top: 0;
  }

  .div-slider-content {
    display: flex;
    width: auto;
  }

  .slider-img {
    width: 100vw;
    min-width: 100vw;
    max-width: 100vw;
    max-height: clamp(200px, 30vh, 350px);
    flex-shrink: 0;
    object-fit: cover;
  }

  .div-slider-content picture,
  .div-slider-content picture > img.slider-img {
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    max-height: clamp(200px, 30vh, 350px) !important;
    flex-shrink: 0 !important;
    object-fit: cover !important;
    display: block !important;
  }

  /* ---------- SECTION 3 ---------- */
  .event-section-3 {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-top: clamp(20px, 3vh, 35px);
  }

  .event-section-3 .div-split2 {
    flex-direction: column;
  }

  /* ---------- SECTION 4 ---------- */
  .event-section-4 {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    margin-bottom: 0;
    padding: clamp(20px, 3vh, 35px) 4vw;
  }

  .div-container-wed-section4 {
    flex-direction: column;
    gap: clamp(20px, 3vh, 35px);
    align-items: center;
    width: 100%;
  }

  .div-col-in-container {
    width: 100%;
    max-width: 100%;
    align-items: center;
  }

  .div-text-in-container {
    max-width: 100%;
    margin: 0 0 clamp(15px, 2vh, 25px) 0;
    text-align: center;
  }

  .text-in-container {
    font-size: clamp(18px, 4.5vw, 26px);
    line-height: 1.5;
  }

  .btn-second-non-active {
    width: clamp(220px, 75vw, 320px);
    height: clamp(50px, 7vh, 65px);
    font-size: clamp(20px, 5vw, 28px);
    border-radius: 30px;
  }

  /* ---------- POPUP ---------- */
  .popup {
    padding: 0;
    align-items: flex-start;
    padding-top: clamp(50px, 8vh, 80px);
  }

  .popup-content {
    width: 100%;
    max-width: 100vw;
    height: calc(100vh - clamp(50px, 8vh, 80px));
    max-height: calc(100vh - clamp(50px, 8vh, 80px));
    border-radius: clamp(16px, 4vw, 20px) clamp(16px, 4vw, 20px) 0 0;
    transform: translateY(100%);
    transition: transform 0.4s ease, opacity 0.4s ease;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .popup.active .popup-content {
    transform: translateY(0);
  }

  .popup-close {
    top: clamp(12px, 2vh, 18px);
    right: clamp(15px, 4vw, 25px);
    font-size: clamp(32px, 8vw, 42px);
    width: clamp(40px, 10vw, 50px);
    height: clamp(40px, 10vw, 50px);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(250, 249, 246, 0.9);
    border-radius: 50%;
    color: #4C3B34;
    font-weight: 300;
    line-height: 1;
    z-index: 25;
    transition: background 0.3s ease, transform 0.3s ease;
  }

  .popup-close:hover {
    background: rgba(250, 249, 246, 1);
    transform: scale(1.1);
  }


  .slides-container {
    width: 100%;
    height: 100%;
    min-height: 100%;
  }

  .slide {
    flex-direction: column;
    position: relative;
    height: auto;
    min-height: auto;
    inset: auto;
  }

  .slide-left {
    display: contents;
    position: static !important;
    width: 100%;
  }

  .slide-right {
    flex: 0;
    order: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: clamp(15px, 2vh, 25px) clamp(15px, 4vw, 25px);
    overflow: visible;
    justify-content: flex-start;
    box-sizing: border-box;
  }

  .slide-title {
    font-size: clamp(22px, 5.5vw, 30px);
    margin-bottom: clamp(10px, 1.5vh, 15px);
  }

  .slide-text {
    font-size: clamp(16px, 4vw, 22px);
    line-height: 1.6;
    letter-spacing: 0.1em;
  }

  .read-more-text {
    font-size: clamp(16px, 4vw, 22px);
    margin-left: 4px;
  }

  .slide-text-wrapper {
    order: 1;
  }

  .slide-thumbs {
    display: none !important;
  }

  .slide-thumbs img {
    display: none !important;
  }

  .image-carousel {
    display: block !important;
    order: 2;
    width: 100% !important;
    height: auto !important;
    min-height: clamp(250px, 35vh, 400px) !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .image-carousel .carousel-container {
    display: block !important;
    width: 100% !important;
    height: clamp(250px, 35vh, 400px) !important;
    position: relative !important;
    overflow: hidden !important;
    visibility: visible !important;
  }
  
  .image-carousel .carousel-slide {
    display: block !important;
    visibility: visible !important;
  }
  
  .image-carousel .carousel-slide.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  
  .image-carousel .carousel-slide img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .slide-left .review-content {
    order: 3;
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    width: 100%;
    height: auto;
    background: #817773;
    padding: clamp(15px, 2vh, 25px) clamp(15px, 4vw, 25px);
    box-sizing: border-box;
    display: block;
    overflow: visible;
    transition: none;
    margin: clamp(15px, 2vh, 25px) 0 0 0;
    z-index: auto;
  }

  .slide-left .review-overlay {
    display: none;
  }

  .review-open-text {
    font-size: clamp(16px, 4vw, 22px);
    line-height: 1.6;
    letter-spacing: 0.1em;
  }

  .read-more-text-review {
    font-size: clamp(16px, 4vw, 22px);
    line-height: 1.6;
    letter-spacing: 0.1em;
  }

  .slide-left img {
    display: none !important;
  }
  
  .slide-main-image {
    display: none !important;
  }

  /* Image Carousel Mobile Styles */
  .image-carousel {
    display: block !important;
    width: 100%;
    height: auto;
    min-height: clamp(250px, 35vh, 400px);
    position: relative;
    order: 2;
    margin: clamp(15px, 2vh, 25px) 0 0 0;
  }

  .carousel-container {
    width: 100%;
    height: clamp(250px, 35vh, 400px);
    position: relative;
    overflow: hidden;
  }

  .carousel-slide {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: block !important;
    visibility: visible !important;
  }

  .carousel-slide.active {
    opacity: 1 !important;
    z-index: 10 !important;
    visibility: visible !important;
    display: block !important;
  }
  
  .carousel-slide:first-child {
    opacity: 1 !important;
    z-index: 10 !important;
  }

  .carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  /* Story popup content */
  .story-popup-content {
    padding: clamp(20px, 3vh, 35px) clamp(15px, 4vw, 25px);
    width: 100%;
    box-sizing: border-box;
  }

  .story-popup-text {
    font-size: clamp(16px, 4vw, 22px);
    line-height: 1.6;
    letter-spacing: 0.1em;
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  /* Review text in popup */
  .popup .review-text {
    font-size: clamp(14px, 3.5vw, 20px);
    line-height: 1.6;
    letter-spacing: 0.1em;
  }
}