/* Tecnify gallery: square, responsive image cards with subtle tap feedback. */
/* Critical visibility fallback: this gallery must remain visible even if the generic
   scroll-reveal observer is delayed, blocked, or unavailable on a page. */
[data-story-gallery] {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    filter: none !important;
    content-visibility: visible;
}
[data-story-gallery] .story-gallery-card,
[data-story-gallery] .story-img-wrap,
[data-story-gallery] .story-img-wrap img {
    visibility: visible !important;
}
[data-story-gallery] {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: clamp(14px, 2vw, 24px);
    width: 100%;
}
[data-story-gallery] .story-gallery-card {
    appearance: none;
    -webkit-appearance: none;
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    color: inherit;
    text-align: left;
    font: inherit;
    cursor: pointer;
    border: 1px solid var(--glass-border, rgba(125, 173, 255, .2)) !important;
    border-radius: 18px !important;
    background: var(--glass-surface, var(--card-bg, #ffffff)) !important;
    box-shadow: var(--glass-shadow, 0 8px 24px rgba(0, 0, 0, .10)) !important;
    transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
    [data-story-gallery] .story-gallery-card:hover {
        transform: translateY(-5px);
        border-color: rgba(70, 150, 255, .58) !important;
        box-shadow: 0 16px 34px rgba(0, 102, 255, .15) !important;
    }
    [data-story-gallery] .story-gallery-card:hover .story-img-wrap img {
        transform: scale(1.035);
    }
}
[data-story-gallery] .story-gallery-card:focus-visible {
    outline: 3px solid var(--accent, #438cff);
    outline-offset: 4px;
}
[data-story-gallery] .story-img-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #edf2fb;
}
[data-story-gallery] .story-img-wrap img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .35s ease;
}
/* Old gallery images also use the clean no-caption treatment. */
[data-story-gallery] .story-overlay { display: none !important; }
[data-story-gallery] .story-gallery-card.is-animating {
    animation: story-gallery-tap .5s cubic-bezier(.2, .8, .2, 1);
}
@keyframes story-gallery-tap {
    0%, 100% { transform: scale(1); }
    38% { transform: scale(.978); }
    72% { transform: scale(1.012); }
}
.stories-gallery-cta {
    display: flex;
    justify-content: center;
    margin: 28px auto 0;
    padding: 0 12px;
}
.stories-gallery-cta .btn { min-width: 190px; }
@media (max-width: 820px) {
    [data-story-gallery] {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }
    [data-story-gallery] .story-gallery-card { border-radius: 14px !important; }
    .stories-gallery-cta { margin-top: 22px; }
}
@media (max-width: 360px) {
    [data-story-gallery] { gap: 10px; }
    [data-story-gallery] .story-gallery-card { border-radius: 11px !important; }
}
@media (prefers-reduced-motion: reduce) {
    [data-story-gallery] .story-gallery-card,
    [data-story-gallery] .story-img-wrap img { transition: none !important; }
    [data-story-gallery] .story-gallery-card.is-animating { animation: none !important; }
}

/* Keep the gallery anchor below the fixed site header after View More navigation. */
#gallery { scroll-margin-top: 96px; }
@media (max-width: 820px) {
    #gallery { scroll-margin-top: 82px; }
}
