/**
 * Service Page Styles
 * 
 * Styles for single-services.php template
 */

/* ================================
   Service Page Base
   ================================ */

.single-services {
    overflow: unset !important;
    --background--color: #FDFBF7;
    background-color: var(--background--color);

    footer > div {
        margin-top: 0;
    }
}

.service-hero {
    position: sticky;
    z-index: 30;
    top: var(--header-height, 80px);
    background-color: var(--background--color);
}

.service-page {
    --e-global-color-primary: #FFA01F;
    --border-color: #696969;
    font-family: var(--e-global-typography-accent-font-family);
    color: var(--e-global-color-secondary);

    .h1, .h2, .h3,
    h1, h2, h3 {
        font-family: var(--e-global-typography-primary-font-family);
    }

    .h1,
    h1 {
        font-size: 36px;
        font-weight: 900;
        line-height: 1.1;
        letter-spacing: 0.01em;
        color: #231F20;
    }

    .h2,
    h2 {
        font-size: 22px;
        font-weight: 900;
        line-height: 1.2;
        letter-spacing: 0.02em;
    }

    .h3,
    h3 {
        font-size: 20px;
        font-weight: 800;
        line-height: 1.2;
    }

    .h4,
    h4 {
        font-size: 19px;
        font-weight: 700;
        line-height: 1.1;
        letter-spacing: 0.01em;
    }

    .p,
    p {
        font-size: 19px;
        font-weight: 400;
        line-height: 1.1;
        letter-spacing: 0;
    }

    .s-button {
        font-size: 18px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0;
        text-transform: none;
        color: #fff;
        background-color: #E376D5;
        padding: 12px 32px;
        border-radius: 80px;
        display: inline-block;
        transition: background-color 0.3s;
    }

    .s-button:hover {
        background-color: #de59cc;
    }

    .service-img,
    .service-video {
        max-width: 100%;
        height: auto;
        display: block;
    }

    @media (max-width: 768px) {
        .h1, h1 {
            font-size: 22px;
        }

        .h2, h2 {
            font-size: 17px;
        }

        .h3, h3 {
            font-size: 16px;
        }

        .h4, h4 {
            font-size: 18px;
        }

        .p, p {
            font-size: 18px;
        }
    }
}

/* ================================
   Hero Section
   ================================ */
.service-hero {
    border-top: 3px solid #ECD4C3;
    border-bottom: 3px solid #ECD4C3;
}

.service-hero__container {
    max-width: 1440px;
    padding: 16px 40px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.service-hero__nav {
    flex: 1;
    display: flex;
}

.service-hero__nav--prev {
    justify-content: flex-start;
}

.service-hero__nav--next {
    justify-content: flex-end;
}

.service-hero__nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--e-global-color-primary);
    font-size: 19px;
    font-weight: 700;
    transition: color 0.3s;
}

.service-hero__nav-link:hover {
    color: var(--e-global-color-secondary);
}

.service-hero__content {
    flex: 3;
    text-align: center;
}

.service-page .service-hero__subtitle {
    font-weight: 600;
    color: var(--e-global-color-primary);
    margin: 0 0 3px 0;
    text-transform: none;
}

.service-page .service-hero__title {
    color: var(--e-global-color-secondary);
    margin: 0;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

@media (max-width: 768px) {
    .service-hero {
        padding: 16px;
    }

    .service-hero__content {
        flex: 8;
    }
    
    .service-hero__title {
        font-size: 22px;
    }

    .service-hero__subtitle {
        font-size: 18px;
    }
    
    .service-hero__nav-text {
        display: none;
    }

    .service-hero__container {
        padding: 0 5px;
    }
}

/* ================================
   Sections - Sticky Stacking Effect
   ================================ */

.section_1,
.section_2 {
    padding: 0 16px;
    position: sticky;
    top: min(var(--hero-sticky-top, 80px), calc(100dvh - var(--section-height, 100dvh)));
    background-color: var(--background--color, #FDFBF7);
}

.section_2 {
    top: min(calc(var(--hero-sticky-top, 80px) - 2px), calc(100dvh - var(--section-height, 100dvh)));
}

.section_1 {
    z-index: 10;
}

.section_2 {
    z-index: 20;
}

.section_2 .section-container,
.section_3 .section-container {
    border-top: 1px solid #696969;
}

.section_3,
.section_4 {
    position: relative;
    z-index: 25;
    background-color: var(--background--color, #FDFBF7);
}

.section-container {
    max-width: 1280px;
    margin: 0 auto;
}

.section-block {
    margin: 0;
    padding: 64px 92px;
    border-bottom: 1px solid var(--border-color);
}

.section-block:last-child {
    border-bottom: none;
}

.bottom-block {
    padding: 96px 108px;
}

.content-block .content-media {
    flex: 1.78;
}

.content-block .content-html {
    flex: 1;

    h1, h2, h3, p {
        margin: 0 0 24px;
    }

    h4, h5, h6,
    p:last-child {
        margin: 0;
    }
}

.content-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 64px;
}

.s2-block--3__row_1,
.s1-block--3__row_1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 64px;
    padding-bottom: 96px;
}

.bottom-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 64px;
    padding-top: 96px;
}

.bottom-block__img-secondary {
    flex: 1;
    max-width: 436px;
}

.bottom-block__text-content {
    flex: 1;
    max-width: 400px;

    h1, h2, h3, p {
        margin: 0 0 16px;
    }

    h4, h5, h6,
    p:last-child {
        margin: 0;
    }

    a {
        margin-top: 26px;
    }
}

@media (max-width: 1024px) {
    .service-page .section-block {
        padding: 40px 0;
    }

    .section-block:first-child {
        padding-top: 32px;
    }

    .section-block:last-child {
        padding-bottom: 64px;
    }
}

@media (max-width: 768px) {
    .section-block {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .section-block:last-child {
        padding-top: 64px;
    }

    .section_2 .content-block {
        flex-direction: column-reverse;
    }

    .section-block:nth-child(3) {
        padding-bottom: 32px;
    }

    .bottom-block {
        padding-top: 64px;
        flex-direction: column-reverse;
        gap: 32px;
    }

    .bottom-block__text-content {
        h1, h2, h3 {
            padding: 0 40px;
            margin-bottom: 8px;
        }

        a {
            margin-top: 8px;
        }
    }
}

/* ================================
   Responsive Media (Desktop/Mobile variants)
   ================================ */

.responsive-media-wrapper {
    width: 100%;
}

/* Default: show desktop, hide mobile */
.responsive-media-wrapper .media-desktop {
    display: block;
}

.responsive-media-wrapper .media-mobile {
    display: none;
}

/* When mobile variant exists and viewport is mobile, swap visibility */
@media (max-width: 768px) {
    .responsive-media-wrapper.has-mobile-variant .media-desktop {
        display: none;
    }
    
    .responsive-media-wrapper.has-mobile-variant .media-mobile {
        display: block;
    }
}
