.tree-pages-carousel {
    --tree-pages-carousel-height: 400px;
    --tree-pages-carousel-content-left: 6%;
    position: relative;
    width: 100%;
    height: auto;
    box-sizing: border-box;
    max-height: var(--tree-pages-carousel-height);
    overflow: hidden;
    background: transparent;
}

.tree-pages-carousel.is-viewport-width {
    width: 100%;
    margin-left: 0;
}

.tree-pages-carousel.is-auto-height {
    max-height: none;
}

.tree-pages-carousel-track {
    position: relative;
    width: 100%;
    height: auto;
    outline: none;
}

.tree-pages-carousel.is-auto-height .tree-pages-carousel-track {
    height: auto;
}

.tree-pages-carousel-slide {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: auto;
    max-height: var(--tree-pages-carousel-height);
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.tree-pages-carousel-slide.is-active {
    position: relative;
    max-height: var(--tree-pages-carousel-height);
    visibility: visible;
    opacity: 1;
}

.tree-pages-carousel.is-auto-height .tree-pages-carousel-slide,
.tree-pages-carousel.is-auto-height .tree-pages-carousel-slide.is-active {
    max-height: none;
}

.tree-pages-carousel-link {
    display: block;
    width: 100%;
    height: auto;
    color: inherit;
}

.tree-pages-carousel-image {
    display: block;
    width: 100%;
    height: auto;
}

.tree-pages-carousel-caption {
    position: absolute;
    top: 22%;
    left: var(--tree-pages-carousel-content-left);
    z-index: 2;
    width: 42%;
    max-width: 42rem;
    overflow-wrap: anywhere;
    color: #ffffff;
    text-shadow: 0 2px 8px #000000;
}

.tree-pages-carousel-title,
.tree-pages-carousel-description {
    position: static;
    right: auto;
    left: auto;
    z-index: 2;
    margin: 0;
    color: #ffffff;
    text-shadow: 0 2px 8px #000000;
}

.tree-pages-carousel-title {
    font-size: clamp(1.1rem, 4vw, 3.4rem);
    line-height: 1.1;
    color: #97e531;
}

.tree-pages-carousel-description {
    max-width: 100%;
    margin-top: 1.2rem;
    padding: clamp(0.15rem, 0.35vw, 0.35rem) clamp(0.3rem, 0.65vw, 0.65rem);
    font-size: clamp(0.65rem, 1.5vw, 1rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.tree-pages-carousel-description img,
.tree-pages-carousel-description video,
.tree-pages-carousel-description iframe,
.tree-pages-carousel-description table {
    max-width: 100%;
    box-sizing: border-box;
}

.tree-pages-carousel-description-background-image,
.tree-pages-carousel-description-background-gradient {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    display: block;
    pointer-events: none;
}

.tree-pages-carousel-description-background-image {
    background-image: url("../../files/site/green.png");
    background-position: left top;
    background-repeat: no-repeat;
    background-size: auto 100%;
}

.tree-pages-carousel-description-background-gradient {
    background-image: linear-gradient(
        to right,
        rgba(0, 82, 35, 1) 0%,
        rgba(0, 82, 35, 0.7) 55%,
        rgba(0, 82, 35, 0) 100%
    );
    background-position: left top;
    background-repeat: no-repeat;
    background-size: 50% 100%;
}

.tree-pages-carousel-controls {
    position: absolute;
    bottom: 60px;
    left: var(--tree-pages-carousel-content-left);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: #00451d87;
    border-radius: 50px;
    padding: 5px;    
}

.tree-pages-carousel-control,
.tree-pages-carousel-pause {
    position: static;
    display: flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-width: 1px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background-color: transparent;
    color: #ffffff;
    cursor: pointer;
}

.tree-pages-carousel-control {
    font-size: 1rem;
    line-height: 1;
}

.tree-pages-carousel-control:hover,
.tree-pages-carousel-control:focus,
.tree-pages-carousel-pause:hover,
.tree-pages-carousel-pause:focus {
    background-color: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

.tree-pages-carousel-pause {
    font-size: 0.9rem;
    line-height: 1;
}

.tree-pages-carousel-dots {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 4px;
}

.tree-pages-carousel-dot {
    position: static;
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
}

.tree-pages-carousel-dot.is-active {
    width: 28px;
    border-radius: 4px;
    background-color: #97e531;
}

.tree-pages-carousel-gallery {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
    gap: min(16px, calc(25% / var(--tree-pages-carousel-image-count)));
}

.tree-pages-carousel-gallery-item {
    position: relative;
    width: var(--tree-pages-carousel-preview-width, 350px);
    min-width: 0;
    flex: 0 1 var(--tree-pages-carousel-preview-width, 350px);
    overflow: hidden;
    background: transparent;
    border: 2px solid #00451d;
    border-radius: 5px;
    padding: 3px;
}

.tree-pages-carousel-gallery-item .tree-pages-carousel-image {
    transition: transform 0.2s ease;
}

.tree-pages-carousel-gallery-item:hover .tree-pages-carousel-image,
.tree-pages-carousel-gallery-item:focus-within .tree-pages-carousel-image {
    transform: scale(1.018);
}

.margins-carousel-many {
    margin: 30px 0;
}

.tree-pages-carousel-gallery-item .tree-pages-carousel-caption {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-width: none;
    padding: 12px 14px;
    pointer-events: none;
}

.tree-pages-carousel-gallery-item .tree-pages-carousel-caption a {
    pointer-events: auto;
}

.tree-pages-carousel-gallery-item .tree-pages-carousel-title {
    font-size: clamp(1rem, 2.4vw, 1.6rem);
}

.tree-pages-carousel-gallery-item .tree-pages-carousel-description {
    margin-top: 0.45rem;
    font-size: clamp(0.72rem, 1.2vw, 0.95rem);
}

.tree-pages-carousel-lightbox-trigger {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;
    display: flex;
    width: min(44px, 100%);
    height: min(44px, 100%);
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.34);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.35rem;
    transform: translate(-50%, -50%);
    transition: background-color 0.2s ease;
}

.tree-pages-carousel-lightbox-trigger:hover,
.tree-pages-carousel-lightbox-trigger:focus {
    background: rgba(0, 0, 0, 0.62);
}

.tree-pages-carousel-lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    margin: 0;
    padding: 24px;
    border: 0;
    overflow: visible;
    background: transparent;
    flex-direction: column;
}

.tree-pages-carousel-lightbox[open] {
    display: flex;
}

.tree-pages-carousel-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.84);
}

body:has(.tree-pages-carousel-lightbox[open]) {
    overflow: hidden;
}

.tree-pages-carousel-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    object-fit: contain;
}

.tree-pages-carousel-lightbox-stage {
    position: relative;
    display: flex;
    max-width: 100%;
    max-height: calc(100vh - 96px);
    max-height: calc(100dvh - 96px);
    align-items: center;
    justify-content: center;
}

.tree-pages-carousel-lightbox-control {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    cursor: pointer;
    font-size: 1.1rem;
    transform: translateY(-50%);
}

.tree-pages-carousel-lightbox-prev {
    left: 24px;
}

.tree-pages-carousel-lightbox-next {
    right: 24px;
}

.tree-pages-carousel-lightbox-control:hover,
.tree-pages-carousel-lightbox-control:focus {
    background: rgba(0, 0, 0, 0.82);
}

.tree-pages-carousel-lightbox-counter {
    margin-top: 10px;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.2;
    text-align: center;
}

.tree-pages-carousel-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    cursor: pointer;
    font-size: 1rem;
}

.tree-pages-carousel-lightbox-close:hover,
.tree-pages-carousel-lightbox-close:focus {
    background: rgba(0, 0, 0, 0.82);
}

@media (max-width: 1024px) {
    .tree-pages-carousel-gallery {
        flex-wrap: wrap;
    }

    .tree-pages-carousel-gallery-item {
        flex-basis: min(var(--tree-pages-carousel-preview-width, 350px), 100%);
    }
}

@media (max-width: 1280px) {
    main > .tree-pages-carousel {
        width: calc(100% + 64px);
        margin-left: -32px;
        margin-right: 0;
    }

    .site-sidebar > .tree-pages-carousel {
        width: calc(100% + 64px);
        margin-left: -32px;
        margin-right: 0;
    }

    .site-container > .tree-pages-carousel {
        width: calc(100% + 50px);
        margin-left: -25px;
        margin-right: 0;
    }
}

@media (max-width: 767px) {
    .tree-pages-carousel {
        --tree-pages-carousel-content-left: 8%;
    }

    main > .tree-pages-carousel {
        width: calc(100% + 50px);
        margin-left: -25px;
        margin-right: 0;
    }

    .site-sidebar > .tree-pages-carousel,
    .site-container > .tree-pages-carousel {
        width: calc(100% + 50px);
        margin-left: -25px;
        margin-right: 0;
    }

    .tree-pages-carousel-caption {
        right: 8%;
        left: var(--tree-pages-carousel-content-left);
        width: auto;
        max-width: none;
    }

    .tree-pages-carousel-description {
        margin-top: 0.6rem;
    }

    .tree-pages-carousel-lightbox-control {
        width: 36px;
        height: 36px;
    }

    .tree-pages-carousel-lightbox-prev {
        left: 10px;
    }

    .tree-pages-carousel-lightbox-next {
        right: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tree-pages-carousel-slide {
        transition: none;
    }

    .tree-pages-carousel-gallery-item:hover .tree-pages-carousel-image,
    .tree-pages-carousel-gallery-item:focus-within .tree-pages-carousel-image {
        transform: none;
    }
}
