/* ============================================================================
   FAME Callout Actions — the frontend popup (FAME → Settings → Callout Actions,
   2026-10-20).

   Four layouts, chosen per popup in the settings row:
     .fame-co--left    image beside the words, image first
     .fame-co--right   image beside the words, words first
     .fame-co--top     image above the words
     .fame-co--background  image behind everything, under an overlay

   Only what a stylesheet cannot know is inline, as custom properties on the
   card: --fame-co-image and --fame-co-overlay. Everything else is here.
   Colours and type follow the site's own: #1877F2, Lato.
   ========================================================================== */

.fame-co {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fame-co[hidden] {
    display: none;
}

.fame-co__veil {
    position: absolute;
    inset: 0;
    background: rgba(8, 20, 45, 0.55);
    border: 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.fame-co__card {
    position: relative;
    display: flex;
    gap: 0;
    width: 100%;
    /* The desktop target (owner, 2026-10-20: at least 1140px), and never wider
       than the device: `width: 100%` inside the 20px-padded shell means a
       narrower screen simply gets the room it has. Every layout and both
       sliders share this one figure — none of them caps it lower. */
    max-width: 1140px;
    max-height: calc(100vh - 40px);
    overflow: hidden auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 64px rgba(8, 20, 45, 0.28);
    font-family: Lato, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    transform: translateY(14px) scale(0.98);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
}

/* .is-open is added a frame after the popup is shown, so the move animates. */
.fame-co.is-open .fame-co__veil {
    opacity: 1;
}

.fame-co.is-open .fame-co__card {
    transform: none;
    opacity: 1;
}

/* A popup with no title still needs a name for screen readers. The theme does
   ship .visually-hidden, but this stylesheet owns the rule so the popup stays
   self-contained whatever the theme does later. */
.fame-co .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ------------------------------------------------------------ the close X */
.fame-co__x {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: #10213b;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(16, 33, 59, 0.12);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.18s ease;
}

.fame-co__x:hover,
.fame-co__x:focus-visible {
    color: #1877f2;
    background: #fff;
    border-color: #1877f2;
}

.fame-co__x svg {
    width: 18px;
    height: 18px;
}

/* --------------------------------------------------------------- the parts */
.fame-co__media {
    flex: 0 0 42%;
    min-height: 200px;
    background: #eef2f7;
}

.fame-co__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fame-co__body {
    flex: 1 1 auto;
    padding: 28px;
}

.fame-co__title {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.25;
    color: #10213b;
}

.fame-co__text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5a72;
}

/* Up to two buttons: they sit side by side, and wrap on a narrow screen. */
.fame-co__btns {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.fame-co__btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    background: #1877f2;
    border-radius: 10px;
    transition: 0.18s ease;
}

.fame-co__btn:hover,
.fame-co__btn:focus-visible {
    color: #fff;
    background: #0f5ecb;
    text-decoration: none;
}

/* The second button is the quieter one — an outline, so the first still leads. */
.fame-co__btn--alt {
    color: #1877f2;
    background: transparent;
    box-shadow: inset 0 0 0 2px #1877f2;
}

.fame-co__btn--alt:hover,
.fame-co__btn--alt:focus-visible {
    color: #fff;
    background: #1877f2;
}

.fame-co__card--bg .fame-co__btn--alt {
    color: #fff;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}

.fame-co__card--bg .fame-co__btn--alt:hover,
.fame-co__card--bg .fame-co__btn--alt:focus-visible {
    color: #10213b;
    background: #fff;
}

/* ------------------------------------------------------------- the layouts */
.fame-co--right .fame-co__card {
    flex-direction: row-reverse;
}

.fame-co--top .fame-co__card {
    flex-direction: column;
}

.fame-co--top .fame-co__media,
.fame-co__pane--top .fame-co__media {
    flex: 0 0 auto;
    max-height: 320px;
}

/* A card 1140px wide would give the words a line far too long to read when they
   run the full width (image above, or image as the background). The CARD keeps
   its width; the text inside it is given a comfortable measure and centred. */
.fame-co--top .fame-co__body > *,
.fame-co__pane--top .fame-co__body > *,
.fame-co__card--bg .fame-co__body > *,
.fame-co__pane--bg .fame-co__body > * {
    max-width: 68ch;
    margin-left: auto;
    margin-right: auto;
}

.fame-co--top .fame-co__body .fame-co__btns,
.fame-co__pane--top .fame-co__body .fame-co__btns,
.fame-co__card--bg .fame-co__body .fame-co__btns,
.fame-co__pane--bg .fame-co__body .fame-co__btns {
    justify-content: center;
}

/* The image AS the background: the overlay sits between it and the words, so
   the text stays readable whatever the picture. Both values come from the
   popup's own settings row. */
.fame-co__card--bg {
    background-image: linear-gradient(var(--fame-co-overlay, rgba(11, 27, 58, 0.55)), var(--fame-co-overlay, rgba(11, 27, 58, 0.55))), var(--fame-co-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.fame-co__card--bg .fame-co__body {
    padding: 44px 32px;
    text-align: center;
}

.fame-co__card--bg .fame-co__title,
.fame-co__card--bg .fame-co__text {
    color: #fff;
}

.fame-co__card--bg .fame-co__text {
    color: rgba(255, 255, 255, 0.92);
}

.fame-co__card--bg .fame-co__x {
    color: #fff;
    background: rgba(8, 20, 45, 0.45);
    border-color: rgba(255, 255, 255, 0.35);
}

.fame-co__card--bg .fame-co__x:hover,
.fame-co__card--bg .fame-co__x:focus-visible {
    color: #10213b;
    background: #fff;
}

/* A wider card deserves more room around its words than a 760px one did. */
@media (min-width: 992px) {
    .fame-co__body {
        padding: 40px;
    }

    .fame-co__card--bg .fame-co__body,
    .fame-co__pane--bg .fame-co__body {
        padding: 64px 40px;
    }

    .fame-co__title {
        font-size: 1.75rem;
    }

    .fame-co__text {
        font-size: 1.0625rem;
    }
}

/* -------------------------------------------------------------- the phone */
@media (max-width: 767px) {
    .fame-co {
        padding: 12px;
    }

    .fame-co__card,
    .fame-co--right .fame-co__card {
        flex-direction: column;
        max-width: 100%;
    }

    .fame-co__media {
        flex: 0 0 auto;
        max-height: 180px;
        min-height: 0;
    }

    .fame-co__body {
        padding: 22px 20px;
    }

    .fame-co__card--bg .fame-co__body {
        padding: 32px 22px;
    }

    .fame-co__title {
        font-size: 1.25rem;
    }

    .fame-co__btn {
        display: block;
        text-align: center;
    }
}

/* A visitor who asked for less movement gets none. */
@media (prefers-reduced-motion: reduce) {
    .fame-co__veil,
    .fame-co__card {
        transition: none;
    }
}

/* ============================ the sliders (Swiper) ======================== */

/* Swiper needs a width it can measure; inside the card that is the full width. */
.fame-co__swiper {
    width: 100%;
    min-width: 0;
}

/* An image slider IS the card: the pictures fill it edge to edge, at the same
   width as every other popup. */
.fame-co--image-slider .fame-co__card {
    display: block;
}

/* `contain`, not `cover` (owner, 2026-10-20): the WHOLE picture is shown. A
   picture whose shape differs from the card's is letterboxed against the card
   rather than cropped — nothing of what was uploaded is cut off. */
.fame-co__swiper--images .swiper-slide img,
.fame-co__pic-link img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
}

.fame-co__pic-link {
    display: block;
}

/* A text slider moves whole PANES: each slide carries its own picture and its
   own words, so the picture changes with the slide. The card becomes a plain
   box and each pane takes the layout the popup chose. */
.fame-co--text-slider .fame-co__card {
    display: block;
}

.fame-co__swiper--text .swiper-slide {
    height: auto;
}

.fame-co__pane {
    display: flex;
    min-height: 100%;
}

/* The same four arrangements as a single popup, but chosen PER PANE (owner,
   2026-10-20) — a slide that does not choose carries the popup's, resolved
   server-side, so there is always exactly one of these classes. */
.fame-co__pane--right {
    flex-direction: row-reverse;
}

.fame-co__pane--top {
    flex-direction: column;
}

.fame-co__pane--bg {
    display: block;
    background-image: linear-gradient(var(--fame-co-overlay, rgba(11, 27, 58, 0.55)), var(--fame-co-overlay, rgba(11, 27, 58, 0.55))), var(--fame-co-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.fame-co__pane--bg .fame-co__body {
    padding: 44px 32px;
    text-align: center;
}

.fame-co__pane--bg .fame-co__title,
.fame-co__pane--bg .fame-co__text {
    color: #fff;
}

.fame-co__pane--bg .fame-co__text {
    color: rgba(255, 255, 255, 0.92);
}

/* Slides of unequal height would otherwise jump as they move; Swiper's
   autoHeight settles on the tallest pane it is showing. */
.fame-co__pane .fame-co__media {
    min-height: 0;
}

/* On a phone every pane stacks, whichever side its picture chose. */
@media (max-width: 767px) {
    .fame-co__pane,
    .fame-co__pane--right {
        flex-direction: column;
    }
}

/* ---------------------------------------------------- the dots and arrows */
.fame-co__slider-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px 14px;
}

.fame-co__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    color: #10213b;
    background: #fff;
    border: 1px solid rgba(16, 33, 59, 0.16);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.18s ease;
}

.fame-co__nav:hover,
.fame-co__nav:focus-visible {
    color: #fff;
    background: #1877f2;
    border-color: #1877f2;
}

.fame-co__nav svg {
    width: 16px;
    height: 16px;
}

/* Swiper's own disabled state, when looping is off (a single slide). */
.fame-co__nav.swiper-button-disabled {
    opacity: 0.4;
    cursor: default;
}

/* The dots: Swiper's bullets, in the site's colours. */
.fame-co__dots {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
}

.fame-co__dots .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    margin: 0 !important;
    background: rgba(16, 33, 59, 0.28);
    opacity: 1;
}

.fame-co__dots .swiper-pagination-bullet-active {
    width: 22px;
    background: #1877f2;
    border-radius: 4px;
}

/* On a background-image card the nav sits on the picture, so it goes light. */
.fame-co__card--bg .fame-co__nav {
    color: #fff;
    background: rgba(8, 20, 45, 0.45);
    border-color: rgba(255, 255, 255, 0.35);
}

.fame-co__card--bg .fame-co__nav:hover,
.fame-co__card--bg .fame-co__nav:focus-visible {
    color: #10213b;
    background: #fff;
}

.fame-co__card--bg .fame-co__dots .swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.45);
}

.fame-co__card--bg .fame-co__dots .swiper-pagination-bullet-active {
    background: #fff;
}

/* Swiper never arrived: the slides stay readable as a plain stack rather than
   piling on top of one another. */
.fame-co__swiper--plain .swiper-wrapper {
    display: block;
}

.fame-co__swiper--plain .swiper-slide + .swiper-slide {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(16, 33, 59, 0.12);
}
