/* frontend.css v2.6.0 - Defined Spacing Fix */

/* --- 1. GLOBAL FIXES --- */
html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden !important;
}

/* --- 2. SLIDER CONTAINER --- */
.calids-slider {
    position: relative;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    max-width: 100vw !important;
    background: #020617;
    overflow: hidden;
    user-select: none;
}

/* ADMIN BAR FIX */
body.admin-bar .calids-slider {
    height: calc(100vh - 32px) !important;
    height: calc(100dvh - 32px) !important;
}
@media screen and (max-width: 782px) {
    body.admin-bar .calids-slider {
        height: calc(100vh - 46px) !important;
        height: calc(100dvh - 46px) !important;
    }
}

/* --- 3. INDIVIDUAL SLIDE --- */
.calids-slide-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    z-index: 1;
    transition: opacity 0.8s ease-in-out;
    pointer-events: none;
}

.calids-slide-item.active {
    opacity: 1;
    z-index: 5;
    pointer-events: auto;
}

/* --- 4. LAYERS --- */
.calids-layer {
    position: absolute;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    max-width: 100%;
    padding-top: 6px;
    padding-bottom: 6px;
}

.calids-layer > * + * {
    margin-top: 12px; /* defined vertical spacing between children */
}

.calids-layer img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain !important;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

/* --- TEXT LAYERS --- */
.calids-layer .text {
    width: 100%;
    height: auto !important;
    display: block !important;
    white-space: pre-wrap;
    line-height: 1.6;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    box-sizing: border-box !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-bottom: 8px !important;
    max-width: 100%;
    overflow: visible !important;
}

/* Keep rich text inline so bold/span wrappers do not break layout */
.calids-layer .text b,
.calids-layer .text strong,
.calids-layer .text span,
.calids-layer .text div {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* --- BUTTON LAYERS --- */
.calids-studio-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    max-width: 100%;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

/* --- 5. NAVIGATION --- */
.calids-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 9999;
    transition: all 0.2s;
    line-height: 1;
    color: #fff;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}

.calids-nav:hover {
    opacity: 0.8;
    transform: translateY(-50%) scale(1.1);
}

.calids-nav.prev { left: 20px; }
.calids-nav.next { right: 20px; }

.calids-nav.simple { font-size: 50px; width: 40px; height: 80px; }
.calids-nav.circle { width: 50px; height: 50px; border-radius: 50%; background: rgba(0,0,0,0.4); border: 2px solid #fff; font-size: 24px; }
.calids-nav.box { width: 50px; height: 60px; background: rgba(0,0,0,0.6); font-size: 24px; border-radius: 4px; }
.calids-nav.minimal { font-size: 40px; font-weight: 300; }

/* --- 6. DOTS --- */
.calids-dots {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    z-index: 9999;
}

.calids-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    opacity: 0.5;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    border: 1px solid rgba(0,0,0,0.2);
}

.calids-dot:hover { opacity: 0.9; }
.calids-dot.active {
    opacity: 1;
    transform: scale(1.3);
    background: #fff;
}

/* --- 7. TABLET / SMALL HEIGHT SAFE ZONE --- */
@media (max-width: 1200px), (max-height: 800px) {
    .calids-slide-item.active {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto !important;
        padding-bottom: 120px;
    }

    .calids-layer {
        max-height: none !important;
    }
}

/* --- 8. MOBILE FIXES --- */
@media (max-width: 768px) {
    .calids-layer {
        max-width: 92% !important;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .calids-layer .text {
        max-width: 100% !important;
        max-height: 45vh !important;
        overflow-y: auto !important;
        pointer-events: auto !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-bottom: 16px !important;
        line-height: 1.5 !important;

        /* IMPORTANT: no relative positioning hack */
        position: static !important;
        top: auto !important;
    }

    .calids-studio-btn {
        max-width: calc(100vw - 40px);
    }
}