/* Blog : mosaïque d'images des produits (bento) et sommaire latéral */

.post-bento {
    display: grid;
    gap: .5rem;
    border-radius: var(--border-radius, .75rem);
    overflow: hidden;
}
.post-bento a, .post-bento .bento-cell { display: block; overflow: hidden; background: var(--light-gray, #f3f3f5); }
.post-bento img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.post-bento a:hover img { transform: scale(1.04); }

/* En-tête d'article */
.post-bento--hero { grid-template-columns: 2fr 1fr; grid-auto-rows: 180px; margin-bottom: 2.5rem; }
.post-bento--hero.count-1 { grid-template-columns: 1fr; grid-auto-rows: 360px; }
.post-bento--hero.count-2 { grid-template-columns: 1fr 1fr; grid-auto-rows: 320px; }
.post-bento--hero .bento-cell:first-child { grid-row: span 2; }
.post-bento--hero.count-1 .bento-cell:first-child,
.post-bento--hero.count-2 .bento-cell:first-child { grid-row: auto; }
.post-bento--hero.count-4 { grid-auto-rows: 120px; }
.post-bento--hero.count-4 .bento-cell:first-child { grid-row: span 3; }

/* Cartes de la liste */
.post-bento--card { grid-template-columns: 2fr 1fr; aspect-ratio: 16 / 10; gap: 3px; border-radius: 0; }
.post-bento--card.count-1 { grid-template-columns: 1fr; }
.post-bento--card.count-2 { grid-template-columns: 1fr 1fr; }
.post-bento--card .bento-cell:first-child { grid-row: span 2; }
.post-bento--card.count-1 .bento-cell:first-child,
.post-bento--card.count-2 .bento-cell:first-child { grid-row: auto; }
.post-bento--card.count-4 .bento-cell:first-child { grid-row: span 3; }

.bento-caption {
    position: relative;
}
.bento-caption span {
    position: absolute; left: .5rem; bottom: .5rem; max-width: calc(100% - 1rem);
    padding: .15rem .5rem; border-radius: 999px; font-size: .75rem;
    background: rgba(0, 0, 0, .55); color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
    .post-bento--hero, .post-bento--hero.count-4 { grid-auto-rows: 110px; }
    .post-bento--hero.count-1, .post-bento--hero.count-2 { grid-auto-rows: 220px; }
}

/* Sommaire : fixé sur le côté en grand écran, repliable en tête d'article sinon */
.post-toc { font-size: .9rem; }
.post-toc .toc-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--secondary-color, #6c757d); }
.post-toc ol { list-style: none; padding-left: 0; margin: 0; border-left: 2px solid var(--light-gray, #e9ecef); }
.post-toc li a {
    display: block; padding: .3rem .75rem; margin-left: -2px; border-left: 2px solid transparent;
    color: inherit; opacity: .75; text-decoration: none; line-height: 1.35;
}
.post-toc li.toc-level-3 a { padding-left: 1.5rem; font-size: .85rem; }
.post-toc li a:hover, .post-toc li a.active { opacity: 1; border-left-color: var(--accent-color, #c71a45); color: var(--accent-color, #c71a45); }
@media (min-width: 992px) {
    .post-toc-sticky { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; }
}
.article-content h2, .article-content h3 { scroll-margin-top: 100px; }

/* Article sans image produit : vignette de remplacement */
.post-bento-placeholder {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem;
    aspect-ratio: 16 / 10; text-decoration: none; color: #fff;
    background: linear-gradient(135deg, var(--primary-color, #c71a45), var(--accent-color, #7a1030));
}
.post-bento-placeholder i { font-size: 2.25rem; opacity: .85; }
.post-bento-placeholder span { font-weight: 600; letter-spacing: .03em; }

/* Photos produit (flacons, pots, souvent en portrait) : photo entière par-dessus
   une version floutée d'elle-même qui remplit la case, quel que soit le format */
.post-bento .bento-cell { position: relative; isolation: isolate; }
.post-bento .bento-cell:has(img.is-product)::before {
    content: ''; position: absolute; inset: -12%; z-index: -1;
    background: var(--bento-bg) center / cover no-repeat;
    filter: blur(22px) saturate(1.1) brightness(.92);
}
.post-bento img.is-product { object-fit: contain; }
.post-bento a:hover img.is-product { transform: scale(1.03); }

/* La mosaïque impose son format (16:10) : pas de hauteur fixe sur la carte */
.blog-card .card-img-top-wrapper:has(.post-bento) { height: auto; }

/* Fenêtre de documentation : PDF à la hauteur de l'écran */
.doc-pdf-frame { width: 100%; height: 75vh; border: 0; border-radius: .5rem; background: #fff; }
#docModal .doc-description { white-space: normal; line-height: 1.6; }

/* Aperçu d'un produit au survol d'un lien (façon Open Graph) */
.product-peek {
    position: absolute; z-index: 1080; width: 320px; overflow: hidden;
    border-radius: .75rem; background: var(--bs-body-bg, #fff); color: var(--text-color, inherit);
    border: 1px solid rgba(127, 127, 127, .25);
}
.product-peek img { width: 100%; height: 170px; object-fit: contain; background: #fff; display: block; }
.product-peek .peek-body { padding: .75rem .9rem .9rem; font-size: .875rem; }
.product-peek .peek-price { font-weight: 700; margin: .15rem 0 .35rem; color: var(--accent-color, #c71a45); }
.product-peek p { margin: 0 0 .6rem; opacity: .8; }
.product-peek .peek-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
