/* ==========================================================
   Glossaire Financier v1.2 — Elementor-proof
   Fix icône : position relative/absolute sur .gf-search-box
   isolé du contexte flex d'Elementor grâce au display:block
   ========================================================== */

.gf-wrap {
    --gf-primary:        #215471;
    --gf-primary-dark:   #183d52;
    --gf-primary-light:  #d6e8f2;
    --gf-primary-xlight: #edf5fa;
    --gf-secondary:      #62B0D4;
    --gf-secondary-light:#e0f2fb;
    --gf-ink:            #0f1e26;
    --gf-ink-soft:       #3a5060;
    --gf-ink-muted:      #7a99aa;
    --gf-surface:        #f4f8fa;
    --gf-white:          #ffffff;
    --gf-border:         #ccdde6;
    --gf-border-strong:  #a8c8d8;
    --gf-radius:         14px;
    --gf-radius-sm:      8px;

    font-family: 'Outfit', sans-serif !important;
    color: var(--gf-ink);
    width: 100%;
}

.gf-wrap *,
.gf-wrap *::before,
.gf-wrap *::after {
    box-sizing: border-box;
}

/* ── HERO ── */
.gf-wrap .gf-hero {
    background: var(--gf-primary);
    padding: 4rem 2.5rem 3.5rem;
    position: relative;
    overflow: hidden;
    border-radius: var(--gf-radius) var(--gf-radius) 0 0;
    margin-bottom: 0;
}

.gf-wrap .gf-hero::before {
    content: 'Aa';
    position: absolute;
    right: -1rem; top: -1rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 18rem;
    font-weight: 600;
    color: rgba(255,255,255,.05);
    line-height: 1;
    pointer-events: none;
    user-select: none;
}

.gf-wrap .gf-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(to right, var(--gf-secondary), transparent);
}

.gf-wrap .gf-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(98,176,212,.18);
    border: 1px solid rgba(98,176,212,.35);
    color: var(--gf-secondary);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 1.25rem;
}

.gf-wrap .gf-hero-title {
    font-family: 'Cormorant Garamond', serif !important;
    font-size: clamp(2.2rem, 5vw, 4rem) !important;
    font-weight: 600 !important;
    color: #fff !important;
    line-height: 1.08 !important;
    margin: 0 0 .75rem 0 !important;
    padding: 0 !important;
    border: none !important;
}

.gf-wrap .gf-hero-title em {
    font-style: italic;
    color: var(--gf-secondary);
}

.gf-wrap .gf-hero-sub {
    font-size: 15px;
    color: rgba(255,255,255,.5);
    font-weight: 300;
    max-width: 460px;
    line-height: 1.7;
    margin: 0;
}

.gf-wrap .gf-hero-stats {
    display: flex;
    gap: 2.5rem;
    margin-top: 2rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255,255,255,.1);
}

.gf-wrap .gf-stat-num {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.9rem;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}

.gf-wrap .gf-stat-lbl {
    display: block;
    font-size: 12px;
    color: rgba(255,255,255,.35);
    margin-top: 4px;
    letter-spacing: .04em;
}

/* ── TOOLBAR ── */
.gf-wrap .gf-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 1.25rem 0 1rem;
    border-bottom: 1px solid var(--gf-border);
    margin-bottom: 1.25rem;
}

/*
 * .gf-search-box :
 * - display: block + position: relative → crée un nouveau contexte
 *   de positionnement, indépendant du flex d'Elementor
 * - width: 100% + flex: 1 → double sécurité pour qu'il prenne
 *   tout l'espace disponible dans .gf-toolbar
 */
.gf-wrap .gf-search-box {
    flex: 1;
    display: block;          /* pas flex → l'input s'étale naturellement */
    position: relative;      /* ancre l'icône en absolu */
    width: 100%;
}

.gf-wrap .gf-search-input {
    display: block !important;
    width: 100% !important;
    height: 46px !important;
    padding: 0 46px 0 18px !important;   /* padding-right = place pour l'icône */
    background: var(--gf-white) !important;
    border: 1.5px solid var(--gf-border) !important;
    border-radius: 23px !important;
    font-family: 'Outfit', sans-serif !important;
    font-size: 14px !important;
    color: var(--gf-ink) !important;
    outline: none !important;
    box-shadow: 0 1px 8px rgba(33,84,113,.07) !important;
    transition: border-color .2s, box-shadow .2s !important;
    margin: 0 !important;
    line-height: normal !important;
    /* reset tout ce qu'Elementor pourrait imposer */
    flex: none !important;
    min-height: 0 !important;
}

.gf-wrap .gf-search-input::placeholder {
    color: var(--gf-ink-muted);
    opacity: 1;
}

.gf-wrap .gf-search-input:focus {
    border-color: var(--gf-secondary) !important;
    box-shadow: 0 1px 8px rgba(33,84,113,.07), 0 0 0 3px rgba(98,176,212,.18) !important;
}

/*
 * Icône : position absolute dans .gf-search-box
 * right: 16px → toujours collée à droite, quelle que soit
 * la largeur de la barre ou les overrides d'Elementor
 */
.gf-wrap .gf-search-icon {
    position: absolute !important;
    right: 16px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: var(--gf-ink-muted);
    pointer-events: none;
    display: block !important;
    width: 16px !important;
    height: 16px !important;
    flex: none !important;
}

.gf-wrap .gf-count {
    font-size: 12px;
    color: var(--gf-ink-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── ALPHA NAV ── */
.gf-wrap .gf-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 1rem 1.25rem;
    background: var(--gf-white);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    box-shadow: 0 2px 10px rgba(33,84,113,.06);
    margin-bottom: 2rem;
}

.gf-wrap .gf-alpha-btn {
    height: 32px;
    min-width: 32px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: var(--gf-radius-sm);
    background: transparent;
    color: var(--gf-ink-soft);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    line-height: 1;
}

.gf-wrap .gf-alpha-btn:disabled {
    opacity: .22;
    cursor: default;
}

.gf-wrap .gf-alpha-btn:not(:disabled):hover {
    background: var(--gf-primary-xlight);
    color: var(--gf-primary);
    border-color: rgba(33,84,113,.18);
}

.gf-wrap .gf-alpha-btn.active {
    background: var(--gf-primary);
    color: #fff;
    border-color: var(--gf-primary);
    box-shadow: 0 2px 8px rgba(33,84,113,.28);
}

.gf-wrap .gf-btn-all {
    padding: 0 14px;
    font-weight: 600;
    background: var(--gf-secondary-light);
    color: var(--gf-primary);
    border-color: rgba(98,176,212,.3);
}

.gf-wrap .gf-btn-all.active {
    background: var(--gf-secondary);
    color: #fff;
    border-color: var(--gf-secondary);
    box-shadow: 0 2px 8px rgba(98,176,212,.35);
}

.gf-wrap .gf-btn-all:not(.active):hover {
    background: #c8e8f5;
    color: var(--gf-primary-dark);
    border-color: rgba(98,176,212,.4);
}

/* ── LETTER GROUP ── */
.gf-wrap .gf-group {
    margin-bottom: 2.5rem;
    animation: gfFadeUp .25s ease both;
}

.gf-wrap .gf-letter-anchor {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.gf-wrap .gf-letter-big {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    font-weight: 600;
    color: var(--gf-primary);
    line-height: 1;
    width: 46px;
    flex-shrink: 0;
}

.gf-wrap .gf-letter-line {
    flex: 1;
    height: 1.5px;
    background: linear-gradient(to right, var(--gf-secondary), transparent);
}

.gf-wrap .gf-letter-count {
    font-size: 11px;
    color: var(--gf-ink-muted);
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ── TERM CARDS ── */
.gf-wrap .gf-term-card {
    background: var(--gf-white);
    border: 1px solid var(--gf-border);
    border-radius: var(--gf-radius);
    margin-bottom: 10px;
    overflow: hidden;
    display: grid;
    grid-template-columns: 48px 1fr;
    transition: border-color .2s, box-shadow .2s, transform .15s;
    box-shadow: 0 1px 4px rgba(33,84,113,.05);
}

.gf-wrap .gf-term-card:hover {
    border-color: var(--gf-secondary);
    box-shadow: 0 4px 18px rgba(33,84,113,.1);
    transform: translateY(-1px);
}

.gf-wrap .gf-term-bar {
    background: var(--gf-primary-xlight);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 1.1rem;
    border-right: 1px solid var(--gf-border);
    transition: background .2s;
}

.gf-wrap .gf-term-card:hover .gf-term-bar {
    background: var(--gf-primary-light);
}

.gf-wrap .gf-term-initial {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--gf-primary);
    line-height: 1;
}

.gf-wrap .gf-term-content {
    padding: 1.1rem 1.4rem 1.2rem;
}

.gf-wrap .gf-term-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--gf-primary);
    margin-bottom: .5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.3;
}

.gf-wrap .gf-term-name::after {
    content: '';
    display: block;
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, var(--gf-border), transparent);
}

.gf-wrap .gf-term-def {
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--gf-ink-soft);
    font-weight: 300;
    margin: 0;
}

/* ── EMPTY STATE ── */
.gf-wrap .gf-empty {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
    color: var(--gf-ink-muted);
}

.gf-wrap .gf-empty-icon {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4rem;
    font-weight: 600;
    color: var(--gf-border-strong);
    line-height: 1;
    margin-bottom: .5rem;
    display: block;
}

.gf-wrap .gf-empty strong {
    display: block;
    font-size: 15px;
    color: var(--gf-ink-soft);
    margin-bottom: .35rem;
}

/* ── ANIMATION ── */
@keyframes gfFadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
    .gf-wrap .gf-hero         { padding: 2.5rem 1.25rem; }
    .gf-wrap .gf-hero::before { font-size: 10rem; }
    .gf-wrap .gf-hero-title   { font-size: 2rem !important; }
    .gf-wrap .gf-hero-stats   { gap: 1.5rem; }
    .gf-wrap .gf-alpha        { padding: .75rem; gap: 4px; }
    .gf-wrap .gf-alpha-btn    { height: 28px; min-width: 28px; font-size: 11px; }
    .gf-wrap .gf-letter-big   { font-size: 2.4rem; width: 40px; }
    .gf-wrap .gf-term-card    { grid-template-columns: 36px 1fr; }
    .gf-wrap .gf-term-bar     { padding-top: .9rem; }
    .gf-wrap .gf-term-initial { font-size: 1.1rem; }
    .gf-wrap .gf-term-content { padding: .9rem 1rem; }
}
