/* Content Studio — template Divi Premium */
:root {
    --cs-surface: #fff;
    --cs-border: #e7e2ee;
    --cs-text: #2e2933;
    --cs-accent: #7b5bbf;
    --cs-radius: 18px;
    --cs-shadow-color: rgba(123, 91, 191, .10);
    --cs-shadow-soft-color: rgba(123, 91, 191, .06);
    --cs-shadow: 0 14px 34px var(--cs-shadow-color);
}
.cs-recipe-card{width:100%;box-sizing:border-box;color:var(--cs-text)}
.cs-recipe-card h2,.cs-recipe-card h3,.cs-recipe-card h4,.cs-recipe-card h5,.cs-recipe-card h6{margin:0 0 18px;color:var(--cs-text);line-height:1.2}
.cs-recipe-card h2{font-size:clamp(1.7rem,2.4vw,2.35rem)}
.cs-recipe-card h3{font-size:clamp(1.45rem,2vw,2rem)}
.cs-recipe-card h4{font-size:clamp(1.25rem,1.6vw,1.6rem)}
.cs-recipe-card h5{font-size:1.15rem}
.cs-recipe-card h6{font-size:1rem}
.cs-recipe-card p,.cs-recipe-card li{color:var(--cs-text);font-size:1rem;line-height:1.75}
.cs-recipe-intro,.cs-recipe-info,.cs-recipe-list,.cs-recipe-step-text,.cs-recipe-special,.cs-recipe-faq-title{
    border:1px solid var(--cs-border);border-radius:var(--cs-radius);
    background:var(--cs-surface);box-shadow:var(--cs-shadow)
}
.cs-recipe-intro,.cs-recipe-info,.cs-recipe-special,.cs-recipe-faq-title{padding:30px 34px}
.cs-recipe-list,.cs-recipe-step-text{min-height:100%;padding:30px 34px}
.cs-info-grid ul{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin:20px 0 0;padding:0;list-style:none}
.cs-info-grid li{margin:0;padding:16px 18px;border:1px solid var(--cs-border);border-radius:14px;background:#fff}
.cs-recipe-list ul{margin:0;padding-left:1.25em}
.cs-recipe-list li{margin-bottom:9px}
.cs-recipe-step-text{display:flex;flex-direction:column;justify-content:center}
.cs-recipe-special{border-left:5px solid var(--cs-accent)}
.cs-recipe-special-conseils{background:#fffaf0}
.cs-recipe-special-variantes{background:#f8fbff}
.cs-recipe-special-conservation{background:#f5fbf7}
.et_pb_toggle{margin-bottom:12px;border:1px solid var(--cs-border);border-radius:14px;overflow:hidden;background:#fff;box-shadow:0 8px 20px var(--cs-shadow-soft-color)}
.et_pb_toggle_title{font-size:1.05rem;line-height:1.45}
.et_pb_toggle_content{color:var(--cs-text);line-height:1.7}
@media(max-width:980px){
    .cs-info-grid ul{grid-template-columns:repeat(2,minmax(0,1fr))}
    .cs-recipe-list,.cs-recipe-step-text{min-height:auto}
}
@media(max-width:767px){
    .cs-recipe-intro,.cs-recipe-info,.cs-recipe-list,.cs-recipe-step-text,.cs-recipe-special,.cs-recipe-faq-title{padding:22px 20px;border-radius:14px}
    .cs-info-grid ul{grid-template-columns:1fr}
    }

/* Étapes : style sans modifier les shortcodes Divi */
.et_pb_row:has(.cs-recipe-step-text) > .et_pb_column {
    display: flex;
    flex-direction: column;
}

.et_pb_row:has(.cs-recipe-step-text) .et_pb_text {
    flex: 1 1 auto;
}

.et_pb_row:has(.cs-recipe-step-text) .cs-recipe-step-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 420px;
}

.et_pb_row:has(.cs-recipe-step-text) .et_pb_image {
    margin: 0;
    overflow: hidden;
    border-radius: var(--cs-radius);
    background: var(--cs-surface);
    box-shadow: var(--cs-shadow);
}

.et_pb_row:has(.cs-recipe-step-text) .et_pb_image .et_pb_image_wrap {
    display: block;
    width: 100%;
}

.et_pb_row:has(.cs-recipe-step-text) .et_pb_image img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 420px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 980px) {
    .et_pb_row:has(.cs-recipe-step-text) > .et_pb_column {
        display: block;
    }

    .et_pb_row:has(.cs-recipe-step-text) .cs-recipe-step-text {
        min-height: 0;
    }

    .et_pb_row:has(.cs-recipe-step-text) .et_pb_image img {
        min-height: 0;
        aspect-ratio: 4 / 3;
    }
}

@media (max-width: 767px) {
    .et_pb_row:has(.cs-recipe-step-text) .et_pb_image img {
        aspect-ratio: 1 / 1;
    }
}


/* FAQ : accordéon Divi natif */
.et_pb_accordion .et_pb_toggle {
    margin-bottom: 12px;
    border: 1px solid var(--cs-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px var(--cs-shadow-soft-color);
}

.et_pb_accordion .et_pb_toggle_title {
    padding: 18px 54px 18px 20px;
    font-size: 1.05rem;
    line-height: 1.45;
}

.et_pb_accordion .et_pb_toggle_content {
    padding: 0 20px 20px;
    color: var(--cs-text);
    line-height: 1.7;
}

.et_pb_accordion .et_pb_toggle_open,
.et_pb_accordion .et_pb_toggle_close {
    border: 0;
}


/* États accessibles pour l’accordéon de secours Content Studio */
.et_pb_accordion .et_pb_toggle_title[role="button"] {
    cursor: pointer;
}

.et_pb_accordion .et_pb_toggle_title[role="button"]:focus-visible {
    outline: 3px solid rgba(49, 81, 232, .35);
    outline-offset: 3px;
}

.et_pb_accordion .et_pb_toggle.et_pb_toggle_close .et_pb_toggle_content {
    display: none;
}

.et_pb_accordion .et_pb_toggle.et_pb_toggle_open .et_pb_toggle_content {
    display: block;
}


/* FAQ native : fiable sans JavaScript */
.cs-recipe-faq {
    display: grid;
    gap: 14px;
}

.cs-recipe-faq-title {
    margin-bottom: 8px;
}

.cs-faq-item {
    border: 1px solid var(--cs-border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(55, 39, 74, .05);
}

.cs-faq-item summary {
    position: relative;
    padding: 20px 58px 20px 22px;
    cursor: pointer;
    list-style: none;
    color: var(--cs-text);
    font-size: 1.05rem;
    line-height: 1.45;
}

.cs-faq-item summary::-webkit-details-marker {
    display: none;
}

.cs-faq-item summary::after {
    content: '+';
    position: absolute;
    top: 50%;
    right: 22px;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #c7c9ce;
    color: #fff;
    font-size: 20px;
    line-height: 22px;
    text-align: center;
}

.cs-faq-item[open] summary::after {
    content: '−';
}

.cs-faq-item summary:focus-visible {
    outline: 3px solid rgba(49, 81, 232, .35);
    outline-offset: -3px;
}

.cs-faq-answer {
    padding: 0 22px 22px;
    color: var(--cs-text);
    line-height: 1.7;
}

.cs-faq-answer > :last-child {
    margin-bottom: 0;
}


/* Galerie et vidéo Content Studio */
.cs-recipe-gallery-section,
.cs-recipe-video-section {
    padding: 30px 34px;
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    background: var(--cs-surface);
    box-shadow: var(--cs-shadow);
}

.cs-recipe-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.cs-gallery-item {
    display: block;
    overflow: hidden;
    border-radius: 14px;
    background: #f5f3f7;
    box-shadow: 0 8px 20px rgba(55, 39, 74, .06);
}

.cs-gallery-item img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .25s ease;
}

.cs-gallery-item:hover img,
.cs-gallery-item:focus-visible img {
    transform: scale(1.035);
}

.cs-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 16px;
    background: #111;
}

.cs-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.cs-recipe-video {
    display: block;
    width: 100%;
    border-radius: 16px;
    background: #111;
}

@media (max-width: 980px) {
    .cs-recipe-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .cs-recipe-gallery-section,
    .cs-recipe-video-section {
        padding: 22px 20px;
    }

    .cs-recipe-gallery {
        grid-template-columns: 1fr;
    }
}


/* Préparation — espacement vertical resserré sur desktop */
@media (min-width: 981px) {
    .et_pb_section:has(.cs-recipe-preparation-title) {
        padding-top: 16px;
        padding-bottom: 8px;
    }

    .et_pb_row:has(.cs-recipe-preparation-title) {
        padding-top: 0;
        padding-bottom: 0;
    }

    .cs-recipe-preparation-title h2 {
        margin-bottom: 0;
    }

    .et_pb_section:has(.cs-recipe-step-text) {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .et_pb_row:has(.cs-recipe-step-text) {
        padding-top: 0;
        padding-bottom: 0;
    }

    .et_pb_row:has(.cs-recipe-step-text) .cs-recipe-step-text {
        min-height: 0;
        padding-top: 22px;
        padding-bottom: 22px;
        justify-content: flex-start;
    }

    .et_pb_row:has(.cs-recipe-step-text) .cs-recipe-step-text h3 {
        margin-bottom: 10px;
    }

    .et_pb_row:has(.cs-recipe-step-text) .cs-recipe-step-text > :last-child {
        margin-bottom: 0;
    }

    .et_pb_row:has(.cs-recipe-step-text) .et_pb_image img {
        min-height: 0;
    }
}


/* Galerie 0.21.6 — ligne desktop + lightbox */
@media (min-width: 981px) {
    .cs-recipe-gallery {
        display: flex;
        flex-wrap: nowrap;
        gap: 18px;
        align-items: stretch;
    }

    .cs-recipe-gallery .cs-gallery-item {
        flex: 1 1 0;
        min-width: 0;
    }

    .cs-recipe-gallery .cs-gallery-item img {
        width: 100%;
        height: 100%;
        min-height: 240px;
        max-height: 360px;
        aspect-ratio: 4 / 3;
        object-fit: cover;
    }
}

.cs-gallery-item {
    cursor: zoom-in;
}

body.cs-lightbox-open {
    overflow: hidden;
}

.cs-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 28px;
    background: rgba(12, 12, 15, .92);
}

.cs-gallery-lightbox.is-open {
    display: flex;
}

.cs-gallery-lightbox__dialog {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(96vw, 1500px);
    height: min(94vh, 980px);
}

.cs-gallery-lightbox__image {
    display: block;
    max-width: calc(100% - 120px);
    max-height: calc(100% - 60px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}

.cs-gallery-lightbox__close,
.cs-gallery-lightbox__prev,
.cs-gallery-lightbox__next {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    border: 0;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.cs-gallery-lightbox__close:hover,
.cs-gallery-lightbox__prev:hover,
.cs-gallery-lightbox__next:hover {
    background: rgba(0, 0, 0, .8);
}

.cs-gallery-lightbox__close:focus-visible,
.cs-gallery-lightbox__prev:focus-visible,
.cs-gallery-lightbox__next:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.cs-gallery-lightbox__close {
    top: 0;
    right: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
}

.cs-gallery-lightbox__prev,
.cs-gallery-lightbox__next {
    top: 50%;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transform: translateY(-50%);
    font-size: 34px;
}

.cs-gallery-lightbox__prev {
    left: 4px;
}

.cs-gallery-lightbox__next {
    right: 4px;
}

.cs-gallery-lightbox__counter {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .55);
    color: #fff;
    font-size: 15px;
    line-height: 1.2;
}

@media (max-width: 980px) {
    .cs-gallery-lightbox {
        padding: 16px;
    }

    .cs-gallery-lightbox__dialog {
        width: 100%;
        height: 92vh;
    }

    .cs-gallery-lightbox__image {
        max-width: calc(100% - 72px);
        max-height: calc(100% - 70px);
    }

    .cs-gallery-lightbox__prev,
    .cs-gallery-lightbox__next {
        width: 42px;
        height: 42px;
        font-size: 28px;
    }
}


/* Pour aller plus loin — même typographie que les autres blocs,
   sans ajouter d'encadré ni modifier la structure Hn du Google Docs. */
.cs-recipe-long-content {
    width: 100%;
    box-sizing: border-box;
    color: var(--cs-text);
}

.cs-recipe-long-content > :first-child {
    margin-top: 0;
}

.cs-recipe-long-content > :last-child {
    margin-bottom: 0;
}


/* Typographie responsive 0.22.7
   Content Studio ne fixe plus les tailles sur tablette/smartphone.
   Les réglages responsive de Divi peuvent piloter la typographie.
   Les règles de structure et de mise en page restent actives. */


/* Pour aller plus loin — harmonisation typographique avec les autres blocs.
   Divi garde la main sur les familles et tailles responsive. */
.cs-recipe-long-content,
.cs-recipe-long-content p,
.cs-recipe-long-content li,
.cs-recipe-long-content h2,
.cs-recipe-long-content h3,
.cs-recipe-long-content h4,
.cs-recipe-long-content h5,
.cs-recipe-long-content h6 {
    color: var(--cs-text) !important;
}

.cs-recipe-long-content p,
.cs-recipe-long-content li {
    font-weight: 400 !important;
}

@media (max-width: 980px) {
    .cs-recipe-long-content,
    .cs-recipe-long-content p,
    .cs-recipe-long-content li,
    .cs-recipe-long-content h2,
    .cs-recipe-long-content h3,
    .cs-recipe-long-content h4,
    .cs-recipe-long-content h5,
    .cs-recipe-long-content h6 {
        font-family: inherit !important;
        color: var(--cs-text) !important;
    }

    .cs-recipe-long-content p,
    .cs-recipe-long-content li {
        font-weight: 400 !important;
    }
}


/* Pour aller plus loin — correction mobile renforcée 0.22.9.
   Le module parent Divi est neutralisé pour éviter un texte gris/atténué.
   La taille et la famille restent celles de la chaîne typographique du site. */
@media (max-width: 980px) {
    .et_pb_text:has(.cs-recipe-long-content),
    .et_pb_text:has(.cs-recipe-long-content) .et_pb_text_inner,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content p,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content li,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content h2,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content h3,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content h4,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content h5,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content h6 {
        color: var(--cs-text) !important;
        opacity: 1 !important;
        -webkit-text-fill-color: currentColor !important;
        text-shadow: none !important;
    }

    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content p,
    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content li {
        font-weight: 400 !important;
        line-height: 1.75 !important;
    }

    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content strong {
        font-weight: 700 !important;
    }

    .et_pb_text:has(.cs-recipe-long-content) .cs-recipe-long-content a {
        color: inherit;
        text-decoration: underline;
        text-underline-offset: 2px;
    }
}
