/* ============================================================
   Services page (page-services.php)
   Depends on css/front-page.css for the --fp-* token layer.
   ============================================================ */

:root {
    /* Arc segment palette — new tokens introduced by the Services Figma frame. */
    --fp-orange: #f6a125;
    --fp-sky:    #2aacf1;
    --fp-arc-hover: #a3baec;
}

/* ── Hero (services variant) ───────────────────────────────── */

/* Flat navy band with the white circuit line-art on the right; no dark
   gradient overlay (the Figma hero has none). */
.fp-hero--services {
    background-color: var(--fp-navy);
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
    min-height: clamp(320px, 31.8vw, 610px);
}

.fp-hero--services::before {
    display: none;
}

/* ── Intro (concept → design → production) ─────────────────── */

/* Full-width anchor for the Contact sticker, which positions itself
   (right:0, negative bottom) against this wrap's box — independent of
   .fp-svc-intro's own top offset, so removing that offset below doesn't
   move the sticker relative to the panel. */
.fp-svc-intro-wrap {
    background: var(--fp-bg-light);
    position: relative;
}

/* The hero's own ::after now provides the curved transition into this
   section (shared .fp-hero mechanism, front-page.css) — plain content
   block in normal flow, still inset to match the Figma intro width. */
.fp-svc-intro {
    position: relative;
    background: var(--fp-bg-light);
    max-width: min(1588px, 91.5vw);
    margin: 0 auto;
    padding: var(--fp-hero-gap) 0;
}

.fp-intro-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 4.7vw, 90px);
    margin-bottom: clamp(36px, 3.5vw, 68px);
}

.fp-intro-steps__label {
    font-family: var(--fp-font-heading);
    font-size: clamp(28px, 2.24vw, 43px);
    letter-spacing: 0.02em;
    line-height: 1.5;
    text-transform: uppercase;
    color: var(--fp-text);
}

.fp-intro-steps__arrow {
    width: clamp(36px, 2.95vw, 57px);
    height: auto;
    flex-shrink: 0;
}

/* Arrows wipe in left→right when the row enters view. The custom data-aos
   value carries none of AOS's built-in motion, so the labels around the
   arrows never move; AOS only toggles .aos-animate. A keyframes animation
   (not a transition) so the wipe still plays when AOS flags an in-view row
   before the first paint — a transition needs a rendered start state. */
[data-aos="svc-arrow-wipe"] .fp-intro-steps__arrow {
    clip-path: inset(0 100% 0 0);
}

[data-aos="svc-arrow-wipe"].aos-animate .fp-intro-steps__arrow {
    animation: fp-arrow-wipe 0.35s ease-out forwards;
}

[data-aos="svc-arrow-wipe"].aos-animate .fp-intro-steps__arrow:nth-of-type(2) {
    animation-delay: 0.15s;
}

@keyframes fp-arrow-wipe {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

.fp-svc-intro__body {
    font-family: var(--fp-font-body);
    font-size: var(--fp-body-size);
    line-height: var(--fp-body-lh);
    color: var(--fp-text);
    text-align: justify;
    margin: 0;
}

.fp-svc-intro__body p {
    margin: 0;
}

.fp-svc-intro__body p + p {
    margin-top: 1em;
}

/* ── CTA sticker (ribbon banner) ───────────────────────────── */
/* Copied from css/about-pronat.css so the Services page is self-contained;
   the About page and its stylesheet are intentionally untouched. */

.fp-sticker {
    position: absolute;
    z-index: 6;
    display: flex;
    align-items: center;
    width: min(384px, 92vw);
    min-height: clamp(120px, 11vw, 161px);
    padding-top: 16px;
    padding-bottom: 16px;
    text-decoration: none;
    bottom: clamp(-80px, -5.5vw, -40px);
}

.fp-sticker::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--fp-red);
    z-index: -1;
}

.fp-sticker::after {
    content: '';
    position: absolute;
    top: 100%;
    width: 29px;
    height: 26px;
    background: #8c0002;
}

.fp-sticker__text {
    font-family: var(--fp-font-body);
    font-weight: 500; /* QA round: designer overrode the Figma 600 */
    font-size: clamp(20px, 1.6vw, 29px);
    line-height: 1.25;
    color: var(--fp-white);
    max-width: 280px;
}

.fp-sticker--right {
    right: 0;
    padding-left: 112px;
    padding-right: 30px;
}

/* Desktop: center the label in the red body right of the notch (the
   notch tip sits at 24% of the 384px ribbon ≈ 92px). Mobile keeps its
   own padding/alignment overrides below. */
@media (min-width: 576px) {
    .fp-sticker--right {
        justify-content: center;
        padding-left: 92px;
        padding-right: 0;
    }
}

.fp-sticker--right::before {
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 24% 50%);
}

.fp-sticker--right::after {
    right: 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.fp-sticker--left {
    left: 0;
    padding-left: 40px;
    padding-right: 112px;
}

.fp-sticker--left::before {
    clip-path: polygon(0% 0%, 100% 0%, 76% 50%, 100% 100%, 0% 100%);
}

.fp-sticker--left::after {
    left: 0;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.fp-sticker:hover .fp-sticker__text {
    text-decoration: underline;
}

/* ── Manufacturing services overview (navy panel) ──────────── */

.fp-svc-overview {
    position: relative;
    background: var(--fp-navy);
    border-radius: 60px 60px 0 0;
    padding: var(--fp-section-py) 0;
    color: var(--fp-white);
}

.fp-svc-overview .fp-section-title {
    color: var(--fp-white);
}

/* ── Division links row (inside the navy panel) ────────────── */

.fp-svc-divisions {
    margin-top: clamp(48px, 4vw, 76px);
    text-align: center;
}

.fp-svc-divisions__note {
    font-family: var(--fp-font-body);
    font-weight: 700;
    font-size: 20px;
    line-height: 33px;
    color: var(--fp-white);
    margin: 0 0 clamp(20px, 1.8vw, 34px);
}

.fp-svc-divisions__links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(20px, 3vw, 58px);
}

.fp-svc-divisions__link {
    font-family: var(--fp-font-body);
    font-weight: 700;
    font-size: clamp(22px, 1.67vw, 32px);
    line-height: 1.45;
    color: var(--fp-white);
    text-decoration: none;
}

.fp-svc-divisions__link:hover,
.fp-svc-divisions__link:focus-visible {
    color: var(--fp-white);
    text-decoration: underline;
}

.fp-svc-divisions__sep {
    font-weight: 700;
    font-size: clamp(22px, 1.67vw, 32px);
    color: var(--fp-white);
    user-select: none;
}

/* ── Production environments & services ────────────────────── */

.fp-svc-env {
    background: var(--fp-bg-light);
    padding: var(--fp-section-py) 0;
}

.fp-svc-env__row {
    display: flex;
    align-items: flex-start;
    gap: clamp(48px, 7.5vw, 144px);
    margin-top: clamp(60px, 6vw, 118px);
}

.fp-svc-env__row--reverse {
    flex-direction: row-reverse;
}

.fp-svc-env__content {
    flex: 1 1 45%;
    min-width: 0;
}

.fp-svc-env__title {
    font-family: var(--fp-font-heading);
    font-size: var(--fp-heading-size);
    color: var(--fp-text);
    text-transform: uppercase;
    line-height: 1.15;
    margin: 0 0 clamp(16px, 1.3vw, 25px);
}

.fp-svc-env__text {
    font-family: var(--fp-font-body);
    font-size: var(--fp-body-size);
    line-height: var(--fp-body-lh);
    color: var(--fp-text);
    text-align: justify;
    margin: 0;
}

.fp-svc-env__text p {
    margin: 0;
}

.fp-svc-env__text p + p {
    margin-top: 1em;
}

.fp-svc-env__figure {
    flex: 1 1 45%;
    margin: 0;
    aspect-ratio: 697 / 463;
    border-radius: var(--fp-radius-card);
    overflow: hidden;
}

.fp-svc-env__figure img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── Arc capability selector ───────────────────────────────── */

.fp-arc {
    display: flex;
    align-items: center;
    gap: 24px;
    max-width: 1108px;
    margin-inline: auto;
}

.fp-arc__stage {
    position: relative;
}

.fp-arc__svg {
    display: none;
}

/* Buttons: strip UA styles; the visual lives on .fp-arc__label. */
.fp-arc__item {
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    user-select: none;
    text-align: left;
}

.fp-arc__label {
    display: inline-block;
    font-family: var(--fp-font-body);
    font-size: 20px;
    line-height: 33px;
    letter-spacing: 0.01em;
    color: var(--fp-white);
    white-space: nowrap;
    border-radius: 5px;
    padding: 6px 10px;
    transition: color 0.13s, background 0.16s;
}

.fp-arc__item:not(.is-active):hover .fp-arc__label,
.fp-arc__item:not(.is-active):focus-visible .fp-arc__label {
    color: var(--fp-arc-hover);
}

.fp-arc__item:focus-visible {
    outline: 2px solid var(--fp-white);
    outline-offset: 2px;
    border-radius: 5px;
}

.fp-arc__item.is-active .fp-arc__label {
    background: var(--fp-arc-gc, var(--fp-red));
    color: var(--fp-white);
    font-weight: 500;
}

.fp-arc__card {
    background: var(--fp-white);
    border-left: 9px solid var(--fp-red);
    border-radius: var(--fp-radius-card);
    box-shadow: 3px 3px 42px 0 rgba(0, 0, 0, 0.1);
    padding: 37px 39px;
    transition: border-color 0.22s;
}

.fp-arc__card-text {
    margin: 0;
    font-family: var(--fp-font-body);
    font-size: 20px;
    line-height: 33px;
    color: #000;
}

.fp-arc__legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 32px;
    list-style: none;
    margin: 32px 0 0;
    padding: 0;
}

.fp-arc__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--fp-font-body);
    font-size: 16px;
    color: var(--fp-white);
}

.fp-arc__legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 auto;
}

/* Desktop: labels ride the arc; positions are set inline by js/services.js. */
@media (min-width: 992px) {
    .fp-arc {
        height: 562px;
    }

    .fp-arc__stage {
        flex: 0 0 57%;
        height: 100%;
    }

    .fp-arc__svg {
        display: block;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .fp-arc__item {
        position: absolute;
        transform: translateY(-50%);
    }

    /* Avoid a top-left pile-up in the instant before JS assigns positions. */
    .fp-arc:not(.fp-arc--ready) .fp-arc__item {
        visibility: hidden;
    }

    .fp-arc__card {
        flex: 1;
        min-width: 0;
        align-self: center;
    }
}

/* Wide desktop: the Figma arc block is 616px tall — use it 1:1 so the
   52px row rhythm matches the design exactly. */
@media (min-width: 1200px) {
    .fp-arc {
        height: 616px;
    }
}

/* Below lg: stacked list, group colour as left border; js/services.js
   moves the card under the active item for an accordion feel. */
@media (max-width: 991.98px) {
    .fp-arc {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .fp-arc__list {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .fp-arc__item {
        display: block;
        width: 100%;
        border-left: 6px solid var(--fp-arc-gc, var(--fp-red));
        border-radius: 0 5px 5px 0;
        padding: 2px 0;
    }

    .fp-arc__label {
        font-size: 17px;
        line-height: 26px;
        white-space: normal;
    }

    .fp-arc__item.is-active .fp-arc__label {
        background: none;
        font-weight: 500;
    }

    .fp-arc__item.is-active {
        background: var(--fp-arc-gc, var(--fp-red));
    }

    .fp-arc__card {
        margin: 10px 0;
        padding: 24px 22px;
    }

    .fp-arc__card-text {
        font-size: 16px;
        line-height: 1.65;
    }

    .fp-svc-env__row,
    .fp-svc-env__row--reverse {
        flex-direction: column;
        gap: 28px;
    }

    .fp-svc-env__figure {
        width: 100%;
    }

    .fp-svc-divisions__links {
        flex-direction: column;
        gap: 12px;
    }

    .fp-svc-divisions__sep {
        display: none;
    }
}

/* Small screens: sticker scale-down (mirrors the About-page overrides). */
@media (max-width: 575.98px) {
    .fp-sticker {
        min-height: 96px;
        bottom: 0;
        transform: translateY(50%);
        width: min(384px, 72vw);
    }

    .fp-sticker--right {
        padding-left: 88px;
        padding-right: 20px;
        text-align: right;
    }

    .fp-sticker--left {
        text-align: left;
        padding-left: 20px;
        padding-right: 88px;
    }

    .fp-sticker__text {
        font-size: 17px;
        max-width: 180px;
    }

    .fp-sticker::after {
        width: 20px;
        height: 18px;
    }

    .fp-svc-intro {
        max-width: 100%;
        border-radius: 40px 40px 0 0;
    }

    .fp-intro-steps {
        flex-direction: column;
        gap: 10px;
    }

    .fp-intro-steps__arrow {
        transform: rotate(90deg);
        width: 32px;
    }
}
