/* =============================================================
   Aradel Page Gallery Carousel — Module
   Prefix: .ar-pg
   ============================================================= */

/* ── Box-sizing scope ───────────────────────────────────────── */
.ar-pg-section *,
.ar-pg-section *::before,
.ar-pg-section *::after {
    box-sizing: border-box;
}

/* ── Section wrapper ────────────────────────────────────────── */
.ar-pg-section {
    width: 100%;
    /* No top/bottom padding — section sits flush;
       consuming page layout controls spacing around it */
}

/* ── Inner container ────────────────────────────────────────── */
.ar-pg-inner {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 112px;
    padding-right: 112px;
    padding-bottom: 96px;
}

/* ── Controls row (arrows, top-right) ───────────────────────── */
.ar-pg-controls {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

/*
 * Arrow buttons are rendered by [ar_action] as .ar-action.ar-action--circle-only
 * We add our own classes .ar-pg__arrow--prev / --next for JS targeting.
 * No pointer-events: none ever on .ar-action elements.
 */
.ar-pg__arrow {
    /* Force Aradel orange — overrides ar-action tone system */
    color: #F75900 !important;
    transition: opacity 200ms ease;
}

.ar-pg__arrow[data-pg-disabled] {
    opacity: 0.35;
    cursor: default;
    pointer-events: none; /* safe here — this is the wrapper, not .ar-action itself */
}

/* ── Viewport ───────────────────────────────────────────────── */
/*
 * The viewport is wider than the inner container's usable area so that
 * partial peek slides bleed into the padding zone on both sides.
 * We achieve this with negative margins that eat into the inner padding,
 * then restore internal padding for the track to breathe.
 *
 * At 1440px container with 112px padding:
 *   content width = 1440 - 224 = 1216px
 *   we want the viewport to span the full 1440px inner width (before padding)
 *   so: negative margin of -112px each side
 *
 * The active slide occupies ~70% of the viewport.
 * Peeking slides get ~12% of viewport width visible on each side.
 */
.ar-pg-viewport {
    overflow: hidden;
    margin-left: -112px;
    margin-right: -112px;
    border-radius: 0; /* viewport itself has no radius — slides have it */
    position: relative;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.ar-pg-viewport.is-dragging {
    cursor: grabbing;
}

/* ── Track ──────────────────────────────────────────────────── */
.ar-pg-track {
    display: flex;
    align-items: stretch;

    /* Default: no transition (set by JS when animating) */
    will-change: transform;
}

.ar-pg-track[data-animating] {
    transition: transform 480ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

/* ── Slides ─────────────────────────────────────────────────── */
/*
 * Each slide takes up a fixed % of the viewport.
 * With 3 visible slots: peek-left (~12%) + active (~76%) + peek-right (~12%).
 * Slide width = 76% of viewport.
 *
 * We position the track so the active slide is centred.
 * The offset per slide = slide width + gap.
 * Gap between slides = 16px.
 */
.ar-pg-slide {
    flex: 0 0 76%;
    max-width: 76%;
    padding: 0 8px; /* 8px each side = 16px gap between slide images */
    transition: opacity 300ms ease;
}

/* Non-active slides are slightly dimmed */
.ar-pg-slide:not(.is-active) {
    opacity: 0.45;
}

/* ── Figure + image ─────────────────────────────────────────── */
.ar-pg-figure {
    margin: 0;
    padding: 0;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    /* 3:2 aspect ratio — professional default for editorial photos */
    aspect-ratio: 3 / 2;
    background: var(--ads-surface, #F0F0F0); /* placeholder while loading */
}

.ar-pg-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 20px;
    /* No pointer events on image — drag handled at viewport level */
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* ── Caption ────────────────────────────────────────────────── */
/* Caption is a <p> outside .ar-pg-figure, so it is never clipped
   by the figure's overflow:hidden + aspect-ratio box. */
.ar-pg-caption {
    font-family: var(--ads-font, 'Nunito Sans', sans-serif);
    font-size: 18px;
    font-weight: 400;
    line-height: 27px;
    color: #000;
    margin: 12px 8px 0; /* 8px matches slide cell inner padding */
    padding: 0;

    /* Only visible on active slide */
    opacity: 0;
    transition: opacity 250ms ease 200ms;
}

.ar-pg-slide.is-active .ar-pg-caption {
    opacity: 1;
}

/* ── Dots ───────────────────────────────────────────────────── */
/*
 * Visual language borrowed directly from Full Year Results (.fyr-dot)
 * but scoped to .ar-pg and sized to match carousel context.
 */
.ar-pg-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 28px;
    padding-left: 0; /* reset from <nav> defaults */
}

.ar-pg-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1.5px solid #B0BFC2;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 200ms ease, border-color 200ms ease, transform 200ms ease;
    flex-shrink: 0;
}

.ar-pg-dot.is-active,
.ar-pg-dot[aria-current="true"] {
    background: #F75900;
    border-color: #F75900;
    transform: scale(1.3);
}

.ar-pg-dot:hover {
    border-color: #F75900;
}

.ar-pg-dot:focus-visible {
    outline: 2px solid rgba(247, 89, 0, 0.35);
    outline-offset: 3px;
}

/* ── Reduced motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ar-pg-track[data-animating] {
        transition: none;
    }
    .ar-pg-dot {
        transition: none;
    }
    .ar-pg-slide {
        transition: none;
    }
    .ar-pg-caption {
        transition: none;
    }
}

/* ── Tablet (≤ 1024px) ──────────────────────────────────────── */
@media (max-width: 1024px) {
    .ar-pg-inner {
        padding-left: 64px;
        padding-right: 64px;
        padding-bottom: 72px;
    }

    .ar-pg-viewport {
        margin-left: -64px;
        margin-right: -64px;
    }

    /* On tablet the active slide is slightly wider — less peek room */
    .ar-pg-slide {
        flex: 0 0 82%;
        max-width: 82%;
    }
}

/* ── Mobile (≤ 767px) ───────────────────────────────────────── */
@media (max-width: 767px) {
    .ar-pg-inner {
        padding-left: 24px;
        padding-right: 24px;
        padding-bottom: 48px;
    }

    .ar-pg-viewport {
        margin-left: -24px;
        margin-right: -24px;
    }

    /* Mobile: active slide is nearly full viewport, small peek */
    .ar-pg-slide {
        flex: 0 0 88%;
        max-width: 88%;
    }

    .ar-pg-slide {
        padding: 0 6px;
    }

    .ar-pg-caption {
        font-size: 16px;
        line-height: 24px;
        margin-left: 6px;
        margin-right: 6px;
        margin-top: 10px;
    }

    /* Arrows sit closer together on mobile */
    .ar-pg-controls {
        gap: 8px;
        margin-bottom: 16px;
    }
}
