/* =============================================================================
   Prentiss Connect — Custom Overrides
   -----------------------------------------------------------------------------
   Dedicated "advanced / custom CSS" area. This file is enqueued LAST (after
   main.css and dark-mode.css), so rules here win without touching the core
   theme styles. Put one-off tweaks and third-party widget adjustments here.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Support One / HappyFox live chat widget
   The chat panel is a CROSS-ORIGIN iframe (#hfc-frame from widget.happyfoxchat.com),
   so only the iframe BOX is styleable from here — the orange header, fonts, and
   form fields INSIDE are controlled in the HappyFox dashboard, not in CSS.
   These rules give the panel + launcher the same raised, brand-tinted depth as
   the site's .pc-btn buttons (drop-shadow follows the widget's real shape even
   though it's cross-origin). Shadow tint rgba(43,52,125,…) = the brand blue
   (--pc-primary) used on the primary button.
   -------------------------------------------------------------------------- */

/* --- Open chat panel (≈380×590; the box fills the visible card) --- */
#hfc-frame.hfc-chatbox:not(.hfc-chatbox__is-mobile) {
    border-radius: 18px !important;
    overflow: hidden !important;                       /* clips card to rounded corners */
    /* Position left at HappyFox's default (docked to the bottom-right corner). */
    filter:
        drop-shadow(0 16px 34px rgba(43, 52, 125, 0.32))
        drop-shadow(0 5px 12px rgba(0, 0, 0, 0.18)) !important;
    animation: pcHfcPanelIn 240ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Gentle open animation: fade + slight rise + scale, matching the site's easing */
@keyframes pcHfcPanelIn {
    from { opacity: 0; transform: translateY(10px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* --- Launcher bubble (transparent box, so we keep drop-shadow, no clipping) --- */
#hfc-frame.hfc-badge {
    filter:
        drop-shadow(0 6px 14px rgba(43, 52, 125, 0.30))
        drop-shadow(0 2px 5px rgba(0, 0, 0, 0.20)) !important;
    transition: filter 220ms ease, transform 150ms ease !important;
}

/* Same hover lift as .pc-btn:hover — bubble rises and the glow deepens */
#hfc-frame.hfc-badge:hover {
    transform: translateY(-2px) !important;
    filter:
        drop-shadow(0 11px 24px rgba(43, 52, 125, 0.44))
        drop-shadow(0 3px 8px rgba(0, 0, 0, 0.24)) !important;
}

/* Accessibility: honor reduced-motion (mirrors the theme's global a11y guard) */
@media (prefers-reduced-motion: reduce) {
    #hfc-frame.hfc-chatbox:not(.hfc-chatbox__is-mobile) { animation: none !important; }
    #hfc-frame.hfc-badge { transition: none !important; }
    #hfc-frame.hfc-badge:hover { transform: none !important; }
}

/* --- Mobile contact page fixes --- */
@media (max-width: 760px) {
    .pc-contact__grid .pc-contact__info {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    .pc-contact__grid .pc-contact__info > .pc-contact__info-row,
    .pc-contact__grid .pc-contact__info > a.pc-contact__info-row {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
        min-height: 7rem !important;
        padding: 1.25rem !important;
        box-sizing: border-box !important;
    }
/* --- Mobile contact page fixes --- */
@media (max-width: 760px) {
    .pc-contact__grid .pc-contact__info {
        flex-direction: column !important;
        gap: 1rem !important;
    }
    .pc-contact__grid .pc-contact__info > .pc-contact__info-row,
    .pc-contact__grid .pc-contact__info > a.pc-contact__info-row {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        flex: 1 1 100% !important;
        min-height: 7rem !important;
        padding: 1.25rem !important;
        box-sizing: border-box !important;
    }
    /* Map popup: keep it inside the card on mobile */
    .pc-contact__map-canvas .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 5rem) !important;
    }
    .pc-contact__map-canvas .leaflet-popup-content {
        margin: 10px 12px !important;
        font-size: 0.85rem !important;
        line-height: 1.35 !important;
    }
}
        /* Map popup: keep it inside the card on mobile */
    .pc-contact__map-canvas .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 5rem) !important;
    }
    .pc-contact__map-canvas .leaflet-popup-content {
        margin: 10px 12px !important;
        font-size: 0.85rem !important;
        line-height: 1.35 !important;
    }
}