/* ==========================================================
   Community Frontend — Fil social v0.2.0
   Cartes compactes, menu d'actions discret (⋯), icônes SVG
   inline légères (aucune librairie externe).
   ========================================================== */

.cf-feed-social {
	font-family: var(--community-font-sans, var(--cc-font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif));
	max-width: 620px;
	margin: 0 auto;
	color: var(--community-text, var(--cc-color-text, #172033));
	font-size: 14px;
}

.cf-feed-social__title { font-size: 19px; font-weight: 700; margin: 0 0 16px; }

.cf-notice {
	border-radius: var(--community-radius-md, 10px);
	padding: 12px 14px;
	margin-bottom: 14px;
	font-size: 13px;
	background: var(--community-surface, #fff);
	border: 1px solid var(--community-border, #e2e8f0);
}
.cf-notice--error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

/* --- Composer --- */

.cf-feed-social__composer {
	background: var(--community-surface, #fff);
	border: 1px solid var(--community-border, #e2e8f0);
	border-radius: var(--community-radius-md, 10px);
	padding: 14px;
	margin-bottom: 16px;
	box-shadow: var(--community-shadow-sm, 0 1px 2px rgba(15, 23, 42, .06));
}
.cf-feed-social__composer textarea {
	width: 100%;
	min-height: 60px;
	border: 1px solid var(--community-border, #e2e8f0);
	border-radius: var(--community-radius-sm, 6px);
	padding: 9px 10px;
	margin-bottom: 10px;
	font-family: inherit;
	font-size: 13.5px;
	resize: vertical;
}

.cf-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	border-radius: var(--community-radius-sm, 6px);
	border: 1px solid var(--community-border, #e2e8f0);
	background: var(--community-surface, #fff);
	cursor: pointer;
	font-weight: 600;
	font-size: 13.5px;
	color: var(--community-text, #172033);
}
.cf-button--primary { background: var(--community-primary, #14b8a6); border-color: var(--community-primary, #14b8a6); color: #fff; }
.cf-button--primary:hover { background: var(--community-primary-dark, #0f766e); }
.cf-button--sm { padding: 5px 11px; font-size: 12px; }

.cf-feed-social__empty { color: var(--community-text-muted, #64748b); text-align: center; padding: 24px; }

/* --- Carte publication --- */

.cf-post {
	background: var(--community-surface, #fff);
	border: 1px solid var(--community-border, #e2e8f0);
	border-radius: var(--community-radius-md, 10px);
	padding: 14px;
	margin-bottom: 10px;
}

.cf-post__header { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 8px; }
.cf-post__header img { border-radius: 50%; flex-shrink: 0; }
.cf-post__identity { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cf-post__author { font-weight: 600; font-size: 13.5px; }
.cf-post__date { font-size: 11.5px; color: var(--community-text-muted, #64748b); }

.cf-post__menu { flex-shrink: 0; }
.cf-post__menu summary { list-style: none; }
.cf-post__menu summary::-webkit-details-marker { display: none; }
.cf-post__js-required { display: block; padding: 6px 10px; font-size: 11px; color: var(--community-text-muted, #64748b); }

/* Repli autonome pour .community-menu / .community-btn--icon : le
   thème dédié (Community LMS) les définit déjà, mais Community
   Frontend ne doit jamais dépendre d'un thème précis pour rester
   utilisable. */
.community-menu { position: relative; display: inline-block; }
.community-btn--icon {
	width: 30px; height: 30px; padding: 0; border-radius: 50%;
	border: none; background: transparent; cursor: pointer;
	color: var(--community-text-muted, #64748b); font-size: 17px; line-height: 1;
}
.community-btn--icon:hover { background: var(--community-bg, #f8fafc); color: var(--community-text, #172033); }
.community-menu__panel {
	position: absolute; right: 0; top: calc(100% + 4px); min-width: 150px;
	background: var(--community-surface, #fff); border: 1px solid var(--community-border, #e2e8f0);
	border-radius: var(--community-radius-md, 10px); box-shadow: var(--community-shadow-md, 0 4px 12px rgba(15,23,42,.1));
	padding: 6px; z-index: 20;
}
.community-menu__item {
	display: block; width: 100%; text-align: left; background: none; border: none;
	padding: 7px 9px; font-size: 13px; color: var(--community-text, #172033);
	border-radius: var(--community-radius-sm, 6px); cursor: pointer; font-family: inherit;
}
.community-menu__item:hover { background: var(--community-bg, #f8fafc); }
.community-menu__item--danger { color: var(--community-danger, #dc2626); }

.cf-post__content { white-space: pre-wrap; margin: 0 0 10px; word-break: break-word; font-size: 14px; line-height: 1.55; }

.cf-post__footer { display: flex; align-items: center; gap: 4px; padding-top: 6px; border-top: 1px solid var(--community-border, #e2e8f0); }

.cf-post__action {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 10px;
	border-radius: var(--community-radius-sm, 6px);
	border: none;
	background: none;
	color: var(--community-text-muted, #64748b);
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.cf-post__action:hover { background: var(--community-bg, #f8fafc); color: var(--community-text, #172033); }
.cf-post__action.is-active { color: var(--community-danger, #dc2626); }
.cf-post__action.is-active svg { fill: currentColor; }
.cf-post__action--readonly { cursor: default; }
.cf-post__action--readonly:hover { background: none; color: var(--community-text-muted, #64748b); }

/* --- Commentaires : compacts --- */

.cf-post__comments { margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--community-border, #e2e8f0); }
.cf-comment-list { list-style: none; margin: 0 0 8px; padding: 0; }
.cf-comment { display: flex; gap: 8px; padding: 6px 0; }
.cf-comment img { border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.cf-comment__body { flex: 1; min-width: 0; }
.cf-comment__meta { margin: 0; font-size: 12px; }
.cf-comment__content { margin: 1px 0 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; color: var(--community-text, #172033); }
.cf-comment--empty { color: var(--community-text-muted, #64748b); font-style: italic; font-size: 12.5px; padding-left: 0; }

.cf-comment-form { display: flex; gap: 8px; }
.cf-comment-form input[type="text"] {
	flex: 1;
	border: 1px solid var(--community-border, #e2e8f0);
	border-radius: var(--community-radius-sm, 6px);
	padding: 7px 10px;
	font-size: 13px;
}

.cf-feed-social__load-more { text-align: center; margin-top: 6px; }

@media (min-width: 640px) { .cf-feed-social { padding: 0 16px; } }

@media (prefers-reduced-motion: reduce) { .cf-feed-social * { transition: none !important; animation: none !important; } }

/* --- Salons, badges, règles, épinglé (v0.17.0) --- */
.cf-rooms { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; margin-bottom: 4px; -webkit-overflow-scrolling: touch; }
body .community-app .cf-rooms__tab { flex: 0 0 auto; padding: 6px 13px; border: 1px solid var(--community-border, #e2e8f0); border-radius: 999px; background: var(--community-surface, #fff); color: #475569; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
body .community-app .cf-rooms__tab:hover { border-color: #4f46e5; color: #4f46e5; }
body .community-app .cf-rooms__tab.is-active { background: #4f46e5; border-color: #4f46e5; color: #fff; }
body .community-app .cf-rooms__tab.is-locked { color: #94a3b8; }
.cf-room-locked { text-align: center; padding: 22px 16px; }
.cf-rules { margin: 0 0 14px; border: 1px solid #c7d2fe; background: #eef2ff; border-radius: var(--community-radius-md, 10px); padding: 10px 14px; font-size: 13px; }
.cf-rules summary { cursor: pointer; font-weight: 700; color: #3730a3; }
.cf-rules__body { margin-top: 8px; color: #334155; line-height: 1.55; }
.cf-feed-social__composer-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cf-feed-social__room { min-height: 38px; max-width: 60%; border: 1px solid var(--community-border, #e2e8f0); border-radius: 6px; padding: 0 10px; background: #fff; font-size: 13px; }
.cf-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; font-weight: 700; line-height: 1.6; vertical-align: middle; background: #e0e7ff; color: #3730a3; }
.cf-badge--staff { background: #0f766e; color: #fff; }
.cf-post__room { font-weight: 600; color: #4f46e5; }
.cf-post__pinned { color: #b45309; font-weight: 600; }
.cf-post--pinned { border-color: #fcd34d; background: #fffbeb; }
.community-app .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cf-feed-social__composer textarea, .cf-feed-social__room { box-sizing: border-box; }

/* --- Photos, mentions, profil (v0.18.0) --- */
.cf-feed-social { padding-left: 16px; padding-right: 16px; box-sizing: border-box; }
.cf-feed-social__title { font-size: clamp(24px, 4vw, 30px); font-weight: 800; letter-spacing: -.02em; margin: 0 0 20px; }
.cf-feed-social__attach { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 7px 12px; border-radius: 8px; background: #f1f5f9; font-size: 13px; }
.cf-feed-social__attach[hidden] { display: none; }
.cf-feed-social__photo { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 6px; border: 1px dashed #cbd5e1; color: #475569; font-size: 13px; font-weight: 600; cursor: pointer; }
.cf-feed-social__photo:hover { border-color: #4f46e5; color: #4f46e5; }
.cf-feed-social__composer-row { justify-content: flex-start; }
.cf-feed-social__composer-row .cf-feed-social__room { max-width: 46%; }
.cf-feed-social__composer-row .cf-button--primary { margin-left: auto; }
.cf-post__media { display: block; margin: 4px 0 12px; border-radius: 10px; overflow: hidden; background: #f1f5f9; }
.cf-post__img { display: block; width: 100%; height: auto; max-height: 520px; object-fit: cover; }
body .community-app a.cf-post__author-link { color: inherit; text-decoration: none; }
body .community-app a.cf-post__author-link:hover { color: #4f46e5; text-decoration: none; }
body .community-app a.cf-mention { color: #4f46e5; font-weight: 600; text-decoration: none; background: #eef2ff; border-radius: 4px; padding: 0 3px; }
.cf-mention-box { position: absolute; left: 14px; right: 14px; bottom: 56px; z-index: 20; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 23, 42, .15); }
.cf-comment-form .cf-mention-box { bottom: 48px; left: 0; right: 0; }
.cf-mention-box li { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; font-size: 13.5px; }
.cf-mention-box li.is-active, .cf-mention-box li:hover { background: #eef2ff; }
.cf-mention-box img { border-radius: 50%; }
.cf-mention-box small { margin-left: auto; color: #64748b; }

/* --- Recherche, tri, colonne latérale (v0.19.0) --- */
.cf-feed-social { max-width: 1020px; }
.cf-feed-social__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.cf-feed-social__main { min-width: 0; max-width: 680px; width: 100%; margin: 0 auto; }
@media (min-width: 960px) {
	.cf-feed-social__layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
	.cf-feed-social__main { margin: 0; }
	.cf-feed-social__aside { position: sticky; top: 88px; }
}
.cf-feed-tools { display: flex; gap: 8px; margin: 0 0 14px; flex-wrap: wrap; }
.cf-feed-tools input[type="search"] { flex: 1 1 180px; min-width: 0; min-height: 40px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--community-border, #e2e8f0); border-radius: 8px; background: #fff; font-size: 14px; }
.cf-feed-tools select { min-height: 40px; padding: 0 10px; border: 1px solid var(--community-border, #e2e8f0); border-radius: 8px; background: #fff; font-size: 13.5px; }
.cf-feed-tools__result { margin: -4px 0 12px; font-size: 13px; color: #64748b; }
.cf-side { background: #fff; border: 1px solid var(--community-border, #e2e8f0); border-radius: 14px; padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(15, 23, 42, .05); }
.cf-side__title { margin: 0 0 10px; font-size: 15px; font-weight: 800; letter-spacing: -.01em; }
.cf-side__tabs { display: flex; gap: 6px; margin: 0 0 12px; }
body .community-app .cf-side__tabs a { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #64748b; background: #f1f5f9; text-decoration: none; }
body .community-app .cf-side__tabs a.is-active { background: #4f46e5; color: #fff; }
.cf-side__empty { margin: 0; font-size: 13px; line-height: 1.5; color: #64748b; }
.cf-leaderboard, .cf-news { list-style: none; margin: 0; padding: 0; }
.cf-leaderboard li { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid #f1f5f9; }
.cf-leaderboard li:first-child { border-top: 0; }
.cf-leaderboard img { border-radius: 50%; }
.cf-leaderboard__rank { width: 22px; height: 22px; border-radius: 50%; background: #f1f5f9; color: #475569; font-size: 12px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cf-leaderboard__rank--1 { background: #fde68a; color: #92400e; }
.cf-leaderboard__rank--2 { background: #e2e8f0; color: #334155; }
.cf-leaderboard__rank--3 { background: #fed7aa; color: #9a3412; }
body .community-app a.cf-leaderboard__name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-leaderboard__pts { font-size: 12px; font-weight: 700; color: #4f46e5; white-space: nowrap; }
.cf-news li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid #f1f5f9; font-size: 13px; line-height: 1.45; }
.cf-news li:first-child { border-top: 0; }
.cf-news__icon { font-size: 16px; line-height: 1.3; }
.cf-news__text { display: flex; flex-direction: column; min-width: 0; }
body .community-app .cf-news__text a { color: #172033; text-decoration: none; overflow-wrap: anywhere; }
body .community-app .cf-news__text a:hover { color: #4f46e5; }
.cf-news__text small { color: #94a3b8; font-size: 11.5px; }
