/* ==========================================================
   Canon Media Carousel – Styles
   ========================================================== */

/* --- Wrapper --- */
.cmc-wrapper {
    width: 100%;
    box-sizing: border-box;
    font-size: 0; /* remove inline-block gap */
}

/* ---- Slides wrap ---- */
.cmc-slides-wrap {
    position: relative;
    width: 100%;
}

/* Individual slide */
.cmc-slide {
    display: none;
}
.cmc-slide.is-active {
    display: block;
}

/* Main display box */
.cmc-main {
    position: relative;
    width: 100%;
    height: 420px;
    background-color: #181818;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image fills the box */
.cmc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Native video */
.cmc-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

/* Iframe (YouTube / Vimeo) */
.cmc-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Placeholder (no media set) */
.cmc-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.cmc-placeholder svg {
    width: 120px;
    height: auto;
    opacity: .6;
}

/* Play overlay for video with thumbnail in editor preview */
.cmc-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* ---- Caption area ---- */
.cmc-caption-area {
    position: relative;
    background-color: #fff;
    padding: 12px 16px;
    min-height: 1.5em;
    font-size: 16px; /* reset after wrapper font-size:0 */
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-top: 6px;
    box-sizing: border-box;
}
.cmc-caption {
    display: none;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: 1.5;
}
.cmc-caption.is-active {
    display: block;
}

/* ---- Thumbnails outer (flex wrapper for reliable alignment) ---- */
.cmc-thumbs-outer {
    display: flex;
    justify-content: center;
    margin-top: 12px;
    overflow-x: auto;
}

/* ---- Thumbnails grid ---- */
.cmc-thumbs {
    display: grid;
    grid-template-columns: repeat(6, 110px);
    gap: 8px;
    font-size: 0;
    flex-shrink: 0;
}

.cmc-thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 0;
    margin: 0;
    background-color: #1a1a1a;
    border: 3px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.18s ease, opacity 0.18s ease;
    outline: none;
    box-sizing: border-box;
}
.cmc-thumb:hover:not(.is-active) {
    border-color: rgba(232, 160, 32, 0.45);
    opacity: 0.85;
}
.cmc-thumb.is-active {
    border-color: #e8a020;
    cursor: default;
}

.cmc-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important; /* Elementor/theme reset img{height:auto} */
    object-fit: cover;
    display: block;
    pointer-events: none;
}

/* Thumb placeholder icon */
.cmc-thumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.cmc-thumb-icon svg {
    width: 28px;
    height: 28px;
    fill: #555;
}

/* Small play badge for video thumbnails */
.cmc-play-badge {
    position: absolute;
    bottom: 4px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,.55);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.cmc-play-badge svg {
    width: 10px;
    height: 10px;
    fill: #fff;
}

/* ---- Transition: fade between slides ---- */
.cmc-slide {
    animation: none;
}
.cmc-slide.is-active {
    animation: cmcFadeIn 0.28s ease;
}
@keyframes cmcFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .cmc-main { height: 320px; }
}
@media (max-width: 767px) {
    .cmc-main { height: 220px; }
    .cmc-thumbs-outer { margin-top: 8px; }
    .cmc-thumbs { gap: 5px; }
}
