/* Page accueil CSE */

.ix {
    --ix-content-max: 1640px;
    --ix-page-gutter: clamp(18px, 2.4vw, 44px);
    --ix-bg: #f4f7fb;
    --ix-surface: #ffffff;
    --ix-surface-2: #f8fafc;
    --ix-line: #dbe5ef;
    --ix-line-soft: #edf2f7;
    --ix-text: #0f172a;
    --ix-muted: #64748b;
    --ix-soft: #e0f2fe;
    --ix-primary: #0f8fb3;
    --ix-primary-dark: #07566b;
    --ix-green: #0f766e;
    --ix-danger: #dc2626;
    --ix-danger-soft: #fee2e2;
    --ix-warning: #b45309;
    --ix-shadow: 0 18px 50px rgba(15, 23, 42, .10);
    --ix-shadow-soft: 0 10px 30px rgba(15, 23, 42, .07);
    --ix-radius: 12px;
    --ix-radius-sm: 8px;

    min-height: calc(100vh - var(--height-nav, 64px));
    background:
        linear-gradient(180deg, #eaf6fa 0, var(--ix-bg) 260px),
        var(--ix-bg);
    color: var(--ix-text);
    font-family: var(--font-ui, 'Inter', sans-serif);
}

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

.ix-shell {
    width: 100%;
    max-width: var(--ix-content-max);
    margin: 0 auto;
    padding: clamp(18px, 2.6vw, 36px) var(--ix-page-gutter) clamp(44px, 5vw, 72px);
}

.ix-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, .85fr);
    gap: clamp(18px, 3vw, 34px);
    align-items: stretch;
    margin-bottom: clamp(18px, 2.8vw, 30px);
    padding: clamp(22px, 3vw, 34px);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 18px;
    background:
        radial-gradient(620px circle at 88% -10%, rgba(34, 211, 238, .22), transparent 60%),
        linear-gradient(135deg, rgba(34, 211, 238, .14), rgba(20, 184, 166, .08)),
        #062532;
    box-shadow: var(--ix-shadow);
    color: #f8fafc;
}

.ix-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), transparent 40%);
}

.ix-hero-copy {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.ix-kicker,
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--ix-primary);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.ix-kicker::before,
.section-eyebrow::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    opacity: .55;
}

.ix-hero .ix-kicker {
    color: #67e8f9;
}

.ix-hero h1,
.ix-auth-card h1 {
    margin: 10px 0 10px;
    font-family: var(--font-brand, 'Montserrat', sans-serif);
    font-size: clamp(2rem, 4.3vw, 3.15rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: .98;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.ix-hero p,
.ix-auth-card p {
    max-width: 680px;
    margin: 0;
    color: #bfdbfe;
    font-size: 1rem;
    line-height: 1.65;
    text-wrap: pretty;
}

.ix-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.ix-stats {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-content: end;
    width: min(100%, 380px);
    min-width: 0;
}

.ix-stat {
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(14px);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.ix-stat:hover {
    border-color: rgba(34, 211, 238, .35);
    background: rgba(34, 211, 238, .12);
    transform: translateY(-2px);
}

.ix-stat-value {
    display: block;
    color: #fff;
    font-family: var(--font-brand, 'Montserrat', sans-serif);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.ix-stat-label {
    display: block;
    margin-top: 8px;
    color: #cbd5e1;
    font-size: .78rem;
    font-weight: 700;
}

.ix-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 420px);
    gap: clamp(18px, 2.5vw, 30px);
    align-items: start;
}

.ix-main {
    min-width: 0;
}

.section-head,
.sidebar-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.section-head h2,
.sidebar-head h2,
.sheet-header h2 {
    margin: 4px 0 0;
    color: var(--ix-text);
    font-family: var(--font-brand, 'Montserrat', sans-serif);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0;
}

.article-list {
    display: grid;
    gap: 16px;
}

.article-card,
.sidebar-card,
.empty-state,
.ix-auth-card {
    border: 1px solid var(--ix-line);
    border-radius: var(--ix-radius);
    background: var(--ix-surface);
    box-shadow: var(--ix-shadow-soft);
}

.article-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.article-card::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: linear-gradient(180deg, var(--ix-primary), var(--ix-green));
    opacity: 0;
    transition: opacity .18s ease;
}

.article-card:hover {
    border-color: #bae6fd;
    box-shadow: var(--ix-shadow);
    transform: translateY(-2px);
}

.article-card:hover::before {
    opacity: 1;
}

.article-card.is-hidden {
    border-color: #fecaca;
    background: #fff7f7;
}

.article-card.is-hidden:hover {
    border-color: #fca5a5;
}

.article-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    min-width: 0;
    padding: 22px 24px 0;
}

.article-heading {
    min-width: 0;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    font-size: .78rem;
    font-weight: 700;
}

.article-meta > span:not(.hidden-tag) {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--ix-soft);
    color: var(--ix-primary-dark);
}

.article-title {
    margin: 0;
    color: var(--ix-text);
    font-family: var(--font-brand, 'Montserrat', sans-serif);
    font-size: clamp(1.2rem, 2.4vw, 1.65rem);
    font-weight: 800;
    line-height: 1.16;
}

.article-body {
    padding: 18px 24px 24px;
    color: #243244;
    font-size: .98rem;
    line-height: 1.72;
    min-width: 0;
    overflow-wrap: break-word;
}

.article-body table,
.article-body iframe,
.article-body video {
    max-width: 100%;
}

.article-body table {
    display: block;
    overflow-x: auto;
}

.article-body > :first-child {
    margin-top: 0;
}

.article-body > :last-child {
    margin-bottom: 0;
}

.article-body p {
    margin: 0 0 .95rem;
}

.article-body h1,
.article-body h2,
.article-body h3 {
    margin: 1.4rem 0 .55rem;
    color: var(--ix-text);
    font-family: var(--font-brand, 'Montserrat', sans-serif);
    letter-spacing: 0;
}

.article-body ul,
.article-body ol {
    margin: .75rem 0 1rem;
    padding-left: 1.25rem;
}

.article-body li + li {
    margin-top: .35rem;
}

.article-body a {
    color: var(--ix-primary-dark);
    font-weight: 800;
    text-decoration: underline;
    text-decoration-color: rgba(15, 143, 179, .35);
    text-underline-offset: 3px;
}

.article-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 18px auto;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
}

.article-body hr {
    height: 1px;
    margin: 16px 0;
    border: 0;
    background: var(--ix-line);
}

.article-admin-bar,
.lien-actions {
    display: flex;
    flex-shrink: 0;
    gap: 6px;
}

.ix .inline-action,
.ix form.inline-action {
    display: inline-flex;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: inherit;
}

.ix .btn,
.ix .btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-weight: 800;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, color .16s ease;
}

.ix .btn {
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 10px;
    font-size: .86rem;
}

.ix .btn:hover,
.ix .btn-icon:hover {
    transform: translateY(-1px);
}

.ix .btn-primary {
    background: #22d3ee;
    color: #04212b;
    box-shadow: 0 14px 28px rgba(34, 211, 238, .22);
}

.ix .btn-soft {
    border: 1px solid rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .10);
    color: #e0f2fe;
}

.ix .btn-ghost {
    border: 1px solid var(--ix-line);
    background: #fff;
    color: var(--ix-primary-dark);
}

.ix .btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
}

.ix .btn-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.btn-edit {
    background: var(--ix-soft);
    color: var(--ix-primary-dark);
}

.btn-toggle {
    background: #f1f5f9;
    color: #475569;
}

.btn-delete {
    background: var(--ix-danger-soft);
    color: var(--ix-danger);
}

.hidden-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--ix-danger-soft);
    color: var(--ix-danger);
    font-size: .72rem;
    font-weight: 800;
}

.ix-sidebar {
    min-width: 0;
    position: sticky;
    top: calc(var(--height-nav, 64px) + 18px);
}

.sidebar-card {
    padding: 18px;
    border-top: 3px solid var(--ix-primary);
}

.sidebar-head {
    display: block;
}

.sidebar-body {
    display: grid;
    gap: 8px;
}

.lien-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--ix-line-soft);
    border-radius: 10px;
    background: var(--ix-surface-2);
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.lien-row:hover {
    border-color: #bae6fd;
    background: #fff;
    transform: translateY(-1px);
}

.lien-info {
    min-width: 0;
}

.lien-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: var(--ix-text);
    font-size: .92rem;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lien-title:hover {
    color: var(--ix-primary-dark);
}

.lien-desc {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: var(--ix-muted);
    font-size: .78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lien-empty {
    padding: 14px;
    border: 1px dashed var(--ix-line);
    border-radius: 10px;
    color: var(--ix-muted);
    font-size: .9rem;
}

.empty-state {
    padding: 48px 24px;
    text-align: center;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ix-soft), #e0e7ff);
    box-shadow: var(--ix-shadow-soft);
    color: var(--ix-primary-dark);
    font-size: 1.1rem;
    font-weight: 900;
}

.empty-state h3 {
    margin: 0 0 8px;
    color: var(--ix-text);
    font-size: 1.05rem;
}

.empty-state p {
    max-width: 420px;
    margin: 0 auto;
    color: var(--ix-muted);
    line-height: 1.6;
}

.ix-auth {
    display: grid;
    place-items: center;
    min-height: calc(100vh - var(--height-nav, 64px));
    padding: 40px 20px;
}

.ix-auth-card {
    width: min(560px, 100%);
    padding: 36px;
    text-align: center;
}

.ix-auth-card h1,
.ix-auth-card p {
    color: var(--ix-text);
}

.ix-auth-card p {
    margin-bottom: 22px;
    color: var(--ix-muted);
}

.liens-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1002;
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--ix-primary-dark);
    box-shadow: 0 14px 34px rgba(7, 86, 107, .28);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
}

.ix-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2, 6, 23, .54);
    opacity: 0;
    pointer-events: none;
    transition: opacity .24s ease;
}

.ix-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.bottom-sheet {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1001;
    max-height: 82vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
    border-radius: 18px 18px 0 0;
    background: #fff;
    box-shadow: 0 -18px 50px rgba(15, 23, 42, .20);
    transform: translateY(105%);
    transition: transform .28s ease;
    -webkit-overflow-scrolling: touch;
}

.bottom-sheet.open {
    transform: translateY(0);
}

.sheet-handle {
    width: 42px;
    height: 4px;
    margin: 12px auto 6px;
    border-radius: 999px;
    background: #cbd5e1;
}

.sheet-content {
    padding: 16px;
}

.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.sheet-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--ix-line);
    border-radius: 10px;
    background: #fff;
    color: var(--ix-muted);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

body.liens-open {
    overflow: hidden;
}

@media (max-width: 980px) {
    .ix-hero,
    .ix-layout {
        grid-template-columns: 1fr;
    }

    .ix-stats {
        width: 100%;
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
        min-width: 0;
    }

    .ix-sidebar {
        display: none;
    }

    .liens-fab {
        display: inline-flex;
    }
}

@media (max-width: 680px) {
    .ix {
        --ix-page-gutter: clamp(12px, 4.5vw, 18px);
    }

    .ix-shell {
        max-width: none;
        padding-top: 16px;
        padding-bottom: 48px;
    }

    .ix-hero {
        padding: clamp(18px, 5.5vw, 24px);
        border-radius: 14px;
    }

    .ix-hero h1,
    .ix-auth-card h1 {
        font-size: clamp(1.8rem, 9vw, 2.55rem);
        line-height: 1.04;
    }

    .ix-stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .ix-stat {
        padding: 12px 10px;
    }

    .ix-stat-value {
        font-size: 1.45rem;
    }

    .section-head,
    .article-top {
        flex-direction: column;
        align-items: stretch;
    }

    .article-top,
    .article-body {
        padding-right: 18px;
        padding-left: 18px;
    }

    .article-admin-bar {
        justify-content: flex-start;
    }
}

@media (max-width: 420px) {
    .ix-stats {
        grid-template-columns: 1fr;
    }

    .ix-hero-actions,
    .section-head .btn {
        width: 100%;
    }

    .ix .btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ix *,
    .ix *::before,
    .ix *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
