/* ─────────────────────────────────────────────────────────────────────────────
   Homepage IMPACT section — Components/Shared/FoundationImpact.razor.
   Layout, the video card and the numbers variant of the feature card; type and
   buttons come from nikalas-theme.css (nfd-*).
   ───────────────────────────────────────────────────────────────────────────── */

.nf-imp {
    background:
        radial-gradient(ellipse 45% 55% at 90% 20%, rgba(214, 230, 250, .6) 0%, rgba(214, 230, 250, 0) 70%),
        radial-gradient(ellipse 45% 55% at 5% 80%, rgba(255, 255, 255, .9) 0%, rgba(255, 255, 255, 0) 70%),
        var(--nfd-bg);
}

.nf-imp__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: var(--nfd-gap);
}

/* ── Video card ────────────────────────────────────────────────────────────── */

.nf-imp__media { position: relative; padding: 10px; }
.nf-imp__media::before {             /* soft orange shape behind the video's top-left */
    content: "";
    position: absolute;
    left: -10px;
    top: -4px;
    z-index: -1;
    width: 42%;
    height: 58%;
    border-radius: 48% 52% 40% 60% / 56% 44% 56% 44%;
    background: linear-gradient(160deg, var(--nfd-orange-2) 0%, var(--nfd-orange) 100%);
    opacity: .85;
}

.nf-imp__video {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border: 5px solid #fff;
    border-radius: var(--nfd-radius);
    background: #0b1a33;
    box-shadow: var(--nfd-shadow-photo);
}
.nf-imp__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.nf-imp__poster { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; cursor: pointer; }
.nf-imp .nf-imp__poster img[width] {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    transition: transform .4s var(--nfd-ease);
}
/* Shade top and bottom so the caption and label stay legible on any frame. */
.nf-imp__poster::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, 0) 28%, rgba(0, 0, 0, 0) 72%, rgba(0, 0, 0, .45) 100%);
}
.nf-imp__caption {
    position: absolute;
    z-index: 1;
    left: 16px;
    right: 16px;
    top: 12px;
    overflow: hidden;
    font-size: clamp(13px, 1vw, 16px);
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.nf-imp__play {
    position: absolute;
    z-index: 1;
    left: 50%;
    top: 50%;
    width: clamp(58px, 5.5vw, 78px);
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .35));
    transition: transform .3s var(--nfd-ease);
}
.nf-imp__play svg { display: block; width: 100%; height: auto; }
.nf-imp__yt {
    position: absolute;
    z-index: 1;
    left: 12px;
    bottom: 12px;
    padding: 7px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, .62);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-transform: none;
}
.nf-imp__poster:hover img { transform: scale(1.03); }
.nf-imp__poster:hover .nf-imp__play { transform: translate(-50%, -50%) scale(1.08); }
.nf-imp__poster:focus-visible { outline: 3px solid var(--nfd-orange); outline-offset: -3px; }

/* ── Numbers variant of the feature card ───────────────────────────────────── */

.nf-imp__stats .nfd-feature { justify-content: center; }
.nf-imp__stats .nfd-feature-text { font-weight: 500; color: var(--nfd-muted); }
.nf-imp__stats .nfd-feature-text strong {
    font-size: clamp(24px, 2.1vw, 32px);
    font-weight: 800;
    line-height: 1.1;
    color: var(--nfd-navy);
    font-variant-numeric: tabular-nums;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 1099.98px) {
    .nf-imp__stats .nfd-feature { justify-content: flex-start; }
}

@media (max-width: 899.98px) {
    .nf-imp__inner { grid-template-columns: 1fr; }
    .nf-imp__media,
    .nf-imp__content { max-width: 680px; width: 100%; margin: 0 auto; }
}

@media (max-width: 599.98px) {
    .nf-imp__media { padding: 6px; }
    .nf-imp__video { border-width: 3px; border-radius: var(--nfd-radius-sm); }
    .nf-imp__caption { left: 10px; right: 10px; top: 8px; }
    .nf-imp__yt { left: 8px; bottom: 8px; padding: 6px 10px; font-size: 12px; }
    /* Numbers stay two-up on phones, icon above the figure. */
    .rioc-app ul.nf-imp__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; padding: 18px 12px; }
    .nf-imp__stats .nfd-feature { flex-direction: column; text-align: center; gap: 8px; padding: 0; }
    .nf-imp__stats .nfd-feature + .nfd-feature,
    .nf-imp__stats .nfd-feature:nth-child(3) { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .nf-imp .nf-imp__poster img[width], .nf-imp__play { transition: none; }
    .nf-imp__poster:hover img { transform: none; }
    .nf-imp__poster:hover .nf-imp__play { transform: translate(-50%, -50%); }
}
