/* Wrapper for scroller and arrows */
.hz-scroller-wrapper-99a6766c {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* Arrows */
.hz-arrow-99a6766c {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    transition: opacity 0.3s ease;
}

.hz-arrow-99a6766c:hover,
.hz-arrow-99a6766c:focus,
.hz-arrow-99a6766c:active {
    opacity: 0.7;
    background: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}

.hz-arrow-99a6766c.hz-disabled-99a6766c {
    opacity: 0.3;
    pointer-events: none;
}

.hz-arrow-prev-99a6766c {
    left: 20px;
}

.hz-arrow-next-99a6766c {
    right: 20px;
}

/* Arrow Lines */
.hz-arrow-99a6766c::before,
.hz-arrow-99a6766c::after {
    content: '';
    position: absolute;
    width: 50%;
    height: 2px;
    background-color: #000;
    transition: background-color 0.3s;
}

.hz-arrow-prev-99a6766c::before {
    transform: rotate(-45deg);
    top: 30%;
    left: 20%;
}

.hz-arrow-prev-99a6766c::after {
    transform: rotate(45deg);
    bottom: 30%;
    left: 20%;
}

.hz-arrow-next-99a6766c::before {
    transform: rotate(45deg);
    top: 30%;
    right: 20%;
}

.hz-arrow-next-99a6766c::after {
    transform: rotate(-45deg);
    bottom: 30%;
    right: 20%;
}

/* Container for horizontal scroll */
.hz-scroller-99a6766c {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scrollbar-width: none; /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.hz-scroller-99a6766c::-webkit-scrollbar {
    display: none;
}

/* Track holding all items */
.hz-scroller-track-99a6766c {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start; /* Align to top to ensure consistent baseline for text */
    position: relative;
    width: max-content;
    padding-right: 5vw; /* give some breathing room at the end */
}

/* Individual scroller item */
.hz-scroller-track-99a6766c .hz-item-99a6766c {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1; /* Keep above the line */
    height: 100%;
    width: max-content; /* Allow item to size based on its content (media) */
}

/* The Continuous Line */
/* Bound to the top position determined by hz-item-top height plus margin */
.hz-scroller-track-99a6766c::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    /* This calculates the exact position based on the flex container's fixed top sections */
    /* It sits exactly between hz-item-top and hz-item-bottom */
    top: calc(var(--image-area-height, 60vh) + var(--divider-top-margin, 20px));
    transform: translateY(-50%);
    z-index: 0;
}

/* Media wrapper setup to enforce a consistent height */
.hz-scroller-track-99a6766c .hz-item-top-99a6766c {
    display: flex;
    align-items: flex-end; /* Push smaller images/videos down to meet the line */
    height: var(--image-area-height, 60vh);
    margin-bottom: var(--divider-top-margin, 20px);
}

.hz-scroller-track-99a6766c .hz-media-99a6766c {
    height: 100%;
    overflow: hidden; /* Added to contain hover enlargement */
    /* No fixed width here, allow it to dictate the width */
}

.hz-scroller-track-99a6766c .hz-media-99a6766c > img,
.hz-scroller-track-99a6766c .hz-media-99a6766c > video {
    height: 100%;
    width: auto; /* Width becomes proportional to height */
    max-width: none;
    object-fit: contain; /* Ensure it stays within bounds without cropping */
    display: block;
    transition: transform 0.4s ease; /* Added for hover effect */
}

.hz-scroller-track-99a6766c .hz-media-99a6766c > img.hz-lightbox-trigger-99a6766c {
    cursor: zoom-in;
}

.hz-scroller-track-99a6766c .hz-media-99a6766c:hover > img {
    transform: scale(1.05); /* Hover enlargement */
}

/* Gallery Grid Styles */
.hz-scroller-track-99a6766c .hz-gallery-grid-99a6766c {
    display: grid;
    height: 100%;
    grid-template-columns: repeat(var(--gallery-cols, 2), 1fr);
    grid-template-rows: repeat(var(--gallery-rows, 2), 1fr);
    gap: var(--gallery-gap, 10px);
    /* Width will be calculated based on aspect ratio or height */
}

/* If no aspect ratio is set, default to scaling width to fit children's implicit size */
.hz-scroller-track-99a6766c .hz-gallery-grid-99a6766c[style*="aspect-ratio: auto"],
.hz-scroller-track-99a6766c .hz-gallery-grid-99a6766c:not([style*="aspect-ratio"]) {
    /* If aspect ratio is auto, we make the grid item width proportional to height assuming roughly square images */
    width: calc( (var(--image-area-height, 60vh) / var(--gallery-rows, 2)) * var(--gallery-cols, 2) + (var(--gallery-gap, 10px) * (var(--gallery-cols, 2) - 1)) );
}

.hz-scroller-track-99a6766c .hz-gallery-item-99a6766c {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.hz-scroller-track-99a6766c .hz-gallery-item-99a6766c img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease; /* Added for hover effect */
}

.hz-scroller-track-99a6766c .hz-gallery-item-99a6766c img.hz-lightbox-trigger-99a6766c {
    cursor: zoom-in;
}

.hz-scroller-track-99a6766c .hz-gallery-item-99a6766c:hover img {
    transform: scale(1.05); /* Hover enlargement */
}

/* Dynamically adjust the calculated width based on the aspect-ratio value */
/* Elementor will output an inline style for aspect-ratio on the gallery container */
.hz-scroller-track-99a6766c .hz-media-99a6766c .hz-gallery-grid-99a6766c[style*="aspect-ratio: 16:9"] { width: calc(var(--image-area-height, 60vh) * (16 / 9)); }
.hz-scroller-track-99a6766c .hz-media-99a6766c .hz-gallery-grid-99a6766c[style*="aspect-ratio: 4:3"] { width: calc(var(--image-area-height, 60vh) * (4 / 3)); }
.hz-scroller-track-99a6766c .hz-media-99a6766c .hz-gallery-grid-99a6766c[style*="aspect-ratio: 1:1"] { width: calc(var(--image-area-height, 60vh) * (1 / 1)); }
.hz-scroller-track-99a6766c .hz-media-99a6766c .hz-gallery-grid-99a6766c[style*="aspect-ratio: 3:4"] { width: calc(var(--image-area-height, 60vh) * (3 / 4)); }
.hz-scroller-track-99a6766c .hz-media-99a6766c .hz-gallery-grid-99a6766c[style*="aspect-ratio: 9:16"] { width: calc(var(--image-area-height, 60vh) * (9 / 16)); }

/* Embedded video iframe handling */
.hz-scroller-track-99a6766c .hz-media-99a6766c iframe {
    height: 100%;
    max-width: none;
    display: block;
    /* By default iframes don't size width based on height automatically like images do, 
       so we rely on the aspect-ratio CSS property which is set via Elementor controls */
    aspect-ratio: 16 / 9;
    /* Calculate width based on height and aspect ratio to ensure it expands the parent flex item */
    width: calc(var(--image-area-height, 60vh) * (16 / 9)); 
}

/* Dynamically adjust the calculated width based on the aspect-ratio value */
/* Elementor will output an inline style for aspect-ratio on the iframe */
.hz-scroller-track-99a6766c .hz-media-99a6766c iframe[style*="aspect-ratio: 4:3"] { width: calc(var(--image-area-height, 60vh) * (4 / 3)); }
.hz-scroller-track-99a6766c .hz-media-99a6766c iframe[style*="aspect-ratio: 1:1"] { width: calc(var(--image-area-height, 60vh) * (1 / 1)); }
.hz-scroller-track-99a6766c .hz-media-99a6766c iframe[style*="aspect-ratio: 9:16"] { width: calc(var(--image-area-height, 60vh) * (9 / 16)); }


/* Content block setup */
.hz-item-bottom-99a6766c {
    padding-top: var(--divider-bottom-margin, 20px);
}

/* Ensure the content area does not exceed the width of the media */
.hz-scroller-track-99a6766c .hz-item-99a6766c {
    /* Use grid to make children respect the max-content width defined by the image */
    display: grid;
    grid-template-rows: auto 1fr;
}

.hz-scroller-track-99a6766c .hz-content-99a6766c {
    width: 100%;
    /* This is key: prevent the text from dictating the grid item's width */
    min-width: 0; 
    max-width: 100%;
}

.hz-scroller-track-99a6766c .hz-title-99a6766c {
    margin: 0 0 10px 0;
    /* Ensure long words break if necessary */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hz-scroller-track-99a6766c .hz-desc-99a6766c {
    margin: 0;
    /* Ensure long words break if necessary */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Link transitions */
.hz-scroller-track-99a6766c .hz-content-99a6766c a {
    transition: color 0.3s ease;
}

/* Lightbox Styles - Default fallbacks before Elementor styling */
.hz-lightbox-overlay-99a6766c {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95); /* Fallback */
    z-index: 99999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 40px;
    box-sizing: border-box;
}

body.admin-bar .hz-lightbox-overlay-99a6766c {
    top: var(--wp-admin--admin-bar--height, 32px);
    height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}
@media screen and (max-width: 782px) {
    body.admin-bar .hz-lightbox-overlay-99a6766c {
        top: 46px;
        height: calc(100vh - 46px);
    }
}

.hz-lightbox-overlay-99a6766c.hz-active-99a6766c {
    opacity: 1;
    visibility: visible;
}

.hz-lightbox-content-99a6766c {
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.hz-lightbox-overlay-99a6766c.hz-active-99a6766c .hz-lightbox-content-99a6766c {
    transform: scale(1);
}

.hz-lightbox-image-wrapper-99a6766c {
    border: 2px solid #000; /* Fallback */
    padding: 10px; /* Space between image and frame */
    background: #fff; /* Fallback */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1); 
}

.hz-lightbox-image-99a6766c {
    max-width: 100%;
    max-height: 60vh; 
    object-fit: contain;
    display: block;
}

.hz-lightbox-caption-99a6766c {
    color: #000; /* Fallback */
    margin-top: 20px;
    padding: 15px 20px;
    text-align: center;
    font-size: 11px;
    font-family: inherit;
    max-width: 600px;
    border: 2px solid #000; /* Fallback */
    background: #fff; /* Fallback */
}

.hz-lightbox-close-99a6766c {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hz-lightbox-close-99a6766c::before,
.hz-lightbox-close-99a6766c::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background-color: #000; /* Fallback */
    transition: transform 0.3s ease;
}

.hz-lightbox-close-99a6766c::before {
    transform: rotate(45deg);
}

.hz-lightbox-close-99a6766c::after {
    transform: rotate(-45deg);
}

.hz-lightbox-close-99a6766c:hover::before {
    transform: rotate(135deg);
}

.hz-lightbox-close-99a6766c:hover::after {
    transform: rotate(45deg);
}
