/* ================================================
   Page — Mentions légales
   ================================================ */

/* ── Background global ── */
.legal-page {
    background: var(--light-warm);
    min-height: 100vh;
    padding-top: 40px;
}

/* En mobile le hero est plein écran (géré globalement dans hero-visual.css) :
   on supprime aussi le padding-top pour coller le hero au navbar */
@media (max-width: 768px) {
    .legal-page {
        padding-top: 0;
    }
}

/* ── Hero ── */
.legal-page .hero__container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 80px var(--padding-horizontal-large);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Layout 2 colonnes ── */
.legal-layout {
    display: flex;
    gap: 40px;
    max-width: var(--container-max-width);
    margin: 40px auto;
    padding: 0 var(--padding-horizontal-large);
    align-items: flex-start;
}

.legal-layout__sidebar {
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: 120px;
}

.legal-layout__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

/* ── Conditions row (2 cards side by side) ── */
.terms-conditions-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.terms-conditions-row .content-card {
    height: 100%;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .legal-layout {
        gap: 24px;
        padding: 0 20px;
    }

    .legal-layout__sidebar {
        width: 260px;
    }
}

@media (max-width: 900px) {
    .legal-page .hero__container {
        padding: 50px 20px;
    }

    .legal-layout {
        flex-direction: column;
        gap: 24px;
        margin: 24px auto;
    }

    .legal-layout__sidebar {
        width: 100%;
        position: static;
    }

    .legal-layout__main {
        gap: 30px;
    }

    .terms-conditions-row {
        grid-template-columns: 1fr;
    }
}

/* ================================================
   CMS Content — API HTML styled to match pricing
   page design system (content-card / data-table)
   ================================================ */

/* .cms-content sits inside a .content-card — only styles inner HTML elements */
.cms-content {
    width: 100%;
    color: var(--dark1);
    font-family: var(--font-rubik);
    font-size: 15px;
    line-height: 1.8;
}

/* Hide top-level h1 — title already shown in hero */
.cms-content > h1:first-child {
    display: none;
}

/* ── h1 (non-first) ── */
.cms-content h1 {
    font-size: 32px;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-helvetica);
    color: var(--dark1);
    margin: 40px 0 20px;
    line-height: 1.3;
}

/* ── h2 — section header with orange accent bar ── */
.cms-content h2 {
    font-size: 26px;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-helvetica);
    color: var(--dark1);
    margin: 44px 0 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--main-color);
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 12px;
}

.cms-content h2::before {
    content: '';
    display: inline-block;
    width: 5px;
    min-height: 26px;
    background: var(--main-color);
    border-radius: 3px;
    flex-shrink: 0;
    align-self: stretch;
}

/* ── h3 — sub-section title ── */
.cms-content h3 {
    font-size: 19px;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-helvetica);
    color: var(--dark1);
    margin: 32px 0 12px;
    line-height: 1.3;
}

/* ── h4 — callout label ── */
.cms-content h4 {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-helvetica);
    color: var(--dark1);
    margin: 24px 0 10px;
    padding: 14px 20px;
    background: var(--light-warm);
    border-left: 4px solid var(--main-color);
    border-radius: 0 var(--border-radius-base) var(--border-radius-base) 0;
    line-height: 1.4;
}

/* Reset first-child top margin */
.cms-content > *:first-child { margin-top: 0; }

/* ── Paragraphs ── */
.cms-content p {
    margin: 0 0 14px;
    color: var(--dark1);
    font-family: var(--font-rubik);
    font-size: 15px;
    line-height: 1.8;
}

.cms-content p:empty { display: none; }

.cms-content p:last-child { margin-bottom: 0; }

/* ── Unordered list — content-card__value-item style pills ── */
.cms-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cms-content ul li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--white);
    box-shadow: var(--shadow-card);
    border-radius: var(--border-radius-base);
    color: var(--dark1);
    font-family: var(--font-rubik);
    font-size: 15px;
    line-height: 1.5;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0;
}

.cms-content ul li:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.cms-content ul li::before {
    /* fa-circle-check unicode fallback */
    content: '\f058';
    font-family: 'Font Awesome 6 Pro', 'Font Awesome 6 Free', FontAwesome;
    font-weight: 400;
    font-size: 18px;
    color: var(--main-color);
    flex-shrink: 0;
    line-height: 1;
}

/* ── Ordered list — timeline marker style ── */
.cms-content ol {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: cms-counter;
}

.cms-content ol li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    counter-increment: cms-counter;
    color: var(--dark1);
    font-family: var(--font-rubik);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
}

.cms-content ol li::before {
    content: counter(cms-counter);
    min-width: 36px;
    height: 36px;
    background: var(--white);
    box-shadow: var(--shadow-card);
    border: 2px solid var(--main-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-family: var(--font-helvetica);
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    color: var(--main-color);
    margin-top: 2px;
}

/* Nested lists — simplified inside pills */
.cms-content li ul,
.cms-content li ol {
    margin: 8px 0 0 4px;
    gap: 6px;
}

.cms-content li ul li {
    box-shadow: none;
    background: transparent;
    padding: 4px 0 4px 8px;
    border-radius: 0;
    font-size: 14px;
}

.cms-content li ul li::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--main-color);
    border-radius: 50%;
    flex-shrink: 0;
    font-family: inherit;
    font-size: inherit;
}

/* ── Table wrapper (injected by CmsExtension for mobile scroll) ── */
.cms-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 10px 0 24px;
    border-radius: var(--border-radius-base);
}

.cms-table-wrap .cms-content table {
    margin: 0;
}

/* ── Table — data-table style ── */
.cms-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--border-radius-base);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    font-size: 14px;
    margin: 10px 0 24px;
}

.cms-content table th {
    background: var(--main-color);
    color: var(--white);
    font-family: var(--font-helvetica);
    font-size: 14px;
    font-weight: var(--font-weight-bold);
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
    border: none;
}

.cms-content table td {
    background: var(--white);
    color: var(--dark1);
    font-family: var(--font-rubik);
    font-size: 14px;
    font-weight: var(--font-weight-regular);
    padding: 10px 16px;
    border: none;
    border-bottom: 1px solid var(--light-warm);
}

.cms-content table tr:last-child td { border-bottom: none; }

.cms-content table tr:nth-child(even) td { background: var(--light3); }

.cms-content table tr:hover td { background: rgba(250, 171, 87, 0.08); }

/* ── Blockquote / q — highlighted callout ── */
.cms-content blockquote,
.cms-content q {
    display: block;
    margin: 20px 0;
    padding: 20px 24px;
    background: var(--light-warm);
    border-left: 4px solid var(--main-color);
    border-radius: 0 var(--border-radius-base) var(--border-radius-base) 0;
    font-family: var(--font-rubik);
    font-style: italic;
    color: var(--dark1);
    quotes: none;
    font-size: 15px;
    line-height: 1.7;
}

/* ── Horizontal rule ── */
.cms-content hr {
    border: none;
    border-top: 2px solid var(--light-warm);
    margin: 30px 0;
}

/* ── Inline text ── */
.cms-content b,
.cms-content strong {
    font-weight: var(--font-weight-bold);
    color: var(--dark1);
}

.cms-content em,
.cms-content i { font-style: italic; }

.cms-content u { text-decoration: underline; }

.cms-content a {
    color: var(--main-color);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.cms-content a:hover {
    color: var(--main-color-orange);
    border-bottom-color: var(--main-color-orange);
}

.cms-content span { display: inline; }

.cms-content > div { margin-bottom: 16px; }

.cms-content br {
    display: block;
    content: "";
    margin: 6px 0;
    line-height: 1;
}

/* ── Feature block — h3 + p combination ── */
.cms-feature-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px 24px;
    background: var(--white);
    border-left: 4px solid var(--main-color);
    border-radius: 0 var(--border-radius-base) var(--border-radius-base) 0;
    box-shadow: var(--shadow-card);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cms-feature-block:hover {
    border-left-color: var(--main-color-orange);
    box-shadow: var(--shadow-sm);
}

.cms-feature-block__header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cms-feature-block__accent {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--main-color);
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.cms-feature-block:hover .cms-feature-block__accent {
    background: var(--main-color-orange);
}

.cms-feature-block__title {
    font-size: 16px;
    font-family: var(--font-helvetica);
    font-weight: var(--font-weight-bold);
    color: var(--dark1);
    margin: 0;
    line-height: 1.3;
}

.cms-feature-block__title span {
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
}

.cms-feature-block__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 18px;
}

.cms-feature-block__text {
    font-size: 14px;
    font-family: var(--font-rubik);
    font-weight: var(--font-weight-regular);
    color: var(--dark1);
    opacity: 0.82;
    line-height: 1.7;
    margin: 0;
}

.cms-feature-block__text span {
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    opacity: inherit;
}

.cms-feature-block__text strong,
.cms-feature-block__text b {
    font-weight: var(--font-weight-semibold);
    color: var(--dark1);
    opacity: 1;
}

/* ── Feature grid — multiple consecutive h3+p → 2-column layout ── */
.cms-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 860px) {
    .cms-feature-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Links — override browser default blue across all CMS-generated components ── */
.content-card a,
.timeline-card a,
.data-table a,
.cms-feature-block a {
    color: var(--main-color);
    text-decoration: none;
    font-weight: var(--font-weight-semibold);
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.content-card a:hover,
.timeline-card a:hover,
.data-table a:hover,
.cms-feature-block a:hover {
    color: var(--main-color-orange);
    border-bottom-color: var(--main-color-orange);
}

/* Links inside orange cards stay white */
.content-card--orange a {
    color: var(--white);
    border-bottom-color: rgba(255, 255, 255, 0.4);
}

.content-card--orange a:hover {
    color: var(--white);
    border-bottom-color: var(--white);
}

/* Links inside table cells — no bold, more subtle */
.data-table__table td a {
    font-weight: var(--font-weight-regular);
    border-bottom: 1px dotted var(--main-color);
}

/* ── Normalize any remaining <span> that wasn't unwrapped ── */
.content-card span,
.timeline-card span,
.data-table span {
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
    display: inline;
}

/* ── data-table text sizing ── */
.data-table__table td span,
.data-table__table th span {
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
    color: inherit;
}

/* ── cms_to_cards helper classes ── */
/* Standalone h3 (no following p) — acts as a divider title */
.cms-section-h3 {
    font-size: 17px;
    font-weight: var(--font-weight-bold);
    font-family: var(--font-helvetica);
    color: var(--dark1);
    margin: 0;
    padding: 10px 0 10px 14px;
    border-left: 3px solid var(--main-color);
    line-height: 1.3;
}

.cms-section-h4 {
    font-size: 15px;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-helvetica);
    color: var(--dark1);
    margin: 0;
    padding: 12px 18px;
    background: var(--light-warm);
    border-left: 4px solid var(--main-color);
    border-radius: 0 var(--border-radius-base) var(--border-radius-base) 0;
    line-height: 1.4;
}

.cms-blockquote {
    margin: 0;
    padding: 20px 24px;
    background: var(--light-warm);
    border-left: 4px solid var(--main-color);
    border-radius: 0 var(--border-radius-base) var(--border-radius-base) 0;
    font-family: var(--font-rubik);
    font-style: italic;
    color: var(--dark1);
    font-size: 15px;
    line-height: 1.7;
}

.cms-hr {
    border: none;
    border-top: 2px solid var(--light-warm);
    margin: 10px 0;
}

/* ── data-table__header-body (generated by cms_to_cards) ── */
.data-table__header-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .cms-content {
        padding: 24px 20px;
    }

    .cms-content h2 {
        font-size: 20px;
    }

    .cms-content h2::before {
        min-height: 20px;
    }

    .cms-content h3 {
        font-size: 17px;
    }

    .cms-content ul li {
        padding: 10px 14px;
    }

    .cms-content table {
        min-width: 340px;
    }
}
