/* ════════════════════════════════════════════════════════════════════
   HT Unified Engagement Widget — The Lantern
   Replaces: ht_mobile_cta_bar + ht_find_trek_pill
   z-index:  1001 (above pill 998, replaces cta-bar 9999)
   Mobile:   hidden until 1500px scroll depth
   Desktop:  always visible, bottom-right
   ════════════════════════════════════════════════════════════════════ */

/* ── Root container ───────────────────────────────────────────────── */
.ht-lantern {
    position: fixed;
    bottom: 1.75rem;
    right: 1.5rem;
    z-index: 1001;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Mobile: hidden until scroll trigger fires */
.ht-lantern.is-mobile {
    opacity: 0;
    visibility: hidden;
}

.ht-lantern.is-mobile.is-visible {
    opacity: 1;
    visibility: visible;
}

/* ── FAB button ───────────────────────────────────────────────────── */
.ht-lantern-fab {
    position: relative;
    z-index: 2;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #DCA134;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 16px rgba(140, 92, 2, 0.26),
        0 1px 4px rgba(0, 0, 0, 0.10);
    transition: background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.ht-lantern-fab:hover {
    background: #C8921E;
    transform: scale(1.06);
    box-shadow:
        0 6px 22px rgba(140, 92, 2, 0.32),
        0 2px 6px rgba(0, 0, 0, 0.13);
}

.ht-lantern-fab:focus-visible {
    outline: 2.5px solid #DCA134;
    outline-offset: 4px;
}

/* Icon swap: mountain ↔ close */
.ht-lantern-icon {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    transition: opacity 0.16s ease, transform 0.18s ease;
}

.ht-lantern-icon svg {
    width: 24px;
    height: 24px;
}

.ht-lantern-icon--mountain { color: #013C1A; opacity: 1; transform: scale(1) rotate(0deg); }
.ht-lantern-icon--close    { color: #ffffff; opacity: 0; transform: scale(0.5) rotate(-45deg); }

/* FAB open state */
.ht-lantern.is-open .ht-lantern-fab {
    background: #013C1A;
    box-shadow:
        0 4px 18px rgba(1, 60, 26, 0.30),
        0 1px 4px rgba(0, 0, 0, 0.12);
}

.ht-lantern.is-open .ht-lantern-icon--mountain {
    opacity: 0;
    transform: scale(0.5) rotate(45deg);
}

.ht-lantern.is-open .ht-lantern-icon--close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* ── Satellite container ──────────────────────────────────────────── */
.ht-lantern-sats {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 52px;
    height: 52px;
    overflow: visible;
    pointer-events: none;
}

.ht-lantern.is-open .ht-lantern-sats {
    pointer-events: auto;
}

/* ── Individual satellite ─────────────────────────────────────────── */
.ht-lantern-sat {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
    /* Closed: collapsed on FAB */
    transform: translate(0, 0) scale(0.15);
    opacity: 0;
    transition:
        transform 0.26s cubic-bezier(0.34, 1.52, 0.64, 1),
        opacity 0.18s ease;
    pointer-events: none;
    display: block;
    text-decoration: none;
}

/* Open arc — staggered spring animation */
/* Nearly straight up */
.ht-lantern.is-open .ht-lantern-sat--contact {
    transform: translate(-10px, -108px) scale(1);
    opacity: 1;
    transition-delay: 0s;
    pointer-events: auto;
}

/* Upper-left */
.ht-lantern.is-open .ht-lantern-sat--trek {
    transform: translate(-62px, -98px) scale(1);
    opacity: 1;
    transition-delay: 0.07s;
    pointer-events: auto;
}

/* Left, moderate height */
.ht-lantern.is-open .ht-lantern-sat--search {
    transform: translate(-100px, -50px) scale(1);
    opacity: 1;
    transition-delay: 0.14s;
    pointer-events: auto;
}

/* Reverse stagger on close */
.ht-lantern-sat--search  { transition-delay: 0s; }
.ht-lantern-sat--trek    { transition-delay: 0.06s; }
.ht-lantern-sat--contact { transition-delay: 0.12s; }

/* ── Satellite inner button ───────────────────────────────────────── */
.ht-lantern-sat-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #DCA134;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow:
        0 3px 10px rgba(140, 92, 2, 0.16),
        0 1px 3px rgba(0, 0, 0, 0.08);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.ht-lantern-sat-btn svg {
    width: 20px;
    height: 20px;
    color: #013C1A;
    flex-shrink: 0;
}

.ht-lantern-sat-btn:hover,
a.ht-lantern-sat:hover .ht-lantern-sat-btn {
    background: #FBF2DF;
    border-color: #C8921E;
    transform: scale(1.08);
}

.ht-lantern-sat-btn:focus-visible {
    outline: 2px solid #DCA134;
    outline-offset: 2px;
}

/* Trek satellite: green accent */
.ht-lantern-sat--trek .ht-lantern-sat-btn {
    border-color: #01A347;
}

.ht-lantern-sat--trek .ht-lantern-sat-btn svg {
    color: #01A347;
}

.ht-lantern-sat--trek .ht-lantern-sat-btn:hover,
.ht-lantern-sat--trek:hover .ht-lantern-sat-btn {
    background: #F0F9F4;
    border-color: #018a3c;
}

/* ── Satellite tooltip labels ─────────────────────────────────────── */
.ht-lantern-sat-label {
    position: absolute;
    right: calc(100% + 9px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    background: #013C1A;
    color: #ffffff;
    font-family: 'Karla', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.14s ease;
}

.ht-lantern-sat-label::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-width: 0;
    border-left-color: #013C1A;
}

.ht-lantern-sat:hover .ht-lantern-sat-label {
    opacity: 1;
}

.ht-lantern-sat--trek .ht-lantern-sat-label {
    background: #01A347;
}

.ht-lantern-sat--trek .ht-lantern-sat-label::after {
    border-left-color: #01A347;
}

/* ── Search tooltip panel ─────────────────────────────────────────── */
.ht-lantern-search-tip {
    display: none;
    position: absolute;
    right: calc(100% + 10px);
    bottom: 0;
    width: 252px;
    background: #ffffff;
    border-radius: 8px;
    border-top: 3px solid #DCA134;
    box-shadow:
        0 6px 24px rgba(1, 60, 26, 0.13),
        0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 10px 10px 8px;
    z-index: 10;
    animation: ht-widget-fade-in 0.17s ease;
}

.ht-lantern-sat--search.has-panel .ht-lantern-search-tip {
    display: block;
}

.ht-lantern-search-form {
    display: flex;
    gap: 0;
}

.ht-lantern-search-input {
    flex: 1;
    min-width: 0;
    border: 1.5px solid #C4D8C4;
    border-right: none;
    border-radius: 5px 0 0 5px;
    padding: 7px 10px;
    font-size: 12px;
    font-family: 'Karla', Arial, sans-serif;
    color: #1a1a1a;
    background: #F5FAF5;
    outline: none;
    transition: border-color 0.14s, background 0.14s;
}

.ht-lantern-search-input::placeholder {
    color: #BBBBBB;
}

.ht-lantern-search-input:focus {
    border-color: #01A347;
    background: #ffffff;
}

.ht-lantern-search-submit {
    background: #013C1A;
    border: none;
    border-radius: 0 5px 5px 0;
    padding: 7px 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.14s;
    flex-shrink: 0;
}

.ht-lantern-search-submit svg {
    width: 15px;
    height: 15px;
    color: #ffffff;
}

.ht-lantern-search-submit:hover {
    background: #01A347;
}

.ht-lantern-search-hint {
    font-size: 9.5px;
    color: #BBBBBB;
    font-family: 'Karla', Arial, sans-serif;
    margin-top: 6px;
    line-height: 1.3;
}

/* ── Contact card ─────────────────────────────────────────────────── */
.ht-lantern-contact-card {
    display: none;
    position: absolute;
    right: calc(100% + 10px);
    bottom: 0;
    width: 224px;
    background: #ffffff;
    border-radius: 8px;
    border-top: 3px solid #DCA134;
    box-shadow:
        0 6px 24px rgba(1, 60, 26, 0.13),
        0 2px 6px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    z-index: 10;
    animation: ht-widget-fade-in 0.17s ease;
}

.ht-lantern-sat--contact.has-panel .ht-lantern-contact-card {
    display: block;
}

.ht-contact-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 13px;
    text-decoration: none;
    border-bottom: 1px solid #F2F2F0;
    transition: background 0.12s ease;
}

.ht-contact-row:last-child {
    border-bottom: none;
}

.ht-contact-row:hover {
    background: #F5FAF5;
}

.ht-contact-row-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ht-contact-row-icon svg {
    width: 20px;
    height: 20px;
    color: #013C1A;
}

.ht-contact-row-icon--wa svg {
    width: 22px;
    height: 22px;
}

.ht-contact-row-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ht-contact-row-label {
    font-size: 11.5px;
    font-weight: 700;
    color: #013C1A;
    font-family: 'Karla', Arial, sans-serif;
    line-height: 1.2;
}

.ht-contact-row-sub {
    font-size: 10px;
    color: #888888;
    font-family: 'Karla', Arial, sans-serif;
    line-height: 1.2;
}

/* ── Animation ────────────────────────────────────────────────────── */
@keyframes ht-widget-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile breakpoint ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .ht-lantern {
        bottom: 1.25rem;
        right: 1rem;
    }

    /* Satellite positions: tighten arc on narrow screens */
    .ht-lantern.is-open .ht-lantern-sat--contact {
        transform: translate(-6px, -100px) scale(1);
    }

    .ht-lantern.is-open .ht-lantern-sat--trek {
        transform: translate(-56px, -90px) scale(1);
    }

    .ht-lantern.is-open .ht-lantern-sat--search {
        transform: translate(-90px, -44px) scale(1);
    }

    /* Labels: hide on touch (rely on tap) */
    .ht-lantern-sat-label { display: none; }

    /* Panels: slightly narrower */
    .ht-lantern-search-tip    { width: 220px; }
    .ht-lantern-contact-card  { width: 200px; }
}
