/**
 * TipTap / MyEasyContent — styles pour le contenu rendu sur le front.
 *
 * Ces règles ciblent les classes émises par les extensions TipTap lorsque la
 * description (catégorie, produit, article…) est rendue dans une page front
 * PrestaShop. Elles couvrent la mise en page des blocs images (largeur +
 * alignement), car le `style=""` inline émis par l'éditeur est partiellement
 * strippé par HTMLPurifier (display, max-width, width % non whitelistés).
 *
 * Injecté globalement par src/Hook/ActionFrontControllerSetMedia.php.
 */

/* ============================================================== */
/* Image bloc — taille + alignement                                 */
/* ============================================================== */

img.myec-tiptap-img {
    display: block;
    height: auto;
    max-width: 100%;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

img.myec-tiptap-img--w-25 { width: 25%; }
img.myec-tiptap-img--w-50 { width: 50%; }
img.myec-tiptap-img--w-75 { width: 75%; }
img.myec-tiptap-img--w-100 { width: 100%; }

img.myec-tiptap-img--align-left {
    margin-left: 0;
    margin-right: auto;
}

img.myec-tiptap-img--align-center {
    margin-left: auto;
    margin-right: auto;
}

img.myec-tiptap-img--align-right {
    margin-left: auto;
    margin-right: 0;
}

/* Responsive : force 100% sur mobile */
@media (max-width: 640px) {
    img.myec-tiptap-img {
        width: 100%;
    }
}

/* ============================================================== */
/* AEO/SEO + crédibilité magic blocks — fallback générique         */
/* (palette neutre, surchargeable par chaque thème via override)   */
/* ============================================================== */

.myec-tldr,
.myec-takeaways,
.myec-author-card,
.myec-proscons,
.myec-rating,
.myec-stat,
.myec-steps,
.myec-testimonial,
.myec-timeline {
    margin: 24px 0;
    padding: 16px 18px;
    background: var(--myec-surface, #fafafa);
    border: 1px solid var(--myec-border, #e0e0e0);
    border-radius: var(--myec-radius, 6px);
    font-family: inherit;
}

.myec-tldr__label,
.myec-takeaways__label,
.myec-author-card__role,
.myec-proscons__title,
.myec-steps__title {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #555;
}

.myec-tldr__answer { margin: 0; font-size: 15px; line-height: 1.5; }
.myec-takeaways__list { list-style: disc; padding-left: 20px; margin: 0; }
.myec-takeaways__item { margin-bottom: 4px; }

.myec-author-card { display: flex; gap: 14px; align-items: flex-start; }
.myec-author-card__avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.myec-author-card__body { flex: 1; }
.myec-author-card__name { font-weight: 700; }
.myec-author-card__bio { font-size: 13px; color: #666; margin: 4px 0; }
.myec-author-card__links { list-style: none; padding: 0; margin: 4px 0 0; display: flex; gap: 10px; flex-wrap: wrap; }
.myec-author-card__links a { font-size: 12px; color: #555; text-decoration: underline; }

.myec-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.myec-proscons__list { list-style: none; padding: 0; margin: 0; }
.myec-proscons__col--pros .myec-proscons__title { color: #057a4e; }
.myec-proscons__col--cons .myec-proscons__title { color: #b1382f; }
.myec-proscons__col--pros .myec-proscons__item::before { content: "✓ "; color: #057a4e; font-weight: 700; }
.myec-proscons__col--cons .myec-proscons__item::before { content: "✗ "; color: #b1382f; font-weight: 700; }

.myec-rating__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.myec-rating__stars { color: #e5a100; font-size: 18px; }
.myec-rating__star--empty { opacity: 0.35; }
.myec-rating__value strong { font-size: 22px; font-weight: 800; }
.myec-rating__criteria { list-style: none; padding: 0; margin: 10px 0 0; }
.myec-rating__criterion { display: flex; justify-content: space-between; padding: 4px 0; border-top: 1px solid var(--myec-border, #eee); font-size: 13px; }

/* Le chiffre et son évolution sur une même ligne de base : sans cela, la
   pastille flotte au-dessus d'un nombre de 40px au lieu de s'y adosser. */
.myec-stat__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.myec-stat__value { font-size: 40px; font-weight: 800; line-height: 1; }
.myec-stat__label { display: block; font-size: 14px; margin-top: 2px; }
.myec-stat__context { display: block; font-size: 12px; color: #777; font-style: italic; }
/* Le sens est calculé côté serveur d'après le signe, jamais saisi librement. */
.myec-stat__trend { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--myec-surface, #eee); color: #333; }
.myec-stat__trend[data-way="up"] { background: #ecfdf5; color: #047857; }
.myec-stat__trend[data-way="down"] { background: #fef2f2; color: #b91c1c; }
/* Rappel visuel du chiffre, pas une donnée de plus — d'où l'aria-hidden. */
.myec-stat__bar { display: block; width: 100%; height: 8px; margin-top: 10px; background: rgba(0,0,0,.1); border-radius: 999px; overflow: hidden; }
.myec-stat__bar-fill { display: block; height: 100%; background: #555; border-radius: 999px; }

.myec-steps__list { list-style: none; padding: 0; margin: 0; counter-reset: meb-step; }
.myec-steps__item { display: flex; gap: 12px; padding: 8px 0; }
.myec-steps__num { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 28px; height: 28px; background: #555; color: #fff; border-radius: 50%; font-weight: 700; font-size: 13px; }
.myec-steps__desc { margin: 2px 0 0; font-size: 14px; color: #444; }

.myec-testimonial__quote { border: 0; padding: 0; margin: 0 0 10px; }
.myec-testimonial__quote p { font-style: italic; font-size: 15px; line-height: 1.5; margin: 0; }
.myec-testimonial__caption { display: flex; align-items: center; gap: 10px; }
.myec-testimonial__photo { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.myec-testimonial__name { display: block; font-weight: 700; font-size: 13px; }
.myec-testimonial__role { font-size: 12px; color: #777; }

.myec-timeline__list { list-style: none; padding-left: 18px; margin: 0; border-left: 2px solid var(--myec-border, #ccc); }
.myec-timeline__item { padding: 6px 0 6px 12px; position: relative; }
.myec-timeline__item::before { content: ""; position: absolute; left: -23px; top: 12px; width: 8px; height: 8px; background: #555; border-radius: 50%; }
.myec-timeline__date { font-weight: 700; margin-right: 8px; }

@media (max-width: 640px) {
    .myec-author-card { flex-direction: column; }
    .myec-proscons { grid-template-columns: 1fr; }
}

/* ============================================================== */
/* Catégories / Produits — repli générique                         */
/* ============================================================== */
/*
 * `categories` et `products` sont rendus par les gabarits du thème actif
 * (views/parser/categories.parser.tpl, products.grid.parser.tpl) via les
 * raccourcis [CATEGORIES=...] / [PRODUCTS-GRID=...]. Contrairement aux neuf
 * blocs ci-dessus, aucun autre fichier partagé ne les habille (ni
 * magic-blocks.css, ni — depuis la suppression de
 * _dev/css/article/blocks-from-editor/ — la feuille propre de `classic`) :
 * sans ce qui suit, ils s'affichent en liste HTML brute.
 *
 * Mêmes variables que ci-dessus. Jamais --myec-accent : ce nom est aussi
 * déclaré par magic-blocks.css (`:root`, chargé après le CSS de thème sur
 * toutes les pages du blog) et gagne systématiquement la cascade — un
 * `var(--myec-accent, ...)` ici ne retomberait donc jamais sur son repli,
 * pas même sur un thème qui ne le déclare pas. Aucune couleur n'est donc
 * imposée sur les liens/texte : `color: inherit` seulement, jamais une
 * teinte figée.
 */
.meb__cat-block,
.meb__prod-block { margin: 24px 0; }
.meb__cat-block__title { margin: 0 0 12px; }
.meb__cat-block__grid,
.meb__prod-block__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--myec-space, 1rem); list-style: none; margin: 0; padding: 0; }

.meb__cat-card,
.meb__prod-card { display: flex; flex-direction: column; overflow: hidden; background: var(--myec-surface, #fafafa); border: 1px solid var(--myec-border, #e0e0e0); border-radius: var(--myec-radius, 6px); box-shadow: var(--myec-shadow, none); }
.meb__cat-card { position: relative; text-decoration: none; color: inherit; }

.meb__cat-card__img,
.meb__prod-card__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--myec-surface, #fafafa); }
.meb__prod-card__media { position: relative; text-decoration: none; color: inherit; }
.meb__cat-card__img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.meb__prod-card__media img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; }

/* Badge numéro (catégories) / pastille promo-nouveauté (produits) : la carte
   (catégories) ou le lien-média (produits) est le seul ancêtre positionné,
   c'est donc lui qui sert de repère pour l'incrustation en absolu. */
.meb__cat-card__num,
.meb__prod-card__tag { position: absolute; top: 8px; left: 8px; z-index: 1; padding: 3px 8px; font-size: 10px; font-weight: 700; background: var(--myec-surface, #fafafa); border: 1px solid var(--myec-border, #e0e0e0); }
.meb__cat-card__num { border-radius: var(--myec-radius, 6px); }
.meb__prod-card__tag { text-transform: uppercase; letter-spacing: 0.05em; border-radius: 999px; }

.meb__cat-card__meta,
.meb__prod-card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; flex: 1; }

.meb__cat-card__name,
.meb__prod-card__name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.meb__prod-card__name { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-decoration: none; color: inherit; }
.meb__cat-card__cta { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.meb__prod-card__ticket { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--myec-border, #e0e0e0); }
.meb__prod-card__price-block { display: flex; flex-direction: column; line-height: 1; }
.meb__prod-card__price { font-size: 17px; font-weight: 800; }
/* Prix barré : mise en retrait par COULEUR, jamais par opacity ici — cette
   regle est un repli PARTAGE entre tous les themes (contrairement au
   figcaption de Task 6, qui vit dans le CSS propre a chaque theme et peut
   donc se permettre `opacity` sans effet de bord). theme-meb redeclare deja
   `color` pour cette classe (article.css) sans jamais toucher `opacity` :
   une opacity posee ici se cumulerait avec sa couleur deja attenuee, pour un
   alpha effectif d'environ 0,36 au lieu de 0,6. --myec-text-muted est
   exactement le rgba(26,22,33,.6) que theme-meb pose en dur : inerte pour
   lui, et donne enfin une couleur a `classic`, qui ne redeclare pas cette
   classe du tout. */
.meb__prod-card__price-old { margin-top: 3px; font-size: 11px; text-decoration: line-through; color: var(--myec-text-muted, rgba(26, 22, 33, 0.6)); }
.meb__prod-card__cta-icon { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 34px; height: 34px; background: var(--myec-surface, #fafafa); border: 1px solid var(--myec-border, #e0e0e0); border-radius: var(--myec-radius, 6px); text-decoration: none; color: inherit; }

@media (max-width: 480px) {
    .meb__cat-block__grid,
    .meb__prod-block__grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ============================================================== */
/* Surlignage (« encadré ») — repli générique, surchargeable       */
/* ============================================================== */
/*
 * Le <mark> produit par l'éditeur n'avait aucun style sur le front : seule la
 * couleur passait, portée en style en ligne. Le rendu tombait donc sur le
 * défaut du navigateur — texte collé aux bords, coins vifs — là où l'éditeur
 * montre un encadré aéré. D'où « c'est plus beau en configuration ».
 *
 * `box-decoration-break: clone` fait porter la marge et l'arrondi à CHAQUE
 * ligne quand le surlignage court sur plusieurs lignes ; sans lui, seules la
 * première et la dernière sont habillées.
 *
 * La couleur n'est pas fixée ici : elle est choisie dans l'éditeur.
 *
 * Ciblé sur le conteneur d'article de chacun des trois thèmes plutôt que sur
 * `mark` tout court : cette feuille est enregistrée sur TOUTES les pages du
 * front, un sélecteur nu habillerait aussi les <mark> de la boutique.
 */
.meb__article_page_content mark,
.entry-main-content mark,
.post_content mark {
    padding: 2px 6px;
    border-radius: 3px;
    color: inherit;
    text-decoration: none;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
