/*
 * Largeur et centrage : sous CheerUp, .main.wrap donnait 1170 px centrés (marges de 25 px
 * puis 15 px sur mobile). Sans ce thème, la page se centre seule, avec la marge latérale
 * du thème actif (--ij-gutter d'iliona-journal ; 0 si le jeton n'existe pas, comme sous CheerUp).
 */
.codex-widget-page {
    box-sizing: border-box;
    max-width: calc(1170px + 2 * var(--ij-gutter, 0px));
    margin-inline: auto;
    padding-inline: var(--ij-gutter, 0px);
    padding-top: 26px;
    padding-bottom: 42px;
}

.codex-widget-page__article,
.codex-widget-page__content {
    width: 100%;
}

.codex-widget-page__content {
    display: grid;
    gap: 28px;
}

.codex-widget-hero,
.codex-widget-config,
.codex-widget-benefits,
.codex-widget-faq {
    background: #fff;
    border: 1px solid #dde7e2;
    border-radius: 24px;
    box-shadow: 0 18px 42px rgba(22, 43, 37, 0.08);
}

.codex-widget-hero,
.codex-widget-config {
    padding: 28px;
}

.codex-widget-benefits,
.codex-widget-faq {
    padding: 26px;
}

.codex-widget-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
    gap: 28px;
    background:
        radial-gradient(circle at top right, rgba(14, 111, 144, 0.12), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f5fbf8 100%);
}

.codex-widget-hero__eyebrow,
.codex-widget-section-head__eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: #eef6f3;
    color: #1f6d5d;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.codex-widget-hero__title {
    margin: 14px 0 12px;
    color: #173d35;
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.08;
}

.codex-widget-hero__lead,
.codex-widget-hero__points,
.codex-widget-benefits__item p,
.codex-widget-faq__item p,
.codex-widget-panel p,
.codex-widget-note {
    color: #4f625d;
    font-size: 15px;
    line-height: 1.75;
}

.codex-widget-hero__points {
    margin: 16px 0 0;
    padding-left: 18px;
}

.codex-widget-hero__points li + li,
.codex-widget-benefits-mini li + li {
    margin-top: 8px;
}

.codex-widget-hero__card {
    display: grid;
    gap: 14px;
    align-content: start;
}

.codex-widget-hero__badge {
    justify-self: start;
    padding: 8px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #d9f4ec 0%, #e9f5fb 100%);
    color: #0e6f90;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.codex-widget-hero__preview {
    display: flex;
    justify-content: center;
    padding: 18px;
    border-radius: 18px;
    background: linear-gradient(180deg, #edf5f2 0%, #ffffff 100%);
    border: 1px solid #deebe6;
}

.codex-widget-hero__preview iframe {
    max-width: 100%;
    border: 0;
    border-radius: 16px;
    box-shadow: 0 22px 34px rgba(17, 42, 37, 0.14);
}

.codex-widget-config {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
}

.codex-widget-section-head h2 {
    margin: 12px 0 0;
    color: #183e36;
    font-size: 30px;
    line-height: 1.15;
}

.codex-widget-picker,
.codex-widget-sizes {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.codex-widget-picker__button,
.codex-widget-sizes__button,
.codex-widget-copy {
    border: 1px solid #cfe0da;
    border-radius: 999px;
    background: #fff;
    color: #234b40;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.codex-widget-picker__button,
.codex-widget-sizes__button {
    min-height: 42px;
    padding: 0 16px;
}

.codex-widget-picker__button:hover,
.codex-widget-sizes__button:hover,
.codex-widget-copy:hover {
    transform: translateY(-1px);
}

.codex-widget-picker__button.is-active,
.codex-widget-sizes__button.is-active,
.codex-widget-copy {
    border-color: #1f6d5d;
    background: #1f6d5d;
    color: #fff;
}

.codex-widget-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.codex-widget-panel {
    padding: 18px;
    border: 1px solid #e1ebe7;
    border-radius: 18px;
    background: #fbfdfc;
}

.codex-widget-panel h3,
.codex-widget-benefits__item h3,
.codex-widget-faq__item h3 {
    margin: 0 0 10px;
    color: #1d453b;
    font-size: 18px;
    line-height: 1.35;
}

.codex-widget-panel--code {
    margin-top: 18px;
}

.codex-widget-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.codex-widget-copy {
    min-height: 38px;
    padding: 0 16px;
}

.codex-widget-copy.is-copied {
    background: #1f8f5f;
    border-color: #1f8f5f;
}

.codex-widget-color {
    display: flex;
    align-items: center;
    gap: 10px;
}

.codex-widget-color input[type="color"] {
    width: 58px;
    height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.codex-widget-color input[type="text"],
#embed-code {
    width: 100%;
    border: 1px solid #cfe0da;
    border-radius: 14px;
    background: #fff;
    color: #21423a;
}

.codex-widget-color input[type="text"] {
    max-width: 140px;
    min-height: 44px;
    padding: 0 14px;
    font-family: monospace;
    font-size: 14px;
    text-transform: uppercase;
}

#embed-code {
    min-height: 152px;
    padding: 16px;
    font-family: monospace;
    font-size: 12.5px;
    line-height: 1.6;
    resize: vertical;
}

.codex-widget-note {
    margin: 10px 0 0;
    font-size: 13px;
}

.codex-widget-panel--warning {
    background: linear-gradient(180deg, #fff8dd 0%, #fffdf4 100%);
    border-color: #f1dd89;
}

.codex-widget-benefits-mini {
    margin: 0;
    padding-left: 18px;
    color: #29463f;
    line-height: 1.65;
}

.codex-widget-benefits__grid,
.codex-widget-faq__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.codex-widget-benefits__item,
.codex-widget-faq__item {
    padding: 18px;
    border: 1px solid #e1ebe7;
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fcfa 100%);
}

@media (max-width: 1080px) {
    .codex-widget-hero,
    .codex-widget-config {
        grid-template-columns: 1fr;
    }

    .codex-widget-config__aside {
        display: grid;
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .codex-widget-page {
        padding-top: 18px;
        padding-bottom: 28px;
    }

    .codex-widget-hero,
    .codex-widget-config,
    .codex-widget-benefits,
    .codex-widget-faq {
        padding: 18px;
        border-radius: 20px;
    }

    .codex-widget-grid,
    .codex-widget-benefits__grid,
    .codex-widget-faq__list {
        grid-template-columns: 1fr;
    }

    .codex-widget-section-head h2 {
        font-size: 24px;
    }

    .codex-widget-panel__head {
        align-items: flex-start;
        flex-direction: column;
    }

    .codex-widget-copy {
        width: 100%;
    }
}

/* Mesure du texte sous iliona-journal (01/10/2026) : à 1 440 px, l'accroche, la note du code et les
   paragraphes des cartes passaient 84 à 123 caractères par ligne. Mesure du thème à la taille de
   chaque bloc (13 à 15 px) : 1em x --ij-measure-k (30 sur IMC). Sans --ij-measure-k (autre
   thème) : max-width invalide, donc aucune limite. */
.codex-widget-hero__lead,
.codex-widget-panel p,
.codex-widget-note,
.codex-widget-benefits__item p,
.codex-widget-faq__item p {
    max-width: calc(1em * var(--ij-measure-k));
}
