/* ============================================================
   HEXIS DAM v2 — Public Frontend
   Hero, Header, Masonry grid, Modal, AI Panel
   ============================================================ */

/* The [hidden] attribute must always win, even over author display rules
   like `.masonry { display: grid }` (author display overrides the UA
   `[hidden] { display: none }`, which otherwise leaves #skeleton-grid /
   #masonry-grid visible despite el.hidden = true). */
[hidden] { display: none !important; }

/* ── HERO SECTION ───────────────────────────────────────── */
.hero {
    position: relative;
    min-height: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-3xl) var(--space-lg) var(--space-2xl);
    background: linear-gradient(135deg,
        var(--brand-accent) 0%,
        color-mix(in srgb, var(--brand-accent), #000 25%) 100%
    );
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 40%);
    pointer-events: none;
}

/* ── Mosaïque animée des dernières images du DAM ──────────── */
.hero__mosaic {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    filter: blur(12px);
    transition: opacity 0.45s ease, filter 0.45s ease;
}
.hero__mosaic.is-ready { opacity: 1; filter: blur(0); }

.hero__mosaic-col {
    flex: 1 0 160px;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    min-width: 0;
    will-change: transform;
    animation: heroMosaicScroll var(--dur, 70s) linear infinite;
}
.hero__mosaic-col--reverse { animation-direction: reverse; }

.hero__mosaic-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center center;
    border-radius: var(--radius-md);
    display: block;
    background: rgba(255,255,255,0.06);
}

/* Voile dégradé de marque par-dessus la mosaïque (lisibilité du contenu) */
.hero__mosaic::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 60% at 50% 56%, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 70%, transparent 100%),
        linear-gradient(135deg,
            color-mix(in srgb, var(--brand-accent) 42%, transparent) 0%,
            color-mix(in srgb, var(--brand-accent) 60%, transparent) 100%
        );
}

@keyframes heroMosaicScroll {
    from { transform: translateY(0); }
    to   { transform: translateY(-50%); }
}

@media (prefers-reduced-motion: reduce) {
    .hero__mosaic-col { animation: none; }
}

/* La mosaïque disparaît quand le hero se compacte (recherche active) */
.hero--compact .hero__mosaic { display: none; }

/* Circuit Le Mans background */
.hero__circuit {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    overflow: hidden;
}

.hero__circuit svg {
    width: 110%;
    height: 110%;
    max-width: 1100px;
    opacity: 0.3;
}

/* Tout le contenu du hero au-dessus du circuit */
.hero__logo,
.hero__title,
.hero__subtitle,
.hero__search,
.hero__divisions {
    position: relative;
    z-index: 3;
}

.hero__logo {
    height: 36px;
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.6s ease both;
}

.hero__title {
    font-size: var(--text-4xl);
    font-weight: var(--weight-bold);
    color: white;
    margin-bottom: var(--space-sm);
    letter-spacing: -0.02em;
    animation: fadeInUp 0.6s ease 0.1s both;
}

.hero__subtitle {
    font-size: var(--text-lg);
    color: rgba(255,255,255,0.8);
    font-weight: var(--weight-light);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.6s ease 0.15s both;
}

.hero__search {
    position: relative;
    width: 100%;
    max-width: 640px;
    animation: fadeInUp 0.6s ease 0.2s both;
}

.hero__search-input {
    width: 100%;
    padding: 18px 24px 18px 52px;
    font-size: var(--text-lg);
    background: rgba(255,255,255,0.95);
    border: none;
    border-radius: var(--radius-xl);
    color: var(--text);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    transition: all var(--ease-base);
}

.hero__search-input::placeholder {
    color: var(--text-muted);
}

.hero__search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    transform: scale(1.01);
}

.hero__search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.hero__search-icon svg { width: 22px; height: 22px; }

.hero__search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px;
    color: var(--text-light);
    border-radius: var(--radius-full);
    transition: all var(--ease-fast);
}

.hero__search-clear:hover { background: var(--bg-hover); color: var(--text); }

.hero__divisions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeInUp 0.6s ease 0.3s both;
}

.hero__division-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.15);
    color: white;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all var(--ease-fast);
    cursor: pointer;
}

.hero__division-pill:hover,
.hero__division-pill.active {
    background: rgba(255,255,255,0.95);
    color: var(--brand-accent);
}

.hero__division-pill svg { width: 16px; height: 16px; }

/* Hero collapses when searching */
.hero--compact {
    min-height: auto;
    padding: var(--space-md) var(--space-lg);
}
.hero--compact .hero__title,
.hero--compact .hero__subtitle,
.hero--compact .hero__divisions,
.hero--compact .hero__logo { display: none; }

.hero--compact .hero__search-input {
    padding: 14px 20px 14px 48px;
    font-size: var(--text-base);
    border-radius: var(--radius-lg);
}

/* ── STICKY HEADER ──────────────────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all var(--ease-base);
}

.header__inner, .active-filters {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

/* Top bar: search + controls */
.header__top {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    height: var(--header-height);
}

.header__logo {
    flex-shrink: 0;
}

.header__logo img {
    height: 26px;
    transition: filter var(--ease-fast);
}


.header__search {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.header__search-input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: var(--text);
    transition: all var(--ease-fast);
}

.header__search-input:focus {
    outline: none;
    border-color: var(--brand-accent);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px rgba(254, 1, 108, 0.08);
}

.header__search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.header__search-icon svg { width: 16px; height: 16px; }

.header__search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px;
    color: var(--text-light);
    border-radius: var(--radius-full);
    transition: all var(--ease-fast);
}

.header__search-clear:hover { background: var(--bg-hover); color: var(--text); }
.header__search-clear svg { width: 14px; height: 14px; }

.header__controls {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
}

/* Lang buttons */
.lang-switch {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-full);
    padding: 2px;
    gap: 2px;
}

.lang-switch__btn {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: all var(--ease-fast);
    letter-spacing: 0.3px;
}

.lang-switch__btn.active {
    background: var(--brand-accent);
    color: white;
}

.lang-switch__btn:hover:not(.active) {
    color: var(--text);
}

/* Theme toggle */
.theme-toggle {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--ease-fast);
}

.theme-toggle:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.theme-toggle svg { width: 18px; height: 18px; }

/* AI trigger button */
.ai-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--brand-accent), #8B5CF6);
    color: white;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    border-radius: var(--radius-full);
    transition: all var(--ease-fast);
    box-shadow: 0 2px 12px rgba(139, 92, 246, 0.3);
}

.ai-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.ai-trigger svg { width: 16px; height: 16px; }

/* Admin link */
.admin-link {
    padding: 8px;
    color: var(--text-light);
    border-radius: var(--radius-full);
    transition: all var(--ease-fast);
}
.admin-link:hover { background: var(--bg-hover); color: var(--text); }
.admin-link svg { width: 18px; height: 18px; }

/* Lien Catalogue produits (header) */
.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: all var(--ease-fast);
}
.nav-link:hover { background: var(--bg-hover); color: var(--text); border-color: var(--text-light); }
.nav-link svg { width: 16px; height: 16px; }
@media (max-width: 720px) { .nav-link span { display: none; } }

/* Écosystème — app launcher */
.launcher { position: relative; }
.launcher__btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--ease-fast);
}
.launcher__btn:hover,
.launcher.is-open .launcher__btn {
    background: var(--bg-hover);
    color: var(--text);
}
.launcher__btn svg { width: 18px; height: 18px; }

.launcher__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-width: calc(100vw - 24px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-sm);
    z-index: var(--z-dropdown);
    animation: launcher-in var(--ease-spring);
    transform-origin: top right;
}
@keyframes launcher-in {
    from { opacity: 0; transform: scale(0.96) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.launcher__head {
    padding: var(--space-sm) var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-light);
    margin-bottom: var(--space-xs);
}
.launcher__title {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text);
}
.launcher__hint {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-top: 2px;
}
.launcher__grid { display: flex; flex-direction: column; gap: 2px; }
.launcher__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px;
    border-radius: var(--radius-md);
    transition: background var(--ease-fast);
}
.launcher__item:hover { background: var(--bg-hover); }
.launcher__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--site-color, var(--text-muted));
    background: color-mix(in srgb, var(--site-color, var(--text-muted)) 12%, transparent);
}
.launcher__icon svg { width: 19px; height: 19px; }
.launcher__text { flex: 1; min-width: 0; }
.launcher__name {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text);
}
.launcher__desc {
    display: block;
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.launcher__ext {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--text-light);
    opacity: 0;
    transition: opacity var(--ease-fast);
}
.launcher__item:hover .launcher__ext { opacity: 1; }

/* ── TABS (Divisions) ───────────────────────────────────── */
.tabs {
    display: flex;
    gap: 2px;
    padding: 0 var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    transition: all var(--ease-fast);
    white-space: nowrap;
    position: relative;
}

.tab svg { width: 16px; height: 16px; }

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--brand-accent);
    border-bottom-color: var(--brand-accent);
}

/* ── FILTERS ────────────────────────────────────────────── */
.filters {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
    overflow-x: auto;
    scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    transition: all var(--ease-fast);
    white-space: nowrap;
    cursor: pointer;
}

.filter-chip svg { width: 14px; height: 14px; }

.filter-chip:hover {
    border-color: var(--brand-accent);
    color: var(--brand-accent);
}

.filter-chip.active {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
    color: white;
}

.filter-chip__count {
    font-size: 10px;
    opacity: 0.7;
    margin-left: 2px;
}

/* ── RESULTS BAR ────────────────────────────────────────── */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    max-width: var(--max-width);
    margin: 0 auto;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.results-bar__left,
.results-bar__right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.results-bar__count { font-weight: var(--weight-medium); }

.results-bar__collection {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px 3px 8px;
    background: var(--brand-accent);
    color: white;
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
}

.results-bar__collection svg { width: 13px; height: 13px; }

#collection-clear {
    display: inline-flex;
    align-items: center;
    padding: 0 0 0 4px;
    color: rgba(255,255,255,0.7);
    transition: color var(--ease-fast);
}
#collection-clear:hover { color: white; }
#collection-clear svg { width: 12px; height: 12px; }

.results-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    transition: all var(--ease-fast);
}

.results-bar__btn:hover {
    background: var(--bg-hover);
    color: var(--text);
    border-color: var(--border);
}

.results-bar__btn--select.active {
    background: var(--brand-accent);
    color: white;
    border-color: var(--brand-accent);
}

.results-bar__btn svg { width: 13px; height: 13px; }

.results-bar__sort select {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: var(--text-sm);
    cursor: pointer;
}

/* ── ACTIVE FILTER CHIPS ────────────────────────────────── */
.active-filters {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-lg);
    flex-wrap: wrap;
    border-top: 1px solid var(--border-light);
    background: var(--bg-surface);
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px 4px 10px;
    background: color-mix(in srgb, var(--chip-color, var(--brand-accent)) 12%, var(--bg-surface));
    border: 1px solid color-mix(in srgb, var(--chip-color, var(--brand-accent)) 30%, transparent);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--text);
    animation: fadeInUp 0.15s ease both;
}

.active-filter-chip svg { width: 11px; height: 11px; color: var(--chip-color, var(--brand-accent)); flex-shrink: 0; }

.active-filter-chip__remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: var(--text-muted);
    margin-left: 2px;
    transition: all var(--ease-fast);
}
.active-filter-chip__remove:hover { background: rgba(0,0,0,0.08); color: var(--text); }
.active-filter-chip__remove svg { width: 10px; height: 10px; }

/* ── SEARCH HISTORY ─────────────────────────────────────── */
.suggestions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 4px;
    font-size: 10px;
    font-weight: var(--weight-semibold);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.suggestions-header button {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: var(--text-xs);
    color: var(--text-light);
    font-weight: var(--weight-normal);
    text-transform: none;
    letter-spacing: 0;
    transition: color var(--ease-fast);
}
.suggestions-header button:hover { color: var(--text); }
.suggestions-header svg { width: 12px; height: 12px; }

.suggestion-item--history .suggestion-item__remove {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: var(--text-light);
    transition: all var(--ease-fast);
}
.suggestion-item--history .suggestion-item__remove:hover { background: var(--bg-hover); color: var(--text); }
.suggestion-item--history .suggestion-item__remove svg { width: 12px; height: 12px; }

/* ── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-lg) 0;
    font-size: var(--text-sm);
}

.breadcrumb__home {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--brand-accent);
    font-weight: var(--weight-medium);
    transition: opacity var(--ease-fast);
}
.breadcrumb__home:hover { opacity: 0.75; }
.breadcrumb__home svg { width: 14px; height: 14px; }

.breadcrumb__sep { color: var(--text-light); }
.breadcrumb__sep svg { width: 14px; height: 14px; }

.breadcrumb__current {
    color: var(--text);
    font-weight: var(--weight-semibold);
}

/* ── RECENTLY VIEWED ────────────────────────────────────── */
.recents-bar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg) 0;
}

.recents-bar__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.recents-bar__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
}

/* ── COLLAPSIBLE (en-tête repliable) ────────────────────── */
.collapsible__header {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px 0;
    color: var(--text-secondary);
    user-select: none;
}
.collapsible__header:hover { color: var(--text); }

.collapsible__chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform var(--ease-base);
}
.collapsible:not(.is-collapsed) .collapsible__chevron { transform: rotate(90deg); }

.collapsible__count {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--text-muted);
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    min-width: 20px;
    padding: 1px 7px;
    text-align: center;
}

.collapsible.is-collapsed .collapsible__body { display: none; }

.recents-bar__list {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.recents-bar__list::-webkit-scrollbar { display: none; }

.recent-card {
    flex-shrink: 0;
    width: 80px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-light);
    cursor: pointer;
    transition: all var(--ease-base);
    text-align: left;
}
.recent-card:hover {
    border-color: var(--brand-accent);
    transform: translateY(-2px);
}

.recent-card__thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}
.recent-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.recent-card__thumb svg { width: 20px; height: 20px; }

.recent-card__title {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    padding: 4px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── COLLECTIONS BAR ────────────────────────────────────── */
.collections-bar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg) var(--space-lg);
}

.collections-bar__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.collections-bar__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
}

.collections-bar__list {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.collections-bar__list::-webkit-scrollbar { display: none; }

.collection-card {
    flex-shrink: 0;
    width: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-light);
    cursor: pointer;
    transition: all var(--ease-base);
    text-align: left;
}

.collection-card:hover {
    border-color: var(--brand-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.collection-card__cover {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.collection-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.collection-card__cover svg { width: 28px; height: 28px; }

.collection-card__info {
    padding: 6px 8px;
}

.collection-card__name {
    display: block;
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-card__count {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ── SEARCH SUGGESTIONS ─────────────────────────────────── */
.hero__search-shortcut {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: opacity var(--ease-fast);
}

.hero__search-shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.7);
    font-family: inherit;
}

.hero__search-shortcut.hidden,
.hero__search-shortcut[hidden] { display: none; }

.search-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card-hover);
    z-index: 100;
    overflow: hidden;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 10px 16px;
    font-size: var(--text-sm);
    color: var(--text);
    transition: background var(--ease-fast);
    text-align: left;
}

.suggestion-item:hover { background: var(--bg-hover); }
.suggestion-item svg { width: 14px; height: 14px; color: var(--text-light); flex-shrink: 0; }

.suggestion-item__count {
    margin-left: auto;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.suggestion-item.highlighted {
    background: var(--bg-hover);
    color: var(--brand-accent);
}
.suggestion-item.highlighted svg { color: var(--brand-accent); }

/* ── SELECTION MODE ─────────────────────────────────────── */
.card__select {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--border);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all var(--ease-fast);
}

.card__select svg { width: 12px; height: 12px; color: transparent; }

.masonry--select-mode .card__select { display: flex; }
.masonry--select-mode .card__overlay { display: none; }
.masonry--select-mode .card:hover .card__select {
    border-color: var(--brand-accent);
}

.masonry--select-mode .card.selected .card__select {
    background: var(--brand-accent);
    border-color: var(--brand-accent);
}
.masonry--select-mode .card.selected .card__select svg { color: white; }
.masonry--select-mode .card.selected {
    box-shadow: 0 0 0 2px var(--brand-accent);
}

/* ── SELECTION BAR ──────────────────────────────────────── */
.selection-bar {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-card-hover);
    z-index: 200;
    animation: fadeInUp 0.25s ease both;
}

.selection-bar__count {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text);
    padding: 0 var(--space-sm);
    white-space: nowrap;
}

.selection-bar__download {
    font-size: var(--text-sm);
}

.selection-bar__cancel {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: all var(--ease-fast);
}
.selection-bar__cancel:hover { background: var(--bg-hover); color: var(--text); }
.selection-bar__cancel svg { width: 16px; height: 16px; }

/* ── MODAL INFO TOGGLE (raccourci I) ────────────────────── */
.modal--info-hidden .modal__sidebar { display: none; }
.modal--info-hidden .modal__preview { grid-column: 1 / -1; }

/* ── BTN LOADING STATE ──────────────────────────────────── */
.btn.is-loading {
    color: transparent !important;
    pointer-events: none;
    position: relative;
}
.btn.is-loading svg { opacity: 0; }
.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 50%;
    left: 50%;
    margin: -7px 0 0 -7px;
    border: 2px solid rgba(255,255,255,0.35);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── MASONRY GRID ───────────────────────────────────────── */
.masonry {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg) var(--space-2xl);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 10px;
    column-gap: var(--space-md);
    row-gap: var(--space-md);
    align-items: start;
}

/* Skeleton grid: its cards never receive a JS grid-row-end span, so they
   would collapse onto the 10px auto-rows and overlap. Let them size to
   their own content instead. */
#skeleton-grid {
    grid-auto-rows: auto;
}

/* List view */
.masonry--list {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 4px;
    padding-bottom: var(--space-2xl);
}

/* ── ASSET CARD ─────────────────────────────────────────── */
.card {
    margin-bottom: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--ease-base);
    animation: fadeInUp 0.5s ease both;
    animation-delay: calc(var(--i, 0) * 50ms);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border);
}

.card__thumb {
    position: relative;
    overflow: hidden;
    background: var(--bg-hover);
}

.card__img {
    width: 100%;
    display: block;
    object-fit: cover;
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.3s ease;
}

.card__img.loaded { opacity: 1; }

.card:hover .card__img {
    transform: scale(1.03);
}

/* Format badge */
.card__format {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 6px;
    background: rgba(0,0,0,0.55);
    color: rgba(255,255,255,0.9);
    font-size: 9px;
    font-weight: var(--weight-bold);
    border-radius: 3px;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

/* Overlay au hover */
.card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.6) 100%);
    opacity: 0;
    transition: opacity var(--ease-base);
    display: flex;
    align-items: flex-end;
    padding: var(--space-md);
}

.card:hover .card__overlay { opacity: 1; }

.card__overlay-actions {
    display: flex;
    gap: var(--space-sm);
    margin-left: auto;
}

.card__overlay-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(255,255,255,0.9);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ease-fast);
    backdrop-filter: blur(4px);
}

.card__overlay-btn:hover {
    background: white;
    transform: scale(1.1);
}

.card__overlay-btn svg { width: 16px; height: 16px; }

/* Type badge */
.card__type {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    z-index: 2;
}

/* Featured badge */
.card__featured {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    z-index: 2;
}

/* Video play icon */
.card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: var(--radius-full);
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: all var(--ease-fast);
    z-index: 2;
}

.card:hover .card__play {
    background: var(--brand-accent);
    transform: translate(-50%, -50%) scale(1.1);
}

.card__play svg { width: 24px; height: 24px; }

/* Card body */
.card__body {
    padding: var(--space-md);
}

.card__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--text);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: var(--space-sm);
}

.card__tag {
    padding: 2px 8px;
    font-size: 10px;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: all var(--ease-fast);
}

.card__tag:hover {
    background: var(--brand-accent);
    color: white;
}

/* Skeleton card */
.card--skeleton .card__thumb {
    aspect-ratio: 4/3;
}

.card--skeleton .card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card--skeleton .skeleton-line {
    height: 12px;
    border-radius: 6px;
}

.card--skeleton .skeleton-line--wide  { width: 90%; }
.card--skeleton .skeleton-line--mid   { width: 60%; }
.card--skeleton .skeleton-line--short { width: 40%; }

/* ── INFINITE SCROLL SENTINEL ───────────────────────────── */
.scroll-sentinel {
    height: 1px;
    width: 100%;
}

.loading-more {
    display: flex;
    justify-content: center;
    padding: var(--space-xl);
}

/* ── MODAL ──────────────────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    opacity: 0;
    visibility: hidden;
    transition: all var(--ease-base);
}

.modal.open {
    opacity: 1;
    visibility: visible;
}

.modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal__panel {
    position: relative;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: grid;
    grid-template-columns: 1fr 340px;
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: transform var(--ease-spring);
}

.modal.open .modal__panel {
    transform: scale(1) translateY(0);
}

.modal__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--ease-fast);
}

.modal__close:hover { background: rgba(0,0,0,0.7); }
.modal__close svg { width: 20px; height: 20px; }

/* Modal nav arrows */
.modal__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: rgba(0,0,0,0.4);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all var(--ease-fast);
}

.modal__nav:hover { background: rgba(0,0,0,0.7); }
.modal__nav svg { width: 20px; height: 20px; }
.modal__nav--prev { left: var(--space-md); }
.modal__nav--next { right: 356px; }

/* Preview area */
.modal__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    min-height: 400px;
    overflow: hidden;
}

.modal__preview img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.modal__preview video {
    max-width: 100%;
    max-height: 80vh;
}

.modal__preview embed {
    width: 100%;
    height: 80vh;
}

/* Metadata sidebar */
.modal__sidebar {
    padding: var(--space-xl);
    overflow-y: auto;
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.modal__title {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    line-height: 1.3;
}

.modal__description {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
}

.modal__details {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.modal__detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--text-sm);
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-light);
}

.modal__detail-label {
    color: var(--text-muted);
}

.modal__detail-value {
    font-weight: var(--weight-medium);
    text-align: right;
}

.modal__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal__actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: auto;
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-light);
}

.modal__actions .btn { flex: 1; }

/* Similar assets */
.modal__similar {
    border-top: 1px solid var(--border-light);
    padding-top: var(--space-md);
}

.modal__similar-title {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    margin-bottom: var(--space-sm);
    color: var(--text-muted);
}

.modal__similar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.modal__similar-item {
    aspect-ratio: 1;
    border-radius: var(--radius-xs);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--ease-fast);
}

.modal__similar-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.modal__similar-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ── AI PANEL ───────────────────────────────────────────── */
.ai-panel {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 400px;
    z-index: var(--z-overlay);
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-xl);
    transform: translateX(100%);
    transition: transform var(--ease-base);
    display: flex;
    flex-direction: column;
}

.ai-panel.open {
    transform: translateX(0);
}

.ai-panel__header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--brand-accent), #8B5CF6);
    color: white;
}

.ai-panel__header-icon svg { width: 22px; height: 22px; }

.ai-panel__header-title {
    font-weight: var(--weight-semibold);
    font-size: var(--text-base);
}

.ai-panel__close {
    margin-left: auto;
    width: 32px; height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0.8;
    transition: all var(--ease-fast);
}

.ai-panel__close:hover { opacity: 1; background: rgba(255,255,255,0.15); }
.ai-panel__close svg { width: 18px; height: 18px; }

.ai-panel__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.ai-panel__message {
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    line-height: 1.7;
    animation: fadeInUp 0.3s ease;
}

.ai-panel__message--user {
    background: var(--brand-accent);
    color: white;
    align-self: flex-end;
    max-width: 85%;
    border-bottom-right-radius: var(--radius-xs);
}

.ai-panel__message--ai {
    background: var(--bg-hover);
    color: var(--text);
    align-self: flex-start;
    border-bottom-left-radius: var(--radius-xs);
}

.ai-panel__message--ai a {
    color: var(--brand-accent);
    text-decoration: underline;
}

/* Assistant IA — chips écosystème */
.ai-ecosystem { align-self: stretch; }
.ai-ecosystem__label {
    display: block;
    font-size: 11px;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-light);
    margin-bottom: var(--space-sm);
}
.ai-ecosystem__chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}
.ai-ecosystem__chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: all var(--ease-fast);
}
.ai-ecosystem__chip:hover {
    border-color: var(--site-color, var(--brand-accent));
    color: var(--text);
}
.ai-ecosystem__chip svg {
    width: 14px;
    height: 14px;
    color: var(--site-color, var(--text-muted));
}

.ai-panel__disclaimer {
    font-size: 11px;
    color: var(--text-light);
    text-align: center;
    padding: var(--space-sm);
}

.ai-panel__footer {
    padding: var(--space-md);
    border-top: 1px solid var(--border);
}

.ai-panel__input-wrap {
    display: flex;
    gap: var(--space-sm);
}

.ai-panel__input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    color: var(--text);
    transition: all var(--ease-fast);
}

.ai-panel__input:focus {
    outline: none;
    border-color: var(--brand-accent);
}

.ai-panel__send {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--brand-accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--ease-fast);
    flex-shrink: 0;
}

.ai-panel__send:hover { transform: scale(1.05); }
.ai-panel__send svg { width: 18px; height: 18px; }

/* ── AI FAB (mobile) ────────────────────────────────────── */
.ai-fab {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--brand-accent), #8B5CF6);
    color: white;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
    z-index: var(--z-overlay);
    transition: all var(--ease-fast);
}

.ai-fab:hover { transform: scale(1.08); }
.ai-fab svg { width: 24px; height: 24px; }

/* ── COLLECTIONS VIEW ───────────────────────────────────── */
.collections-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg);
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.collection-card {
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--ease-base);
}

.collection-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

.collection-card__cover {
    aspect-ratio: 16/9;
    background: var(--bg-hover);
    overflow: hidden;
}

.collection-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.collection-card:hover .collection-card__cover img {
    transform: scale(1.05);
}

.collection-card__body {
    padding: var(--space-md);
}

.collection-card__title {
    font-weight: var(--weight-semibold);
    margin-bottom: 4px;
}

.collection-card__count {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

/* ── LIST CARD ──────────────────────────────────────────── */
.masonry--list .card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: 0;
    animation: none;
}

.masonry--list .card__thumb {
    flex-shrink: 0;
    width: 64px;
    height: 48px;
    border-radius: var(--radius-xs);
    overflow: hidden;
    background: var(--bg-hover);
}

.masonry--list .card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.masonry--list .card__body {
    flex: 1;
    min-width: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.masonry--list .card__title {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    -webkit-line-clamp: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.masonry--list .card__meta {
    flex-shrink: 0;
    white-space: nowrap;
}

.masonry--list .card__tags { display: none; }
.masonry--list .card__overlay { display: none; }
.masonry--list .card__play { display: none; }
.masonry--list .card__featured { display: none; }
.masonry--list .card__type { display: none; }
.masonry--list .card__format { display: none; }
.masonry--list .card__select { display: none; }

.masonry--list .card__list-download {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: all var(--ease-fast);
}
.masonry--list .card__list-download:hover { background: var(--bg-hover); color: var(--brand-accent); }
.masonry--list .card__list-download svg { width: 16px; height: 16px; }

/* ── SHARE POPOVER ──────────────────────────────────────── */
.share-wrap { position: relative; }

.share-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card-hover);
    z-index: 20;
    min-width: 200px;
    overflow: hidden;
    animation: fadeInUp 0.15s ease both;
}

.share-popover__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: 10px 14px;
    font-size: var(--text-sm);
    color: var(--text);
    text-align: left;
    transition: background var(--ease-fast);
}
.share-popover__item:hover { background: var(--bg-hover); }
.share-popover__item svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }

.share-popover__sep {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.share-popover__item--social { color: var(--text); }
.share-popover__item--social:hover { color: var(--text); }
#share-linkedin:hover svg  { color: #0A66C2; }
#share-x:hover svg         { color: var(--text); }
#share-whatsapp:hover svg  { color: #25D366; }
#share-email:hover svg     { color: var(--brand-accent); }

/* ── SHORTCUTS MODAL ────────────────────────────────────── */
.shortcuts-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.shortcuts-modal[hidden] { display: none; }

.shortcuts-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.shortcuts-modal__panel {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeInUp 0.2s ease both;
}

.shortcuts-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-light);
}

.shortcuts-modal__title {
    font-size: var(--text-base);
    font-weight: var(--weight-semibold);
}

.shortcuts-modal__close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--text-muted);
    transition: all var(--ease-fast);
}
.shortcuts-modal__close:hover { background: var(--bg-hover); color: var(--text); }
.shortcuts-modal__close svg { width: 16px; height: 16px; }

.shortcuts-modal__body {
    padding: var(--space-md) var(--space-xl) var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.shortcut-row--sep {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
    padding: 0;
}

.shortcut-keys {
    display: flex;
    gap: 4px;
}

.shortcut-row kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 3px 7px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    font-size: 11px;
    font-family: inherit;
    font-weight: var(--weight-semibold);
    color: var(--text);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 1200px) {
    .masonry { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .masonry { grid-template-columns: repeat(2, 1fr); }
    .modal__panel { grid-template-columns: 1fr; max-height: 95vh; }
    .modal__sidebar { max-height: 40vh; }
    .modal__nav--next { right: var(--space-md); }
    .ai-panel { width: 100%; }
    .hero__title { font-size: var(--text-3xl); }
    .tab__label { display: none; }
    .ai-trigger span { display: none; }
    .ai-trigger { padding: 8px; }
    .header__search { max-width: none; }
}

@media (max-width: 640px) {
    .masonry {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 var(--space-md);
        column-gap: var(--space-sm);
    }
    .card { margin-bottom: var(--space-sm); }
    .hero { min-height: 340px; padding: var(--space-2xl) var(--space-md); }
    .hero__title { font-size: var(--text-2xl); }
    .hero__search-input { padding: 14px 18px 14px 44px; font-size: var(--text-base); }
    .header__logo { display: none; }
    .lang-switch { display: none; }
    .ai-trigger { display: none; }
    .ai-fab { display: flex; }
    .modal { padding: 0; }
    .modal__panel { border-radius: 0; max-height: 100vh; }
    .tabs { padding: 0 var(--space-md); }
    .filters { padding: var(--space-sm) var(--space-md); }
}

@media (max-width: 400px) {
    .masonry { grid-template-columns: 1fr; }
}

/* ── FOOTER ─────────────────────────────────────────────── */
.footer {
    margin-top: var(--space-3xl);
    background: var(--bg-surface);
    border-top: 1.5px solid var(--border);
}

.footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg);
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-2xl);
}

.footer__brand { max-width: 360px; }
.footer__logo { height: 26px; width: auto; margin-bottom: var(--space-md); }
.footer__tagline {
    font-size: var(--text-sm);
    color: var(--text-muted);
    line-height: 1.6;
}

.footer__social-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}
.footer__social-list { display: flex; gap: var(--space-sm); }
.footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--bg-hover);
    color: var(--text-secondary);
    transition: all var(--ease-base);
}
.footer__social-link:hover {
    background: var(--brand-accent);
    color: #fff;
    transform: translateY(-2px);
}
.footer__social-link svg { width: 18px; height: 18px; }

.footer__links {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.footer__links a {
    font-size: var(--text-sm);
    color: var(--text-secondary);
}
.footer__links a:hover { color: var(--brand-accent); }

/* Footer — écosystème HEXIS */
.footer__sites-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}
.footer__sites-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}
.footer__site {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    transition: color var(--ease-fast);
}
.footer__site:hover { color: var(--text); }
.footer__site-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: var(--site-color, var(--text-muted));
    flex-shrink: 0;
}

.footer__bottom {
    border-top: 1.5px solid var(--border-light);
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .footer__inner {
        flex-direction: column;
        gap: var(--space-xl);
        padding: var(--space-xl) var(--space-md);
    }
}

/* Liens légaux dans le footer */
.footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    align-items: center;
}
.footer__links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: color var(--ease-fast);
}
.footer__links a:hover { color: var(--brand-accent); }

/* ============================================================
   BANDEAU COOKIES
   ============================================================ */
.cookie-banner {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: var(--z-toast);
    padding: var(--space-md);
    display: flex;
    justify-content: center;
    transform: translateY(120%);
    transition: transform .4s var(--ease-base);
    pointer-events: none;
}
.cookie-banner.is-visible { transform: translateY(0); pointer-events: auto; }
.cookie-banner__inner {
    width: min(720px, 100%);
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}
.cookie-banner__title {
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--text);
    margin: 0;
}
.cookie-banner__text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}
.cookie-banner__text a { color: var(--brand-accent); }
.cookie-banner__details {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-md) 0;
}
.cookie-cat { display: flex; flex-direction: column; gap: 2px; }
.cookie-cat__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    color: var(--text);
    font-size: var(--text-sm);
}
.cookie-cat__state { font-size: var(--text-xs); color: var(--text-muted); }
.cookie-cat__desc { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.5; }
.cookie-cat--locked { opacity: .85; }
.cookie-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    justify-content: flex-end;
}

/* ============================================================
   MODALE DROIT D'USAGE
   ============================================================ */
.usage-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}
.usage-modal.is-visible { display: flex; }
.usage-modal__backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(3px);
}
.usage-modal__panel {
    position: relative;
    width: min(480px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--bg-elevated);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--space-xl);
    animation: usageIn .25s var(--ease-base);
}
@keyframes usageIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.usage-modal__close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px; height: 32px;
    border: none;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    font-size: 22px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}
.usage-modal__close:hover { background: var(--bg-input); color: var(--text); }
.usage-modal__title {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    color: var(--text);
    margin: 0 0 var(--space-sm);
    padding-right: var(--space-xl);
}
.usage-modal__intro {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 var(--space-lg);
}
.usage-modal__form { display: flex; flex-direction: column; gap: var(--space-md); }
.usage-field { display: flex; flex-direction: column; gap: 6px; }
.usage-field > span { font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text); }
.usage-field input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text);
    font-family: inherit;
    font-size: var(--text-base);
}
.usage-field input:focus { outline: none; border-color: var(--border-focus); }
.usage-consent {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.5;
}
.usage-consent input { margin-top: 3px; flex-shrink: 0; }
.usage-consent a { color: var(--brand-accent); }
.usage-modal__error {
    font-size: var(--text-sm);
    color: #e2001a;
    margin: 0;
}
.usage-modal__actions {
    display: flex;
    gap: var(--space-sm);
    justify-content: flex-end;
    margin-top: var(--space-sm);
}

/* ============================================================
   PAGES LÉGALES (legal.php)
   ============================================================ */
.legal-body { background: var(--bg); }
.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-xl);
    border-bottom: 1.5px solid var(--border-light);
    background: var(--bg-elevated);
}
.legal-header__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: var(--text-sm);
}
.legal-header__back:hover { color: var(--brand-accent); }
.legal-header__back svg { width: 16px; height: 16px; }
.legal {
    max-width: 820px;
    margin: 0 auto;
    padding: var(--space-2xl) var(--space-lg) var(--space-3xl);
}
.legal__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-2xl);
    border-bottom: 1.5px solid var(--border-light);
}
.legal__tab {
    padding: 10px 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    border-bottom: 2px solid transparent;
    margin-bottom: -1.5px;
}
.legal__tab:hover { color: var(--text); }
.legal__tab.is-active { color: var(--brand-accent); border-bottom-color: var(--brand-accent); }
.legal__title {
    font-size: var(--text-3xl);
    font-weight: var(--weight-bold);
    color: var(--text);
    margin: 0 0 var(--space-xl);
}
.legal__content { color: var(--text-secondary); line-height: 1.7; font-size: var(--text-base); }
.legal__content h2 {
    font-size: var(--text-xl);
    font-weight: var(--weight-semibold);
    color: var(--text);
    margin: var(--space-2xl) 0 var(--space-sm);
}
.legal__content p { margin: 0 0 var(--space-md); }
.legal__content ul { margin: 0 0 var(--space-md); padding-left: var(--space-lg); }
.legal__content li { margin-bottom: 6px; }
.legal__content a { color: var(--brand-accent); }
.legal__content code {
    font-family: var(--font-mono);
    font-size: .9em;
    background: var(--bg-hover);
    padding: 1px 5px;
    border-radius: var(--radius-xs);
}
.legal__version { font-size: var(--text-sm); color: var(--text-muted); font-style: italic; }
.legal__footer {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-3xl);
    padding-top: var(--space-lg);
    border-top: 1.5px solid var(--border-light);
    font-size: var(--text-sm);
    color: var(--text-muted);
}
.legal__footer a { color: var(--text-muted); }
.legal__footer a:hover { color: var(--brand-accent); }

@media (max-width: 640px) {
    .cookie-banner__actions { justify-content: stretch; }
    .cookie-banner__actions .btn { flex: 1; }
}
