/* =========================================================
   Home Page — Hero Office Location Card
   Markup: centrix_hero_location_render() in inc/hero-location.php.
   Behaviour: assets/js/hero-location.js.

   A quiet glass plate in the hero's bottom-right corner. Tinted dark rather
   than white so the white type reads over any photograph without needing a
   heavier blur, and so it sits in the same family as the hero's own
   readability gradient on the left.

   States (on .fp-loc):
     .is-empty    — the active slide has no office: card hidden
     .is-yielding — hero copy currently overlaps the card: card hidden
     .is-swapping — mid-change between two offices: text cross-fade
   ========================================================= */

.fp-loc {
    --fp-loc-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --fp-loc-accent: #FF5F06;

    position: absolute;
    right: 32px;
    bottom: 32px;
    /* Above the readability layers (z 1–2) and the copy row (z 10), which is
       pointer-events: none outside the text column. */
    z-index: 20;
    width: 312px;
    max-width: calc(100% - 64px);

    /* Opacity is faded on .fp-loc__card, not here: opacity below 1 on an
       ancestor makes it a backdrop root, which would switch the card's blur
       off for the length of every fade. */
    transform: translateY(0);
    transition:
        transform 600ms var(--fp-loc-ease),
        visibility 0s linear 0s;
}

.fp-loc.is-empty,
.fp-loc.is-yielding {
    transform: translateY(10px);
    visibility: hidden;
    pointer-events: none;
    transition:
        transform 400ms var(--fp-loc-ease),
        visibility 0s linear 400ms;
}

.fp-loc.is-empty .fp-loc__card,
.fp-loc.is-yielding .fp-loc__card {
    opacity: 0;
    transition-duration: 400ms;
}

/* ── The plate ── */
.fp-loc__card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px 14px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%),
        rgba(9, 15, 24, 0.34);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.10) inset,
        0 12px 32px -14px rgba(0, 0, 0, 0.55),
        0 2px 6px -2px rgba(0, 0, 0, 0.20);
    color: #fff;
    text-decoration: none;
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity 600ms var(--fp-loc-ease),
        transform 450ms var(--fp-loc-ease),
        box-shadow 450ms var(--fp-loc-ease),
        border-color 450ms var(--fp-loc-ease),
        background-color 450ms var(--fp-loc-ease);
}

/* No backdrop-filter: fall back to a denser tint so the text still reads. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .fp-loc__card {
        background: rgba(9, 15, 24, 0.72);
    }
}

.fp-loc__card:hover,
.fp-loc__card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.26);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.14) inset,
        0 18px 40px -16px rgba(0, 0, 0, 0.6),
        0 4px 10px -4px rgba(0, 0, 0, 0.22);
}

.fp-loc__card:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.85);
    outline-offset: 3px;
}

/* ── Pin ── */
.fp-loc__pin {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--fp-loc-accent);
    background: rgba(255, 95, 6, 0.12);
    box-shadow: 0 0 0 1px rgba(255, 95, 6, 0.22) inset;
}

.fp-loc__pin svg {
    position: relative;
    z-index: 1;
    display: block;
}

/* A single soft ring breathing out every few seconds — present, not busy. */
.fp-loc__pin::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 95, 6, 0.45);
    opacity: 0;
    animation: fp-loc-pulse 3.2s var(--fp-loc-ease) infinite;
}

@keyframes fp-loc-pulse {
    0%   { transform: scale(1);    opacity: 0.55; }
    70%  { transform: scale(1.55); opacity: 0; }
    100% { transform: scale(1.55); opacity: 0; }
}

/* ── Text ── */
.fp-loc__body {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    transition:
        opacity 280ms var(--fp-loc-ease),
        transform 280ms var(--fp-loc-ease),
        filter 280ms var(--fp-loc-ease);
}

.fp-loc.is-swapping .fp-loc__body {
    opacity: 0;
    transform: translateY(5px);
    filter: blur(2px);
}

.fp-loc__name {
    font-family: 'aleniaregular', 'Inter', sans-serif;
    font-size: 17px;
    line-height: 1.25;
    letter-spacing: 0.01em;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fp-loc__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    transition: color 400ms var(--fp-loc-ease);
}

/* Hairline underline that draws in from the left on hover. */
.fp-loc__cta-text {
    padding-bottom: 2px;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0% 1px;
    transition: background-size 450ms var(--fp-loc-ease);
}

.fp-loc__cta-arrow {
    display: inline-flex;
    color: var(--fp-loc-accent);
    transition: transform 450ms var(--fp-loc-ease);
}

.fp-loc__card:hover .fp-loc__cta,
.fp-loc__card:focus-visible .fp-loc__cta {
    color: #fff;
}

.fp-loc__card:hover .fp-loc__cta-text,
.fp-loc__card:focus-visible .fp-loc__cta-text {
    background-size: 100% 1px;
}

.fp-loc__card:hover .fp-loc__cta-arrow,
.fp-loc__card:focus-visible .fp-loc__cta-arrow {
    transform: translate(2px, -2px);
}

/* ── Laptop ── */
@media (max-width: 1279px) {
    .fp-loc {
        width: 288px;
    }
}

/* ── Tablet ──
   Lifted to clear the centred slide dots (.cx-rail-wrap, bottom ~22px),
   still well right of the scroll chevron in the centre. */
@media (max-width: 1023px) {
    .fp-loc {
        right: 24px;
        bottom: 60px;
        width: 264px;
        max-width: calc(100% - 48px);
    }

    .fp-loc__card {
        gap: 12px;
        padding: 12px 18px 12px 12px;
        border-radius: 13px;
    }

    .fp-loc__pin {
        width: 32px;
        height: 32px;
    }

    .fp-loc__name {
        font-size: 16px;
    }
}

/* ── Phone ──
   Shrinks to its content and sits above both the dots (bottom ~18px) and
   the scroll chevron (bottom 64–94px), so nothing shares its corner. */
@media (max-width: 767px) {
    .fp-loc {
        right: 16px;
        bottom: calc(108px + env(safe-area-inset-bottom, 0px));
        width: auto;
        max-width: calc(100% - 32px);
    }

    .fp-loc__card {
        gap: 10px;
        padding: 10px 16px 10px 10px;
        border-radius: 12px;
    }

    .fp-loc__pin {
        width: 30px;
        height: 30px;
    }

    .fp-loc__pin svg {
        width: 14px;
        height: 14px;
    }

    .fp-loc__body {
        gap: 3px;
    }

    .fp-loc__name {
        font-size: 15px;
    }

    .fp-loc__cta {
        font-size: 10px;
        letter-spacing: 0.12em;
    }
}

/* Touch screens have no hover to reveal the underline, so show it at rest. */
@media (hover: none) {
    .fp-loc__cta-text {
        background-size: 100% 1px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fp-loc,
    .fp-loc.is-empty,
    .fp-loc.is-yielding,
    .fp-loc__card,
    .fp-loc__body,
    .fp-loc__cta-text,
    .fp-loc__cta-arrow {
        transition-duration: 1ms;
        transition-delay: 0s;
    }

    .fp-loc.is-empty,
    .fp-loc.is-yielding,
    .fp-loc.is-swapping .fp-loc__body,
    .fp-loc__card:hover,
    .fp-loc__card:focus-visible {
        transform: none;
    }

    .fp-loc__pin::after {
        animation: none;
    }
}
