/* VistaCMS — Blog (front-office) */

/* --vcb-cols : articles par ligne, réglé dans le back-office. */
.vcb-list {
    display: grid;
    grid-template-columns: repeat(var(--vcb-cols, 3), minmax(0, 1fr));
    gap: 26px;
}
.vcb-card {
    background: #fff;
    border: 1px solid #e6e8f0;
    border-radius: 14px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}
.vcb-card:hover { box-shadow: 0 10px 30px rgba(15, 20, 40, .1); transform: translateY(-2px); }
.vcb-card-link { display: block; color: inherit; text-decoration: none; }
.vcb-cover { aspect-ratio: 16/9; overflow: hidden; background: #eef0f5; }
.vcb-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcb-card-body { padding: 18px 20px 20px; }
.vcb-title { margin: 0 0 8px; font-size: 19px; line-height: 1.3; }
.vcb-excerpt { margin: 0 0 10px; color: #4a5060; font-size: 14.5px; line-height: 1.55; }
.vcb-meta { margin: 0; font-size: 12.5px; color: #8a90a0; }

/* --- Article --- */
.vcb-article { max-width: 780px; }
.vcb-back { margin: 0 0 14px; font-size: 14px; }
.vcb-back a { color: inherit; }
.vcb-article-title { margin: 0 0 8px; font-size: clamp(26px, 4vw, 40px); line-height: 1.15; }
.vcb-cover-full { width: 100%; height: auto; border-radius: 14px; margin: 20px 0; display: block; }

/* Avec couverture : 2/3 contenu + 1/3 image qui reste fixe au scroll. */
.vcb-article-cols {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 34px;
    margin-top: 20px;
}
.vcb-article-c { max-width: none; }
.vcb-article-main { min-width: 0; }
/* La colonne s'étire sur toute la hauteur du contenu — sans cela le
   sticky n'a pas de piste et l'image défile avec le texte. */
.vcb-article-aside { align-self: stretch; }
.vcb-sticky { position: sticky; top: 20px; }
.vcb-sticky .vcb-cover-full {
    margin: 0;
    max-height: calc(100vh - 40px);
    object-fit: cover;
}
.vcb-content { font-size: 17px; line-height: 1.75; }
.vcb-content h1, .vcb-content h2, .vcb-content h3, .vcb-content h4 { line-height: 1.3; }
.vcb-content img { max-width: 100%; height: auto; }
.vcb-content blockquote {
    margin: 1.4em 0;
    padding: 4px 20px;
    border-left: 3px solid #c7cbe0;
    color: #4a5060;
}

/* --- Partage --- */
.vcb-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid #e6e8f0;
}
.vcb-share-label { font-size: 13.5px; color: #8a90a0; }
.vcb-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid #e6e8f0;
    background: #fff;
    color: #1f2430;
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.vcb-share-btn:hover { background: #1f2430; color: #fff; }
.vcb-copy { font-size: 16px; }

/* --- Slider horizontal (option « Slider » du réglage Affichage) --- */
.vcb-slider { position: relative; }
.vcb-track {
    display: flex;
    gap: 26px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 4px 2px 12px;
}
.vcb-track::-webkit-scrollbar { display: none; }
.vcb-track .vcb-card {
    flex: 0 0 calc((100% - (var(--vcb-cols, 3) - 1) * 26px) / var(--vcb-cols, 3));
    scroll-snap-align: start;
    min-width: 0;
}
.vcb-arrows { display: flex; gap: 10px; margin-top: 18px; }
.vcb-nav {
    width: 36px;
    height: 36px;
    border: 1px solid #ddd8cf;
    border-radius: 50%;
    background: #fff;
    color: #1f2430;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s ease;
}
.vcb-nav:hover { background: #f6f7fb; }
.vcb-nav:disabled { opacity: .35; cursor: default; }
.vcb-nav:disabled:hover { background: #fff; }

/* Coins carrés */
.vcb-square .vcb-card { border-radius: 2px; }
.vcb-square .vcb-all-btn { border-radius: 2px; }
.vcb-square .vcb-page-btn { border-radius: 2px; }

/* Bouton « Voir tous les articles » */
.vcb-all { margin: 26px 0 0; text-align: center; }
.vcb-all-btn {
    display: inline-block;
    padding: 12px 30px;
    border: 1px solid #1f2430;
    border-radius: 999px;
    color: #1f2430;
    text-decoration: none;
    font-weight: 600;
    font-size: 14.5px;
    transition: background .2s ease, color .2s ease;
}
.vcb-all-btn:hover { background: #1f2430; color: #fff; }

/* Pagination de la page liste */
.vcb-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.vcb-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #e6e8f0;
    border-radius: 999px;
    background: #fff;
    color: #1f2430;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}
a.vcb-page-btn:hover { background: #1f2430; color: #fff; }
.vcb-page-cur { background: #1f2430; color: #fff; border-color: #1f2430; }
.vcb-page-dots { color: #8a90a0; }

/* --- Encart latéral « autres articles » (vcms_blog_side) ---
   Flottant : placez vcms_blog_side() juste avant la liste dans la page. */
.vcb-side {
    float: right;
    width: 280px;
    margin: 0 0 24px 24px;
    padding: 16px 18px;
    background: #fff;
    border: 1px solid #e6e8f0;
    border-radius: 14px;
}
.vcb-side-left { float: left; margin: 0 24px 24px 0; }
.vcb-side-title {
    margin: 0 0 6px;
    font-size: 12.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #8a90a0;
}
.vcb-side-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid #eef0f5;
    color: inherit;
    text-decoration: none;
}
.vcb-side-thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    background: #eef0f5;
}
.vcb-side-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcb-side-name { font-size: 14px; font-weight: 600; line-height: 1.35; }
.vcb-side-item:hover .vcb-side-name { text-decoration: underline; }

/* --- Suggestions en bas d'article (vcms_blog_related) --- */
.vcb-related {
    margin-top: 48px;
    padding-top: 26px;
    border-top: 1px solid #e6e8f0;
    clear: both;            /* passe sous l'encart latéral flottant */
}
.vcb-rel-title { margin: 0 0 20px; font-size: 20px; font-weight: 700; }

@media (max-width: 1100px) {

    .vcb-list {
        grid-template-columns: repeat(min(var(--vcb-cols, 3), 2), minmax(0, 1fr));
    }
    .vcb-track .vcb-card {
        flex-basis: calc((100% - (min(var(--vcb-cols, 3), 2) - 1) * 26px)
            / min(var(--vcb-cols, 3), 2));
    }
}

@media (max-width: 900px) {
    /* Article : une colonne, l'image repasse en haut non fixe. */
    .vcb-article-cols { grid-template-columns: 1fr; }
    .vcb-article-aside { order: -1; }
    .vcb-sticky { position: static; }
}

@media (max-width: 640px) {
    .vcb-list { grid-template-columns: 1fr; }
    /* Encart latéral : repasse en pleine largeur au-dessus de la liste. */
    .vcb-side { float: none; width: auto; margin: 0 0 24px; }
    .vcb-nav, .vcb-arrows { display: none; }
    /* Aperçu de la carte suivante : invite au swipe. */
    .vcb-track .vcb-card { flex-basis: 84%; }
}
