/* Cashback Malin — surcouche du thème Source (charte graphique v2).
   Chargé APRÈS built/screen.css (voir default.hbs). Ne PAS recoller de règles dans le CSS compilé : un `gulp build` les effacerait.
   Sections : 1. polices et variables · 2. existant migré (nav, mode sombre, bascule de thème, liens sociaux) · 3. charte v2. */

/* 1. Polices et variables ---------------------------------------------------- */

@font-face {
    font-family: "Fredoka";
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url("../fonts/fredoka-latin.woff2") format("woff2");
}

:root {
    --font-display: "Fredoka", system-ui, sans-serif;
    --m-bg: #fdf8f3;
    --m-card: #fff;
    --m-bd: #eeddc8;
    --m-mut: #956542;
    --m-bt: #136cbd;
    --m-chip: #f9f0e6;
    --m-ink: #101b42;
    --m-yellow: #fdbb02;
}

/* L'accent réglé dans l'admin Ghost (#1a7de0 en prod) est un 3e bleu : on le remplace par le bleu Malin. */
html:root {
    --ghost-accent-color: #136cbd;
    /* Le CSS de base lit cette variable pour TOUS les titres (h1-h6, .is-title) avec une forte spécificité : on la renseigne plutôt que de lutter. */
    --gh-font-heading: var(--font-display);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --m-bg: #1a1108;
        --m-card: #241a0f;
        --m-bd: #3a2a1a;
        --m-mut: #c9a07a;
        --m-bt: #4298f5;
        --m-chip: #2e1e12;
    }
}

html[data-theme="dark"] {
    --m-bg: #1a1108;
    --m-card: #241a0f;
    --m-bd: #3a2a1a;
    --m-mut: #c9a07a;
    --m-bt: #4298f5;
    --m-chip: #2e1e12;
}

/* 2. Existant migré du CSS compilé (couleurs alignées sur la charte) ------------ */

/* === Cashback Malin === */
:root{--color-darker-gray:#2e1e12;--color-dark-gray:#4f3421;--color-secondary-text:rgba(46,30,18,.55)}
body{background-color:#fdf8f3}
.gh-navigation{height:104px}
.gh-navigation-logo img{max-height:72px}
.gh-header.is-classic{padding-block:107px;background:linear-gradient(to top,rgba(15,84,153,.3),transparent),linear-gradient(to bottom right,#0f5499,#136cbd,#4298f5);color:#fff}.gh-header.is-classic.has-image::before{opacity:0;pointer-events:none}
.gh-navigation.gh-outer{padding-left:0;padding-right:0}
.gh-navigation .gh-inner{max-width:1152px;padding-left:16px;padding-right:16px}
@media (max-width:639px){.gh-navigation .gh-inner{padding-left:12px;padding-right:12px}}
.gh-navigation .gh-navigation-menu a:not(.gh-button),.gh-navigation .gh-navigation-actions a:not(.gh-button){color:#4b5563}
.gh-navigation .gh-navigation-menu a:not(.gh-button):hover,.gh-navigation .gh-navigation-actions a:not(.gh-button):hover{color:#136cbd;opacity:1}
.gh-navigation .gh-navigation-actions .gh-icon-button{color:#4b5563}
.gh-navigation .gh-navigation-actions .gh-icon-button:hover{color:#136cbd;opacity:1}
@media (max-width:767px){.gh-navigation-logo img{max-height:40px}.is-open#gh-navigation .gh-navigation-menu{flex-direction:column;align-items:center;gap:20px}.is-open#gh-navigation .gh-navigation-menu>a:not(.gh-button){font-size:1.75rem;font-weight:600}}
a[data-portal]{touch-action:manipulation;cursor:pointer}
@media(prefers-color-scheme:dark){
  :root:not([data-theme="light"]){--color-darker-gray:#e8ddd4;--color-dark-gray:#c4b4a4;--color-secondary-text:rgba(232,221,212,.55);--color-border:rgba(255,255,255,.1);--color-dark-border:rgba(255,255,255,.3);--color-lighter-gray:rgba(255,255,255,.06);--color-light-gray:#3a2e25}
  html:not([data-theme="light"]) body{background-color:#1a1108}
  html:not([data-theme="light"]) .gh-navigation,html:not([data-theme="light"]) .gh-navigation-actions{background-color:#1a1108}
  html:not([data-theme="light"]) .gh-navigation .gh-navigation-menu a:not(.gh-button),html:not([data-theme="light"]) .gh-navigation .gh-navigation-actions a:not(.gh-button){color:#9ca3af}
  html:not([data-theme="light"]) .gh-navigation .gh-navigation-menu a:not(.gh-button):hover,html:not([data-theme="light"]) .gh-navigation .gh-navigation-actions a:not(.gh-button):hover{color:#4298f5}
  html:not([data-theme="light"]) .gh-navigation .gh-navigation-actions .gh-icon-button{color:#9ca3af}
  html:not([data-theme="light"]) .gh-navigation .gh-navigation-actions .gh-icon-button:hover{color:#4298f5;opacity:1}
  html:not([data-theme="light"]) .gh-footer{background-color:#1a1108}
  html:not([data-theme="light"]) .gh-dropdown{background-color:#291910}
  html:not([data-theme="light"]) .gh-dropdown li a{color:#e8ddd4!important}
  html:not([data-theme="light"]) .gh-content [style*="background"]{color:#1a1108!important}
  html:not([data-theme="light"]) .gh-theme-dropdown{background:#291910;border-color:rgba(255,255,255,.1)}
  html:not([data-theme="light"]) .gh-theme-option{color:#9ca3af}
  html:not([data-theme="light"]) .gh-theme-option:hover{background:rgba(255,255,255,.08);color:#e8ddd4}
  html:not([data-theme="light"]) .gh-theme-option.is-active{background:rgba(66,152,245,.15);color:#4298f5}
}
html[data-theme="dark"]{--color-darker-gray:#e8ddd4;--color-dark-gray:#c4b4a4;--color-secondary-text:rgba(232,221,212,.55);--color-border:rgba(255,255,255,.1);--color-dark-border:rgba(255,255,255,.3);--color-lighter-gray:rgba(255,255,255,.06);--color-light-gray:#3a2e25}
html[data-theme="dark"] body{background-color:#1a1108}
html[data-theme="dark"] .gh-navigation,html[data-theme="dark"] .gh-navigation-actions{background-color:#1a1108}
html[data-theme="dark"] .gh-navigation .gh-navigation-menu a:not(.gh-button),html[data-theme="dark"] .gh-navigation .gh-navigation-actions a:not(.gh-button){color:#9ca3af}
html[data-theme="dark"] .gh-navigation .gh-navigation-menu a:not(.gh-button):hover,html[data-theme="dark"] .gh-navigation .gh-navigation-actions a:not(.gh-button):hover{color:#4298f5}
html[data-theme="dark"] .gh-navigation .gh-navigation-actions .gh-icon-button{color:#9ca3af}
html[data-theme="dark"] .gh-navigation .gh-navigation-actions .gh-icon-button:hover{color:#4298f5;opacity:1}
html[data-theme="dark"] .gh-footer{background-color:#1a1108}
html[data-theme="dark"] .gh-dropdown{background-color:#291910}
html[data-theme="dark"] .gh-dropdown li a{color:#e8ddd4!important}
html[data-theme="dark"] .gh-content [style*="background"]{color:#1a1108!important}
html[data-theme="dark"] .gh-theme-dropdown{background:#291910;border-color:rgba(255,255,255,.1)}
html[data-theme="dark"] .gh-theme-option{color:#9ca3af}
html[data-theme="dark"] .gh-theme-option:hover{background:rgba(255,255,255,.08);color:#e8ddd4}
html[data-theme="dark"] .gh-theme-option.is-active{background:rgba(66,152,245,.15);color:#4298f5}
.gh-theme-toggle{position:relative}
.gh-theme-toggle-brand{display:none}
@media(max-width:767px){.gh-theme-toggle-brand{display:block}.gh-navigation-actions .gh-theme-toggle:not(.gh-theme-toggle-brand){display:none}#gh-navigation .gh-navigation-brand{grid-template-columns:1fr auto auto auto}#gh-theme-dropdown-mobile{position:fixed;top:64px;right:16px}}
.gh-theme-dropdown{display:none;position:absolute;right:0;top:calc(100% + 8px);background:#fff;border:1px solid rgba(0,0,0,.08);border-radius:12px;box-shadow:0 4px 16px rgba(0,0,0,.12);padding:4px;width:148px;z-index:100}
.gh-theme-dropdown.is-open{display:block}
.gh-theme-option{align-items:center;background:transparent;border:0;border-radius:8px;color:#4b5563;cursor:pointer;display:flex;font-size:1.4rem;font-weight:500;gap:8px;padding:8px 12px;width:100%}
.gh-theme-option:hover{background:rgba(0,0,0,.05);color:#15171a}
.gh-theme-option.is-active{background:rgba(19,108,189,.1);color:#136cbd;font-weight:600}
.gh-theme-check{display:none;height:14px;margin-left:auto;width:14px;flex-shrink:0}
.gh-theme-icon-light,.gh-theme-icon-dark,.gh-theme-icon-system{display:none}
[data-gh-current="light"] .gh-theme-icon-light,[data-gh-current="dark"] .gh-theme-icon-dark,[data-gh-current="system"] .gh-theme-icon-system{display:block}
.gh-social-links{display:flex;align-items:center;gap:20px}.gh-social-link{display:flex;color:var(--color-secondary-text);transition:color 0.2s}.gh-social-link:hover{opacity:1!important}.gh-social-link .icon{width:22px;height:22px}.gh-social-link.gh-social-instagram:hover{color:#FF0069!important}.gh-social-link.gh-social-facebook:hover{color:#0866FF!important}@media(max-width:767px){.is-open#gh-navigation .gh-navigation-actions{padding-top:16px}}
.gh-article-affiliate{display:none;justify-content:flex-end;margin-top:16px;font-size:1.3rem;font-style:italic}.gh-article-affiliate a{color:var(--color-secondary-text);text-decoration:underline dotted;text-underline-offset:2px}.gh-article:has(.gh-content a[href*="/go/"]) .gh-article-affiliate{display:flex}

/* 3. Charte v2 ---------------------------------------------------------------- */

/* Titres et boutons en Fredoka */
.is-title,
.gh-header-title,
.gh-card-title,
.gh-container-title,
.gh-article-title,
.gh-about-title,
.gh-content h1,
.gh-content h2,
.gh-content h3,
.gh-content h4,
.gh-button,
.gh-more {
    font-family: var(--font-display);
}

.gh-header-title,
.gh-card-title,
.gh-article-title,
.gh-container-title,
.gh-content h2,
.gh-content h3 {
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Navigation : lien de la page active souligné en jaune */
.gh-navigation .gh-navigation-menu a:not(.gh-button) {
    font-weight: 600;
}

.gh-navigation .gh-navigation-menu .nav-current a {
    box-shadow: inset 0 -3px 0 var(--m-yellow);
}

/* Boutons : bleu Malin, rayon 12 px, Fredoka 600 */
.gh-button {
    font-weight: 600;
    background-color: #136cbd;
    color: #fff;
    border-radius: 12px;
}

/* Hero : bleu profond, barres jaunes, coup de pinceau, formes douces, vague */
.gh-header.is-classic {
    position: relative;
    overflow: hidden;
    padding-block: 72px 96px;
    background: linear-gradient(135deg, #0f5499 0%, #136cbd 100%);
    color: #fff;
}

/* Hero en mode sombre : bleu plus profond (comme le comparateur) */
html[data-theme="dark"] .gh-header.is-classic {
    background: linear-gradient(135deg, #0a2f57 0%, #0d4278 60%, #0f5499 100%);
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .gh-header.is-classic {
        background: linear-gradient(135deg, #0a2f57 0%, #0d4278 60%, #0f5499 100%);
    }
}

.gh-header.is-classic::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle 120px at 88% 6%, rgba(255, 255, 255, 0.08) 99%, transparent 100%),
        radial-gradient(circle 90px at 72% 104%, rgba(253, 187, 2, 0.16) 99%, transparent 100%);
}

.gh-header.is-classic::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 34px;
    background: var(--m-bg);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 34' preserveAspectRatio='none'%3E%3Cpath d='M0 34 L0 18 Q 150 0 300 14 T 600 14 T 900 14 T 1200 16 L1200 34 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 34' preserveAspectRatio='none'%3E%3Cpath d='M0 34 L0 18 Q 150 0 300 14 T 600 14 T 900 14 T 1200 16 L1200 34 Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}

.gh-header.is-classic .gh-header-inner {
    position: relative;
    z-index: 1;
}

.gh-header.is-classic .gh-header-title {
    color: #fff;
}

.gh-header.is-classic .gh-header-title::before {
    content: "";
    display: block;
    width: 46px;
    height: 38px;
    margin: 0 auto 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 38'%3E%3Cg fill='%23fdbb02'%3E%3Crect x='6' y='14' width='6' height='22' rx='3' transform='rotate(-18 9 25)'/%3E%3Crect x='18' y='4' width='6' height='32' rx='3' transform='rotate(-18 21 20)'/%3E%3Crect x='30' y='18' width='6' height='17' rx='3' transform='rotate(-18 33 26)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.gh-header.is-classic .gh-header-title::after {
    content: "";
    display: block;
    width: 170px;
    height: 16px;
    margin: 12px auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 220 26'%3E%3Cpath d='M4 18 Q 40 2 76 16 T 148 14 T 216 12' fill='none' stroke='%23fdbb02' stroke-width='8' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Abonnement : champ en pilule, bouton jaune encre */
.gh-header .gh-form {
    border-radius: 999px;
}

.gh-header .gh-form .gh-button {
    background-color: var(--m-yellow);
    color: var(--m-ink);
    border-radius: 999px;
}

/* Titres de section : mini-barres bleues */
.gh-container-title {
    font-size: 2.2rem;
    text-transform: none;
    letter-spacing: -0.01em;
    color: var(--color-darker-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.gh-container-title::before {
    content: "";
    flex: none;
    width: 22px;
    height: 20px;
    background: var(--m-bt);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 20'%3E%3Cg%3E%3Crect x='2' y='7' width='3.5' height='11' rx='1.7' transform='rotate(-18 4 12)'/%3E%3Crect x='9' y='1' width='3.5' height='17' rx='1.7' transform='rotate(-18 11 10)'/%3E%3Crect x='16' y='9' width='3.5' height='9' rx='1.7' transform='rotate(-18 18 13)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 20'%3E%3Cg%3E%3Crect x='2' y='7' width='3.5' height='11' rx='1.7' transform='rotate(-18 4 12)'/%3E%3Crect x='9' y='1' width='3.5' height='17' rx='1.7' transform='rotate(-18 11 10)'/%3E%3Crect x='16' y='9' width='3.5' height='9' rx='1.7' transform='rotate(-18 18 13)'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* Cartes d'articles : 16 px, contour fin, survol jaune */
.gh-card-link {
    padding: 12px;
    background: var(--m-card);
    border: 1px solid var(--m-bd);
    border-radius: 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.gh-card-link:hover {
    border-color: var(--m-yellow);
    box-shadow: 0 6px 16px rgba(16, 27, 66, 0.1);
}

.gh-card-image {
    overflow: hidden;
    border-radius: 12px;
}

.gh-container.is-list .gh-card + .gh-card::before {
    display: none;
}

.gh-container.is-list .gh-feed {
    gap: 14px;
}

.gh-card-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #dbeeff;
    color: #0d4278;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.gh-card-link:hover .gh-card-title {
    opacity: 1;
}

.gh-card-excerpt,
.gh-card-meta {
    color: var(--m-mut);
}

html[data-theme="dark"] .gh-card-tag {
    background: #14263d;
    color: #7dbcfa;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .gh-card-tag {
        background: #14263d;
        color: #7dbcfa;
    }
}

/* Article : rubrique en pastille, liens soulignés jaune, citations à liseré jaune */
.gh-article-tag {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    background: #dbeeff;
    color: #0d4278;
    font-size: 1.2rem;
    font-weight: 700;
}

html[data-theme="dark"] .gh-article-tag {
    background: #14263d;
    color: #7dbcfa;
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme="light"]) .gh-article-tag {
        background: #14263d;
        color: #7dbcfa;
    }
}

.gh-content a:not(.gh-button):not(.kg-btn):not(.kg-bookmark-container):not(.kg-product-card-button) {
    color: var(--m-bt);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--m-yellow);
    text-decoration-thickness: 3px;
    text-underline-offset: 3px;
}

.gh-content blockquote:not([class]) {
    padding: 10px 18px;
    border-left: 5px solid var(--m-yellow);
    border-radius: 0 12px 12px 0;
    background: var(--m-chip);
}

/* Pied de page : logo et menu en Fredoka, fond de carte */
.gh-footer {
    border-top: 1px solid var(--m-bd);
}

.gh-footer-menu a {
    font-family: var(--font-display);
    font-weight: 600;
}
