/*
 * LNK Hero - textes, boutons, arguments et badge : communs a toutes les structures.
 *
 * Regle de conduite : ce fichier ne style QUE les elements du module (prefixe
 * .lnk-hero). Aucun selecteur du theme hote n'est touche, aucune regle globale
 * (body, #content...) n'est posee : un module distribue ne doit jamais reecrire
 * la mise en page de la boutique.
 *
 * Les valeurs personnalisables arrivent en variables CSS posees sur .lnk-hero,
 * avec un repli neutre pour que le hero herite du theme par defaut. Chaque page
 * ne charge que ce qui lui sert : split.css pour la structure cote a cote,
 * v3/core.css et v3/s-<structure>.css pour les autres, subcats.css quand des
 * sous-categories ou des tuiles s'affichent.
 *
 * @author    LNKBOOT
 * @copyright LNKBOOT
 * @license   GPL-2.0-or-later
 */

/*
 * Marge laterale (--lnk-hero-gutter) : un hook pose en pleine largeur (Hummingbird,
 * apercu du back-office) collait le texte au bord de la fenetre. Dans le conteneur
 * d'un theme (.container de Bootstrap), la marge du conteneur suffit : 0, rendu
 * inchange. padding-inline : symetrique, juste aussi en arabe (RTL).
 */
.lnk-hero {
    position: relative;
    background: var(--lnk-hero-bg, transparent);
    padding-block: 40px;
    padding-inline: var(--lnk-hero-gutter, clamp(16px, 4vw, 32px));
}

:where(.container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl) .lnk-hero {
    --lnk-hero-gutter: 0px;
}

/*
 * Largeur « container » : .lnk-hero__inner porte la classe .container du theme, donc sa
 * largeur et son retrait exacts (Hummingbird rend l'accueil hors conteneur : texte et image
 * s'alignent enfin sur le reste de la page). La section n'ajoute plus de marge laterale.
 * Hook deja dans un conteneur (Classic) : le conteneur interne est neutralise, rendu inchange.
 */
.lnk-hero--w-container {
    --lnk-hero-gutter: 0px;
}

/* WordPress : pas de classe .container ; largeur « container » de la structure côte à côte prise
   sur --lnk-hero-container, comme les autres structures (v3/core.css). */
.lnk-hero--w-container:not(.lnk-hero--v3) .lnk-hero__inner {
    box-sizing: border-box;
    max-width: var(--lnk-hero-container, 1200px);
    margin-inline: auto;
    padding-inline: 20px;
}

/* Pleine largeur sortie du conteneur du theme par front.js : la marge laterale revient. */
.lnk-hero.lnk-hero--out {
    --lnk-hero-gutter: clamp(16px, 4vw, 32px);
}

:where(.container, .container-fluid, .container-sm, .container-md, .container-lg, .container-xl, .container-xxl) .lnk-hero:not(.lnk-hero--v3) .lnk-hero__inner.container {
    width: auto;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
}

/* Espacement (structure cote a cote ; les autres ont le leur dans v3/core.css). « theme » :
   la ou le theme espace deja ses sections par une grille (accueil Hummingbird, gap de 40 px),
   une banniere sans fond n'ajoute aucune marge verticale ; ailleurs (Classic, ou chaque
   section porte sa marge), comme « normal ». */
.lnk-hero--sp-compact:not(.lnk-hero--v3) {
    padding-block: 24px;
}

.lnk-hero--sp-airy:not(.lnk-hero--v3) {
    padding-block: clamp(56px, 8vw, 104px);
}

:where(.page-content--home) > .lnk-hero--sp-theme:not(.lnk-hero--v3):not(.lnk-hero--bg) {
    padding-block: 0;
}

.lnk-hero__breadcrumb {
    margin-bottom: 14px;
    font-size: 13px;
    opacity: .85;
}

.lnk-hero__breadcrumb a {
    text-decoration: none;
}

.lnk-hero__breadcrumb-sep {
    margin: 0 6px;
}

.lnk-hero__eyebrow {
    display: block;
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: calc(.06em * var(--lnkhero-track, 1));
    text-transform: uppercase;
    color: var(--lnk-hero-eyebrow, inherit);
}

.lnk-hero__title {
    display: block;
    margin: 0 0 16px;
    line-height: 1.1;
    color: var(--lnk-hero-title1, inherit);
}

.lnk-hero__title-line {
    display: block;
}

.lnk-hero__title-line--2 {
    color: var(--lnk-hero-title2, inherit);
}

.lnk-hero__subtitle {
    margin: 0 0 20px;
    font-size: 17px;
    line-height: 1.5;
    color: var(--lnk-hero-subtitle, inherit);
}

.lnk-hero__usps {
    list-style: none;
    margin: 0 0 22px;
    padding: 0;
    display: flex;
    flex-flow: row wrap;
    gap: 10px 22px;
    color: var(--lnk-hero-usp, inherit);
}

.lnk-hero__usp {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lnk-hero__check {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.lnk-hero__price {
    margin: 0 0 18px;
    font-size: 15px;
}

.lnk-hero__price strong {
    font-size: 24px;
    margin-inline-start: 6px;
}

.lnk-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.lnk-hero__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    text-decoration: none;
}

/* Bouton du theme (wp-element-button, styles de bouton de theme.json) : le theme l'habille, le module ne pose que la mise en page. */
.lnk-hero__btn:not(.wp-element-button) {
    padding: 13px 24px;
    border-radius: 6px;
    font-weight: 600;
    transition: filter .15s ease;
}

.lnk-hero__btn:hover,
.lnk-hero__btn:focus {
    text-decoration: none;
}

.lnk-hero__btn:not(.wp-element-button):hover,
.lnk-hero__btn:not(.wp-element-button):focus {
    filter: brightness(1.1);
}

.lnk-hero__btn svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.lnk-hero__btn--primary:not(.wp-element-button) {
    background: var(--lnk-hero-cta1-bg, #222);
    color: var(--lnk-hero-cta1-color, #fff);
}

.lnk-hero__btn--primary:not(.wp-element-button):hover,
.lnk-hero__btn--primary:not(.wp-element-button):focus {
    color: var(--lnk-hero-cta1-color, #fff);
}

.lnk-hero__btn--ghost {
    background: transparent;
    border: 2px solid var(--lnk-hero-cta2-border, currentColor);
    color: var(--lnk-hero-cta2-color, inherit);
}

.lnk-hero__widget,
.lnk-hero__slot:not(:empty) {
    margin-top: 18px;
}

.lnk-hero__badge {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 120px;
    height: 120px;
    padding: 12px;
    border-radius: 50%;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    background: var(--lnk-hero-badge-bg, #111);
    color: var(--lnk-hero-badge-color, #fff);
}

.lnk-hero__badge-icon {
    display: block;
    line-height: 0;
}

.lnk-hero__badge-icon svg {
    width: 22px;
    height: 22px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */

@media (max-width: 991px) {
    .lnk-hero {
        padding-block: 26px;
    }

    .lnk-hero__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .lnk-hero__btn {
        width: 100%;
    }

    .lnk-hero__badge {
        width: 96px;
        height: 96px;
        font-size: 9px;
    }

    .lnk-hero--hide-mobile {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lnk-hero__btn:not(.wp-element-button) {
        transition: none;
    }
}

/* Arabic script: any letter-spacing (eyebrow, tightened titles) breaks the joined letters. */
.lnk-hero:lang(ar), .lnk-hero:lang(fa), .lnk-hero:lang(ur) { --lnkhero-track: 0; }
