/* Landing v2 — hero strip + 2x2 grid of live Pulse panels.
   Mobile-first. Prefixes: .lh-* for the page, .pulse-* for the widget. */

.lh-page {
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-primary);
    overflow-x: hidden;
}

/* ===== Hero strip ===== */

.lh-hero-strip {
    padding: 1rem 0.75rem 0.5rem;
}

.lh-hero-strip-inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto;
}

.lh-hero-copy {
    text-align: center;
}

.lh-hero-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 0.375rem 0;
}

.lh-hero-tagline {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.lh-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.lh-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    min-height: 44px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.lh-cta .material-icons-outlined {
    font-size: 18px;
    color: var(--accent-primary);
}

@media (hover: hover) {
    .lh-cta:hover {
        background: var(--bg-tertiary);
        border-color: rgba(99, 102, 241, 0.4);
    }
}

/* ===== 2x2 grid ===== */

.lh-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 0.75rem;
    max-width: 1400px;
    margin: 0 auto;
}

.lh-cell {
    /* On mobile each panel gets its own viewport-relative height so all four
       fit on a scrollable page without one panel hogging the screen. */
    min-height: 380px;
}

.lh-panel-mount {
    height: 100%;
    width: 100%;
}

/* ===== Pulse panel shared chrome ===== */

.pulse-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.pulse-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    flex-shrink: 0;
}

.pulse-header-icon {
    font-size: 18px;
    color: var(--text-secondary);
}

.pulse-header-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.pulse-see-all {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: auto;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    border-radius: 6px;
}

.pulse-see-all .material-icons-outlined {
    font-size: 14px;
}

@media (hover: hover) {
    .pulse-see-all:hover {
        color: var(--accent-primary);
        background: rgba(99, 102, 241, 0.08);
    }
}

.pulse-list {
    /* No internal scroll — the page scrolls. Avoids wheel-trapping when the
       cursor hovers a panel. Panels grow to fit all their items. */
    flex: 1 1 auto;
}

.pulse-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* ===== Generic row (chat / bot / contest) ===== */

.pulse-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 0.625rem;
    align-items: start;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    min-height: 56px;
}

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

@media (hover: hover) {
    .pulse-row:hover {
        background: var(--bg-tertiary);
    }
}

.pulse-row-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-tertiary);
}

.pulse-row-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.pulse-row-body {
    min-width: 0;
}

.pulse-row-meta {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
    font-size: 0.8rem;
}

.pulse-row-user {
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pulse-row-ts {
    color: var(--text-tertiary);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.pulse-row-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.35;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* ===== Contest tile prize column ===== */

.pulse-contest-prize {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    line-height: 1;
    text-align: center;
}

/* Completed contests: gold/trophy color instead of urgency red */
.pulse-row-contest-done .pulse-contest-prize {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

/* ===== Post grid (Hot Posts panel) ===== */

.pulse-post-grid {
    display: grid;
    /* Auto-fill thumbs: 3 cols on narrow panels, more on wider ones */
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 2px;
    padding: 2px;
}

.pulse-post-tile {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 6px;
    background: var(--bg-tertiary);
    cursor: pointer;
}

.pulse-post-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pulse-post-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-tertiary);
}

.pulse-post-fallback .material-icons-outlined {
    font-size: 24px;
}

.pulse-post-caption {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 0.375rem 0.5rem;
    font-size: 0.7rem;
    color: white;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 20%, rgba(0,0,0,0) 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

/* ===== Input row (chat panel only) ===== */

.pulse-input-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.pulse-input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    min-height: 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;   /* ≥16px → no iOS auto-zoom */
    line-height: 1.2;
    outline: none;
}

.pulse-input::placeholder { color: var(--text-tertiary); }
.pulse-input:focus { border-color: var(--accent-primary); }
.pulse-input[readonly] { cursor: pointer; }

.pulse-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: none;
    background: var(--accent-primary);
    color: white;
    cursor: pointer;
    flex-shrink: 0;
}

.pulse-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pulse-send-btn .material-icons-outlined { font-size: 18px; }

@media (hover: hover) {
    .pulse-send-btn:hover { background: var(--accent-hover); }
}

/* ===== Tablet (≥768px) ===== */

@media (min-width: 768px) {
    .lh-hero-strip {
        padding: 1.5rem 1.5rem 0.75rem;
    }
    .lh-hero-strip-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 1.5rem;
    }
    .lh-hero-copy {
        text-align: left;
    }
    .lh-hero-title {
        font-size: 2rem;
    }
    .lh-hero-tagline {
        font-size: 1rem;
    }
    .lh-cta-row {
        flex-wrap: nowrap;
        justify-content: flex-end;
    }
    .lh-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        padding: 1rem 1.5rem;
    }
    .lh-cell {
        min-height: 360px;
    }
}

/* ===== Desktop (≥1024px) ===== */

@media (min-width: 1024px) {
    .lh-hero-title { font-size: 2.5rem; }
    .lh-grid {
        gap: 1.25rem;
        padding: 1rem 2rem 2rem;
    }
    .lh-cell {
        /* No max-height — cells grow to fit their content so the page scrolls
           uniformly instead of each panel being a wheel trap. */
        min-height: 360px;
    }
}
