/* ============================================================
   Nordic Elementor — Hero Header (V5 + Gallery)
   ============================================================ */

.nh-hero {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.nh-hero *, .nh-hero *::before, .nh-hero *::after {
    box-sizing: inherit;
}

.nh-bg-clip {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.nh-fallback-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 0;
}

.nh-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

.nh-video::-webkit-media-controls,
.nh-video::-webkit-media-controls-enclosure,
.nh-video::-webkit-media-controls-panel,
.nh-video::-webkit-media-controls-overlay-play-button,
.nh-video::-webkit-media-controls-play-button,
.nh-video::-webkit-media-controls-start-playback-button {
    display: none !important;
    -webkit-appearance: none !important;
    opacity: 0 !important;
}

.nh-color-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* PNG overlay wrapper */
.nh-png-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    overflow: hidden;
    pointer-events: none;
}

.nh-png-overlay img {
    display: block;
    flex-shrink: 0;
}

/* Text Zone */
.nh-text-zone {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.nh-text {
    max-width: 860px;
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
    pointer-events: auto;
    text-align: center;
}

.nh-heading {
    margin: 0 0 14px;
    line-height: 1.2;
    text-align: center !important;
    width: 100%;
    display: block;
}

.nh-sub {
    margin: 0;
    line-height: 1.6;
    text-align: center;
}

/* Action Buttons */
.nh-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 32px;
}

.nh-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 32px;
    border: 0 solid transparent;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.nh-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Booking Bar */
.nh-booking-outer {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    z-index: 10;
    box-sizing: border-box;
    overflow: visible;
}

.nh-booking-bar {
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    background: transparent;
    border: none;
    box-shadow: none;
}

.nh-booking-bar iframe {
    border: none;
    display: block;
    background: transparent;
    position: absolute;
}

/* Fix Elementor Section Overflow */
.nordic-hero-section,
.nordic-hero-section > .elementor-container,
.nordic-hero-section > .elementor-container > .elementor-row,
.nordic-hero-section .elementor-column,
.nordic-hero-section .elementor-column-wrap,
.nordic-hero-section .elementor-widget-wrap {
    overflow: visible !important;
}

/* ── Inline Gallery Overlay ─────────────────────────────────────── */
.nh-inline-gallery {
    position: absolute;
    inset: 0;
    z-index: 50; /* Above everything inside nh-hero */
    background: #000000;
    display: flex;
}

.nh-inline-gallery[hidden] {
    display: none !important;
}

.nh-inline-gallery__main {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 24px;
}

.nh-inline-gallery__main-img {
    max-width: 100%;
    max-height: calc(100% - 40px);
    object-fit: contain;
}

.nh-inline-gallery__caption {
    color: #aaaaaa;
    font-size: 0.875rem;
    margin-top: 12px;
    text-align: center;
    min-height: 20px;
}

.nh-inline-gallery__sidebar {
    width: 25%;
    min-width: 200px;
    max-width: 300px;
    background: #111111;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #222222;
}

.nh-inline-gallery__topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #1a1a1a;
    border-bottom: 1px solid #222;
}

.nh-inline-gallery__counter {
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 600;
}

.nh-inline-gallery__prev,
.nh-inline-gallery__next,
.nh-inline-gallery__close {
    background: transparent;
    border: none;
    color: #aaaaaa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.2s;
}

.nh-inline-gallery__prev:hover,
.nh-inline-gallery__next:hover,
.nh-inline-gallery__close:hover {
    color: #ffffff;
}

.nh-inline-gallery__thumbs {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
    align-content: flex-start;
}

/* Scrollbar for thumbs */
.nh-inline-gallery__thumbs::-webkit-scrollbar {
    width: 6px;
}
.nh-inline-gallery__thumbs::-webkit-scrollbar-track {
    background: #111; 
}
.nh-inline-gallery__thumbs::-webkit-scrollbar-thumb {
    background: #444; 
    border-radius: 3px;
}
.nh-inline-gallery__thumbs::-webkit-scrollbar-thumb:hover {
    background: #666; 
}

.nh-inline-gallery__thumb {
    background: #000;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    transition: border-color 0.2s;
}

.nh-inline-gallery__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.3s;
    display: block;
}

.nh-inline-gallery__thumb:hover img {
    opacity: 0.8;
}

.nh-inline-gallery__thumb.is-active {
    border-color: #ffffff;
}

.nh-inline-gallery__thumb.is-active img {
    opacity: 1;
}

/* ── Inline Video Player ────────────────────────────────────────── */
.nh-inline-video {
    position: absolute;
    inset: 0;
    z-index: 50; /* Above everything */
    background: #000000;
    display: flex;
    flex-direction: column;
}

.nh-inline-video[hidden] {
    display: none !important;
}

.nh-inline-video__close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: #ffffff;
    cursor: pointer;
    z-index: 2;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.nh-inline-video__close:hover {
    background: rgba(0,0,0,0.8);
}

.nh-inline-video__embed {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
}

.nh-inline-video__embed iframe,
.nh-inline-video__embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 767px) {
    .nh-video { display: none; }
    .nh-booking-outer { width: calc(100% - 24px); }
    
    /* Make gallery sidebar sit at the bottom or overlay */
    .nh-inline-gallery {
        flex-direction: column;
    }
    
    .nh-inline-gallery__sidebar {
        width: 100%;
        max-width: 100%;
        height: 120px;
        border-left: none;
        border-top: 1px solid #222;
        flex-direction: row-reverse; /* Put topbar on the right */
    }
    
    .nh-inline-gallery__topbar {
        flex-direction: column;
        border-bottom: none;
        border-left: 1px solid #222;
        padding: 8px;
    }
    
    .nh-inline-gallery__thumbs {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        align-items: center;
        gap: 8px;
    }
    
    .nh-inline-gallery__thumb {
        flex-shrink: 0;
        width: 120px;
        height: 80px;
    }
}

.elementor-editor-active .nh-hero { min-height: 500px !important; }
