/* =========================================================
   Camila — composants du mini builder propres au site (inc/builder.php) :
   grande photo d'en-tête et bijoux du moment. Plus la mise en page
   d'une page qui commence par la photo d'en-tête (l'accueil).
   ========================================================= */

/* ---------- Page qui commence par la photo d'en-tête ---------- */

/* Sections plus espacées et titres plus grands que sur les pages de contenu */
.page-main--hero {
    padding-top: 0;
}

.page-main--hero .cb {
    --cb-gap: clamp(4.5rem, 3rem + 5vw, 8rem);
}

.page-main--hero .cb h2.cb-heading {
    font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.5rem);
}

/* Même espacement que les grands composants de l'extension (front.css) */
.cb > .cb-hero + *,
.cb > * + .cb-products,
.cb > .cb-products + * {
    margin-top: var(--cb-gap);
}

/* ---------- Grande photo d'en-tête ---------- */

/* Sur toute la largeur (50cqw : demi-largeur de .page-main, voir page.css), en haut de la page,
   sous le header (pilule floutée de header.css, dont elle reprend la hauteur) */
.cb-hero {
    --header-space: calc(clamp(8px, 1vw, 14px) + 80px);
    position: relative;
    isolation: isolate;
    display: grid;
    place-items: center;
    min-height: clamp(540px, 44vw, 780px);
    margin-top: calc(-1 * var(--header-space));
    margin-inline: calc(50% - 50cqw);
    padding: calc(var(--header-space) + 2rem) 0 clamp(3rem, 6vw, 5rem);
    background: linear-gradient(160deg, #dd8f7a, var(--c-accent-dark)); /* sans photo */
    text-align: center;
}

.cb-hero__photo {
    position: absolute;
    z-index: -1;
    inset: 0;
}

.cb-hero__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Voile qui fonce le bas de la photo : le logo et le texte blancs restent lisibles */
.cb-hero__photo::after {
    content: "";
    position: absolute;
    inset: 0;
    backdrop-filter: blur(4px);
    background: linear-gradient(180deg, rgb(40 20 15 / .1) 0%, rgb(40 20 15 / .3) 50%, rgb(40 20 15 / .55) 100%);
}

/* Photo pas encore choisie (personne connectée) */
.cb-hero__missing {
    position: absolute;
    z-index: 1;
    bottom: 1rem;
    left: 50%;
    padding: .3em .9em;
    border-radius: 999px;
    background: rgb(255 255 255 / .85);
    color: var(--c-accent-ink);
    font-size: .8125rem;
    transform: translateX(-50%);
}

/* Logo du site passé en blanc */
.cb-hero__logo {
    width: min(560px, 86vw);
    margin-inline: auto;
    filter: brightness(0) invert(1) drop-shadow(0 2px 14px rgb(0 0 0 / .25));
}

.cb-hero__title {
    max-width: 24em;
    margin: clamp(1rem, 2vw, 1.5rem) auto 0;
    color: #fff;
    font-family: var(--f-text);
    font-size: clamp(1.125rem, 1rem + .6vw, 1.5rem);
    font-weight: 500;
    line-height: 1.4;
    text-shadow: 0 1px 12px rgb(0 0 0 / .4);
}

.cb-hero .btn {
    margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

/* Bouton blanc sur la photo */
.btn--light {
    --btn-wave: rgb(181 74 52 / .5);
    background: #fff;
    color: var(--c-accent-ink);
}

/* Header moins haut sous 960px (header.css) */
@media (max-width: 959px) {
    .cb-hero {
        --header-space: calc(clamp(8px, 1vw, 14px) + 64px);
    }
}

@media (max-width: 599px) {
    .cb-hero {
        min-height: 520px;
    }
}

/* Remerciement après l'inscription à la newsletter (?inscription=merci) */
.cb > .cb-thanks {
    margin-top: 2.5rem;
    padding: 1.75rem var(--gutter);
    border-radius: 12px;
    background: var(--c-surface);
    text-align: center;
}

.cb-thanks .title {
    margin-bottom: .5rem;
    font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem);
}

.cb-thanks p:not(.title) {
    color: #000;
    font-size: 1.125rem;
    font-weight: 300;
}

/* ---------- Bijoux du moment ---------- */

/* Titre centré, souligné d'une vague rose (comme le titre des pages, page.css) */
.cb-products__title {
    text-align: center;
}

.cb-products__title::after {
    content: "";
    display: block;
    width: min(385px, 90%);
    aspect-ratio: 385 / 12;
    margin: .3em auto 0;
    background: url("../img/vague-sous-titre.svg") center / 100% 100% no-repeat;
}

/* --cols : 3 ou 4 cartes par ligne selon le nombre choisi (voir products.php) */
.cb-products__list {
    display: grid;
    grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr));
    gap: 2rem clamp(1rem, 2.5vw, 2.25rem);
    margin-top: clamp(1.75rem, 3vw, 2.5rem);
    padding: 0;
    list-style: none;
}

.cb-products__list + .cb-button {
    margin-top: 2.5rem;
}

@media (max-width: 999px) {
    .cb-products__list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Téléphones : deux cartes par ligne, textes réduits (comme la boutique, shop.css) */
@media (max-width: 599px) {
    .cb-products__list {
        gap: 1.25rem .75rem;
    }

    .cb-products__list .product-card-body {
        gap: .2rem;
        padding: .7rem .65rem .8rem;
        font-size: .875rem;
    }

    .cb-products__list .product-card-title,
    .cb-products__list .product-card-price {
        font-size: 1rem;
    }

    .cb-products__list .product-card-btn {
        padding: .25rem .6rem;
        font-size: .875rem;
    }
}
