/**
 * Services Section Block Styles
 *
 * Full-width white section with a centered heading, a short 4px accent line and
 * a carousel of service cards (icon, title, description, gradient button)
 * navigated with previous/next arrows.
 *
 * Reference design: child-theme-sections-screenshots/services-section.png
 *
 * @package ACF Child Theme
 */

:root {
    --color-grey: #f3f3f3;
    --color-navy: #0d1e3b;
    --color-teal: #17abc1;
    --color-text: #252525;
    --color-blue: #004e95;
    --color-white: #ffffff;
    --font-primary: 'Montserrat', sans-serif;
}

/* Section wrapper - full-width white background
   ========================================================================== */
.services-section {
    width: 100%;
    margin: 0;
    padding: 70px 0;
    background-color: var(--color-white, #ffffff);
    font-family: var(--font-primary), 'Montserrat', sans-serif;
}

.services-section__container {
    /* Full display width (per design), not the constrained layout width. */
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 40px;
}

/* Heading + accent line
   ========================================================================== */
.services-section__title {
    margin: 0 0 18px 0;
    font-family: var(--font-primary), 'Montserrat', sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-navy, #0d1e3b);
    text-align: center;
}

.services-section__line {
    display: block;
    width: 60px;
    height: 4px;
    margin: 0 auto 45px auto;
    background-color: var(--color-teal, #17abc1);
}

/* Carousel layout: prev arrow | viewport | next arrow
   ========================================================================== */
.services-section__carousel {
    display: flex;
    align-items: center;
    gap: 16px;
}

.services-section__viewport {
    flex: 1 1 auto;
    overflow: hidden;
    /* Padding gives the card shadow room to breathe within the clip. */
    padding: 12px 6px;
    margin: -12px -6px;
}

.services-section__track {
    --gap: 24px;
    --per-view: 4;
    display: flex;
    gap: var(--gap);
    list-style: none;
    margin: 0;
    padding: 0;
    transition: transform 0.4s ease;
    will-change: transform;
}

/* Navigation arrows
   ========================================================================== */
.services-section__nav {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 128px;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--color-teal, #17abc1);
    transition: color 0.3s ease, opacity 0.3s ease;
}

.services-section__nav svg {
    width: 104px;
    height: 104px;
    display: block;
}

.services-section__nav:hover,
.services-section__nav:focus-visible {
    color: var(--color-blue, #004e95);
    outline: none;
}

.services-section__nav:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Service card
   ========================================================================== */
.services-section__card {
    flex: 0 0 calc((100% - (var(--gap) * (var(--per-view) - 1))) / var(--per-view));
    max-width: calc((100% - (var(--gap) * (var(--per-view) - 1))) / var(--per-view));
    display: flex;
    flex-direction: column;
    background-color: var(--color-white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(13, 30, 59, 0.1);
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.services-section__card:hover,
.services-section__card:focus-within {
    box-shadow: 0 12px 30px rgba(13, 30, 59, 0.16);
    transform: translateY(-3px);
}

.services-section__card-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 44px 36px 38px;
}

.services-section__card-icon {
    width: 96px;
    height: 96px;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.services-section__card-icon img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.services-section__card-title {
    margin: 0 0 16px 0;
    font-family: var(--font-primary), 'Montserrat', sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-navy, #0d1e3b);
}

.services-section__card-description {
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-text, #252525);
}

.services-section__card-description p {
    margin: 0 0 12px 0;
}

.services-section__card-description p:last-child {
    margin-bottom: 0;
}

/* Gradient button anchored to the bottom of the card
   ========================================================================== */
.services-section__card-button {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: linear-gradient(to right, var(--color-teal, #17abc1), var(--color-blue, #004e95));
    color: var(--color-white, #ffffff);
    font-family: var(--font-primary), 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.services-section__card-button:hover,
.services-section__card-button:focus-visible {
    background: var(--color-navy, #0d1e3b);
    color: var(--color-white, #ffffff);
    outline: none;
}

.services-section__card-button-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.services-section__card-button-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* Responsive - Tablet (two cards per view)
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1023px) {
    .services-section {
        padding: 60px 0;
    }

    .services-section__container {
        padding: 0 28px;
    }

    .services-section__title {
        font-size: 26px;
    }

    .services-section__track {
        --per-view: 2;
    }
}

/* Responsive - Mobile (one card per view)
   ========================================================================== */
@media (max-width: 768px) {
    .services-section {
        padding: 50px 0;
    }

    .services-section__container {
        padding: 0 16px;
    }

    .services-section__title {
        font-size: 22px;
    }

    .services-section__line {
        margin-bottom: 36px;
    }

    .services-section__carousel {
        gap: 6px;
    }

    .services-section__track {
        --per-view: 1;
        --gap: 16px;
    }

    .services-section__card-body {
        padding: 36px 26px 30px;
    }

    .services-section__card-icon {
        width: 84px;
        height: 84px;
        margin-bottom: 22px;
    }

    .services-section__nav {
        width: 44px;
        height: 44px;
    }

    .services-section__nav svg {
        width: 34px;
        height: 34px;
    }
}
