/*
 * Scrumiz AI — pop-up, nav dropdown and testimonial fallback styles.
 *
 * Loaded AFTER style.css (dependency: scrumizai-style), so plain overrides here
 * win on cascade order; selectors are still written one step more specific than
 * their style.css counterparts so order changes can't break them.
 */

/* ==========================================================================
   1. PRIMARY NAV — About dropdown
   ========================================================================== */

.main-nav .nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.main-nav .nav-item--has-children > .nav-parent {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.main-nav .nav-caret {
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    transition: transform var(--sz-transition);
}

.main-nav .nav-sub {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translate(-50%, 8px);
    min-width: 200px;
    margin: 0;
    padding: 0.5rem;
    list-style: none;
    background: rgba(18, 18, 21, 0.97);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 1px solid var(--sz-border);
    border-radius: var(--sz-radius);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1002;
}

/* Invisible bridge so the pointer can travel from the parent to the submenu. */
.main-nav .nav-item--has-children::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 14px;
}

.main-nav .nav-item--has-children:hover .nav-sub,
.main-nav .nav-item--has-children:focus-within .nav-sub,
.main-nav .nav-item--has-children.is-open .nav-sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.main-nav .nav-item--has-children:hover .nav-caret,
.main-nav .nav-item--has-children:focus-within .nav-caret,
.main-nav .nav-item--has-children.is-open .nav-caret {
    transform: rotate(180deg);
}

.main-nav .nav-sub li {
    list-style: none;
}

.main-nav .nav-sub a {
    display: block;
    padding: 0.55rem 0.85rem;
    border-radius: var(--sz-radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--sz-text-muted);
    white-space: nowrap;
}

.main-nav .nav-sub a:hover,
.main-nav .nav-sub a:focus-visible,
.main-nav .nav-sub a.active {
    color: var(--sz-text);
    background: rgba(99, 102, 241, 0.16);
}

/* The parent underline indicator would sit under the caret — keep it on the text. */
.main-nav .nav-parent.active::after {
    right: 12px;
}

.main-nav a:focus-visible,
.mobile-nav a:focus-visible {
    outline: 2px solid var(--sz-indigo);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Mobile nested links */
.mobile-nav .mobile-nav-sub {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: -0.75rem;
}

.mobile-nav .mobile-nav-sub a {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--sz-text-muted);
}

.mobile-nav .mobile-nav-sub a:hover {
    color: var(--sz-indigo);
}

/* ==========================================================================
   2. POP-UP SHELL — the close button belongs to the MODAL, not the page
   --------------------------------------------------------------------------
   The modal is the positioning context and no longer scrolls itself; an inner
   .popup-body scrolls instead, so the X stays pinned to the modal's top-right
   corner at every size and scroll position.
   ========================================================================== */

.popup-overlay {
    padding: clamp(0.75rem, 4vw, 2.5rem);
    overscroll-behavior: contain;
}

.popup-overlay .popup-modal {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 640px;
    max-height: 100%;
    padding: 0;
    overflow: visible;
    background: linear-gradient(180deg, #1c1c20, #141417);
    border: 1px solid var(--sz-border);
    border-radius: var(--sz-radius-lg);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.65), var(--sz-glow-sm);
}

.popup-overlay .popup-modal .popup-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--sz-border);
    border-radius: 50%;
    color: var(--sz-text-muted);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--sz-transition), background var(--sz-transition), border-color var(--sz-transition);
}

.popup-overlay .popup-modal .popup-close:hover {
    color: var(--sz-text);
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--sz-border-hover);
}

.popup-overlay .popup-modal .popup-close:focus-visible {
    outline: 2px solid var(--sz-indigo);
    outline-offset: 2px;
    color: var(--sz-text);
}

.popup-overlay .popup-modal .popup-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 2.25rem clamp(1.25rem, 4vw, 2.25rem) 2rem;
    -webkit-overflow-scrolling: touch;
}

/* ---- Pop-up copy ---- */

.popup-modal .popup-title {
    font-family: 'Roboto', sans-serif;
    font-size: clamp(1.5rem, 3.4vw, 2rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 2.5rem 0.75rem 0;
    color: var(--sz-text);
}

.popup-modal .popup-subtitle {
    color: var(--sz-text-muted);
    font-size: 0.95rem;
    line-height: 1.65;
    margin: 0 0 1.5rem;
}

.popup-modal .popup-options-heading {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--sz-indigo);
    margin: 0 0 0.85rem;
}

/* ---- Pill options ---- */

.popup-pills {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1.25rem;
}

.popup-pill {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    width: 100%;
    text-align: left;
    padding: 1rem 1.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sz-border);
    border-radius: 999px;
    color: var(--sz-text);
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: border-color var(--sz-transition), background var(--sz-transition),
                box-shadow var(--sz-transition), transform var(--sz-transition);
}

.popup-pill:hover {
    border-color: var(--sz-border-hover);
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-1px);
}

.popup-pill:focus-visible {
    outline: 2px solid var(--sz-indigo);
    outline-offset: 3px;
}

.popup-pill[aria-pressed="true"] {
    border-color: var(--sz-indigo);
    background: rgba(99, 102, 241, 0.14);
    box-shadow: var(--sz-glow-sm);
}

.popup-pill-icon {
    flex: 0 0 auto;
    font-size: 1.15rem;
    line-height: 1.5;
}

.popup-pill-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.popup-pill-label {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--sz-text);
}

.popup-pill-sub {
    font-family: 'Roboto', sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.55;
    color: var(--sz-text-muted);
}

/* ---- Revealed form ---- */

.popup-form-panel[hidden] {
    display: none !important;
}

.popup-form-panel {
    border-top: 1px solid var(--sz-border);
    padding-top: 1.25rem;
    animation: scrumizPopupReveal 0.35s ease both;
}

@keyframes scrumizPopupReveal {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .popup-form-panel { animation: none; }
    .popup-pill:hover { transform: none; }
}

.popup-modal .popup-form-intro {
    color: var(--sz-text-muted);
    font-size: 0.9rem;
    margin: 0 0 1rem;
}

/* When a pill has been matched to a WPForms radio choice, the radio becomes
   redundant — keep it in the accessibility tree but out of the layout. */
.popup-form-panel.has-synced-choice .wpforms-field-radio {
    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;
}

.popup-modal .popup-booking {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--sz-border);
    font-size: 0.9rem;
    color: var(--sz-text-muted);
    text-align: center;
}

.popup-modal .popup-booking-intro {
    margin-right: 0.35rem;
}

.popup-modal .popup-booking-link {
    color: var(--sz-indigo);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.popup-modal .popup-booking-link:hover {
    color: var(--sz-indigo-hover);
}

@media (max-width: 480px) {
    .popup-pill {
        padding: 0.9rem 1.15rem;
        border-radius: 18px;
    }
}

/* ==========================================================================
   3. TESTIMONIALS — heading, name line, and no-Swiper fallback grid
   ========================================================================== */

.testimonials-section .testimonials-heading {
    margin-bottom: 0;
}

.testimonial-name {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--sz-text);
    margin-bottom: 4px;
}

/* Swiper 11 is only enqueued on the front page. Elsewhere (and if the CDN fails)
   the carousel degrades to a plain responsive grid. */
.testimonials-section.testimonials-static .swiper {
    padding: 1.5rem 0 0 !important;
    overflow: visible !important;
}

.testimonials-section.testimonials-static .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    transform: none !important;
}

.testimonials-section.testimonials-static .swiper-slide {
    width: auto !important;
    max-width: none !important;
    height: auto;
    transform: none !important;
}

.testimonials-section.testimonials-static .testimonial-card {
    --s: 1;
    --o: 1;
    --b: 0px;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    min-height: 0;
    cursor: default;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.testimonials-section.testimonials-static .testimonial-card::before,
.testimonials-section.testimonials-static .testimonial-card::after {
    opacity: 0;
}

.testimonials-section.testimonials-static .swiper-button-prev,
.testimonials-section.testimonials-static .swiper-button-next,
.testimonials-section.testimonials-static .swiper-pagination {
    display: none !important;
}

/* --------------------------------------------------------------------------
   Destination button — the popup's primary action once a path is chosen.
   -------------------------------------------------------------------------- */

.popup-overlay .popup-modal .popup-goto {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    margin: 0.25rem 0 1.15rem;
    padding-bottom: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.popup-overlay .popup-modal .popup-goto[hidden] {
    display: none;
}

.popup-overlay .popup-modal .popup-goto-btn {
    width: 100%;
    max-width: 22rem;
    text-align: center;
    font-weight: 600;
}

.popup-overlay .popup-modal .popup-goto-or {
    font-size: 0.85rem;
    color: #a3a3a3;
}
