/* ============================================================
   BEINC — Insights Section
   Desktop/tablet: infinite-marquee cards on the left, text + CTA on the right.
   Phone: text on top, cards below.
   Dashed top/bottom uses the global --guide-border tokens.
   ============================================================ */


/* ── Section shell ── */
.insights-section {
    background: var(--color-black2);
    color: var(--color-white);
    /* 20vh top breathing room is baked into the section's painted box rather
       than a margin — section sits above the homepage-hero sticky wrapper,
       so an empty margin would let the hero video bleed through. */
    padding: calc(20vh + var(--space-9)) 0 var(--space-9);
    position: relative;
}

/* Dashed top/bottom rails — positioned absolute so JS can scaleX them in */
.insights-dash-top,
.insights-dash-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 0;
    z-index: 1;
    transform: scaleX(0);   /* hidden until reveal */
    pointer-events: none;
}
.insights-dash-top {
    top: 20vh;                        /* compensates for the 20vh added to section padding-top */
    border-top: var(--guide-border);
    transform-origin: left center;    /* LTR */
}
.insights-dash-bottom {
    bottom: 0;
    border-bottom: var(--guide-border);
    transform-origin: right center;   /* RTL */
}

.insights-container {
    display: flex;
    align-items: center;
    padding: 0 var(--pad-x);
    margin: 0 auto;
}


/* ── Cards viewport (left) — ~60vw minus left global padding ── */
.insights-cards-wrap {
    position: relative;
    flex: 0 0 60%;
    min-width: 0;
    overflow: hidden;
    container-type: inline-size;
    cursor: grab;
    touch-action: pan-y;

    --cards-visible: 4;
    --cards-gap: 16px;
}

.insights-cards-wrap:active { cursor: grabbing; }

/* Edge fade gradients — black2 → transparent on each side */
.insights-cards-wrap::before,
.insights-cards-wrap::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 10%;
    max-width: 120px;
    pointer-events: none;
    z-index: 2;
}
.insights-cards-wrap::before {
    left: 0;
    background: linear-gradient(to right, var(--color-black2) 0%, rgba(25, 23, 22, 0) 100%);
}
.insights-cards-wrap::after {
    right: 0;
    background: linear-gradient(to left, var(--color-black2) 0%, rgba(25, 23, 22, 0) 100%);
}

.insights-cards-track {
    display: flex;
    gap: var(--cards-gap);
    will-change: transform;
    user-select: none;
    -webkit-user-select: none;
}


/* ── Card ── */
.insight-card {
    /* width = (wrap width − gaps) / visible-count; height auto (image AR drives it) */
    flex: 0 0 calc((100cqw - var(--cards-gap) * (var(--cards-visible) - 1)) / var(--cards-visible));
    display: flex;
    flex-direction: column;
    padding: var(--space-4);
    border: var(--guide-border);
    border-radius: var(--radius);
    background: transparent;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    -webkit-user-drag: none;
    transition:
        background-color var(--duration-fast) var(--ease-primary),
        border-color var(--duration-fast) var(--ease-primary);
}

.insight-card:hover {
    background: var(--color-darkgreyish);
    border-color: var(--color-greyish);
}

/* Fixed landscape image so every card's media looks identical */
.insight-card-image {
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
}

.insight-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
    pointer-events: none; /* keeps drag gestures on the card, not the image */
    -webkit-user-drag: none;
}

.insight-card-title {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--tracking-tight);
    font-size: var(--text-sm);
    line-height: var(--leading-snug);
    color: var(--color-white);
    margin-bottom: var(--space-3);
}

.insight-card-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-top: auto;         /* push date row to the bottom when cards stretch */
    padding-top: var(--space-3);
}

.insight-card-cal {
    width: 14px;
    height: 14px;
    display: block;
    flex: 0 0 auto;
}

.insight-card-date {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-body);
    color: var(--color-greyish);
}


/* ── Text block (right) — ~40vw minus right global padding ── */
.insights-text {
    flex: 0 0 40%;
    min-width: 0;
    padding-left: var(--space-9);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-5);
    box-sizing: border-box;
}

.insights-heading {
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--tracking-tight);
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: var(--leading-none);
    color: var(--color-white);
}

.insights-body {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    letter-spacing: var(--tracking-body);
    line-height: var(--leading-normal);
    color: var(--color-greyish);
}

.insights-cta {
    align-self: flex-start;   /* default: left-aligned (tablet + phone) */
    display: inline-block;
    background: var(--color-white);
    color: var(--color-black2);
    font-family: var(--font-btn);
    font-weight: var(--font-weight-btn);
    letter-spacing: var(--tracking-btn);
    font-size: var(--text-btn);
    padding: var(--btn-pad-y) var(--btn-pad-x);
    border-radius: var(--radius);
    transition: transform var(--duration-fast) var(--ease-primary);
}

.insights-cta:hover {
    transform: translateY(-2px);
}

@media (min-width: 1024px) {
    .insights-cta { align-self: flex-end; }   /* desktop: right-aligned */
}


/* ── Responsive ── */

/* Small desktop: 3 cards visible */
@media (max-width: 1439px) {
    .insights-cards-wrap { --cards-visible: 3; }
}

/* Tablet + phone: stack — text on top, cards below */
@media (max-width: 1023px) {
    .insights-container {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-7);
    }
    .insights-cards-wrap {
        order: 2;
        flex: 0 0 auto;
        --cards-visible: 3;
        --cards-gap: 12px;
    }
    .insights-text {
        order: 1;
        flex: 0 0 auto;
        max-width: 100%;
        padding-left: 0;
    }
    .insights-cards-wrap::before,
    .insights-cards-wrap::after { width: 15%; }
}

@media (max-width: 767px) {
    .insights-heading { font-size: clamp(2.5rem, 12vw, 3.5rem); }
    .insights-cards-wrap { --cards-visible: 2; }

    /* Tighter top breathing room on mobile (was calc(20vh + space-9)).
       Keep the dash at 10vh so 10vh of empty space sits above it, then
       add space-9 BELOW the dash before the heading begins — mirrors
       the cards→bottom-dash gap (which is the section's padding-bottom
       of space-9). */
    .insights-section { padding-top: calc(10vh + var(--space-9)); }
    .insights-dash-top { top: 10vh; }
}


/* ============================================================
   CUSTOM CURSOR — "See Insight" pill (desktop only)
   Same visual pattern as .project-card__cursor. A single cursor
   element is moved to <body> at init so position:fixed tracks
   correctly through the marquee's transforms.
   ============================================================ */
.insights-cursor {
    position: fixed;
    pointer-events: none;
    z-index: var(--z-overlay);
    will-change: transform;
    transform: translate(12px, -46px);
}

.insights-cursor-svg {
    display: block;
    width: 141px;
    height: 41px;
}

.insights-cursor-label {
    position: absolute;
    top: 0;
    left: 10.5px;
    width: 130px;
    height: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: var(--font-weight-medium);
    letter-spacing: var(--tracking-tight);
    font-size: 13px;
    line-height: 1;
    color: var(--color-white);
    white-space: nowrap;
    pointer-events: none;
}

@media (max-width: 767px) {
    .insights-cursor { display: none !important; }
}
