/* ============================================================
   KenhoWeb Livres Cartes v1.0.1
   Grille de livres façon Bible.audio : bannière + cartes blanches.
   Tout est accroché à body.kwlc-on (ajouté par le module sur la
   page « Mes Livres » et sur la boutique uniquement).
   v1.0.1 — PLEINE LARGEUR : bannière bord à bord (100vw) et
   marges latérales de la colonne éliminées sur les deux pages.
   ============================================================ */

/* ---------- Pleine largeur : on neutralise la chaîne des marges ----------
   Chaîne réelle du thème Eduvert sur les deux pages (HTML servi) :
   section.section-post > .nt-container (max-width 1200px, padding
   0 50px) > .nt-columns-area (margin 0 -15px) > .nt-column-8
   (padding 0 15px). Le module Mise en page déplace déjà la barre
   latérale sous le contenu et passe la colonne à 100 %
   (.kwmp-sans-sidebar) ; on verrouille la même géométrie ici pour
   qu'elle soit déterministe, puis on laisse 10 px de respiration :
   la grille touche presque les bords, comme la référence. */
body.kwlc-on { overflow-x: hidden; overflow-x: clip; }
body.kwlc-on #content .section-post .nt-container {
    max-width: none;
    padding-left: 10px;
    padding-right: 10px;
}
body.kwlc-on #content .section-post .nt-columns-area {
    margin-left: 0;
    margin-right: 0;
}
body.kwlc-on #content .section-post .nt-columns-area > .nt-column-8 {
    flex: 0 0 100% !important;
    max-width: 100% !important;
    padding-left: 0;
    padding-right: 0;
}
/* Page Mes Livres : la grille est dans un conteneur Elementor
   (data-id 7d1925d) — aucun rembourrage latéral résiduel. */
body.kwlc-meslivres #content .section-post .nt-column-8 [data-id="7d1925d"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ---------- Bannière (injectée en JS en haut de la colonne contenu) ----------
   Pleine largeur d'écran : la bannière est enfant de la colonne
   contenu, dont la boîte est centrée dans la fenêtre (padding
   symétrique de 10 px, colonne à 100 %) — width:100vw +
   left:50% + translateX(-50%) la pose donc exactement bord à
   bord (390 px sur un mobile de 390 px). Le garde-fou
   overflow-x sur body.kwlc-on empêche tout défilement horizontal. */
.kwlc-banniere {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    max-width: 100vw;
    display: flex;
    align-items: flex-end;
    min-height: 180px;
    margin: 0 0 28px;
    border-radius: 0;
    overflow: hidden;
    background-color: #0b1c33;
    background-size: cover;
    background-position: center 62%;
}
.kwlc-banniere::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(11, 28, 51, .20) 0%,
        rgba(11, 28, 51, .04) 42%,
        rgba(11, 28, 51, .58) 100%);
}
.kwlc-banniere-titre {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 64px 22px 18px;
    color: #fff;
    font-size: clamp(30px, 6vw, 52px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: .03em;
    text-transform: uppercase;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .45);
}
@media (min-width: 992px) {
    .kwlc-banniere { min-height: 220px; }
}

/* ---------- Grille : 2 colonnes mobile, 3 tablette, 3-4 bureau ---------- */
body.kwlc-on .woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}
body.kwlc-on .woocommerce ul.products::before,
body.kwlc-on .woocommerce ul.products::after {
    content: none !important;
    display: none !important;
}
@media (min-width: 768px) {
    body.kwlc-on .woocommerce ul.products {
        grid-template-columns: repeat(3, 1fr);
        gap: 22px;
    }
}
/* Page Mes Livres (pleine largeur utile) : 4 colonnes sur grand écran.
   Boutique : 3 colonnes max (barre latérale du thème à droite). */
@media (min-width: 1200px) {
    body.kwlc-meslivres .woocommerce ul.products {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ---------- Carte ---------- */
body.kwlc-on .woocommerce ul.products li.product {
    float: none !important;
    clear: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 16px 14px;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 14px;
    box-shadow: 0 2px 12px rgba(11, 28, 51, .08);
    display: flex;
    flex-direction: column;
    text-align: center;
    overflow: hidden;
}
body.kwlc-on .woocommerce ul.products li.product .woocommerce-LoopProduct-link {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    text-decoration: none !important;
    box-shadow: none !important;
}

/* Couverture ENTIÈRE, jamais coupée : zone fixe + object-fit contain sur fond blanc.
   (Les couvertures sont des portraits ~300×483 ; la boîte les contient au complet.) */
body.kwlc-on .woocommerce ul.products li.product img {
    order: 1;
    width: 100%;
    height: 205px;
    object-fit: contain;
    background: #fff;
    border-radius: 4px;
    margin: 0 0 12px;
    box-shadow: none;
}
@media (min-width: 768px) {
    body.kwlc-on .woocommerce ul.products li.product img { height: 235px; }
}

/* Titre du livre, en gras */
body.kwlc-on .woocommerce ul.products li.product .woocommerce-loop-product__title {
    order: 2;
    margin: 0 0 6px;
    padding: 0;
    font-size: 1.02rem;
    line-height: 1.3;
    font-weight: 700;
    color: #0b1c33;
}

/* Sous-titre gris : courte description (injectée par le module Mise en page) */
body.kwlc-on .woocommerce ul.products li.product .kwmp-prod-desc {
    order: 3;
    margin: 0 0 10px;
    color: #7a828e;
    font-size: .85rem;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Prix, visible et net */
body.kwlc-on .woocommerce ul.products li.product .price {
    order: 4;
    display: block;
    margin: 0 0 12px;
    font-size: 1rem;
    color: #0b1c33;
}
body.kwlc-on .woocommerce ul.products li.product .price .amount {
    color: #0b1c33;
    font-weight: 700;
}

/* Boutons existants : pleine largeur, tactiles, alignés en bas de carte.
   Leurs couleurs d'origine sont conservées (panier = thème, Amazon = module Mise en page). */
body.kwlc-on .woocommerce ul.products li.product a.button {
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
    padding: 13px 10px;
    border-radius: 10px;
    font-weight: 700;
    text-align: center;
}
body.kwlc-on .woocommerce ul.products li.product .kwmp-btn-amazon {
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 10px;
    border-radius: 10px;
    text-align: center;
}
