:root {
    --ene-blue: #0285ff;
    --ene-text: #0f172a;
    --ene-muted: #475569;
    --ene-border: #dbe7f5;
    --ene-soft: #eaf5ff;
}

/* ENE Smart Community Dashboard */
.ene-sc-wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 22px; font-family: inherit; }
.ene-sc-hero { background: #fff; border: 1px solid var(--ene-border); border-radius: 24px; padding: 34px; margin-bottom: 26px; box-shadow: 0 8px 24px rgba(15,23,42,.06); }
.ene-sc-hero-small { padding: 28px; }
.ene-sc-label { display: inline-block; color: var(--ene-blue); font-weight: 900; text-transform: uppercase; letter-spacing: .05em; font-size: 13px; margin-bottom: 10px; }
.ene-sc-hero h1 { margin: 0 0 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; color: var(--ene-text); }
.ene-sc-hero p, .ene-sc-section-title p, .ene-sc-card small, .ene-sc-panel p, .ene-sc-panel li, .ene-sc-empty { color: var(--ene-muted); font-size: 16px; }
.ene-sc-section { margin-bottom: 28px; }
.ene-sc-section-title { margin-bottom: 14px; }
.ene-sc-section-title h2, .ene-sc-panel h2 { margin: 0 0 6px; color: var(--ene-text); font-size: 24px; }
.ene-sc-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 16px; }
.ene-sc-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ene-sc-card { display: flex; gap: 14px; align-items: flex-start; background: #fff; border: 1px solid var(--ene-border); border-radius: 18px; padding: 18px; text-decoration: none !important; color: inherit !important; min-height: 126px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.ene-sc-card:hover { transform: translateY(-2px); border-color: var(--ene-blue); box-shadow: 0 10px 26px rgba(2,133,255,.12); }
.ene-sc-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: var(--ene-soft); font-size: 24px; flex: 0 0 auto; }
.ene-sc-card-content strong { display: block; margin: 0 0 6px; font-size: 18px; color: var(--ene-text); }
.ene-sc-card-content small { display: block; line-height: 1.45; }
.ene-sc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 28px; }
.ene-sc-panel, .ene-sc-empty, .ene-sc-success { background: #fff; border: 1px solid var(--ene-border); border-radius: 18px; padding: 22px; }
.ene-sc-success { border-color: #86efac; background: #f0fdf4; color: #166534; font-weight: 800; margin-bottom: 22px; }

/* Formulaires modernes */
.ene-sc-form-wrap { max-width: 920px; margin: 24px auto; }
.ene-sc-form { background: #fff; border: 1px solid var(--ene-border); border-radius: 24px; padding: 30px; box-shadow: 0 10px 30px rgba(15,23,42,.06); }
.ene-sc-form-title { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; }
.ene-sc-form-title > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: var(--ene-soft); font-size: 28px; }
.ene-sc-form-title h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 42px); color: var(--ene-text); }
.ene-sc-form-title p { margin: 0; color: var(--ene-muted); }
.ene-sc-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.ene-sc-form label { display: flex; flex-direction: column; gap: 7px; font-weight: 800; color: var(--ene-text); }
.ene-sc-form input, .ene-sc-form textarea { width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; font: inherit; background: #fff; }
.ene-sc-form input:focus, .ene-sc-form textarea:focus { outline: 2px solid rgba(2,133,255,.18); border-color: var(--ene-blue); }
.ene-sc-full { grid-column: 1 / -1; }
.ene-sc-submit { margin-top: 18px; background: var(--ene-blue); color: #fff; border: 0; border-radius: 12px; padding: 13px 20px; font-weight: 900; cursor: pointer; }
.ene-sc-info { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 14px; padding: 14px; color: #7c2d12; font-weight: 700; }
.ene-sc-check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; }
.ene-sc-check input { width: auto; margin-top: 4px; }

/* Amélioration visuelle du Flux FluentCommunity */
body .fluent-community,
body .fcom_app,
body .fcom_main_layout {
    font-family: inherit;
}

body .fcom_main_content,
body .feed_content,
body .fcom_content {
    background: #f4f8fc !important;
}

body .feed_item,
body .fcom_post_card,
body .fcom_post,
body .fcom_card {
    border: 1px solid #dbe7f5 !important;
    border-radius: 18px !important;
    box-shadow: 0 8px 22px rgba(15,23,42,.05) !important;
    overflow: hidden;
}

body .fcom_left_sidebar,
body .fcom_sidebar,
body .left_sidebar {
    background: #fff !important;
    border-right: 1px solid #e2e8f0 !important;
}

body .fcom_left_sidebar a,
body .fcom_sidebar a {
    border-radius: 12px !important;
}

body .fcom_left_sidebar a:hover,
body .fcom_sidebar a:hover {
    background: #eaf5ff !important;
}

body .fcom_top_nav,
body .fcom_header {
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

@media (max-width: 980px) {
    .ene-sc-grid, .ene-sc-grid-3, .ene-sc-two { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 640px) {
    .ene-sc-wrap { padding: 14px; }
    .ene-sc-hero, .ene-sc-form { padding: 22px; }
    .ene-sc-grid, .ene-sc-grid-3, .ene-sc-two, .ene-sc-form-grid { grid-template-columns: 1fr; }
    .ene-sc-form-title { flex-direction: column; }
}


/* =========================================================
   v0.4.0 — Surcouche design FluentCommunity / ENE
   Chargée automatiquement sur /communaute et pages ENE.
   ========================================================= */

body:has(.fcom_app),
body:has(.fluent-community),
body:has([class*="fcom"]) {
    background: #f4f8fc !important;
}

/* En-tête principal des vues FluentCommunity */
body .fcom_main_content > div:first-child,
body .fcom_content > div:first-child,
body [class*="main_content"] > div:first-child {
    border-bottom: 1px solid #dbe7f5 !important;
}

/* Titres standards : Flux, Espaces, Membres, Campus, etc. */
body .fcom_main_content h1,
body .fcom_main_content h2,
body .fcom_content h1,
body .fcom_content h2,
body [class*="content"] h1,
body [class*="content"] h2 {
    color: #0f172a !important;
    letter-spacing: -0.02em;
}

/* Fond central plus doux */
body .fcom_main_content,
body .fcom_content,
body .feed_content,
body [class*="main_content"],
body [class*="feed"] {
    background: #f4f8fc !important;
}

/* Cartes de posts / panneaux */
body .fcom_post_card,
body .fcom_post,
body .feed_item,
body .fcom_card,
body [class*="post_card"],
body [class*="feed_item"] {
    background: #ffffff !important;
    border: 1px solid #dbe7f5 !important;
    border-radius: 20px !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06) !important;
}

/* Zone de création de publication */
body textarea,
body input[type="text"],
body input[type="search"] {
    border-radius: 14px !important;
}

/* Sidebar gauche */
body .fcom_left_sidebar,
body .fcom_sidebar,
body .left_sidebar,
body [class*="sidebar"] {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

/* Liens sidebar */
body .fcom_left_sidebar a,
body .fcom_sidebar a,
body .left_sidebar a,
body [class*="sidebar"] a {
    border-radius: 12px !important;
    transition: background .16s ease, color .16s ease;
}

body .fcom_left_sidebar a:hover,
body .fcom_sidebar a:hover,
body .left_sidebar a:hover,
body [class*="sidebar"] a:hover {
    background: #eaf5ff !important;
    color: #0285ff !important;
}

/* Top navigation */
body .fcom_top_nav,
body .fcom_header,
body [class*="top_nav"],
body [class*="header"] {
    background: rgba(255,255,255,.96) !important;
    border-bottom: 1px solid #e2e8f0 !important;
    backdrop-filter: blur(10px);
}

/* Boutons */
body .fcom_app button,
body .fluent-community button,
body [class*="fcom"] button {
    border-radius: 12px !important;
    font-weight: 800 !important;
}

/* Cartes des espaces */
body .space_card,
body [class*="space_card"],
body [class*="space"] .fcom_card {
    border-radius: 20px !important;
    border: 1px solid #dbe7f5 !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05) !important;
    overflow: hidden !important;
}

/* Images grises des cartes : un peu plus propres */
body [class*="space"] img,
body [class*="card"] img {
    border-radius: 0 !important;
}

/* Colonne droite */
body .right_sidebar,
body .fcom_right_sidebar,
body [class*="right_sidebar"] {
    background: transparent !important;
}

body .right_sidebar > div,
body .fcom_right_sidebar > div,
body [class*="right_sidebar"] > div {
    border-radius: 18px !important;
    border: 1px solid #dbe7f5 !important;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .04) !important;
}

/* Amélioration responsive */
@media (max-width: 900px) {
    body .fcom_main_content,
    body .fcom_content,
    body [class*="main_content"] {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    body .right_sidebar,
    body .fcom_right_sidebar,
    body [class*="right_sidebar"] {
        display: none !important;
    }
}


/* =========================================================
   v0.4.1 — Page publique /communaute/ pour visiteurs
   ========================================================= */

.ene-sc-public-community {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 46px 22px;
}

.ene-sc-public-hero {
    background: #ffffff;
    border: 1px solid #dbe7f5;
    border-radius: 28px;
    padding: 46px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .07);
    margin-bottom: 24px;
}

.ene-sc-public-hero h1 {
    margin: 0 0 12px;
    font-size: clamp(38px, 5vw, 64px);
    line-height: 1;
    color: #0f172a;
}

.ene-sc-public-hero p {
    max-width: 760px;
    color: #475569;
    font-size: 18px;
    line-height: 1.6;
}

.ene-sc-public-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
}

.ene-sc-primary-btn,
.ene-sc-secondary-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 14px;
    text-decoration: none !important;
    font-weight: 900;
}

.ene-sc-primary-btn {
    background: #0285ff;
    color: #ffffff !important;
}

.ene-sc-secondary-btn {
    background: #ffffff;
    color: #0285ff !important;
    border: 1px solid #0285ff;
}

.ene-sc-public-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.ene-sc-public-note {
    background: #ffffff;
    border: 1px solid #dbe7f5;
    border-radius: 22px;
    padding: 28px;
}

.ene-sc-public-note h2 {
    margin: 0 0 8px;
    color: #0f172a;
}

.ene-sc-public-note p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
}


@media (max-width: 900px) {
    .ene-sc-public-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .ene-sc-public-community {
        padding: 24px 14px;
    }

    .ene-sc-public-hero {
        padding: 28px;
    }

    .ene-sc-public-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   v0.4.2 — Flux public ENE, sans modifier les couleurs du menu Astra
   ========================================================= */

.ene-sc-public-feed {
    background: #ffffff;
    border: 1px solid #dbe7f5;
    border-radius: 24px;
    padding: 30px;
    margin: 24px 0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.ene-sc-public-feed-head h2 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
}

.ene-sc-public-feed-head p {
    margin: 0 0 22px;
    color: #475569;
    line-height: 1.6;
}

.ene-sc-feed-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.ene-sc-feed-card {
    background: #f8fbff;
    border: 1px solid #dbe7f5;
    border-radius: 18px;
    padding: 20px;
}

.ene-sc-feed-badge {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eaf5ff;
    color: #0285ff;
    font-weight: 900;
    font-size: 12px;
    margin-bottom: 12px;
}

.ene-sc-feed-card h3 {
    margin: 0 0 8px;
    color: #0f172a;
    font-size: 20px;
}

.ene-sc-feed-card p {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

/* Éviter que le plugin impose des couleurs au menu public du thème */
body:not(.logged-in) .main-header-menu .menu-link,
body:not(.logged-in) .ast-theme-transparent-header .main-header-menu .menu-link {
    background: inherit;
}

@media (max-width: 900px) {
    .ene-sc-feed-list {
        grid-template-columns: 1fr;
    }
}


/* v0.4.3 — Flux compact + colonne gauche améliorée */
body .fcom_main_content,
body .fcom_content,
body [class*="main_content"] {
    background: #f5f8fc !important;
}

body .fcom_post_card,
body .fcom_post,
body .feed_item,
body [class*="post_card"],
body [class*="feed_item"] {
    border-radius: 16px !important;
    border: 1px solid #dbe7f5 !important;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .045) !important;
    margin-bottom: 14px !important;
}

body .fcom_post_card > div,
body .fcom_post > div,
body .feed_item > div,
body [class*="post_card"] > div,
body [class*="feed_item"] > div {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
}

body .fcom_post_card h1,
body .fcom_post_card h2,
body .fcom_post_card h3,
body .fcom_post h1,
body .fcom_post h2,
body .fcom_post h3,
body .feed_item h1,
body .feed_item h2,
body .feed_item h3,
body [class*="post_card"] h1,
body [class*="post_card"] h2,
body [class*="post_card"] h3 {
    font-size: clamp(20px, 2vw, 28px) !important;
    line-height: 1.22 !important;
    margin-bottom: 10px !important;
}

body .fcom_post_card p,
body .fcom_post li,
body .fcom_post p,
body .feed_item p,
body .feed_item li,
body [class*="post_card"] p,
body [class*="post_card"] li {
    font-size: 15px !important;
    line-height: 1.55 !important;
}

body .fcom_right_sidebar > div,
body .right_sidebar > div,
body [class*="right_sidebar"] > div {
    padding: 14px !important;
    border-radius: 16px !important;
}

body .fcom_left_sidebar,
body .fcom_sidebar,
body .left_sidebar,
body [class*="left_sidebar"] {
    background: #ffffff !important;
    border-right: 1px solid #e2e8f0 !important;
}

body .fcom_left_sidebar strong,
body .fcom_sidebar strong,
body .left_sidebar strong,
body [class*="left_sidebar"] strong {
    color: #0f172a !important;
    font-size: 13px !important;
    font-weight: 900 !important;
}

body .fcom_left_sidebar a,
body .fcom_sidebar a,
body .left_sidebar a,
body [class*="left_sidebar"] a {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 34px !important;
    padding: 7px 10px !important;
    border-radius: 12px !important;
    color: #334155 !important;
    font-size: 14px !important;
    text-decoration: none !important;
}

body .fcom_left_sidebar a:hover,
body .fcom_sidebar a:hover,
body .left_sidebar a:hover,
body [class*="left_sidebar"] a:hover {
    background: #eaf5ff !important;
    color: #0285ff !important;
}

body .fcom_left_sidebar a[aria-current="page"],
body .fcom_sidebar a[aria-current="page"],
body .left_sidebar a[aria-current="page"],
body [class*="left_sidebar"] a[aria-current="page"] {
    background: #eaf5ff !important;
    color: #0285ff !important;
    font-weight: 900 !important;
}

body .fcom_left_sidebar a > div:first-child,
body .fcom_sidebar a > div:first-child,
body .left_sidebar a > div:first-child,
body [class*="left_sidebar"] a > div:first-child {
    width: 20px !important;
    height: 20px !important;
    border-radius: 7px !important;
}

.ene-sc-public-feed {
    padding: 24px !important;
}

.ene-sc-feed-card {
    min-height: 150px;
    padding: 18px !important;
}

.ene-sc-feed-card h3 {
    font-size: 19px !important;
    line-height: 1.25 !important;
}

.ene-sc-feed-card p {
    font-size: 14px !important;
}

@media (max-width: 900px) {
    body .fcom_right_sidebar,
    body .right_sidebar,
    body [class*="right_sidebar"] {
        display: none !important;
    }
}

@media (max-width: 700px) {
    .ene-sc-feed-list {
        grid-template-columns: 1fr;
    }
}


/* v0.4.4 — accès public aux URL publiques de communauté */
.ene-sc-public-community {
    min-height: 70vh;
}

.ene-sc-public-hero::after {
    content: "Accès public";
    display: inline-flex;
    margin-top: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #eaf5ff;
    color: #0285ff;
    font-size: 13px;
    font-weight: 900;
}


/* v0.4.5 — bouton direct vers le vrai flux public */
.ene-sc-public-actions .ene-sc-primary-btn {
    min-width: 150px;
}

.ene-sc-public-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .ene-sc-public-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .ene-sc-public-grid {
        grid-template-columns: 1fr;
    }
}


/* v0.4.6 — accès libre au flux public */
.ene-sc-public-hero::after {
    content: "Flux public accessible sans connexion" !important;
}
