/* ===== Cartes en bois en relief : montagne, parcours, monde + encart de l'accueil =====
   Rendus Blender des cartes encadrées (chêne massif / acier noir) produits par
   E:\mountain-clean-app\Blender_scene\cartes ; contenu dynamique : js/cartes-brouillon.js */
.cm {
    --cm-ink: #2b2017;
    --cm-muted: #7a6656;
    --cm-line: #e2d6c6;
    --cm-paper: #f7f2eb;
    --cm-card: #fffdf9;
    --cm-accent: #8b5e3c;
    --cm-dark: #1d150f;
    color: var(--cm-ink);
    background: var(--cm-paper);
}

.cm-wrap {
    width: min(1240px, calc(100% - 48px));
    margin-inline: auto;
}

.cm-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--cm-accent);
}

.cm-h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.7rem, 3vw, 2.6rem);
    line-height: 1.1;
    margin: 12px 0 14px;
    text-wrap: balance;
}

.cm-lede {
    font-size: 1.02rem;
    line-height: 1.7;
    color: var(--cm-muted);
    max-width: 620px;
    margin: 0;
}

.cm-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 14px 22px;
    border-radius: 4px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid var(--cm-accent);
    transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.cm-btn--solid { background: var(--cm-accent); color: #fff; }
.cm-btn--solid:hover { background: #6e4a2f; border-color: #6e4a2f; transform: translateY(-2px); }
.cm-btn--ghost { background: transparent; color: var(--cm-accent); }
.cm-btn--ghost:hover { background: var(--cm-accent); color: #fff; transform: translateY(-2px); }
.cm-btn--light { background: #f5ebdd; color: #24170e; border-color: #f5ebdd; }
.cm-btn--light:hover { background: #fff; border-color: #fff; transform: translateY(-2px); }
.cm-btn--outline-light { background: transparent; color: #f5ebdd; border-color: rgba(245, 235, 221, 0.55); }
.cm-btn--outline-light:hover { border-color: #f5ebdd; transform: translateY(-2px); }
.cm-btn:focus-visible, .cm-seg button:focus-visible, .cm-card:focus-visible { outline: 2px solid var(--cm-accent); outline-offset: 3px; }

/* ----- Héros : le rendu panoramique (mur clair à gauche, la carte à droite) ----- */
.cm-hero {
    position: relative;
    /* les proportions du rendu (2400 x 1100) : l'image n'est jamais rognée en
       haut ni en bas, le cadre reste entier ; si le texte demande plus de
       hauteur, la boîte grandit et seul le mur des côtés est rogné */
    aspect-ratio: 24 / 11;
    display: flex;
    align-items: center;
    color: var(--cm-ink);
    overflow: hidden;
    isolation: isolate;
    background: #ece4d9;
}

.cm-hero__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 70% 0%;
    z-index: -2;
}

.cm-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(236, 228, 217, 0.92) 0%, rgba(236, 228, 217, 0.7) 34%, rgba(236, 228, 217, 0) 58%);
}

.cm-hero__body {
    padding: clamp(48px, 8vh, 96px) 0;
    max-width: 560px;
}

.cm-hero h1 {
    font-family: var(--font-heading);
    font-size: clamp(2.3rem, 4.6vw, 3.9rem);
    line-height: 1.03;
    margin: 14px 0 18px;
    color: #24170e;
    text-wrap: balance;
}

.cm-hero p {
    font-size: 1.08rem;
    line-height: 1.65;
    color: #5f4c3d;
    margin: 0 0 26px;
}

.cm-hero__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.cm-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 22px;
    margin-top: 26px;
    font-size: 0.86rem;
    color: #6f5b4b;
}

.cm-hero__facts i { color: var(--cm-accent); margin-right: 6px; }

/* ----- Galerie ----- */
.cm-gallery { padding: clamp(56px, 7vw, 96px) 0; }

.cm-gallery__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px 40px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.cm-seg {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: #ece2d4;
    gap: 2px;
}

.cm-seg button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    background: transparent;
    font: inherit;
    font-size: 0.9rem;
    color: var(--cm-muted);
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.cm-seg button.is-active {
    background: var(--cm-card);
    color: var(--cm-ink);
    box-shadow: 0 2px 8px rgba(60, 40, 20, 0.12);
}

.cm-seg__swatch {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.cm-seg__swatch--chene { background: linear-gradient(135deg, #d9a36a, #b67b45); }
.cm-seg__swatch--acier { background: linear-gradient(135deg, #3a3a3c, #121214); }

.cm-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 26px;
}

.cm-card {
    display: flex;
    flex-direction: column;
    background: var(--cm-card);
    border: 1px solid var(--cm-line);
    border-radius: 10px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.cm-card:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -24px rgba(60, 40, 20, 0.45); }

.cm-card__vis {
    position: relative;
    aspect-ratio: 4 / 3;
    background: #ece5db;
    overflow: hidden;
}

.cm-card__vis img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.45s ease, transform 0.6s ease;
}

.cm-card__vis .cm-card__alt { opacity: 0; }
.cm-card:hover .cm-card__alt { opacity: 1; }
.cm-card:hover .cm-card__vis img { transform: scale(1.03); }

.cm-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(255, 253, 249, 0.92);
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    color: var(--cm-ink);
}

.cm-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cm-card__name { font-family: var(--font-heading); font-size: 1.32rem; line-height: 1.15; margin: 0; }
.cm-card__sub { font-size: 0.88rem; color: var(--cm-muted); margin: 0; }

.cm-card__foot {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--cm-line);
    font-size: 0.86rem;
    color: var(--cm-muted);
}

.cm-card__price { font-family: var(--font-heading); font-size: 1.25rem; color: var(--cm-ink); }

/* carte « votre trace » dans la grille */
.cm-card--own {
    background: var(--cm-dark);
    color: #f5ebdd;
    border-color: transparent;
}

.cm-card--own .cm-card__sub, .cm-card--own .cm-card__foot { color: rgba(245, 235, 221, 0.72); border-color: rgba(245, 235, 221, 0.15); }
.cm-card--own .cm-card__price { color: #e7b574; }

/* ----- Deux cadres ----- */
.cm-frames { padding: clamp(56px, 7vw, 96px) 0; background: #efe7dc; }
.cm-frames__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px; margin-top: 34px; }
.cm-frame { background: var(--cm-card); border-radius: 10px; overflow: hidden; border: 1px solid var(--cm-line); }
.cm-frame img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cm-frame__body { padding: 22px 24px 24px; }
.cm-frame__body h3 { font-family: var(--font-heading); font-size: 1.4rem; margin: 0 0 8px; }
.cm-frame__body p { margin: 0 0 14px; color: var(--cm-muted); line-height: 1.6; }
.cm-frame__specs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.9rem; }
.cm-frame__specs li { display: flex; gap: 10px; }
.cm-frame__specs i { color: var(--cm-accent); width: 16px; text-align: center; margin-top: 3px; }

/* ----- Votre trace (éditeur) ----- */
.cm-own { padding: clamp(56px, 7vw, 96px) 0; background: var(--cm-dark); color: #f5ebdd; }
.cm-own__inner { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 70px); align-items: center; }
.cm-own__photo { border-radius: 10px; overflow: hidden; background: #fff; }
.cm-own__photo img { display: block; width: 100%; height: auto; }
.cm-own .cm-eyebrow { color: #e7b574; }
.cm-own .cm-h2 { color: #fff8ee; }
.cm-own .cm-lede { color: rgba(245, 235, 221, 0.78); }
.cm-steps { list-style: none; counter-reset: step; margin: 26px 0 30px; padding: 0; display: grid; gap: 14px; }
.cm-steps li { counter-increment: step; display: grid; grid-template-columns: 38px 1fr; gap: 14px; align-items: start; line-height: 1.55; }
.cm-steps li::before {
    content: counter(step);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(231, 181, 116, 0.6);
    color: #e7b574;
    font-family: var(--font-heading);
    font-size: 1.05rem;
}
.cm-steps b { color: #fff8ee; display: block; }
.cm-steps span { color: rgba(245, 235, 221, 0.72); font-size: 0.94rem; }
.cm-own__note { margin-top: 14px; font-size: 0.82rem; color: rgba(245, 235, 221, 0.55); }

/* ----- Du fichier au bois ----- */
.cm-make { padding: clamp(56px, 7vw, 96px) 0; }
.cm-make__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; margin-top: 34px; }
.cm-make__item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #ece5db; }
.cm-make__item h3 { font-family: var(--font-heading); font-size: 1.22rem; margin: 16px 0 6px; }
.cm-make__item p { margin: 0; color: var(--cm-muted); line-height: 1.6; font-size: 0.95rem; }

/* ----- Avec sa lampe ----- */
.cm-pair { padding: clamp(56px, 7vw, 96px) 0; background: #efe7dc; }
.cm-pair__inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.cm-pair__img { border-radius: 10px; overflow: hidden; }
.cm-pair__img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cm-pair__lamps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin-top: 22px; border-radius: 4px; overflow: hidden; box-shadow: 0 16px 34px -20px rgba(0, 0, 0, 0.6); }
.cm-pair__lamps a { position: relative; display: block; aspect-ratio: 1; }
.cm-pair__lamps img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cm-pair__lamps span {
    position: absolute; left: 6%; right: 6%; bottom: 4%;
    width: fit-content; margin-inline: auto; padding: 2px 6px; border-radius: 2px;
    background: rgba(255, 248, 235, 0.92); color: #2a1405; font-size: 0.62rem; line-height: 1.2; text-align: center;
}

/* ----- FAQ ----- */
.cm-faq { padding: clamp(56px, 7vw, 96px) 0; }
.cm-faq__list { margin-top: 26px; border-top: 1px solid var(--cm-line); }
.cm-faq details { border-bottom: 1px solid var(--cm-line); padding: 18px 0; }
.cm-faq summary { cursor: pointer; font-family: var(--font-heading); font-size: 1.15rem; list-style: none; display: flex; justify-content: space-between; gap: 20px; }
.cm-faq summary::-webkit-details-marker { display: none; }
.cm-faq summary::after { content: "+"; color: var(--cm-accent); font-size: 1.4rem; line-height: 1; }
.cm-faq details[open] summary::after { content: "–"; }
.cm-faq details p { margin: 12px 0 0; color: var(--cm-muted); line-height: 1.7; max-width: 820px; }

/* ----- Tailles d'écran ----- */
@media (max-width: 1024px) {
    .cm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cm-make__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
    .cm-wrap { width: calc(100% - 32px); }
    .cm-hero { display: block; min-height: 0; aspect-ratio: auto; }
    .cm-hero__img { position: static; height: auto; aspect-ratio: 16 / 10; object-position: 78% 50%; }
    .cm-hero::before { display: none; }
    .cm-hero__body { padding: 28px 0 44px; }
    .cm-grid, .cm-frames__grid, .cm-make__grid, .cm-own__inner, .cm-pair__inner { grid-template-columns: 1fr; }
    .cm-gallery__head { align-items: flex-start; }
    .cm-pair__lamps span { font-size: 0.55rem; }
}

@media (prefers-reduced-motion: reduce) {
    .cm-card, .cm-card__vis img, .cm-btn { transition: none; }
}

/* ----- Encart « cartes montagne » de l'accueil ----- */
.cm-teaser {
    padding: clamp(56px, 7vw, 96px) 0;
    background: linear-gradient(180deg, #efe7dc 0%, #f7f2eb 100%);
    color: #2b2017;
}

.cm-teaser__inner {
    width: min(1240px, calc(100% - 48px));
    margin-inline: auto;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: clamp(28px, 5vw, 70px);
    align-items: center;
}

.cm-teaser__img { position: relative; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 60px -36px rgba(60, 40, 20, 0.55); }
.cm-teaser__img img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cm-teaser__tag {
    position: absolute; top: 14px; left: 14px; padding: 6px 12px; border-radius: 999px;
    background: rgba(29, 21, 15, 0.82); color: #f5ebdd; font-size: 0.75rem; letter-spacing: 0.5px;
}
.cm-teaser__thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px 0 28px; }
.cm-teaser__thumbs a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid #e2d6c6; background: #fffdf9; color: inherit; text-decoration: none; transition: transform 0.3s ease; }
.cm-teaser__thumbs a:hover { transform: translateY(-3px); }
.cm-teaser__thumbs img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.cm-teaser__thumbs span { display: block; padding: 7px 9px 8px; font-size: 0.78rem; line-height: 1.25; }
.cm-teaser__actions { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 860px) {
    .cm-teaser__inner { grid-template-columns: 1fr; width: calc(100% - 32px); }
}

/* Accueil : les quatre familles de cartes en bois (montagne, parcours, îles, monde) */
.cm-teaser__thumbs--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) and (min-width: 861px) {
    .cm-teaser__thumbs--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
    .cm-teaser__thumbs--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
