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 1*/
.services-section1{
    margin-bottom: 10vh;
    margin-top: 70px;
}

.div-services-cards{
    display: flex;
}

.services-card {
    height: 50vh;
    position: relative;
    width: 33.33%;
    overflow: hidden;
}

.services-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        0deg,
        rgba(0,0,0,0.4)
    );
}

.services-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

.services-main-text {
    font-size: clamp(28px, 2vw, 40px);
    font-weight: 400;
    text-transform: uppercase;
    margin: 0;
    width: 42vh;
    color: #FAF9F6;
    transition: transform 0.5s ease, color 0.5s ease;
}

.services-card:hover .services-image,
.services-card:hover picture > img {
    transform: scale(1.1); /* увеличиваем фото */
}

.services-card:hover .services-main-text {
    transform: scale(1.05); /* аккуратное увеличение текста */
}

.half-ellipse {
    position: absolute;
    bottom: 0;

    width: 10vw;
    height: 4vh;
    background: #4C3B34;

    border-top-left-radius: 20vh;
    border-top-right-radius: 20vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    overflow: hidden;
}

.services-price{
    font-size: clamp(14px, 1.1vw, 20px);
    line-height: 1.5;
    letter-spacing: 0.12em;
    font-style: italic;
    color: #FAF9F6;
}


.services-content-without-img{
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2.5vh 5.3vh
}

.services-main-text-without-img{
    margin: 0;
    margin-bottom: 0.5vh;
    font-weight: 700;
    text-transform: uppercase;
    color: #4C3B34;
    font-size: clamp(16px, 1.2vw, 24px);
    line-height: 1.9;
    letter-spacing: 0.12em;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 800;
}

.portfolio-main-text-without-img{
    margin-top: 3.5vh;
}

.services-span-text{
    font-size: clamp(14px, 1vw, 20px);
    color: #817773;
    line-height: 1.9;
    letter-spacing: 0.12em;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 500;
}

.link-portfolio-instagram {
    font-family: 'Playfair';
    font-style: normal;
    color: #817773;
    text-decoration: underline;
    cursor: pointer;
    position: relative;
    
}

.link-portfolio-instagram:hover {
    font-weight: 700;
}


/*SECTION 2*/
.services-section2{
    margin-bottom: 10vh;
}

.div-split2{
    display: flex;
}

.div-left-facts-services{
    width: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.main-text-facts{
    margin: 0;
    margin-bottom: 3vh;
    font-size: clamp(24px, 2.5vw, 48px);
    color: #4C3B34;
    line-height: 1.9;
    letter-spacing: 0.05em;
    font-family: 'Playfair';
    font-style: normal;
    font-weight: 500;
}

.div-fact-item{
    border: 1px solid #817773;
    display: flex;
    align-items: center;
    width: 80%;
}

.div-fact-item-number{
    width: 15%;
    background: #4C3B34;

    display: flex;
    justify-content: center;
    align-items: center;

}

.div-left-facts-services .div-fact-item:not(:last-child) {
     margin-bottom: 7vh;
}

.fact-item-number{
    font-family: 'Montagu Slab', serif;
    font-weight: 500;
    font-style: normal;
    font-size: clamp(16px, 3vw, 64px);
    line-height: 1.9;
    letter-spacing: 0.05em;
    color: #FFFFFF;
}

.div-fact-item-text{
    display: flex;
    align-items: center;
    padding-left: 3vh;
    font-size: clamp(16px, 3vw, 24px);
    line-height: 1.8;
    letter-spacing: 0.1em;
}

.fact-item-text{
    font-weight: 300;
    font-size: clamp(16px, 1.4vw, 24px);
    line-height: 1.3;
    letter-spacing: 0.1em;
    color: #817773;
    text-transform: lowercase;
    display: inline-block;
    max-width: 45ch;
}

.btn-second-non-active{
    width: clamp(130px, 10vw, 245px);
    height: clamp(40px, 7vh, 56px);
    font-size: clamp(18px, 2vw, 36px);
    color: #FAF9F6;
    background-color: #4C3B34;
    border: 1.5px solid #FAF9F6;
    border-radius: 30px;
    cursor: pointer;

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

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

.div-right-fact-services{
    width: 50%;
}

.img-fact-services{
    width: 100%;
    object-fit: cover;
    height: 100%;
    max-height: 950px;
}

@media (max-width: 1024px) {
    .services-section1 {
        display: flex;
        flex-wrap: wrap;
    }
    
    .div-services-cards{
        display: contents; /* Makes children flow as if they're direct children of parent */
    }
    
    .services-card {
        width: 50%;
    }
    
    /* Reorder cards for mobile */
    .services-card-wedding {
        order: 1;
    }
    
    .services-card-corporate {
        order: 2;
    }
    
    .services-card-ceremony {
        order: 3;
    }
    
    .services-card-story {
        order: 4;
    }
    
    .services-card-gender {
        order: 5;
    }
    
    .services-card-graduation {
        order: 6;
    }
    .services-main-text-without-img{
        font-size: clamp(16px, 1.9vw, 24px);
    }
    .services-span-text{
        font-size: clamp(16px, 1.9vw, 24px);
    }
    .services-span-text br{
        display: none;
    }
    .div-left-facts-services .div-fact-item:not(:last-child) {
        margin-bottom: clamp(30px, 3.5vh, 100px);
    }
    .div-fact-item-number {
        min-width: 55px;
    }
    .fact-item-number {
        line-height: 2.2;
    }
    .div-fact-item-text br{
        display: none;
    }
}

@media (min-width: 481px) and (max-width: 1023px) {
    .services-content-without-img{
        padding: 0 3vw;
        margin: clamp(20px, 5vw, 65px) 0 0 0;
    }
    .services-main-text-without-img{
        font-size: clamp(32px, 4vw, 50px);
        margin: clamp(20px, 5vw, 65px) 0 0 0;
        letter-spacing: 0.05em;
        line-height: 1;
    }
    .services-span-text{
        font-size: clamp(25px, 3.5vw, 40px);
    }
    .services-section1 {
        display: flex;
        flex-wrap: wrap;
        margin-bottom: 0;
    }
    
    .div-services-cards{
        display: contents; /* Makes children flow as if they're direct children of parent */
    }
    
    .services-card {
        width: 100%;
    }
    
    /* Reorder cards for medium screens */
    .services-card-story {
        order: 1;
    }
    
    .services-card-wedding {
        order: 2;
    }
    
    .services-card-ceremony {
        order: 3;
    }
    
    .services-card-corporate {
        order: 4;
    }
    
    .services-card-gender {
        order: 5;
    }
    
    .services-card-graduation {
        order: 6;
    }

    .services-main-text{
        font-size: clamp(40px, 5.5vw, 60px);
    }

    .half-ellipse{
        width: 35vw;
        height: 3vh;
    }

    .services-price{
        font-size: clamp(25px, 3.5vw, 40px);
    }
    
    /* SECTION 2 */
    .services-section2{
        margin-bottom: 0;
    }
    .services-section2 .div-split2 {
        flex-direction: column-reverse;
    }
    
    .div-left-facts-services {
        width: 100%;
        padding: 2vh 0;
    }
    
    .div-right-fact-services {
        display: none;
    }
    
    .img-fact-services {
        height: 30vh;
        object-fit: cover;
    }
    
    .main-text-facts {
        font-size: clamp(28px, 5vw, 50px);
        margin: 0 0 2vh 0;
    }
    
    .div-left-facts-services .div-fact-item:not(:last-child) {
        margin-bottom: 2vh;
    }
    
    .fact-item-text {
        font-size: clamp(25px, 3.5vw, 40px);
        max-width: 30ch;
    }
    
    .fact-item-number {
        font-size: clamp(32px, 6vw, 60px);
        line-height: 3.5;
    }
    
    .btn-second-non-active {
        width: clamp(300px, 35vw, 400px);
        font-size: clamp(28px, 5vw, 50px);
    }
}

/* ---------- 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 ---------- */
  .services-section1 {
    margin-top: 0;
    margin-bottom: 0;
    padding-top: clamp(80px, 14vh, 100px);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .div-services-cards {
    display: contents;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .services-section1 > .div-services-cards {
    display: contents;
  }

  .services-card {
    width: 100% !important;
    max-width: 100%;
    height: clamp(250px, 30vh, 350px);
    min-height: clamp(250px, 30vh, 350px);
    box-sizing: border-box;
  }

  .services-card-story {
    height: auto;
    min-height: clamp(250px, 30vh, 350px);
  }

  /* Reorder cards for mobile - story card first */
  .services-card-story {
    order: 1 !important;
  }

  .services-card-wedding {
    order: 2 !important;
  }

  .services-card-corporate {
    order: 3 !important;
  }

  .services-card-ceremony {
    order: 4 !important;
  }

  .services-card-gender {
    order: 5 !important;
  }

  .services-card-graduation {
    order: 6 !important;
  }

  .services-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .services-main-text {
    font-size: clamp(24px, 6vw, 36px);
    width: 90%;
    max-width: 100%;
  }

  .half-ellipse {
    width: 50vw;
    height: clamp(30px, 4vh, 45px);
    border-top-left-radius: 15vh;
    border-top-right-radius: 15vh;
  }

  .services-price {
    font-size: clamp(14px, 3.5vw, 20px);
  }

  .services-content-without-img {
    padding: 2vh 4vw;
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2vh;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
    height: auto;
    min-height: clamp(250px, 30vh, 350px);
  }

  .services-main-text-without-img {
    font-size: clamp(20px, 5vw, 28px);
    margin: 0;
    line-height: 1.3;
    letter-spacing: 0.05em;
    font-weight: 500;
    text-align: center;
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
  }

  .services-span-text {
    font-size: clamp(18px, 4.5vw, 28px);
    text-align: left;
    line-height: 1.6;
    letter-spacing: 0.08em;
    margin: 0;
    max-width: 100%;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
  }

  /* ---------- SECTION 2 ---------- */
  .services-section2 {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    box-sizing: border-box;
    margin-bottom: 0;
  }

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

  .div-left-facts-services {
    width: 100%;
    max-width: 100%;
    padding: 2vh 4vw;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
  }

  .main-text-facts {
    font-size: clamp(28px, 7vw, 40px);
    margin: 0 0 2vh 0;
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.05em;
    font-weight: 500;
  }

  .div-fact-item {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .div-left-facts-services .div-fact-item:not(:last-child) {
    margin-bottom: 2vh;
  }

  .div-fact-item-number {
    width: 15%;
    min-width: 50px;
    box-sizing: border-box;
  }

  .fact-item-number {
    font-size: clamp(24px, 6vw, 40px);
    line-height: 3;
  }

  .div-fact-item-text {
    width: 85%;
    padding-left: clamp(15px, 3vw, 25px);
    box-sizing: border-box;
  }

  .fact-item-text {
    font-size: clamp(14px, 3.6vw, 24px);
    line-height: 1.4;
    letter-spacing: 0.08em;
    max-width: 100%;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
  }

  .div-right-fact-services {
    display: none;
  }

  .img-fact-services {
    display: none;
  }

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