/* ==========================================================================
   Edy London: Celebrities page (page-celebrities.php)
   The hero reuses the Home visit hero (.el-hv-hero, home-visit.css) and the
   breadcrumb rules of services-archive.css; press and booking reuse the
   front page parts. This file adds the mobile hero order,
   the intro rows with Instagram posts, the Instagram carousel and the
   Edy Features cards.
   Breakpoints: 1024px (tablet), 900px (stack), 767px (mobile).
   ========================================================================== */

/* ---------- Intro: Instagram post + text, alternating sides */
.el-celeb-intro__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(40px, 6vw, 96px);
    align-items: center;
}

.el-celeb-intro__row + .el-celeb-intro__row {
    margin-top: clamp(56px, 7vw, 96px);
}

.el-celeb-intro__post {
    display: flex;
    justify-content: center;
    min-width: 0;
}

/* Instagram's embed.js sets its own sizes; keep it within the column. */
.el-celeb-intro__post .instagram-media,
.el-celeb-intro__post iframe {
    width: 100% !important;
    max-width: 540px !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.el-celeb-intro__text p {
    max-width: 34em;
}

/* ---------- Instagram carousel: centred active post, faded neighbours */
.el-celeb-insta {
    --el-insta-slide: clamp(260px, 24vw, 360px);
    --el-insta-gap: 60px;
    position: relative;
    overflow: hidden;
}

.el-celeb-insta__viewport {
    overflow: hidden;
}

.el-celeb-insta__track {
    display: flex;
    align-items: center;
    gap: var(--el-insta-gap);
    margin: 0;
    padding: 0;
    list-style: none;
    transition: transform .45s ease;
}

.el-celeb-insta__slide {
    position: relative;
    flex: 0 0 var(--el-insta-slide);
    aspect-ratio: 4 / 5;
    opacity: .4;
    transform: scale(.92);
    cursor: pointer;
    transition: opacity .3s ease, transform .3s ease;
}

.el-celeb-insta__slide.is-active {
    z-index: 2;
    opacity: 1;
    transform: none;
    cursor: default;
}

.el-celeb-insta__slide iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    pointer-events: none;
}

.el-celeb-insta__slide.is-active iframe {
    pointer-events: auto;
}

.el-celeb-insta__arrow {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--el-ink);
    cursor: pointer;
    transform: translateY(-50%);
}

.el-celeb-insta__arrow svg {
    width: 34px;
    height: 34px;
}

.el-celeb-insta__arrow:hover {
    color: var(--el-sage);
}

/* Arrows just outside the active post. */
.el-celeb-insta__arrow--prev {
    left: calc(50% - var(--el-insta-slide) / 2 - 56px);
}

.el-celeb-insta__arrow--next {
    right: calc(50% - var(--el-insta-slide) / 2 - 56px);
}

/* ---------- Edy Features */
.el-celeb-features__head {
    margin-bottom: 48px;
}

.el-celeb-features__head .el-h2 {
    margin-bottom: 16px;
}

.el-celeb-features__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(20px, 2.5vw, 32px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.el-celeb-feature__link {
    display: block;
    color: var(--el-ink);
    text-decoration: none;
}

.el-celeb-feature__img {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--el-cream);
}

.el-celeb-feature__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s ease;
}

.el-celeb-feature__link:hover .el-celeb-feature__img img {
    transform: scale(1.03);
}

.el-celeb-feature__title {
    display: block;
    margin-top: 16px;
    font-family: var(--el-serif);
    font-size: clamp(22px, 2vw, 26px);
    line-height: 1.2;
    transition: color .2s ease;
}

.el-celeb-feature__link:hover .el-celeb-feature__title {
    color: var(--el-sage);
}

.el-celeb-features__contact {
    margin: 48px 0 0;
}

/* ---------- Tablet: two feature cards per row */
@media (max-width: 1024px) {
    .el-celeb-features__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ---------- Stack below 900px */
@media (max-width: 900px) {
    /* Hero: text first, photo below it (same ratio as the other heroes). */
    .el-celeb-hero .el-page-hero__img {
        order: 2;
    }

    /* Text first, then the Instagram post, in both intro rows. */
    .el-celeb-intro__row {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .el-celeb-intro__row .el-celeb-intro__post {
        order: 2;
    }
}

/* ---------- Mobile */
@media (max-width: 767px) {
    .el-celeb-insta {
        --el-insta-slide: 72vw;
        --el-insta-gap: 24px;
    }

    .el-celeb-insta__arrow--prev {
        left: 4px;
    }

    .el-celeb-insta__arrow--next {
        right: 4px;
    }

    .el-celeb-features__grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .el-celeb-insta__track,
    .el-celeb-insta__slide,
    .el-celeb-feature__img img {
        transition: none;
    }
}
