/**
 * LIVZO — "Ask residents" (homepage module 6).
 *
 * The conversation layer: the framed society artwork, four reasons to trust the
 * answers, and a strip of popular questions.
 *
 * Motion index
 *   reveal-on-scroll → [data-lz-inview] + .is-in (assets/js/societies.js)
 *   ambient          → glow drift, floating pins
 *   hover            → question pill accent, arrow nudge
 *
 * Layout
 *   ≥1000px : two columns — visual (left, wider) + questions/features (right)
 *   <1000px : stacked — the framed image, then the features
 */

/* ==========================================================================
   1. Shell + decorative background
   ========================================================================== */

.lz-ask {
    position: relative;
    isolation: isolate;
    padding: clamp(60px, 6.6vw, 96px) 0 clamp(68px, 8vw, 100px);
    scroll-margin-top: calc(var(--lz-header-h) + 16px);
}

.lz-ask__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.lz-ask__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(72px);
}

.lz-ask__glow--a {
    top: -12%;
    right: -6%;
    width: min(46vw, 540px);
    aspect-ratio: 1;
    background-image: radial-gradient(circle at 50% 50%, rgba(109, 74, 255, 0.16), rgba(109, 74, 255, 0) 70%);
    animation: lzDrift 24s ease-in-out infinite;
}

.lz-ask__glow--b {
    bottom: -20%;
    left: -10%;
    width: min(42vw, 500px);
    aspect-ratio: 1;
    background-image: radial-gradient(circle at 50% 50%, rgba(109, 74, 255, 0.11), rgba(109, 74, 255, 0) 70%);
    animation: lzDrift 30s ease-in-out infinite reverse;
}

.lz-ask__dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(11, 27, 51, 0.055) 1.4px, transparent 1.4px);
    background-size: 28px 28px;
    -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 0%, transparent 76%);
    mask-image: radial-gradient(ellipse 70% 60% at 50% 42%, #000 0%, transparent 76%);
}

.lz-ask__pin {
    position: absolute;
    color: var(--lz-accent);
}

.lz-ask__pin .lz-icon { width: 100%; height: 100%; }

.lz-ask__pin--a {
    top: 18%;
    left: 3%;
    width: 24px;
    opacity: 0.10;
    animation: lzFloat 13s ease-in-out infinite;
}

.lz-ask__pin--b {
    top: 68%;
    right: 4%;
    width: 18px;
    opacity: 0.08;
    animation: lzFloat 16s ease-in-out infinite reverse;
}

/* ==========================================================================
   2. Two-column body
   ========================================================================== */

.lz-ask__body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(28px, 3.4vw, 46px);
}

/* Below this the visual column gets too narrow for a thread card flanked by two
   bubbles, so the stacked layout (full-width panel + bubble swipe row) takes over. */
@media (min-width: 1180px) {
    .lz-ask__body {
        grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
        align-items: center;
    }
}

/* ==========================================================================
   3. Head
   ========================================================================== */

.lz-ask__head {
    display: grid;
    gap: 18px;
}

.lz-ask__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    align-self: start;
    padding: 7px 16px 7px 9px;
    border: 1px solid rgba(109, 74, 255, 0.18);
    border-radius: var(--lz-r-pill);
    background-color: var(--lz-accent-soft);
    color: var(--lz-accent-700);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.lz-ask__eyebrow-ico {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: #fff;
    color: var(--lz-accent);
    animation: lzPulse 3.4s var(--lz-ease) infinite;
}

.lz-ask__eyebrow-ico .lz-icon { width: 13px; height: 13px; }

.lz-ask__title {
    margin-top: 14px;
    font-size: clamp(1.9rem, 1.25rem + 2.05vw, 2.9rem);
    letter-spacing: -0.035em;
    text-wrap: balance;
}

.lz-ask__title-accent {
    background-image: linear-gradient(100deg, var(--lz-accent-700) 0%, var(--lz-accent) 34%, #9C86FF 62%, var(--lz-accent) 100%);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: var(--lz-accent);
    -webkit-text-fill-color: transparent;
    animation: lzAccentFlow 9s var(--lz-ease) infinite;
}

.lz-ask__lead {
    margin-top: 14px;
    max-width: 52ch;
    font-size: clamp(1rem, 0.96rem + 0.2vw, 1.08rem);
    line-height: 1.7;
    color: var(--lz-body);
}

.lz-ask__action {
    justify-self: start;
    border-color: var(--lz-line-2);
    background-color: #fff;
    color: var(--lz-navy);
    box-shadow: var(--lz-sh-1);
}

.lz-ask__action:hover {
    border-color: rgba(109, 74, 255, 0.34);
    background-color: var(--lz-accent-soft);
    color: var(--lz-accent-700);
    transform: translateY(-2px);
    box-shadow: 0 14px 28px -18px rgba(109, 74, 255, 0.80);
}

@media (min-width: 720px) {
    .lz-ask__head {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 20px clamp(24px, 3vw, 40px);
    }

    .lz-ask__action { justify-self: end; }
}

/* ==========================================================================
   4. Visual — the framed society artwork
   ========================================================================== */

.lz-ask__stage {
    position: relative;
    min-width: 0;
    min-height: clamp(430px, 38vw, 570px);
}

.lz-ask__panel {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    background-color: var(--lz-bg-2);
    box-shadow: 0 1px 2px rgba(11, 27, 51, 0.05), 0 34px 66px -44px rgba(11, 27, 51, 0.42);
}

.lz-ask__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Community thread card (shared with the society profile's ask block) - */

.lz-ask__thread {
    width: min(330px, 50%);
    padding: 18px 18px 20px;
    border: 1px solid var(--lz-line);
    border-radius: 22px;
    background-color: var(--lz-surface);
    box-shadow: 0 2px 4px rgba(11, 27, 51, 0.06), 0 26px 50px -30px rgba(11, 27, 51, 0.42);
}

.lz-ask__thread-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lz-ask__thread-ico {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 11px;
    background-color: var(--lz-accent-soft);
    color: var(--lz-accent);
}

.lz-ask__thread-ico .lz-icon { width: 18px; height: 18px; }

.lz-ask__thread-id { display: grid; min-width: 0; }

.lz-ask__thread-title {
    color: var(--lz-navy);
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.lz-ask__thread-lead {
    color: var(--lz-body);
    font-size: 0.75rem;
    font-weight: 500;
}

.lz-ask__thread-question {
    margin-top: 14px;
    padding: 11px 14px;
    border-radius: 16px 16px 16px 5px;
    background-image: linear-gradient(180deg, var(--lz-accent) 0%, var(--lz-accent-600) 100%);
    color: #fff;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: -0.01em;
    box-shadow: 0 12px 24px -16px rgba(109, 74, 255, 0.9);
}

.lz-ask__reply {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
}

.lz-ask__reply .lz-avatar {
    width: 34px;
    height: 34px;
}

.lz-ask__reply-body { min-width: 0; }

.lz-ask__reply-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.lz-ask__reply-name {
    color: var(--lz-navy);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.lz-ask__reply .lz-verified {
    padding: 3px 8px 3px 6px;
    font-size: 0.63rem;
}

.lz-ask__reply .lz-verified__ico .lz-icon { width: 11px; height: 11px; }

.lz-ask__reply-meta {
    margin-top: 3px;
    color: var(--lz-body);
    font-size: 0.7rem;
    font-weight: 500;
}

.lz-ask__reply-text {
    margin-top: 6px;
    color: var(--lz-ink);
    font-size: 0.82rem;
    line-height: 1.55;
}

/* ==========================================================================
   5. Feature grid (why ask residents)
   ========================================================================== */

.lz-ask__features {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px clamp(20px, 2.4vw, 30px);
    margin-top: clamp(26px, 3.2vw, 38px);
}

@media (min-width: 560px) {
    .lz-ask__features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.lz-ask__feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: 0;
}

.lz-ask__feature-ico {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border: 1px solid rgba(109, 74, 255, 0.16);
    border-radius: 12px;
    background-color: var(--lz-accent-soft);
    color: var(--lz-accent);
    transition: transform 0.3s var(--lz-ease-out), background-color 0.3s var(--lz-ease);
}

.lz-ask__feature-ico .lz-icon { width: 19px; height: 19px; }

.lz-ask__feature:hover .lz-ask__feature-ico {
    transform: translateY(-2px) scale(1.06);
    background-color: var(--lz-accent-soft-2);
}

.lz-ask__feature-body { min-width: 0; }

.lz-ask__feature-title {
    color: var(--lz-navy);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.lz-ask__feature-text {
    margin-top: 5px;
    color: var(--lz-body);
    font-size: 0.85rem;
    line-height: 1.55;
}

/* ==========================================================================
   6. Popular questions strip
   ========================================================================== */

.lz-ask__popular-wrap { margin-top: clamp(34px, 4vw, 54px); }

.lz-ask__popular {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: clamp(18px, 2.2vw, 28px);
    padding: clamp(20px, 2.4vw, 28px);
    border: 1px solid var(--lz-line);
    border-radius: 26px;
    background-image: linear-gradient(135deg, rgba(109, 74, 255, 0.07), rgba(109, 74, 255, 0.02) 48%, rgba(109, 74, 255, 0.06)),
        linear-gradient(180deg, var(--lz-surface), var(--lz-bg-2));
    box-shadow: 0 1px 2px rgba(11, 27, 51, 0.04), 0 22px 46px -38px rgba(11, 27, 51, 0.32);
}

@media (min-width: 1000px) {
    .lz-ask__popular {
        grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
        align-items: center;
        gap: clamp(24px, 3vw, 40px);
    }
}

.lz-ask__popular-ico {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background-image: linear-gradient(180deg, var(--lz-accent) 0%, var(--lz-accent-600) 100%);
    color: #fff;
    box-shadow: 0 12px 24px -16px rgba(109, 74, 255, 0.9);
}

.lz-ask__popular-ico .lz-icon { width: 20px; height: 20px; }

.lz-ask__popular-title {
    margin-top: 12px;
    font-size: clamp(1.1rem, 1rem + 0.4vw, 1.32rem);
    letter-spacing: -0.028em;
}

.lz-ask__popular-lead {
    margin-top: 6px;
    color: var(--lz-body);
    font-size: 0.86rem;
    line-height: 1.55;
}

.lz-ask__questions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}

@media (min-width: 560px) {
    .lz-ask__questions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1240px) {
    .lz-ask__questions { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.lz-ask__question {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 13px 14px;
    border: 1px solid var(--lz-line);
    border-radius: 16px;
    background-color: var(--lz-surface);
    box-shadow: 0 1px 2px rgba(11, 27, 51, 0.04);
    color: var(--lz-navy);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.4;
    transition: border-color 0.25s var(--lz-ease),
        background-color 0.25s var(--lz-ease),
        box-shadow 0.25s var(--lz-ease),
        transform 0.28s var(--lz-ease-out);
}

.lz-ask__question:hover {
    border-color: rgba(109, 74, 255, 0.28);
    background-color: #F8F6FF;
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -22px rgba(109, 74, 255, 0.75);
}

.lz-ask__question-ico {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 10px;
    background-color: var(--lz-accent-soft);
    color: var(--lz-accent);
    transition: transform 0.28s var(--lz-ease-out), background-color 0.25s var(--lz-ease);
}

.lz-ask__question-ico .lz-icon { width: 16px; height: 16px; }

.lz-ask__question:hover .lz-ask__question-ico {
    transform: scale(1.08);
    background-color: var(--lz-accent-soft-2);
}

.lz-ask__question-label { flex: 1 1 auto; min-width: 0; }

.lz-ask__question-arrow {
    width: 16px;
    height: 16px;
    flex: none;
    color: var(--lz-accent);
    transition: transform 0.28s var(--lz-ease-out);
}

.lz-ask__question:hover .lz-ask__question-arrow { transform: translateX(3px); }

/* ==========================================================================
   7. Tagline + note
   ========================================================================== */

.lz-ask__tagline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: clamp(24px, 3vw, 36px);
    color: var(--lz-navy);
    font-size: clamp(0.9rem, 0.86rem + 0.2vw, 1rem);
    font-weight: 700;
    letter-spacing: -0.015em;
    text-align: center;
}

.lz-ask__tagline-ico {
    display: grid;
    place-items: center;
    flex: none;
    color: var(--lz-accent);
}

.lz-ask__tagline-ico .lz-icon { width: 18px; height: 18px; }

.lz-ask__note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    color: var(--lz-body);
    font-size: 0.76rem;
    line-height: 1.5;
    text-align: center;
}

.lz-ask__note-ico {
    display: grid;
    place-items: center;
    flex: none;
    color: var(--lz-accent);
}

.lz-ask__note-ico .lz-icon { width: 14px; height: 14px; }

/* ==========================================================================
   8. Reveal on scroll (scoped copy — the module stays self-contained)
   ========================================================================== */

.has-js .lz-ask [data-lz-inview] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 0.7s var(--lz-ease-out) var(--lz-delay, 0ms),
        transform 0.85s var(--lz-ease-out) var(--lz-delay, 0ms);
    will-change: opacity, transform;
}

.has-js .lz-ask [data-lz-inview].is-in {
    opacity: 1;
    transform: none;
    will-change: auto;
}

/* ==========================================================================
   9. Responsive
   ========================================================================== */

/* Stacked: the framed image leads, then the content below it. */
@media (max-width: 1179px) {
    .lz-ask__stage { min-height: 0; }

    /* The image is square, so the panel takes a ratio — nothing else gives it height
       once the panel stops being absolutely positioned. */
    .lz-ask__panel {
        position: relative;
        inset: auto;
        height: auto;
        aspect-ratio: 1 / 1;
    }

    /* The society profile's ask block is the surviving consumer of this card. */
    .lz-ask__thread { width: min(400px, 100%); }
}

@media (max-width: 640px) {
    .lz-ask__panel { border-radius: 22px; }

    .lz-ask__thread {
        width: 100%;
        border-radius: 18px;
        padding: 15px 15px 17px;
    }

    .lz-ask__thread-question { margin-top: 12px; font-size: 0.8rem; }

    .lz-ask__popular { border-radius: 20px; }

    .lz-ask__tagline {
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 420px) {
    .lz-ask__title { letter-spacing: -0.03em; }
}

/* ==========================================================================
   10. Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .has-js .lz-ask [data-lz-inview] {
        opacity: 1;
        transform: none;
    }

    .lz-ask__title-accent,
    .lz-ask__eyebrow-ico,
    .lz-ask__glow,
    .lz-ask__pin {
        animation: none;
    }
}
