/* ============================================================
   FEATURE GRID - uniform-height cards with click-to-zoom lightbox

   All cards share one row height (grid-auto-rows), one thumb-frame
   height, and one caption area. Thumbnails that are taller than the
   frame are top-cropped with a bottom fade; long captions get the
   same fade treatment so oversized text never pushes a card.

   Thumbnail HTML width attributes set a consistent zoom ratio across
   the set (same visible text size regardless of capture source).

   The lightbox must live at body-level, outside any transform-animated
   ancestor, or position:fixed gets trapped in a containing block.
   ============================================================ */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 200px);
    grid-auto-rows: 380px;
    gap: 1.25rem;
    margin: 1rem 0;
    justify-content: start;
}
.feature-card {
    display: flex;
    flex-direction: column;
    background: var(--insign-card-bg);
    border: 1px solid var(--insign-border);
    border-radius: 10px;
    cursor: zoom-in;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--insign-blue);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
}
.feature-card .thumb-frame {
    position: relative;
    flex-shrink: 0;
    height: 170px;
    margin: 10px 10px 0;
    border-radius: 6px;
    background: var(--insign-code-bg);
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}
/* Bottom fade hints that the thumb may be top-cropped. Harmless when the
   image fits (fades into the matching background). */
.feature-card .thumb-frame::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 36px;
    background: linear-gradient(to bottom, transparent, var(--insign-card-bg));
    pointer-events: none;
}
.feature-card img {
    display: block;
    height: auto;
    max-width: 100%;
}
.feature-card figcaption {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0.75rem 1rem 1rem;
    font-size: 0.82rem;
    color: var(--insign-text-muted);
    line-height: 1.45;
    overflow: hidden;
    /* Soft fade on the bottom edge so over-long captions don't look chopped. */
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
            mask-image: linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
}
.feature-card figcaption strong {
    display: block;
    color: var(--insign-blue);
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.feature-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(10,20,35,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 2rem;
    cursor: zoom-out;
    animation: feature-lightbox-fade 0.2s ease;
}
.feature-lightbox.active { display: flex; }
.feature-lightbox img {
    max-width: 95vw;
    max-height: 90vh;
    box-shadow: 0 10px 50px rgba(0,0,0,0.6);
    border-radius: 8px;
    cursor: default;
}
.feature-lightbox-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: #fff;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.feature-lightbox-close:hover { background: rgba(255,255,255,0.24); }
@keyframes feature-lightbox-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
