/*
 * BACKdigit Posts Slider — Frontend CSS
 * Caricato una sola volta anche con più blocchi in pagina.
 * Le variabili specifiche per istanza (cardWidth, gap, radius…)
 * vengono applicate via <style> inline scoped sull'ID del blocco.
 */

/* ── Wrapper ── */
.bdps-slider {
    position: relative;
    width: 100%;
}

/* ── Scroll track ── */
.bdps-scroll {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    padding: 10px 0 20px;
}

.bdps-scroll::-webkit-scrollbar {
    height: 6px;
}

.bdps-scroll::-webkit-scrollbar-thumb {
    background: #c7c7c7;
    border-radius: 20px;
}

.custom-dark .bdps-scroll::-webkit-scrollbar-thumb {
    background: #444;
}

/* ── Card ── */
.bdps-card {
    position: relative;
    flex-shrink: 0;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .08);
    transition: transform .25s ease, box-shadow .25s ease;
}

.custom-dark .bdps-card {
    background: #1f1f1f;
}

/* ── Overlay link ── */
.bdps-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
}

/* ── Immagine ── */
.bdps-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Contenuto testuale ── */
.bdps-content {
    padding: 14px;
}

/* ── Meta (avatar, autore, categoria, data, views) ── */
.bdps-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    font-size: .78rem;
    color: #777;
}

.bdps-author-avatar img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: block;
}

/* ── Titolo ── */
.bdps-title {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.45;
}

/* ── Excerpt ── */
.bdps-excerpt {
    margin-top: 8px;
    font-size: .92rem;
    line-height: 1.6;
    color: #666;
}

.custom-dark .bdps-excerpt {
    color: #b9b9b9;
}

/* ── Frecce ── */
.bdps-arrow {
    position: absolute;
    top: 45%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .67);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

.bdps-arrow:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.custom-dark .bdps-arrow {
    background: rgba(43, 43, 43, .78);
    color: #fff;
}

.bdps-left  { left:  8px; }
.bdps-right { right: 8px; }

/* ── Badge ── */
.bdps-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    color: #fff;
    font-size: .7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
}

/* ── Dots ── */
.bdps-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 4px;
    flex-wrap: wrap;
}

.bdps-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background .2s, transform .2s;
    flex-shrink: 0;
}

.bdps-dot.active {
    background: #6495ed;
    transform: scale(1.3);
}

.custom-dark .bdps-dot        { background: #555; }
.custom-dark .bdps-dot.active { background: #6495ed; }

/* ── Categoria cliccabile ── */
.bdps-cat-link {
    text-decoration: none;
    color: #6495ed;
    font-weight: 700;
    transition: opacity .2s;
}
.bdps-cat-link:hover { opacity: .75; }

/* ── Tag pillole ── */
.bdps-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
    position: relative;
    z-index: 6;
}
.bdps-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: .72rem;
    font-weight: 700;
    background: rgba(100,149,237,.12);
    color: #6495ed;
    text-decoration: none;
    border: 1px solid rgba(100,149,237,.25);
    transition: background .2s, color .2s;
    white-space: nowrap;
}
.bdps-tag:hover {
    background: #6495ed;
    color: #fff;
}
.custom-dark .bdps-tag {
    background: rgba(100,149,237,.18);
    border-color: rgba(100,149,237,.35);
}

/* ── Magazine mode: card a tutta altezza ── */
.bdps-magazine .bdps-card {
    position: relative;
    overflow: hidden;
}
.bdps-magazine .bdps-content {
    padding: 16px;
    padding-top: 40px;
}
