/* CMY Multi-Column Slider — scoped, no Bootstrap, no global bleed. */

.cmy-cols {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

/* Equal division of 100% regardless of column count.
   flex: 1 1 0 makes every column take the same share. */
.cmy-cols > .cmy-col {
    flex: 1 1 0;
    min-width: 0; /* allow shrinking below content width */
    box-sizing: border-box;
}

/* ---- Slider ---- */
.cmy-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: #f3f1ec;
}

.cmy-slides {
    position: relative;
    width: 100%;
}

.cmy-slide {
    position: absolute;
    inset: 0;
    margin: 0;
    width: 100%;
    height: 480px; /* overridden by Elementor control */
    opacity: 0;
    transition: opacity 0.6s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* First slide holds layout height so the box isn't collapsed. */
.cmy-slide:first-child {
    position: relative;
}

.cmy-slide.active {
    opacity: 1;
    z-index: 2;
}

.cmy-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* crop-to-fill: no distortion, overridden by control */
    object-position: center;
    display: block;
}

/* ---- Arrows ---- */
.cmy-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    background: rgba(255, 255, 255, 0.75);
    border: none;
    width: 35px;
    height: 35px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
    padding: 0;
}

.cmy-arrow:hover {
    background: rgba(255, 255, 255, 0.95);
}

.cmy-prev { left: 8px; }
.cmy-next { right: 8px; }

/* ---- Dots ---- */
.cmy-dots {
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 0;
    margin: 0;
}

.cmy-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: background 0.2s ease;
}

.cmy-dot.active {
    background: #d25400;
}

/* ---- Thumbnail navigation (bottom-left over the main image) ---- */
.cmy-thumbs {
    position: absolute;
    left: 10px;
    bottom: 12px;
    z-index: 6;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: calc(100% - 60px); /* keep clear of the arrows */
    margin: 0;
    padding: 0;
}

.cmy-thumb {
    width: 50px;   /* overridden by Elementor control */
    height: 50px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 2px;
    background: none;
    cursor: pointer;
    overflow: hidden;
    opacity: 0.75;
    transition: opacity 0.2s ease, border-color 0.2s ease;
    line-height: 0;
}

.cmy-thumb img {
    width: 50px;   /* overridden by Elementor control */
    height: 50px;
    object-fit: cover;
    object-position: center;
    display: block;
}

.cmy-thumb:hover {
    opacity: 1;
}

.cmy-thumb.active {
    opacity: 1;
    border-color: #d25400;
}

/* ---- Progress bar ---- */
.cmy-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.cmy-progress-bar {
    display: block;
    height: 100%;
    width: 0%;
    background: #d25400;
}

/* ---- Text block ---- */
.cmy-textblock {
    padding: 4px 2px;
}

.cmy-heading {
    font-family: "Roboto", sans-serif;
    font-size: 22px;
    font-weight: 400;
    color: #d25400;
    margin: 0 0 10px;
}

.cmy-text {
    color: #363636;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
    text-align: justify;
}

.cmy-text p {
    margin: 0 0 10px;
}

/* Mixed column: text sits under the slider. */
.cmy-col-type-mixed .cmy-textblock {
    margin-top: 14px;
}

/* ---- Responsive: stack on tablet/mobile ---- */
@media screen and (max-width: 767px) {
    .cmy-cols {
        flex-direction: column;
    }
    .cmy-cols > .cmy-col {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* ---- Lightbox modal ---- */
.cmy-has-lightbox .cmy-slide img {
    cursor: zoom-in;
}

.cmy-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.cmy-lightbox[aria-hidden="false"] {
    display: flex;
}

body.cmy-lb-open {
    overflow: hidden; /* lock scroll while modal is open */
}

.cmy-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
}

.cmy-lb-figure {
    position: relative;
    z-index: 2;
    margin: 0;
    max-width: 92vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmy-lb-img {
    max-width: 92vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 6px 40px rgba(0, 0, 0, 0.5);
}

.cmy-lb-close,
.cmy-lb-prev,
.cmy-lb-next {
    position: absolute;
    z-index: 3;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: none;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease;
}

.cmy-lb-close:hover,
.cmy-lb-prev:hover,
.cmy-lb-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.cmy-lb-close {
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    font-size: 30px;
    border-radius: 50%;
}

.cmy-lb-prev,
.cmy-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    font-size: 34px;
    border-radius: 50%;
}

.cmy-lb-prev { left: 20px; }
.cmy-lb-next { right: 20px; }

@media screen and (max-width: 767px) {
    .cmy-lb-prev, .cmy-lb-next { width: 40px; height: 40px; font-size: 26px; }
    .cmy-lb-prev { left: 8px; }
    .cmy-lb-next { right: 8px; }
    .cmy-lb-close { top: 10px; right: 10px; }
}
