.elemik-rz * {
    box-sizing: border-box;
}

.elemik-rz {
    padding: 12px 0;
}

.elemik-rz-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.elemik-rz-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 750;
    letter-spacing: -0.02em;
    color: #111;
}

.elemik-rz-lead {
    margin: 10px 0 0 0;
    color: #4b5563;
    line-height: 1.7;
    max-width: 78ch;
}

.elemik-rz-search {
    margin-top: 14px;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.elemik-rz-input {
    width: min(520px, 100%);
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #fff;
    color: #111;
    outline: none;
}

.elemik-rz-count {
    color: #6b7280;
    font-size: 13px;
}

.elemik-rz-grid {
    margin-top: 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 1100px) {
    .elemik-rz-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 820px) {
    .elemik-rz-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .elemik-rz-grid {
        grid-template-columns: 1fr;
    }
}

/* Make each card a 2-row layout: image + caption */
.elemik-rz-card {
    display: grid;
    grid-template-rows: auto 52px;
    /* caption always same height */
    padding: 0;
    background: #fff;
}

/* Disable hover/focus styling (remove blue highlight) */
.elemik-rz-card,
.elemik-rz-card:hover,
.elemik-rz-card:active,
.elemik-rz-card:focus,
.elemik-rz-card:focus-visible {
    background: #fff;
    border-color: #e5e7eb;
    box-shadow: none;
    outline: none;
    transform: none;
}

/* Ensure text doesn’t get a hover color from theme */
.elemik-rz-card:hover .elemik-rz-name,
.elemik-rz-card:focus .elemik-rz-name {
    color: #111;
}

/* 4:3 area stays fixed */
.elemik-rz-thumb {
    aspect-ratio: 3 / 2;
    background: #fff;
    padding: 0;
    /* remove mat if you want full use of area */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Scale image proportionally to fit */
.elemik-rz-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    /* ✅ keeps proportions, no crop */
    display: block;
}

/* Caption area always same height */
.elemik-rz-meta {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Force title to max 2 lines, same space on every card */
.elemik-rz-name {
    font-weight: 650;
    color: #111;
    line-height: 1.25;
    font-size: 13px;
    text-align: center;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    /* max 2 lines */
    overflow: hidden;
}

.elemik-rz-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f3f4f6, #e5e7eb, #f3f4f6);
}

.elemik-rz-lock {
    overflow: hidden;
}

/* Modal */
.elemik-rz-modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 9999;
}

.elemik-rz-modal[aria-hidden="false"] {
    display: block;
}

.elemik-rz-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.elemik-rz-dialog {
    position: relative;
    width: min(980px, calc(100% - 24px));
    margin: 40px auto;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .2);
    overflow: hidden;
}

.elemik-rz-close {
    position: absolute;
    right: 12px;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: black;
}

/* Disable theme hover/focus styling */
.elemik-rz-close:hover,
.elemik-rz-close:active,
.elemik-rz-close:focus,
.elemik-rz-close:focus-visible {
    background: #fff !important;
    color: #111 !important;
    box-shadow: none !important;
    outline: none !important;
    opacity: 1 !important;
}

.elemik-rz-modal-head {
    padding: 16px 18px 0 18px;
}

.elemik-rz-modal-title {
    font-weight: 700;
    color: #111;
}

.elemik-rz-slider {
    position: relative;
}

.elemik-rz-stage {
    background: #f3f4f6;
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    position: relative;
}

.elemik-rz-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    background: #111;
    /* neutral backdrop for contain */
}

.elemik-rz-slide.is-active {
    display: block;
}


/* Put arrows visually inside the stage */
.elemik-rz-nav {
    position: absolute;
    top: calc(14px + 50%);
    /* 14px = .elemik-rz-slider top padding */
    transform: translateY(-50%) !important;

    width: 34px;
    height: 34px;
    border-radius: 999px;

    border: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, .92);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0 !important;
    line-height: 1 !important;
    font-size: 18px !important;
    font-weight: 700;

    box-shadow: 0 6px 16px rgba(0, 0, 0, .10);
    z-index: 20;

    /* Stop theme from rotating/transforming the icon */
    rotate: 0deg !important;
}

/* Make sure left/right are correct and not overridden */
.elemik-rz-nav.prev {
    left: 26px;
}

.elemik-rz-nav.next {
    right: 26px;
}

/* Force correct glyphs even if theme changes button text */
.elemik-rz-nav.prev::before {
    content: "‹";
}

.elemik-rz-nav.next::before {
    content: "›";
}

/* Hide the original button text safely */
.elemik-rz-nav {
    color: #111;
}

.elemik-rz-nav.prev,
.elemik-rz-nav.next {
    text-indent: -9999px;
}

.elemik-rz-nav.prev::before,
.elemik-rz-nav.next::before {
    text-indent: 0;
    display: block;
}

/* Mobile spacing */
@media (max-width: 640px) {
    .elemik-rz-nav.prev {
        left: 10px;
    }

    .elemik-rz-nav.next {
        right: 10px;
    }
}

/* --- Dots: centered + active dot highlighted --- */
.elemik-rz-dots {
    display: flex;
    justify-content: center;
    /* center horizontally */
    align-items: center;
    gap: 8px;
    padding: 12px 18px 18px 18px;
    width: 100%;
    margin: 0 auto;
}

.elemik-rz-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    border: 0;
    padding: 0;
    background: #d1d5db;
    /* inactive */
    cursor: pointer;
    box-shadow: none !important;
    outline: none !important;
}

.elemik-rz-dot.is-active {
    background: #111;
    /* active */
}

/* kill theme hover/focus styles on dots */
.elemik-rz-dot:hover,
.elemik-rz-dot:focus,
.elemik-rz-dot:focus-visible {
    background: #9ca3af;
    outline: none;
}

.elemik-rz-dot.is-active:hover,
.elemik-rz-dot.is-active:focus {
    background: #111;
}
