/* =============================================================
   Intelligent Answering microsite - base layer
   Auto-enqueued for page-intelligent-answering.php by
   enqueue_template_stylesheet() in functions.php.

   Everything is scoped under .ps-micro so nothing leaks into or
   out of the main PerfectServe theme. Per-block styles live in
   /blocks/ps-*/style.css and lean on these tokens.
   ============================================================= */

.ps-micro {
    /* Color tokens (sampled from the approved comp) */
    --psm-ink:        #1B0B3A;   /* deep plum: dark sections + headings */
    --psm-ink-2:      #2B2049;
    --psm-hero-hi:    #3A2A5E;
    --psm-purple:     #7953FF;   /* accent: icons, badges, links */
    --psm-purple-soft:#EFEAFF;
    --psm-teal:       #80DFD9;   /* accent: callouts, number chips, hero line 2 */
    --psm-mint:       #E0FAF9;   /* stat band background */
    --psm-mint-card:  #ECF5F4;   /* quote card background */
    --psm-gold:       #F8BC38;   /* primary CTA */
    --psm-gold-hover: #EFAD1E;
    --psm-body:       #4B4560;
    --psm-white:      #FFFFFF;

    /* Type */
    --psm-serif: 'Libre Baskerville', Georgia, serif;
    --psm-sans:  'Poppins', -apple-system, 'Segoe UI', Roboto, sans-serif;

    /* Layout */
    --psm-max: 1240px;
    --psm-pad: clamp(20px, 4vw, 48px);
    --psm-radius: 16px;

    font-family: var(--psm-sans);
    color: var(--psm-body);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Targeted reset inside the scope ------------------------- */
.ps-micro *,
.ps-micro *::before,
.ps-micro *::after { box-sizing: border-box; }

.ps-micro h1, .ps-micro h2, .ps-micro h3,
.ps-micro h4, .ps-micro h5, .ps-micro h6 {
    font-family: var(--psm-serif);
    color: var(--psm-ink);
    line-height: 1.22;
    letter-spacing: -0.01em;
    margin: 0 0 0.5em;
    font-weight: 700;
    text-wrap: balance;
    clear: none;
}
.ps-micro p { margin: 0 0 1em; }
.ps-micro img { max-width: 100%; height: auto; display: block; }
.ps-micro a { color: var(--psm-purple); text-decoration: none; }
.ps-micro ul, .ps-micro ol { margin: 0; padding: 0; list-style: none; }

/* --- Shared primitives --------------------------------------- */
.ps-micro .psm-wrap {
    max-width: var(--psm-max);
    margin: 0 auto;
    padding-left: var(--psm-pad);
    padding-right: var(--psm-pad);
}

.ps-micro .psm-eyebrow {
    font-family: var(--psm-sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--psm-purple);
}

.ps-micro .psm-h2 {
    font-size: clamp(26px, 3.2vw, 38px);
    text-align: center;
}
.ps-micro .psm-lede {
    max-width: 720px;
    margin: 0 auto 1.5em;
    text-align: center;
    font-size: 16px;
}

/* Buttons */
.ps-micro .psm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--psm-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    padding: 16px 28px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
    white-space: nowrap;
}
.ps-micro .psm-btn--gold {
    background: var(--psm-gold);
    color: var(--psm-ink);
}
.ps-micro .psm-btn--gold:hover {
    background: var(--psm-gold-hover);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(27, 11, 58, .28);
}
.ps-micro .psm-btn--ghost {
    background: var(--psm-white);
    color: var(--psm-ink);
    box-shadow: 0 2px 10px rgba(27, 11, 58, .18);
}
.ps-micro .psm-btn--ghost:hover { transform: translateY(-1px); }

/* Play link ("Watch an overview") */
.ps-micro .psm-play {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--psm-white);
    cursor: pointer;
    background: none;
    border: 0;
    font-family: var(--psm-sans);
    font-size: 15px;
}
.ps-micro .psm-play__disc {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--psm-white);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: transform .15s ease;
}
.ps-micro .psm-play:hover .psm-play__disc { transform: scale(1.06); }
.ps-micro .psm-play__disc svg { margin-left: 3px; }

/* --- Sub navigation ------------------------------------------ */
.ps-micro { position: relative; }
.ps-micro .psm-subnav {
    background: transparent;
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 20;
}
.ps-micro .psm-subnav__inner {
    max-width: var(--psm-max);
    width: calc(100% - 2 * var(--psm-pad));
    margin: 0 auto;
    padding: 16px 0;
    display: flex;
    align-items: center;
    gap: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.ps-micro .psm-subnav__brand {
    display: flex;
    align-items: center;
    color: var(--psm-white);
    margin-right: auto;
}
.ps-micro .psm-subnav__lockup { height: 30px; width: auto; display: block; }
.ps-micro .psm-subnav__mark { align-self: center; display: inline-flex; }
.ps-micro .psm-subnav__title {
    font-family: var(--psm-serif);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .01em;
}
.ps-micro .psm-subnav__by {
    border-left: 1px solid rgba(255, 255, 255, .25);
    padding-left: 12px;
    display: inline-flex;
    align-items: center;
}
.ps-micro .psm-subnav__by img { height: 13px; width: auto; display: block; }
.ps-micro .psm-subnav__menu { display: contents; }
.ps-micro .psm-subnav__toggle { display: none; }
.ps-micro .psm-subnav__links {
    display: flex;
    gap: 26px;
}
.ps-micro .psm-subnav__link {
    color: rgba(255, 255, 255, .85);
    font-family: var(--psm-sans);
    font-size: 15px;
    font-weight: 600;
    padding: 6px 0;
    position: relative;
    align-self: stretch;          /* link spans the full row height so its
                                     bottom edge = the hairline's position */
    display: inline-flex;
    align-items: center;
}
.ps-micro .psm-subnav__link:hover { color: #97DDD8; }
.ps-micro .psm-subnav__link.is-active { color: var(--psm-teal); }
.ps-micro .psm-subnav__link.is-active::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: var(--psm-teal);
}

/* --- Video modal (shared) ------------------------------------ */
.ps-micro .psm-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 5, 26, .82);
    padding: 24px;
}
.ps-micro .psm-modal.is-open { display: flex; }
.ps-micro .psm-modal__frame {
    width: min(960px, 100%);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.ps-micro .psm-modal__frame iframe {
    width: 100%; height: 100%; border: 0; display: block;
}
.ps-micro .psm-modal__close {
    position: absolute;
    top: 20px; right: 24px;
    background: none;
    border: 0;
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
}

/* --- Responsive ---------------------------------------------- */
@media (max-width: 900px) {
    .ps-micro .psm-subnav__lockup { height: 22px; }

    /* Hamburger */
    .ps-micro .psm-subnav__toggle {
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 44px;
        height: 44px;
        padding: 10px;
        background: none;
        border: 0;
        cursor: pointer;
    }
    .ps-micro .psm-subnav__toggle span {
        display: block;
        height: 2px;
        border-radius: 2px;
        background: #fff;
        transition: transform .25s ease, opacity .2s ease;
    }
    .ps-micro .psm-subnav.is-open .psm-subnav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .ps-micro .psm-subnav.is-open .psm-subnav__toggle span:nth-child(2) { opacity: 0; }
    .ps-micro .psm-subnav.is-open .psm-subnav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* Dropdown panel */
    .ps-micro .psm-subnav__menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--psm-ink);
        border-bottom: 1px solid rgba(255, 255, 255, .14);
        padding: 8px var(--psm-pad) 20px;
        box-shadow: 0 24px 40px rgba(10, 5, 26, .5);
    }
    .ps-micro .psm-subnav.is-open .psm-subnav__menu { display: block; }
    .ps-micro .psm-subnav__links {
        flex-direction: column;
        gap: 0;
    }
    .ps-micro .psm-subnav__link {
        padding: 14px 0;
        font-size: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, .1);
    }
    .ps-micro .psm-subnav__link::after,
    .ps-micro .psm-subnav__link.is-active::after { display: none; }
    .ps-micro .psm-subnav__cta {
        margin-top: 16px;
        width: 100%;
    }
}
@media (prefers-reduced-motion: reduce) {
    .ps-micro * { transition: none !important; animation: none !important; }
}


/* Video triggers stay hidden until a URL is provided */
.ps-micro [data-psm-video=""] { display: none !important; }

/* =============================================================
   Micro-interactions layer
   ============================================================= */

/* Scroll reveal: elements get .psm-rv from JS (motion-allowing browsers
   only), then .psm-rv--in when they enter the viewport. No JS = visible. */
.ps-micro .psm-rv {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1);
    transition-delay: var(--psm-rv-delay, 0ms);
}
.ps-micro .psm-rv--in {
    opacity: 1;
    transform: none;
}
/* Capability number chips pop as their item reveals */
.ps-micro .psm-rv .psm-caps__num,
.ps-micro .psm-rv .psm-problem__x {
    transform: scale(.5);
    transition: transform .5s cubic-bezier(.34,1.56,.64,1);
    transition-delay: calc(var(--psm-rv-delay, 0ms) + 120ms);
}
.ps-micro .psm-rv--in .psm-caps__num,
.ps-micro .psm-rv--in .psm-problem__x { transform: scale(1); }

/* Gold CTA sheen sweep on hover */
.ps-micro .psm-btn--gold {
    position: relative;
    overflow: hidden;
}
.ps-micro .psm-btn--gold::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0;
    left: -80%;
    width: 50%;
    background: linear-gradient(105deg, transparent, rgba(255,255,255,.55), transparent);
    transform: skewX(-20deg);
    transition: left .55s ease;
    pointer-events: none;
}
.ps-micro .psm-btn--gold:hover::after { left: 130%; }

/* Video play button: soft expanding pulse ring */
.ps-micro .psm-how__play::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(128, 223, 217, .55);
    animation: psm-pulse 2.4s ease-out infinite;
    pointer-events: none;
}
@keyframes psm-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(128, 223, 217, .55); }
    70%  { box-shadow: 0 0 0 26px rgba(128, 223, 217, 0); }
    100% { box-shadow: 0 0 0 0 rgba(128, 223, 217, 0); }
}

/* Sub-nav links: teal underline slides in on hover */
.ps-micro .psm-subnav__link::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: #97DDD8;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}
.ps-micro .psm-subnav__link:hover::after { transform: scaleX(1); }
.ps-micro .psm-subnav__link.is-active::after { transform: scaleX(1); background: var(--psm-teal); }

/* In-page anchors glide */
.ps-micro { scroll-behavior: smooth; }

/* =============================================================
   Microsite pages run without the main PerfectServe site nav:
   the IA sub-nav is the navigation. Scoped to this template's
   body class only.
   ============================================================= */
body.page-template-psm-microsite header.fixed,
body.page-template-psm-microsite .navigation-section,
body.page-template-page-intelligent-answering header.fixed,
body.page-template-page-intelligent-answering-php .navigation-section,
body.page-template-page-intelligent-answering-php header.fixed {
    display: none !important;
}
