/* Event-page comments — teaser row on [event_template] (.cet-comments-teaser,
   uses .cet-page's own tokens from event_template.css) + the side panel
   (.cec-*), built the same way as the "שמורים" panel (saved_items.css). */

/* --------------------------------------------------------------- teaser */

.cet-comments-teaser {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--cet-border);
}

.cet-comments-teaser__summary {
	margin: 0;
	font-size: 15px;
}

.cet-comments-teaser__count {
	font-weight: 700;
	color: var(--cet-gray-900);
}

.cet-comments-teaser__hint {
	color: var(--cet-gray-500);
}

.cet-comments-teaser__hint::before {
	content: '\00a0|\00a0';
	color: var(--cet-border);
}

.cet-comments-trigger svg {
	width: 18px;
	height: 18px;
}

/* ------------------------------------------------------------- side panel */

#event-comments-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 24, 39, .6);
	z-index: 999998;
	opacity: 0;
	transition: opacity .25s ease;
}

body.cob-event-comments-open #event-comments-overlay {
	opacity: 1;
}

#event-comments-overlay[hidden] {
	display: none;
}

.cec-aside {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(420px, 90vw);
	background: #fff;
	z-index: 999999;
	box-shadow: 8px 0 32px rgba(0, 0, 0, .18);
	transform: translateX(-100%);
	visibility: hidden;
	transition: transform .25s ease, visibility 0s linear .25s;
	display: flex;
	flex-direction: column;
	color: var(--cet-gray-700, #374151);
}

.cec-aside[hidden] {
	display: none;
}

body.cob-event-comments-open .cec-aside {
	transform: translateX(0);
	visibility: visible;
	transition: transform .25s ease;
}

body.cob-event-comments-open {
	overflow: hidden;
}

.cec-aside__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 20px;
	border-bottom: 1px solid var(--cet-border, #e5e7eb);
}

.cec-aside__title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--cet-gray-900, #111827);
}

.cec-aside__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	background: none;
	padding: 0;
	cursor: pointer;
	color: var(--cet-gray-700, #374151);
}

.cec-aside__close:hover,
.cec-aside__close:focus {
	/* !important: overrides a global theme/WooCommerce button:hover rule
	   that otherwise paints a pink background behind this icon button. */
	background: transparent !important;
	color: var(--cet-gray-700, #374151) !important;
}

.cec-aside__close svg {
	width: 20px;
	height: 20px;
}

.cec-aside__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 20px 24px;
}

.cec-aside__body[aria-busy="true"] {
	opacity: .6;
}

/* ------------------------------------------------------------- the form */

.cec-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 20px;
}

.cec-textarea {
	resize: vertical;
	min-height: 56px;
	padding: 10px 12px;
	border: 1.5px solid var(--cet-border, #e5e7eb);
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	color: var(--cet-gray-900, #111827);
}

.cec-textarea:focus {
	outline: none;
	border-color: var(--cet-purple, #6d28d9);
}

.cec-submit {
	align-self: flex-end;
	padding: 8px 20px;
	border: 0;
	border-radius: 8px;
	background: var(--cet-purple, #6d28d9);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}

.cec-submit:hover {
	opacity: .9;
}

.cec-submit:disabled {
	opacity: .6;
	cursor: default;
}

/* --------------------------------------------------------------- list */

.cec-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.cec-comment {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 0;
	border-bottom: 1px solid var(--cet-border, #e5e7eb);
}

.cec-comment:last-child {
	border-bottom: 0;
}

.cec-comment__avatar {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 999px;
	background: var(--cet-purple-bg, #ede9fe);
	color: var(--cet-purple, #6d28d9);
	font-size: 14px;
	font-weight: 700;
}

.cec-comment__body {
	flex: 1 1 auto;
	min-width: 0;
}

.cec-comment__head {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 2px;
}

.cec-comment__name {
	font-size: 14px;
	font-weight: 700;
	color: var(--cet-gray-900, #111827);
}

.cec-comment__time {
	font-size: 12px;
	color: var(--cet-gray-400, #9ca3af);
}

.cec-comment__text {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--cet-gray-700, #374151);
	word-break: break-word;
}

.cec-comment__delete {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: 0;
	background: none;
	padding: 0;
	cursor: pointer;
	color: var(--cet-gray-400, #9ca3af);
}

.cec-comment__delete:hover,
.cec-comment__delete:focus {
	/* !important: overrides a global theme/WooCommerce button:hover rule. */
	background: transparent !important;
	color: #dc2626 !important;
}

.cec-comment__delete:disabled {
	opacity: .5;
	cursor: default;
}

.cec-empty {
	text-align: center;
	padding: 32px 0;
	color: var(--cet-gray-500, #6b7280);
	font-size: 14px;
}

/* --------------------------------------------------------------- toast */

.cec-toast {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	max-width: calc(100% - 40px);
	padding: 10px 18px;
	border-radius: 999px;
	background: var(--cet-gray-900, #111827);
	color: #fff;
	font-size: 13px;
	text-align: center;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
	z-index: 100;
}

.cec-toast[hidden] {
	display: none;
}

@media (max-width: 480px) {
	.cec-aside {
		width: 100vw;
	}
}

/* ---------------------------------------------------- community catalog
   Temporary home for the .csc-comments-* rules (community catalog table,
   includes/functions-community-shell-catalog.php) — belongs in
   community-shell-catalog.css, moved here only because that file isn't
   writable right now. This file is already enqueued on that page via
   cob_event_comments_enqueue(), so no extra enqueue is needed. Move these
   rules back once community-shell-catalog.css is editable again. */

.csc-comments-trigger {
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	color: #2563eb;
	font-weight: 700;
	cursor: pointer;
	text-decoration: underline;
}

.csc-comments-trigger:hover,
.csc-comments-trigger:focus {
	/* !important: overrides a global theme/WooCommerce button:hover rule
	   that otherwise paints a pink background behind this button. */
	background: transparent !important;
	color: #1d4ed8;
}

.csc-comments-badge {
	display: inline-flex;
	margin-inline-start: 8px;
	padding: 2px 8px;
	border-radius: 999px;
	background: #dbeafe;
	color: #1d4ed8;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
}
