/* ═══════════════════════════════════════════════════════════════════════════
   Collaborative File Collection  — Gutenberg block  imoteema/collab-files
   ═══════════════════════════════════════════════════════════════════════════ */

.clf-block-editor-placeholder {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	background: #f8f8f8;
	border: 1.5px dashed #ccc;
	border-radius: 6px;
	font-size: 0.9rem;
	color: #555;
}

.collab-files-app {
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	overflow: hidden;
	font-family: var(--font-body, sans-serif);
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.clf-header {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.75rem 1.25rem;
	background: #fafafa;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.clf-heading {
	flex: 1;
	font-size: 1rem;
	font-weight: 600;
	margin: 0;
	color: var(--color-dark, #1a1a2e);
}

/* ── File list ────────────────────────────────────────────────────────────── */

.clf-list { padding: 0; }

.clf-empty {
	padding: 1.5rem;
	text-align: center;
	color: var(--color-medium-gray, #999);
	font-size: 0.9rem;
	margin: 0;
}

.clf-item {
	padding: 0.85rem 1.25rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.clf-item:last-child { border-bottom: none; }

.clf-item-header {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	margin-bottom: 0.55rem;
}

.clf-icon {
	font-size: 1.35rem;
	flex-shrink: 0;
	line-height: 1.2;
	margin-top: 0.05rem;
}

.clf-item-info {
	flex: 1;
	min-width: 0;
}

.clf-filename {
	display: block;
	font-weight: 600;
	font-size: 0.88rem;
	color: var(--color-accent, #5b5ea6);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.clf-filename:hover { text-decoration: underline; }

.clf-meta-text {
	display: flex;
	flex-direction: column;
	gap: 0.05rem;
	font-size: 0.73rem;
}

.clf-uploader {
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--color-dark, #333);
}

.clf-meta-sub {
	color: var(--color-medium-gray, #999);
}

.clf-delete {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--color-medium-gray, #bbb);
	font-size: 1.25rem;
	line-height: 1;
	padding: 0 0.2rem;
	flex-shrink: 0;
	transition: color 0.15s;
}
.clf-delete:hover { color: var(--color-error, #c0392b); }

/* ── Comment thread ───────────────────────────────────────────────────────── */

.clf-comments {
	padding: 0 1.25rem 0.2rem;
}

.clf-comment-item {
	padding: 0.55rem 0;
	border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.clf-comment-item:last-child { border-bottom: none; }

.clf-comment-header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 0.2rem;
}

.clf-comment-author {
	font-size: 0.78rem;
	font-weight: 700;
	color: var(--color-dark, #333);
}

.clf-comment-date {
	font-size: 0.72rem;
	color: var(--color-medium-gray, #aaa);
	flex: 1;
}

.clf-comment-edit-btn,
.clf-comment-del-btn {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 0.85rem;
	line-height: 1;
	padding: 0 0.15rem;
	color: var(--color-medium-gray, #bbb);
	transition: color 0.15s;
	opacity: 0;
}
.clf-comment-item:hover .clf-comment-edit-btn,
.clf-comment-item:hover .clf-comment-del-btn { opacity: 1; }
.clf-comment-edit-btn:hover { color: var(--color-accent, #5b5ea6); }
.clf-comment-del-btn:hover  { color: var(--color-error, #c0392b); }

.clf-comment-text {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--color-dark, #1a1a2e);
	white-space: pre-wrap;
}

/* edit form */
.clf-comment-edit-form { margin-top: 0.35rem; }

.clf-comment-edit-ta,
.clf-new-comment-ta {
	width: 100%;
	box-sizing: border-box;
	font-family: var(--font-body, sans-serif);
	font-size: 0.85rem;
	line-height: 1.5;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 5px;
	padding: 0.4rem 0.6rem;
	resize: vertical;
	background: #fafafa;
	color: var(--color-dark, #1a1a2e);
	transition: border-color 0.15s, box-shadow 0.15s;
}
.clf-comment-edit-ta:focus,
.clf-new-comment-ta:focus {
	outline: none;
	border-color: var(--color-accent, #5b5ea6);
	box-shadow: 0 0 0 2px rgba(91, 94, 166, 0.15);
	background: #fff;
}

.clf-comment-edit-btns { margin-top: 0.3rem; }

.clf-comment-save-btn,
.clf-comment-cancel-btn,
.clf-submit-comment-btn {
	padding: 0.25rem 0.7rem;
	border-radius: 5px;
	border: none;
	cursor: pointer;
	font-size: 0.8rem;
	font-weight: 600;
	transition: opacity 0.15s;
}
.clf-comment-save-btn,
.clf-submit-comment-btn {
	background: var(--color-accent, #5b5ea6);
	color: #fff;
}
.clf-comment-cancel-btn {
	background: transparent;
	color: var(--color-medium-gray, #888);
	border: 1px solid rgba(0, 0, 0, 0.15);
}
.clf-comment-save-btn:hover,
.clf-submit-comment-btn:hover { opacity: 0.82; }

/* ── Add-comment form ─────────────────────────────────────────────────────── */

.clf-add-comment {
	padding: 0.6rem 1.25rem 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.clf-submit-comment-btn { align-self: flex-start; }

/* ── Upload area ──────────────────────────────────────────────────────────── */

.clf-upload-area {
	padding: 0.85rem 1.25rem;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
	background: #fafafa;
}

.clf-file-input { display: none; }

.clf-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.45rem 1rem;
	border-radius: 6px;
	cursor: pointer;
	background: var(--color-accent, #5b5ea6);
	color: #fff;
	font-size: 0.84rem;
	font-weight: 600;
	transition: opacity 0.15s;
	user-select: none;
}
.clf-upload-label:hover .clf-upload-btn { opacity: 0.88; }

/* ── Upload progress ──────────────────────────────────────────────────────── */

.clf-upload-progress {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.55rem;
}

.clf-progress-name {
	font-size: 0.78rem;
	color: var(--color-medium-gray, #666);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 14ch;
	flex-shrink: 0;
}

.clf-progress-track {
	flex: 1;
	height: 6px;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.clf-progress-fill {
	height: 100%;
	width: 0%;
	border-radius: 3px;
	background: var(--color-accent, #5b5ea6);
	transition: width 0.12s linear;
}

.clf-progress-pct {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--color-accent, #5b5ea6);
	min-width: 3ch;
	text-align: right;
	flex-shrink: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   Collaborative Document Editor  — Gutenberg block  imoteema/collab-doc
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Author attribution list (below the editor) ──────────────────────────── */

.cd-author-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0.55rem 0.9rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	background: #fafafa;
	min-height: 0;
}
.cd-author-list:empty { display: none; }

.cd-author-btn {
	padding: 0.22rem 0.7rem;
	border: 1.5px solid var(--author-color, #888);
	border-radius: 20px;
	background: transparent;
	cursor: pointer;
	font-family: var(--font-body, sans-serif);
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--author-color, #888);
	transition: background 0.15s, color 0.15s;
	line-height: 1.5;
}
.cd-author-btn:hover,
.cd-author-btn.active {
	background: var(--author-color, #888);
	color: #fff;
}

.collab-login-notice {
	margin: 0 0 0.75rem;
	padding: 0.65rem 1rem;
	text-align: left;
	font-size: 0.85rem;
	color: var(--color-medium-gray, #666);
	background: #fafafa;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-left: 3px solid var(--color-accent, #5b5ea6);
	border-radius: 5px;
}

.collab-login-notice a {
	color: var(--color-accent, #5b5ea6);
	font-weight: 600;
	text-decoration: underline;
}

/* Read-only viewer: no toolbar, so the editor body owns all four corners */
.cd-editor-readonly {
	border-radius: 6px;
}

.collab-doc-readonly .ql-editor {
	cursor: default;
}

/* Block editor placeholder */
.cd-block-editor-placeholder {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	background: #f8f8f8;
	border: 1.5px dashed #ccc;
	border-radius: 6px;
	color: #555;
	font-size: 0.9rem;
}

/* ── Block wrapper ────────────────────────────────────────────────────────── */

.collab-doc-app {
	font-family: var(--font-body, sans-serif);
}

/* ── Toolbar ──────────────────────────────────────────────────────────────── */

/* Quill adds .ql-toolbar.ql-snow to this element after init */
.collab-doc-app .ql-toolbar.ql-snow {
	position: relative;       /* anchor for .cd-meta */
	padding-right: 130px;     /* keep buttons clear of the meta overlay */
	border-radius: 6px 6px 0 0;
	background: #fafafa;
	border-color: rgba(0,0,0,0.13) !important;
}

/* Meta overlay: online dots + status — absolute so it never shifts layout */
.cd-meta {
	position: absolute;
	right: 8px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	gap: 8px;
	pointer-events: none;
}

.cd-online-users {
	display: flex;
	align-items: center;
	gap: 3px;
	pointer-events: auto;
}

.cd-online-dot {
	display: inline-block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 1.5px solid rgba(255,255,255,0.8);
	box-shadow: 0 0 0 1px rgba(0,0,0,0.15);
	cursor: default;
}

.cd-status {
	font-size: 0.72rem;
	color: var(--color-medium-gray, #999);
	white-space: nowrap;
}

/* ── Editor body ──────────────────────────────────────────────────────────── */

.cd-editor-body {
	border: 1px solid rgba(0,0,0,0.13);
	border-top: none;
	border-radius: 0 0 6px 6px;
	overflow: hidden;
}

.collab-doc-app .ql-container.ql-snow {
	position: relative;
	border: none !important;
	font-family: var(--font-body, inherit) !important;
	font-size: var(--font-size-base, 1rem) !important;
	line-height: var(--line-height-normal, 1.5) !important;
}

.collab-doc-app .ql-editor {
	min-height: 420px;
	padding: 1.4rem 1.6rem;
	font-size: var(--font-size-base, 1rem) !important;
	font-family: var(--font-body, inherit) !important;
	line-height: var(--line-height-normal, 1.5) !important;
	color: var(--color-text-secondary, #1a1a2e);
}

.collab-doc-app .ql-editor.ql-blank::before {
	font-style: normal;
	color: var(--color-medium-gray, #aaa);
	font-size: var(--font-size-base, 1rem);
}

.collab-doc-app .ql-editor p,
.collab-doc-app .ql-editor li {
	margin-bottom: 0.5em;
}

/* ── Remote cursors ───────────────────────────────────────────────────────── */

.cd-cursor-layer {
	position: absolute;
	top: 0; left: 0;
	width: 100%; height: 100%;
	pointer-events: none;
	overflow: hidden;
}

.cd-remote-cursor {
	position: absolute;
	display: none;
	width: 2px;
	border-left: 2px solid currentColor;
	pointer-events: none;
	animation: cd-blink 1.1s step-start infinite;
}

.cd-remote-cursor-label {
	position: absolute;
	bottom: 100%;
	left: -1px;
	padding: 1px 5px 1px 4px;
	border-radius: 3px 3px 3px 0;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	white-space: nowrap;
	line-height: 1.6;
	pointer-events: none;
}

@keyframes cd-blink {
	0%,  49% { opacity: 1; }
	50%, 100% { opacity: 0; }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
	.cd-status { display: none; }
	.collab-doc-app .ql-editor { padding: 1rem; }
}


/* ═══════════════════════════════════════════════════════════════════════════
   Collaborative Hexagon Editor  — Gutenberg block  imoteema/collab-hex
   ═══════════════════════════════════════════════════════════════════════════ */

/* Block editor placeholder */
.chx-block-editor-placeholder {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.25rem;
	background: #f8f8f8;
	border: 1.5px dashed #ccc;
	border-radius: 6px;
	font-size: 0.9rem;
	color: #555;
}

/* ── Live hero preview ────────────────────────────────────────────────────── */

.chx-preview-wrap {
	position: relative;
	border-radius: 10px 10px 0 0;
	overflow: hidden;
	container-type: inline-size;
}

/* "Eelvaade" badge — top-left corner of the preview */
.chx-preview-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 10;
	background: rgba(255, 255, 255, 0.15);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	padding: 3px 9px;
	border-radius: 4px;
	pointer-events: none;
	user-select: none;
}

/* Strip the navbar-offset spacing; let it fill naturally */
.chx-preview-wrap .hero-section {
	margin-top: 0 !important;
	padding-top: 2.5rem !important;
	padding-bottom: 2.5rem !important;
	min-height: auto !important;
	border-radius: 0;
	align-items: flex-start;
}

.chx-preview-wrap .hero-container {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

/* Default: stack vertically so the hex grid (≈483px) never overflows any block width */
.chx-preview-wrap .hero-content-wrapper {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	gap: 1.5rem !important;
}

/* When the preview container is wide enough, go side-by-side */
@container (min-width: 750px) {
	.chx-preview-wrap .hero-content-wrapper {
		flex-direction: row !important;
		align-items: center !important;
		gap: 2rem !important;
	}

	.chx-preview-wrap .hero-hexagons-area {
		flex-shrink: 0;
	}

	.chx-preview-wrap .hero-info-wrapper {
		flex: 1;
		min-width: 0;
	}
}

/* Always render the hex grid — let the hero's responsive scale() rules handle sizing */
.chx-preview-wrap .hero-hexagons {
	display: grid !important;
	grid-template-columns: repeat(3, 145px) !important;
}

/* Clickable hexagons in the preview */
.chx-preview-wrap .hexagon-wrapper {
	cursor: pointer;
}
.chx-preview-wrap .hexagon-wrapper:hover {
	transform: translateY(-5px);
}

/* ── "Ava väljad" toggle ──────────────────────────────────────────────────── */

.chx-toggle {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.8rem 1.25rem;
	background: none;
	border: none;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
	cursor: pointer;
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--color-accent, #5b5ea6);
	text-align: left;
	font-family: var(--font-body, sans-serif);
	line-height: 1.4;
	transition: background 0.15s;
}

.chx-toggle:hover,
.chx-toggle:focus-visible {
	background: rgba(91, 94, 166, 0.06);
	outline: none;
}

.chx-toggle-icon {
	margin-left: auto;
	color: currentColor;
	flex-shrink: 0;
	transition: transform 0.25s ease;
}

.chx-sections {
	display: none;
}

.chx-sections.open {
	display: block;
}

/* ── App wrapper ──────────────────────────────────────────────────────────── */

.collab-hex-app {
	border: 1px solid rgba(0,0,0,0.12);
	border-radius: 10px;
	overflow: hidden;
	font-family: var(--font-body, sans-serif);
}

/* Read-only (logged-out) variant: notice banner + preview only, no edit form */
.collab-hex-readonly {
	border: none;
	border-radius: 0;
}

.collab-hex-readonly .chx-preview-wrap {
	border-radius: 10px;
}

/* ── Header ───────────────────────────────────────────────────────────────── */

.chx-header {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.75rem 1.25rem;
	background: #fafafa;
	border-bottom: 1px solid rgba(0,0,0,0.08);
}

.chx-heading {
	flex: 1;
	font-size: 1rem;
	font-weight: 600;
	margin: 0;
	color: var(--color-dark, #1a1a2e);
}

.chx-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

/* ── Form sections ────────────────────────────────────────────────────────── */

.chx-section {
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid rgba(0,0,0,0.06);
}
.chx-section:last-child { border-bottom: none; }

.chx-section-title {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-medium-gray, #888);
	margin: 0 0 0.9rem;
}

/* ── Field rows ───────────────────────────────────────────────────────────── */

.chx-row {
	display: grid;
	grid-template-columns: 90px 1fr;
	align-items: start;
	gap: 0.4rem 0.75rem;
	margin-bottom: 0.65rem;
}
.chx-row:last-child { margin-bottom: 0; }
.chx-row-link { opacity: 0.75; }

.chx-label {
	font-size: 0.78rem;
	font-weight: 600;
	color: var(--color-medium-gray, #777);
	padding-top: 0.45rem;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 4px;
}

.chx-input,
.chx-textarea {
	width: 100%;
	font-family: var(--font-body, sans-serif);
	font-size: var(--font-size-base, 1rem);
	line-height: var(--line-height-normal, 1.5);
	color: var(--color-dark, #1a1a2e);
	border: 1px solid rgba(0,0,0,0.15);
	border-radius: 5px;
	padding: 0.35rem 0.6rem;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
	resize: vertical;
}

.chx-input:focus,
.chx-textarea:focus {
	outline: none;
	border-color: var(--color-accent, #5b5ea6);
	box-shadow: 0 0 0 2px rgba(91,94,166,0.15);
}

/* ── Sub-hexagon blocks ───────────────────────────────────────────────────── */

.chx-sub {
	display: flex;
	gap: 1rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid rgba(0,0,0,0.05);
}
.chx-sub:first-of-type { padding-top: 0; }
.chx-sub:last-child     { border-bottom: none; padding-bottom: 0; }

.chx-sub-num {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--color-accent, #5b5ea6);
	color: #fff;
	font-size: 0.78rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin-top: 0.35rem;
}

.chx-sub-body { flex: 1; min-width: 0; }

/* ── Who's typing indicator dots ──────────────────────────────────────────── */

.chx-focusers {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.chx-focus-dot {
	display: inline-block;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	border: 1px solid rgba(255,255,255,0.7);
	box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
	cursor: default;
	animation: chx-pulse 1.4s ease-in-out infinite;
}

@keyframes chx-pulse {
	0%, 100% { opacity: 1; transform: scale(1); }
	50%       { opacity: 0.6; transform: scale(0.85); }
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
	.chx-row {
		grid-template-columns: 1fr;
	}
	.chx-label { padding-top: 0; }
	.chx-section { padding: 1rem; }
	/* Shrink the hex grid on very narrow viewports */
	.chx-preview-wrap .hero-hexagons {
		transform: scale(0.72) !important;
		transform-origin: top center;
	}
}
