/* ── App Development Services – Public CSS ── */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700&family=Plus+Jakarta+Sans:wght@400;700&display=swap');

/* ── Section ── */
.appdev-section {
    width: 100%;
    padding: 60px 24px 80px;
    box-sizing: border-box;
    /* background: #fff; */
}

/* ── Section Heading ── */
.appdev-section__head {
    max-width: 900px;
    margin: 0 auto 50px;
    text-align: center;
}

.appdev-section__title {
    font-family: 'Syne', sans-serif;
    font-weight: 700;
    font-size: 40px;
    line-height: 100%;
    letter-spacing: 0;
    color: #191919;
    margin: 0 0 18px;
}

.appdev-section__desc {
    font-family: 'Google Sans', sans-serif;
    font-weight: 400;
    font-size: 22px;
    line-height: 140%;
    color: #778AA9;
    margin: 0 auto;
    max-width: 793px;
}

/* ── Grid — flex wrap so an incomplete last row stays centered ── */
.appdev-grid {
    --appdev-gap: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* leftover cards in the last row center themselves */
    gap: var(--appdev-gap);
    max-width: 1600px;
    margin: 0 auto;
    align-items: flex-start; /* allows zigzag via margin-top without stretching rows */
    width: 100%;
    box-sizing: border-box;
}

/* JS applies one of these classes based on the saved column setting + current breakpoint.
   Card flex-basis = one Nth of the row minus the shared gaps, so full rows fill exactly
   and shorter rows center. */
.appdev-grid--cols-1 .appdev-service-card { flex: 0 0 305px; }
.appdev-grid--cols-2 .appdev-service-card { flex: 0 0 calc((100% - 1 * var(--appdev-gap)) / 2); }
.appdev-grid--cols-3 .appdev-service-card { flex: 0 0 calc((100% - 2 * var(--appdev-gap)) / 3); }
.appdev-grid--cols-4 .appdev-service-card { flex: 0 0 calc((100% - 3 * var(--appdev-gap)) / 4); }
.appdev-grid--cols-5 .appdev-service-card { flex: 0 0 calc((100% - 4 * var(--appdev-gap)) / 5); }
.appdev-grid--cols-6 .appdev-service-card { flex: 0 0 calc((100% - 5 * var(--appdev-gap)) / 6); }

/* ── Card ── */
.appdev-service-card {
    max-width: 100%;
    background: #FFFFFF;
    border-radius: 35px;
    box-shadow: 0px 0px 25px 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 20px 28px;
    box-sizing: border-box;
    transition: transform .25s ease, box-shadow .25s ease;
    overflow: hidden; /* clips image corners to the 35px card border-radius */
    position: relative;
}

.appdev-service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0px 12px 40px 4px rgba(0, 0, 0, 0.10);
}

/* Zigzag — odd cards sit 60px lower (Figma: first card top 1059, second top 1119) */
.appdev-card--down {
    margin-top: 60px;
}

/* ── Image area ── */
.appdev-service-card__img-wrap {
    width: 100%;
    aspect-ratio: 265 / 288; /* scales height proportionally — no fixed px that causes overflow */
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.appdev-service-card__img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.appdev-service-card__no-img {
    font-size: 56px;
    opacity: .25;
}

/* ── Card text ── */
.appdev-service-card__body {
    width: 100%;
    text-align: center;
    padding: 0 4px;
}

.appdev-service-card__title {
    font-family: 'Plus Jakarta Sans', 'Google Sans', 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 130%;
    color: #191919;
    margin: 0 0 8px;
    text-align: center;
}

.appdev-service-card__desc {
    font-family: 'Plus Jakarta Sans', 'Google Sans', 'Roboto', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 150%;
    color: #778AA9;
    margin: 0;
    text-align: center;
}

/* ── Empty ── */
.appdev-section__empty {
    text-align: center;
    color: #778AA9;
    font-size: 16px;
    padding: 40px;
}

/* ══════════════════════════════════
   Responsive
   ══════════════════════════════════ */

@media (max-width: 900px) {
    .appdev-section__title { font-size: 30px; }
    .appdev-section__desc  { font-size: 18px; }
    .appdev-grid           { --appdev-gap: 14px; }
    .appdev-card--down     { margin-top: 40px; }
}

@media (max-width: 600px) {
    .appdev-section       { padding-top: 40px; padding-bottom: 60px; }
    .appdev-section__title { font-size: 26px; }
    .appdev-section__desc  { font-size: 16px; }
    .appdev-grid           { --appdev-gap: 14px; }

    /* No zigzag on single-column mobile */
    .appdev-grid--cols-1 .appdev-card--down { margin-top: 0; }
}

/* ══════════════════════════════════
   Scroll-reveal entrance — per-section distinct animations
   ──────────────────────────────────────────────────────────────────────
   The shortcode outputs ONE .appdev-section built from two structurally
   distinct blocks: the heading/intro (.appdev-section__head) and the
   services-cards grid (.appdev-service-card). Each block gets its OWN
   entrance animation. When the shortcode is placed more than once on a
   page the resulting sections are structurally identical, so the animation
   set is ALTERNATED per .appdev-section via :nth-of-type(odd|even) —
   consecutive sections always look different:

     ODD  sections:  heading = slide-from-left   · cards = zoom-pop
     EVEN sections:  heading = slide-from-right   · cards = 3D flip-in

   opacity + transform ONLY — no layout shift, no filter/blur on the
   bordered cards (the flip uses rotateX, a transform). Slow premium
   1.2s cubic-bezier(0.16,1,0.3,1) with staggered cards; the longest
   card (0.82s delay + 1.2s) finishes at ~2.02s, inside the JS cleanup
   window (2.4s), which then strips the classes back to the resting state.
   JS toggles .appdev-reveal / .appdev-in — trigger unchanged.
   ══════════════════════════════════ */
@media (prefers-reduced-motion: no-preference) {

    /* Shared hidden state + slow premium easing (opacity + transform only) */
    .appdev-section.appdev-reveal .appdev-section__head,
    .appdev-section.appdev-reveal .appdev-service-card {
        opacity: 0;
        will-change: opacity, transform;
        transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1),
                    transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    /* Heading/intro leads; cards follow in a staggered sequence
       (shared timing across every animation variant) */
    .appdev-section.appdev-reveal .appdev-section__head             { transition-delay: 0s; }
    .appdev-section.appdev-reveal .appdev-service-card              { transition-delay: 0.22s; }
    .appdev-section.appdev-reveal .appdev-service-card:nth-child(2)  { transition-delay: 0.32s; }
    .appdev-section.appdev-reveal .appdev-service-card:nth-child(3)  { transition-delay: 0.42s; }
    .appdev-section.appdev-reveal .appdev-service-card:nth-child(4)  { transition-delay: 0.52s; }
    .appdev-section.appdev-reveal .appdev-service-card:nth-child(5)  { transition-delay: 0.62s; }
    .appdev-section.appdev-reveal .appdev-service-card:nth-child(6)  { transition-delay: 0.72s; }
    .appdev-section.appdev-reveal .appdev-service-card:nth-child(n+7){ transition-delay: 0.82s; }

    /* ── ODD sections (1st, 3rd, …) ─────────────────────────────── */
    /* Heading/intro: slide-from-left */
    .appdev-section:nth-of-type(odd).appdev-reveal .appdev-section__head {
        transform: translateX(-46px);
    }
    /* Cards: zoom-pop */
    .appdev-section:nth-of-type(odd).appdev-reveal .appdev-service-card {
        transform: scale(0.84);
    }

    /* ── EVEN sections (2nd, 4th, …) ────────────────────────────── */
    /* Heading/intro: slide-from-right */
    .appdev-section:nth-of-type(even).appdev-reveal .appdev-section__head {
        transform: translateX(46px);
    }
    /* Cards: 3D flip-in (rotateX — transform only, no filter) */
    .appdev-section:nth-of-type(even).appdev-reveal .appdev-service-card {
        transform: perspective(900px) rotateX(26deg) translateY(26px);
        transform-origin: center top;
    }

    /* Revealed state — every variant settles to the natural resting
       transform. Uses .appdev-reveal.appdev-in (both classes are present
       during the entrance) so this matches the (0,0,4,0) specificity of
       the :nth-of-type hidden rules and, coming later, wins the cascade. */
    .appdev-section.appdev-reveal.appdev-in .appdev-section__head,
    .appdev-section.appdev-reveal.appdev-in .appdev-service-card {
        opacity: 1;
        transform: none;
    }
}
