/* Image Slider Block — Frontend */
.isb-block {
    --isb-blue:   #1591c7;
    --isb-teal:   #0bbfbf;
    --isb-grad:   linear-gradient(135deg,#1591c7,#0bbfbf);
    --isb-r:      14px;
    --isb-gap:    14px;
    --isb-aw:     42px;
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
    width: 100%;
    box-sizing: border-box;
}

/* Header */
.isb-header  { margin-bottom: 20px; }
.isb-title   { font-size:22px; font-weight:700; color:#111; margin:0 0 8px; }
.isb-bar     { width:48px; height:3px; background:var(--isb-grad); border-radius:2px; }

/* Layout row */
.isb-outer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
}

/* Viewport */
.isb-vp {
    flex: 1;
    min-width: 0;
    overflow-x: scroll;
    overflow-y: visible;
    scrollbar-width: none;
    -ms-overflow-style: none;
    box-sizing: border-box;
}
.isb-vp::-webkit-scrollbar { display: none; }

/* Track */
.isb-track {
    display: flex;
    gap: var(--isb-gap);
}

/* Slide — 4 per view */
.isb-slide {
    flex: 0 0 calc((100% - var(--isb-gap) * 3) / 4);
    min-width: 0;
    box-sizing: border-box;
}

/* Card */
.isb-card {
    position: relative;
    width: 100%;
}

/* ── Image frame ─────────────────────────────────────────
   padding-bottom: 75% = 4:3 ratio (3/4 = 0.75).
   This is the most reliable cross-browser way to create a
   fixed-ratio container where position:absolute children
   fill it 100%. Works even when theme CSS overrides things.
───────────────────────────────────────────────────────── */
.isb-img-frame {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: 0 !important;           /* height comes from padding-bottom */
    padding-bottom: 75% !important; /* 3/4 = 75% for 4:3 ratio */
    border-radius: var(--isb-r);
    overflow: hidden;
    background: #cce8f5;
}

/* ── Plain image — direct child, no link ─────────────── */
.isb-img-frame > img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    transition: transform .45s ease;
}
.isb-card:hover .isb-img-frame > img {
    transform: scale(1.08);
}

/* ── Linked image — <a> then <img> ──────────────────── */
.isb-img-link {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    cursor: pointer;
    text-decoration: none;
}
.isb-img-link img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    transition: transform .45s ease;
}
.isb-card:hover .isb-img-link img {
    transform: scale(1.08);
}

/* Number badge */
.isb-num-wrap {
    display: flex;
    justify-content: center;
    margin-top: -15px;
    position: relative;
    z-index: 5;
}
.isb-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--isb-grad);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(21,145,199,.45);
    pointer-events: none;
    flex-shrink: 0;
}

/* Caption */
.isb-caption {
    margin-top: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #111;
    line-height: 1.4;
}

/* Arrow buttons */
.isb-arrow {
    flex-shrink: 0;
    width: var(--isb-aw);
    height: var(--isb-aw);
    border-radius: 50%;
    border: none;
    background: #fff;
    color: var(--isb-blue);
    box-shadow: 0 2px 12px rgba(13,79,122,.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin-top: calc(((100% - var(--isb-gap)*3) / 4) * 0.75 / 2 - var(--isb-aw)/2);
    transition: background .2s, color .2s, transform .15s, opacity .2s, visibility 0s;
}
.isb-arrow svg { width:18px; height:18px; }
.isb-arrow:hover { background:var(--isb-grad); color:#fff; transform:scale(1.1); }
.isb-arrow:active { transform:scale(.95); }
.isb-arrow--off { opacity:.25; pointer-events:none; }

/* Prev arrow hidden until scrolled */
.isb-prev {
    visibility: hidden;
    opacity: 0;
    width: 0;
    margin-right: 0;
    overflow: hidden;
    transition: opacity .25s, width .25s, visibility 0s .25s;
}
.isb-prev.isb-prev--visible {
    visibility: visible;
    opacity: 1;
    width: var(--isb-aw);
    transition: opacity .25s, width .25s, visibility 0s 0s;
}

/* Responsive */
@media(max-width:900px){
    .isb-slide { flex: 0 0 calc((100% - var(--isb-gap)*2)/3); }
}
@media(max-width:640px){
    .isb-slide { flex: 0 0 calc((100% - var(--isb-gap))/2); }
}
@media(max-width:420px){
    .isb-slide { flex: 0 0 80%; }
    .isb-arrow { display:none; }
}
