/* ============================================================
   NAVIGARENT — GALLERIA CSS COMPLETO
   Hero Slider + Masonry Grid + Lightbox + CTA
   ============================================================ */

/* ── HERO SLIDER ── */
.nrg-hero-slider {
    position: relative;
    height: 100vh;
    min-height: 560px;
    max-height: 900px;
    overflow: hidden;
    background: var(--nr-navy);
}

/* Track e slides */
.nrg-slider__track {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.nrg-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1s ease;
    will-change: opacity;
}

.nrg-slide.is-active {
    opacity: 1;
    z-index: 1;
}

.nrg-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nrg-slide__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10,22,40,.25) 0%,
        rgba(10,22,40,.12) 40%,
        rgba(10,22,40,.55) 100%
    );
}

/* Testo hero */
.nrg-hero-slider__content {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    color: #fff;
    pointer-events: none;
}

.nrg-hero-slider__content .nr-overline {
    color: rgba(255,255,255,.7);
    margin-bottom: 16px;
}

.nrg-hero-slider__content h1 {
    font-family: var(--nr-display);
    font-size: clamp(3.5rem, 7vw, 6.5rem);
    font-weight: 600;
    line-height: .9;
    letter-spacing: -.03em;
    color: #fff;
    margin: 0 0 20px;
}

.nrg-hero-slider__content p {
    font-family: var(--nr-display);
    font-style: italic;
    font-size: clamp(1.1rem, 2.2vw, 1.5rem);
    color: rgba(255,255,255,.82);
    margin: 0;
    line-height: 1.5;
}

/* Pulsanti prev/next */
.nrg-slider__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 1.5px solid rgba(255,255,255,.4);
    background: rgba(255,255,255,.1);
    backdrop-filter: blur(8px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .22s ease, border-color .22s ease, transform .22s ease;
}

.nrg-slider__btn svg { width: 22px; height: 22px; }

.nrg-slider__btn--prev { left: 24px; }
.nrg-slider__btn--next { right: 24px; }

.nrg-slider__btn:hover {
    background: rgba(63,169,201,.5);
    border-color: var(--nr-teal);
    transform: translateY(-50%) scale(1.06);
}

/* Dots */
.nrg-slider__dots {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    gap: 8px;
}

.nrg-slider__dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.35);
    border: none;
    cursor: pointer;
    transition: background .25s ease, transform .25s ease, width .25s ease;
    padding: 0;
}

.nrg-slider__dot.is-active {
    background: #fff;
    width: 24px;
}

/* Contatore */
.nrg-slider__counter {
    position: absolute;
    bottom: 32px;
    right: 28px;
    z-index: 4;
    font-family: var(--nr-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    color: rgba(255,255,255,.65);
}

.nrg-slider__counter-sep { margin: 0 4px; opacity: .5; }

/* ── INTRO GRIGLIA ── */
.nrg-grid-intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 20px 16px;
    max-width: 1600px;
    margin: 0 auto;
}

.nrg-grid-intro__count {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--nr-muted);
}

/* ── GRIGLIA MASONRY ── */
.nrg-grid-wrap {
    padding: 0 0 80px;
}

.nrg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 280px;
    gap: 5px;
    width: 100%;
}

.nrg-item--wide  { grid-column: span 2; }
.nrg-item--tall  { grid-row: span 2; }

/* Foto */
.nrg-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    margin: 0;
    border: none;
    background: var(--nr-navy);
    display: block;
}

.nrg-item__img-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.nrg-item__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .65s cubic-bezier(.25,.46,.45,.94), filter .5s ease;
    filter: brightness(.9) saturate(1.04);
}

/* Overlay foto */
.nrg-item__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(10,22,40,.78) 0%,
        rgba(10,22,40,.15) 50%,
        transparent 100%
    );
    display: flex;
    align-items: flex-end;
    padding: 20px 22px;
    opacity: 0;
    transition: opacity .35s ease;
}

.nrg-item__overlay-content {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
}

.nrg-item__hover-label {
    font-family: var(--nr-display);
    font-size: clamp(.85rem, 1.2vw, 1.05rem);
    font-style: italic;
    color: rgba(255,255,255,.92);
    transform: translateY(6px);
    transition: transform .35s ease;
    line-height: 1.2;
}

.nrg-item__zoom {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1.5px solid rgba(255,255,255,.45);
    background: rgba(255,255,255,.08);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transform: scale(.8) translateY(6px);
    transition: transform .35s ease, background .22s ease, border-color .22s ease;
}

.nrg-item__zoom svg { width: 18px; height: 18px; color: #fff; }

/* Hover */
.nrg-item:hover .nrg-item__img-wrap img {
    transform: scale(1.07);
    filter: brightness(1) saturate(1.12);
}

.nrg-item:hover .nrg-item__overlay { opacity: 1; }

.nrg-item:hover .nrg-item__hover-label {
    transform: translateY(0);
}

.nrg-item:hover .nrg-item__zoom {
    transform: scale(1) translateY(0);
    background: rgba(63,169,201,.38);
    border-color: rgba(63,169,201,.75);
}

.nrg-item:focus-visible {
    outline: 2px solid var(--nr-teal);
    outline-offset: -2px;
    z-index: 2;
}

/* ── LIGHTBOX ── */
.nrg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nrg-lightbox[hidden] { display: none; }

.nrg-lb__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5,12,24,.94);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

/* Close */
.nrg-lb__close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 2;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 1.5px solid rgba(255,255,255,.3);
    background: rgba(255,255,255,.08);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease;
}

.nrg-lb__close svg { width: 20px; height: 20px; }
.nrg-lb__close:hover { background: rgba(255,255,255,.18); }

/* Prev / Next */
.nrg-lb__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    border: 1.5px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.08);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.nrg-lb__nav svg { width: 24px; height: 24px; }
.nrg-lb__prev { left: 20px; }
.nrg-lb__next { right: 20px; }

.nrg-lb__nav:hover {
    background: rgba(63,169,201,.35);
    border-color: rgba(63,169,201,.6);
    transform: translateY(-50%) scale(1.06);
}

/* Stage immagine */
.nrg-lb__stage {
    position: relative;
    z-index: 1;
    max-width: calc(100vw - 160px);
    max-height: calc(100vh - 100px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nrg-lb__img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    width: auto;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 32px 80px rgba(0,0,0,.6);
    transition: opacity .3s ease;
    object-fit: contain;
}

.nrg-lb__img.is-loading { opacity: 0; }

/* Loader */
.nrg-lb__loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nrg-lb__loader::after {
    content: '';
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 2.5px solid rgba(255,255,255,.15);
    border-top-color: var(--nr-teal);
    animation: nrgSpin .7s linear infinite;
}

.nrg-lb__loader.is-hidden { display: none; }

@keyframes nrgSpin { to { transform: rotate(360deg); } }

/* Caption */
.nrg-lb__caption {
    display: none;
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--nr-display);
    font-style: italic;
    font-size: 1rem;
    color: rgba(255,255,255,.65);
}

/* Contatore lightbox */
.nrg-lb__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: rgba(255,255,255,.5);
}

/* ── CTA ── */
.nrg-cta {
    background: linear-gradient(135deg, var(--nr-navy) 0%, var(--nr-navy-deep) 100%);
    padding: 88px 20px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.nrg-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 50%, rgba(63,169,201,.18), transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,.04), transparent 40%);
    pointer-events: none;
}

.nrg-cta__inner {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.nrg-cta__inner .nr-overline {
    color: rgba(255,255,255,.65);
    margin-bottom: 14px;
    display: block;
}

.nrg-cta__inner h2 {
    font-family: var(--nr-display);
    font-size: clamp(2.4rem, 4.5vw, 3.8rem);
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px;
    line-height: .95;
    letter-spacing: -.02em;
}

.nrg-cta__inner p {
    font-size: 16px;
    color: rgba(255,255,255,.72);
    line-height: 1.75;
    margin: 0 0 36px;
}

.nrg-cta__actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.nrg-cta__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 54px;
    padding: 0 34px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--nr-teal), var(--nr-teal-dark));
    color: #fff;
    font-family: var(--nr-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    text-decoration: none;
    border: none;
    cursor: pointer;
    box-shadow: 0 14px 32px rgba(63,169,201,.30);
    transition: transform .22s ease, filter .22s ease;
}

.nrg-cta__btn:hover { transform: translateY(-2px); filter: brightness(1.07); }

.nrg-cta__btn--ghost {
    background: rgba(255,255,255,.1);
    box-shadow: none;
    border: 1.5px solid rgba(255,255,255,.28);
}

.nrg-cta__btn--ghost:hover {
    background: rgba(255,255,255,.2);
    filter: none;
}

/* ── RESPONSIVE ── */
@media (max-width: 1200px) {
    .nrg-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 260px;
    }
}

@media (max-width: 900px) {
    .nrg-hero-slider { height: 70vh; }
    .nrg-slider__btn { width: 42px; height: 42px; }
    .nrg-slider__btn--prev { left: 12px; }
    .nrg-slider__btn--next { right: 12px; }
}

@media (max-width: 768px) {
    .nrg-hero-slider { height: 60vh; min-height: 420px; }
    .nrg-hero-slider__content h1 { font-size: clamp(2.8rem, 8vw, 4rem); }

    .nrg-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 200px;
        gap: 4px;
    }
    .nrg-item--wide { grid-column: span 1; }
    .nrg-item--tall { grid-row: span 2; }

    .nrg-lb__stage { max-width: calc(100vw - 100px); }
    .nrg-lb__prev { left: 8px; }
    .nrg-lb__next { right: 8px; }
    .nrg-lb__nav { width: 42px; height: 42px; }

    .nrg-cta { padding: 64px 20px; }
    .nrg-cta__actions { flex-direction: column; }
    .nrg-cta__btn { width: 100%; }
}

@media (max-width: 480px) {
    .nrg-grid { grid-auto-rows: 160px; }
    .nrg-hero-slider { height: 55vh; }
}