/* Chapter Community — בשפה הקיימת של האתר: כרטיסים לבנים, כפתורי גלולה, סגול צ'פטר */

.ccm,
.ccm *,
.ccm-follow-wrap,
.ccm-follow-wrap *,
.ccm-toast {
	box-sizing: border-box;
}

.ccm {
	direction: rtl;
	text-align: right;
	font-family: inherit;
	color: #222;
}

/* ---------- כרטיס בסיסי ---------- */

.ccm-card {
	background: #fff;
	border: 1px solid #f0edf6;
	border-radius: 18px;
	padding: 22px 22px 18px;
	margin: 0 0 20px;
	box-shadow: 0 4px 18px rgba(80, 40, 120, 0.06);
}

.ccm-card-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 6px 12px;
	margin-bottom: 14px;
}

.ccm-h {
	margin: 0;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
	color: #222;
}

.ccm-card-note {
	font-size: 13px;
	color: #888;
}

.ccm-card-note a {
	color: #7b4fa6;
	font-weight: 600;
	text-decoration: none;
}

.ccm-pill {
	display: inline-block;
	min-width: 28px;
	padding: 2px 10px;
	border-radius: 20px;
	background: #f3eeff;
	color: #7b4fa6;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
}

.ccm-empty {
	margin: 0;
	padding: 14px 16px;
	background: #faf8fd;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.7;
	color: #666;
}

.ccm-more,
.ccm-foot {
	margin: 12px 0 0;
	font-size: 12.5px;
	line-height: 1.6;
	color: #999;
}

/* ---------- כפתור מעקב ---------- */

.ccm-follow-wrap {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 10px;
	direction: rtl;
	vertical-align: middle;
}

.ccm-follow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 38px;
	padding: 0 18px;
	background: #111;
	color: #fff;
	border: 1.5px solid #111;
	border-radius: 30px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}

.ccm-follow:hover {
	background: #7b4fa6;
	border-color: #7b4fa6;
	transform: translateY(-1px);
}

.ccm-follow.is-on {
	background: #f3eeff;
	border-color: #e4d8f6;
	color: #7b4fa6;
}

.ccm-follow.is-on:hover {
	background: #fff;
	border-color: #e57373;
	color: #c0392b;
}

.ccm-follow.is-busy {
	opacity: 0.6;
	pointer-events: none;
}

.ccm-follow:focus-visible {
	outline: 3px solid rgba(192, 132, 252, 0.45);
	outline-offset: 2px;
}

.ccm-follow-icon {
	display: inline-flex;
	line-height: 0;
}

.ccm-follow-count {
	font-size: 13px;
	color: #888;
}

.ccm-follow-wrap.is-self .ccm-follow-count {
	padding: 6px 14px;
	background: #f3eeff;
	border-radius: 20px;
	color: #7b4fa6;
	font-weight: 600;
}

.ccm-follow-wrap.in-author-box {
	margin-top: 10px;
}

.ccm-has-follow .more-articles + .ccm-follow-wrap.in-author-box {
	margin-top: 0;
	margin-inline-start: 10px;
}

.ccm-follow-wrap.is-compact .ccm-follow {
	height: 32px;
	padding: 0 12px;
	font-size: 13px;
}

.ccm-follow-wrap.is-compact .ccm-follow-count {
	display: none;
}

/* ---------- [my_follows] ---------- */

.ccm-people {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ccm-person {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-top: 1px solid #f3f0f8;
}

.ccm-person:first-child {
	border-top: 0;
	padding-top: 0;
}

.ccm-person-avatar {
	flex: none;
	line-height: 0;
}

.ccm .ccm-avatar,
.ccm-person-avatar img {
	border-radius: 50%;
	object-fit: cover;
}

.ccm-person-body {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ccm-person-name {
	font-weight: 700;
	font-size: 15px;
	color: #222;
	text-decoration: none;
}

.ccm-person-name:hover {
	color: #7b4fa6;
}

.ccm-person-meta {
	font-size: 13px;
	color: #888;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ccm-person-meta a {
	color: #7b4fa6;
	text-decoration: none;
}

.ccm-faces {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
}

.ccm-faces a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px 6px 6px;
	border-radius: 30px;
	background: #faf8fd;
	color: #333;
	font-size: 13.5px;
	text-decoration: none;
	min-width: 0;
}

.ccm-faces a:hover {
	background: #f3eeff;
}

.ccm-faces img {
	flex: none;
	width: 32px;
	height: 32px;
}

.ccm-faces span {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- [writer_stats] ---------- */

.ccm-tiles {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-bottom: 20px;
}

.ccm-tile {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 18px;
	background: #fff;
	border: 1px solid #f0edf6;
	border-radius: 16px;
	box-shadow: 0 4px 18px rgba(80, 40, 120, 0.05);
}

.ccm-tile-label {
	font-size: 13px;
	color: #777;
}

.ccm-tile-value {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.15;
	color: #222;
	font-variant-numeric: tabular-nums;
}

.ccm-tile-value.is-muted {
	color: #bbb;
}

.ccm-tile-sub {
	font-size: 12px;
	color: #999;
	line-height: 1.5;
}

.ccm-tile-sub.is-up { color: #2e7d4f; }
.ccm-tile-sub.is-down { color: #b4532a; }

.ccm-chart {
	display: flex;
	align-items: flex-end;
	gap: 2px;
	height: 140px;
	padding-top: 8px;
	border-bottom: 1px solid #ece8f3;
	direction: ltr; /* ימים משמאל לימין, כמו ציר זמן */
}

.ccm-bar {
	position: relative;
	flex: 1;
	height: 100%;
	display: flex;
	align-items: flex-end;
	outline: none;
	cursor: default;
}

.ccm-bar i {
	display: block;
	width: 100%;
	background: #b48ad8;
	border-radius: 4px 4px 0 0;
	transition: background 0.12s;
}

.ccm-bar:hover i,
.ccm-bar:focus i {
	background: #7b4fa6;
}

.ccm-bar::after {
	content: attr(data-tip);
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	padding: 5px 9px;
	background: #222;
	color: #fff;
	border-radius: 8px;
	font-size: 12px;
	white-space: nowrap;
	direction: rtl;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.12s;
	z-index: 2;
}

.ccm-bar:hover::after,
.ccm-bar:focus::after {
	opacity: 1;
}

.ccm-bar:first-child::after { left: 0; transform: none; }
.ccm-bar:last-child::after { left: auto; right: 0; transform: none; }

.ccm-chart-axis {
	display: flex;
	justify-content: space-between;
	direction: ltr;
	margin-top: 6px;
	font-size: 12px;
	color: #999;
}

.ccm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14px;
}

.ccm-table th,
.ccm-table td {
	padding: 10px 8px;
	border-bottom: 1px solid #f3f0f8;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.ccm-table thead th {
	font-size: 12.5px;
	font-weight: 600;
	color: #888;
	border-bottom-color: #ece8f3;
}

.ccm-table th:first-child,
.ccm-table td:first-child {
	text-align: right;
}

.ccm-table tbody th {
	font-weight: 600;
	max-width: 280px;
}

.ccm-table tbody th a {
	color: #222;
	text-decoration: none;
}

.ccm-table tbody th a:hover {
	color: #7b4fa6;
}

.ccm-table tr.is-extra {
	display: none;
}

.ccm-table.is-expanded tr.is-extra {
	display: table-row;
}

.ccm-link-btn {
	margin-top: 10px;
	padding: 0;
	background: none;
	border: 0;
	color: #7b4fa6;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

/* ---------- הבלטת השיחה ---------- */

.ccm-convo {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 14px;
	margin: 0 0 18px;
	padding: 16px 20px;
	background: #fff;
	border: 1px solid #f0edf6;
	border-radius: 16px;
	box-shadow: 0 4px 18px rgba(80, 40, 120, 0.05);
}

.ccm-convo-title {
	font-size: 17px;
	font-weight: 700;
	color: #222;
}

.ccm-convo-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
	flex: 1;
}

.ccm-convo-chips li {
	padding: 5px 12px;
	background: #f5f5f7;
	border-radius: 20px;
	font-size: 13.5px;
	color: #555;
}

.ccm-convo-chips li.is-accent {
	background: #f3eeff;
	color: #7b4fa6;
	font-weight: 600;
}

.ccm-convo.is-empty {
	background: #faf7ff;
	border-style: dashed;
	border-color: #e4d8f6;
	box-shadow: none;
}

.ccm-convo-icon {
	font-size: 26px;
	line-height: 1;
}

.ccm-convo-body {
	flex: 1;
	min-width: 200px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.ccm-convo-text {
	font-size: 14px;
	color: #666;
	line-height: 1.6;
}

.ccm .ccm-convo-cta {
	display: inline-flex;
	align-items: center;
	height: 40px;
	padding: 0 20px;
	background: #111;
	color: #fff;
	border: 0;
	border-radius: 30px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s;
}

.ccm .ccm-convo-cta:hover {
	background: #7b4fa6;
	color: #fff;
}

.ccm .ccm-convo-cta.is-ghost {
	height: 34px;
	padding: 0 16px;
	background: transparent;
	color: #7b4fa6;
	border: 1.5px solid #e4d8f6;
}

.ccm .ccm-convo-cta.is-ghost:hover {
	background: #f3eeff;
}

/* תג "כותב/ת הסיפור" ליד השם */
.ccm-author-badge {
	display: inline-block;
	margin-inline-start: 8px;
	padding: 2px 9px;
	background: #7b4fa6;
	color: #fff;
	border-radius: 20px;
	font-size: 11.5px;
	font-weight: 600;
	line-height: 1.6;
	vertical-align: middle;
}

.jet-listing-grid__item.ccm-by-author > .e-con,
.jet-listing-grid__item.ccm-by-author > .elementor > .e-con {
	box-shadow: inset -3px 0 0 #c084fc;
}

/* ---------- טוסט ---------- */

.ccm-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translate(-50%, 20px);
	max-width: calc(100% - 32px);
	padding: 12px 20px;
	background: #222;
	color: #fff;
	border-radius: 30px;
	font-size: 14px;
	direction: rtl;
	opacity: 0;
	transition: opacity 0.25s, transform 0.25s;
	z-index: 99999;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.ccm-toast.is-in {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- מובייל ---------- */

@media (max-width: 780px) {
	.ccm-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.ccm-card {
		padding: 18px 16px 14px;
		border-radius: 14px;
	}

	.ccm-tile {
		padding: 14px;
	}

	.ccm-tile-value {
		font-size: 24px;
	}

	.ccm-chart {
		height: 110px;
	}

	/* טבלה ← כרטיסים */
	.ccm-table thead {
		display: none;
	}

	.ccm-table,
	.ccm-table tbody {
		display: block;
	}

	.ccm-table tr {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		gap: 4px 0;
		padding: 12px 0;
		border-bottom: 1px solid #f3f0f8;
	}

	.ccm-table.is-expanded tr.is-extra {
		display: grid;
	}

	.ccm-table th,
	.ccm-table td {
		border: 0;
		padding: 0;
	}

	.ccm-table tbody th {
		grid-column: 1 / -1;
		max-width: none;
		margin-bottom: 6px;
	}

	.ccm-table td {
		display: flex;
		flex-direction: column;
		align-items: center;
		font-weight: 600;
	}

	.ccm-table td::before {
		content: attr(data-label);
		font-size: 11px;
		font-weight: 400;
		color: #999;
		margin-bottom: 2px;
	}

	.ccm-convo {
		padding: 14px 16px;
	}

	.ccm .ccm-convo-cta:not(.is-ghost) {
		width: 100%;
		justify-content: center;
	}
}
