/************************************************************
	SECTION « SOLUTIONS MÉTIERS » (template-parts/home-solutions.php)
	Home + index /solutions/ — voir functions.php.
	Préfixe hs- : aucune règle ne touche les autres sections.

	Univers « produit » : fond gris chaud, cartes blanches avec un
	aperçu d'interface noir, schématique (aucun faux écran client).
	Survol : CSS seul (léger soulèvement + révélation de l'aperçu).
	GSAP (js/home-solutions.js) ne gère que les entrées au scroll.
************************************************************/
.hs-solutions {
    --hs-fg: #000;
    --hs-bg: #f3f3f1;
    --hs-muted: rgba(0, 0, 0, 0.6);
    --hs-line: rgba(0, 0, 0, 0.12);
    --hs-ui: #0d0d0d;
    --hs-ui-line: rgba(255, 255, 255, 0.14);
    --hs-ui-soft: rgba(255, 255, 255, 0.22);
    --hs-ease: cubic-bezier(0.65, 0, 0.35, 1);
    --hs-gap: clamp(0.9rem, 1.6vw, 1.75rem);

    position: relative;
    padding-block: clamp(5rem, 10vw, 10rem);
    background: var(--hs-bg);
    color: var(--hs-fg);
}

.hs-solutions--hub {
    padding-top: clamp(9rem, 16vw, 14rem);
}

/* En-tête */
.hs-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    max-width: 78rem;
    margin-bottom: clamp(3rem, 6vw, 5.5rem);
}

.hs-kicker {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--hs-muted);
}

.hs-title {
    margin: 0;
    font-size: clamp(2.2rem, 5.2vw, 5.6rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.045em;
}

.hs-title-line {
    display: block;
}

/* Deuxième ligne en retrait de couleur : la réponse au constat */
.hs-title-line--soft {
    color: rgba(0, 0, 0, 0.42);
}

.hs-text {
    max-width: 58ch;
    margin: 0.5rem 0 0;
    font-size: clamp(1.02rem, 1.15vw, 1.2rem);
    line-height: 1.6;
    color: var(--hs-muted);
}

/* Grille */
.hs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--hs-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.hs-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hs-grid--1 {
    grid-template-columns: minmax(0, 36rem);
}

/* 4 cartes : 2 × 2 */
.hs-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 5 cartes : 3 puis 2 (grille de 6 colonnes) */
.hs-grid--5 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.hs-grid--5 .hs-item {
    grid-column: span 2;
}

.hs-grid--5 .hs-item:nth-child(n + 4) {
    grid-column: span 3;
}

.hs-item {
    display: flex;
}

/* Carte entièrement cliquable (un seul lien, pas de lien imbriqué) */
.hs-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--hs-line);
    border-radius: 28px;
    background: #fff;
    color: var(--hs-fg);
    text-decoration: none;
    transition: transform 0.45s var(--hs-ease), box-shadow 0.45s var(--hs-ease), border-color 0.45s var(--hs-ease);
}

.hs-card:hover,
.hs-card:focus-visible {
    color: var(--hs-fg);
    text-decoration: none;
    border-color: rgba(0, 0, 0, 0.35);
    transform: translateY(-6px);
    box-shadow: 0 30px 60px -36px rgba(0, 0, 0, 0.45);
}

.hs-card:focus-visible {
    outline: 2px solid var(--hs-fg);
    outline-offset: 4px;
}

.hs-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: clamp(1.2rem, 1.8vw, 1.75rem) clamp(0.9rem, 1.4vw, 1.4rem) clamp(1rem, 1.4vw, 1.4rem);
}

.hs-card-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.4rem, 1.9vw, 1.95rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.hs-card-for {
    margin: 0 0 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--hs-fg);
}

.hs-card-text {
    margin: 0 0 1.75rem;
    font-size: 0.98rem;
    line-height: 1.55;
    color: var(--hs-muted);
}

.hs-card-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.1rem;
    border-top: 1px solid var(--hs-line);
    font-size: 0.95rem;
    font-weight: 500;
}

.hs-arrow {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--hs-fg);
    border-radius: 50%;
    transition: background-color 0.35s var(--hs-ease), color 0.35s var(--hs-ease), transform 0.35s var(--hs-ease);
}

.hs-card:hover .hs-arrow,
.hs-card:focus-visible .hs-arrow {
    background: var(--hs-fg);
    color: #fff;
    transform: rotate(45deg);
}

/* Pied : preuve + lien vers l'index */
.hs-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem 3rem;
    margin-top: clamp(2.5rem, 4.5vw, 4rem);
}

.hs-proof {
    max-width: 52ch;
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--hs-muted);
}

.hs-all {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    min-height: 54px;
    padding: 0.4rem 0.4rem 0.4rem 1.5rem;
    border: 1px solid var(--hs-fg);
    border-radius: 50px;
    color: var(--hs-fg);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.35s var(--hs-ease), color 0.35s var(--hs-ease);
}

.hs-all:hover,
.hs-all:focus-visible {
    background: var(--hs-fg);
    color: #fff;
    text-decoration: none;
}

.hs-all:focus-visible {
    outline: 2px solid var(--hs-fg);
    outline-offset: 4px;
}

.hs-all-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--hs-fg);
    color: #fff;
    transition: background-color 0.35s var(--hs-ease), color 0.35s var(--hs-ease), transform 0.35s var(--hs-ease);
}

.hs-all:hover .hs-all-icon,
.hs-all:focus-visible .hs-all-icon {
    background: #fff;
    color: var(--hs-fg);
    transform: rotate(45deg);
}

/************************************************************
	APERÇUS SCHÉMATIQUES (template-parts/solution/preview.php)
	Hauteur fixe : aucun décalage de mise en page (CLS).
************************************************************/
.hs-preview {
    position: relative;
    height: clamp(170px, 15vw, 210px);
    overflow: hidden;
    padding: 0 18px 18px;
    border-radius: 20px;
    background: var(--hs-ui);
    color: #fff;
    display: flex;
    flex-direction: column;
}

/* Contenu centré dans la hauteur restante sous la barre */
.hs-preview > :not(.hs-preview-bar) {
    width: 100%;
    margin-block: auto;
}

.hs-preview-bar {
    display: flex;
    gap: 5px;
    padding: 14px 0 16px;
}

.hs-preview-bar span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--hs-ui-soft);
}

.hs-line {
    display: block;
    height: 7px;
    width: 100%;
    border-radius: 4px;
    background: var(--hs-ui-soft);
}

.hs-line--50 { width: 50%; }
.hs-line--60 { width: 60%; }
.hs-line--70 { width: 70%; }

/* Réservation : 4 espaces × une journée */
.hs-booking {
    display: grid;
    gap: 12px;
}

.hs-booking-row {
    display: grid;
    grid-template-columns: 22% 1fr;
    align-items: center;
    gap: 10px;
}

.hs-booking-label {
    height: 7px;
    border-radius: 4px;
    background: var(--hs-ui-soft);
}

.hs-booking-track {
    position: relative;
    height: 22px;
    border-radius: 6px;
    background: repeating-linear-gradient(90deg, var(--hs-ui-line) 0 1px, transparent 1px 12.5%);
}

.hs-booking-slot {
    position: absolute;
    top: 3px;
    bottom: 3px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.32);
}

/* Le nouveau créneau se pose au survol */
.hs-booking-slot.is-new {
    background: #fff;
    transform: scaleX(0.35);
    transform-origin: left center;
    opacity: 0.55;
    transition: transform 0.6s var(--hs-ease), opacity 0.6s var(--hs-ease);
}

.hs-card:hover .hs-booking-slot.is-new,
.hs-card:focus-visible .hs-booking-slot.is-new {
    transform: scaleX(1);
    opacity: 1;
}

/* Espaces privés : profils à gauche, contenus à droite */
.hs-spaces {
    display: grid;
    grid-template-columns: 30% 1fr;
    gap: 14px;
}

.hs-spaces-side {
    display: grid;
    align-content: start;
    gap: 9px;
}

.hs-spaces-role {
    height: 26px;
    border: 1px solid var(--hs-ui-line);
    border-radius: 8px;
    transition: background-color 0.45s var(--hs-ease), border-color 0.45s var(--hs-ease);
}

.hs-spaces-role.is-active {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.85);
}

.hs-spaces-main {
    display: grid;
    align-content: start;
    gap: 10px;
}

.hs-doc {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 9px;
    border: 1px solid var(--hs-ui-line);
    border-radius: 8px;
    transition: transform 0.5s var(--hs-ease), opacity 0.5s var(--hs-ease);
}

.hs-doc-ico {
    flex-shrink: 0;
    width: 12px;
    height: 14px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.45);
}

/* Document réservé à un autre profil : il s'efface au survol (droits d'accès) */
.hs-doc.is-locked .hs-doc-ico {
    border-radius: 50%;
}

.hs-card:hover .hs-doc.is-locked,
.hs-card:focus-visible .hs-doc.is-locked {
    opacity: 0.25;
    transform: translateX(6px);
}

.hs-card:hover .hs-spaces-role:nth-child(2),
.hs-card:focus-visible .hs-spaces-role:nth-child(2) {
    border-color: rgba(255, 255, 255, 0.5);
}

/* Workflow : un dossier avance d'étape en étape */
.hs-flow {
    position: relative;
    display: grid;
    gap: 13px;
    padding-left: 4px;
}

.hs-flow-track {
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 11px;
    width: 1px;
    background: var(--hs-ui-line);
}

.hs-flow-fill {
    position: absolute;
    inset: 0;
    background: #fff;
    transform: scaleY(0.4);
    transform-origin: top center;
    transition: transform 0.8s var(--hs-ease);
}

.hs-card:hover .hs-flow-fill,
.hs-card:focus-visible .hs-flow-fill {
    transform: scaleY(1);
}

.hs-flow-step {
    position: relative;
    display: grid;
    grid-template-columns: 15px 1fr;
    align-items: center;
    gap: 14px;
}

.hs-flow-node {
    width: 15px;
    height: 15px;
    border: 1px solid var(--hs-ui-soft);
    border-radius: 50%;
    background: var(--hs-ui);
    transition: background-color 0.4s var(--hs-ease), border-color 0.4s var(--hs-ease);
}

.hs-flow-step.is-done .hs-flow-node {
    border-color: #fff;
    background: #fff;
}

.hs-card:hover .hs-flow-step .hs-flow-node,
.hs-card:focus-visible .hs-flow-step .hs-flow-node {
    border-color: #fff;
    background: #fff;
}

.hs-card:hover .hs-flow-step:nth-of-type(4) .hs-flow-node { transition-delay: 0.2s; }
.hs-card:hover .hs-flow-step:nth-of-type(5) .hs-flow-node { transition-delay: 0.4s; }

/* Membres : statuts d'adhésion (une cotisation passe « à jour » au survol) */
.hs-members {
    display: grid;
    gap: 10px;
}

.hs-member {
    display: grid;
    grid-template-columns: 16px 1fr 34px;
    align-items: center;
    gap: 12px;
}

.hs-member-avatar {
    width: 16px;
    height: 16px;
    border: 1px solid var(--hs-ui-soft);
    border-radius: 50%;
}

.hs-member-status {
    height: 12px;
    border-radius: 20px;
    background: #fff;
    transition: background-color 0.5s var(--hs-ease), border-color 0.5s var(--hs-ease);
}

.hs-member.is-pending .hs-member-status {
    border: 1px solid var(--hs-ui-soft);
    background: transparent;
}

.hs-card:hover .hs-member.is-pending .hs-member-status,
.hs-card:focus-visible .hs-member.is-pending .hs-member-status {
    border-color: #fff;
    background: #fff;
}

/* Pipeline : colonnes d'étapes (une candidature avance au survol) */
.hs-pipe {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.hs-pipe-col {
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 8px;
    border: 1px solid var(--hs-ui-line);
    border-radius: 6px;
}

.hs-pipe-col .hs-line {
    margin-bottom: 3px;
}

.hs-pipe-card {
    height: 18px;
    border: 1px solid var(--hs-ui-line);
    border-radius: 4px;
    transition: transform 0.6s var(--hs-ease), border-color 0.6s var(--hs-ease);
}

.hs-pipe-card.is-moving {
    border-color: rgba(255, 255, 255, 0.6);
}

.hs-card:hover .hs-pipe-card.is-moving,
.hs-card:focus-visible .hs-pipe-card.is-moving {
    transform: translateX(calc(100% + 25px));
    border-color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .hs-member-status,
    .hs-pipe-card {
        transition: none;
    }
}

/************************************************************
	RESPONSIVE
************************************************************/
@media (max-width: 1199.98px) {
    .hs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hs-grid--5 .hs-item,
    .hs-grid--5 .hs-item:nth-child(n + 4) {
        grid-column: auto;
    }

    /* Nombre impair de cartes sur 2 colonnes : la dernière prend toute la largeur */
    .hs-grid--3 .hs-item:last-child,
    .hs-grid--5 .hs-item:last-child {
        grid-column: 1 / -1;
    }

    .hs-grid--3 .hs-item:last-child .hs-card,
    .hs-grid--5 .hs-item:last-child .hs-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: stretch;
    }

    .hs-grid--3 .hs-item:last-child .hs-preview,
    .hs-grid--5 .hs-item:last-child .hs-preview {
        height: auto;
        min-height: 210px;
    }
}

@media (max-width: 767.98px) {
    .hs-grid,
    .hs-grid--2,
    .hs-grid--4,
    .hs-grid--5 {
        grid-template-columns: minmax(0, 1fr);
    }

    .hs-grid--3 .hs-item:last-child .hs-card,
    .hs-grid--5 .hs-item:last-child .hs-card {
        display: flex;
    }

    .hs-grid--3 .hs-item:last-child .hs-preview,
    .hs-grid--5 .hs-item:last-child .hs-preview {
        height: clamp(172px, 48vw, 200px);
        min-height: 0;
    }

    .hs-preview {
        height: clamp(172px, 48vw, 200px);
    }

    .hs-card {
        border-radius: 24px;
    }

    .hs-all {
        width: 100%;
        justify-content: space-between;
    }
}

/* Écrans tactiles : pas de soulèvement « collé » après un tap */
@media (hover: none) {
    .hs-card:hover {
        transform: none;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hs-card,
    .hs-arrow,
    .hs-all,
    .hs-all-icon,
    .hs-booking-slot.is-new,
    .hs-doc,
    .hs-flow-fill,
    .hs-flow-node,
    .hs-spaces-role {
        transition: none;
    }

    .hs-card:hover,
    .hs-card:focus-visible {
        transform: none;
    }
}
