/* Cave Talk: the Caveman Circus comment section (cc-comments).
   Colours follow the theme's tokens when they exist (--cc-ink, --cc-yellow, --cc-font). */

.cct {
	--cct-ink: var(--cc-ink, #1D1B17);
	--cct-yellow: var(--cc-yellow, #FFE145);
	--cct-card: #FFFFFF;
	--cct-soft: #FFF6C7;
	--cct-muted: #68635A;
	--cct-rule: #D8D1C5;
	--cct-av: 56px;
	--cct-av-small: 44px;
	box-sizing: border-box;
	clear: both;
	margin: 40px 0;
	background: var(--cct-card);
	color: var(--cct-ink);
	border: 2px solid var(--cct-ink);
	border-radius: 12px;
	box-shadow: 4px 4px 0 var(--cct-ink);
	font-family: var(--cc-font, inherit);
	font-size: 17px;
	line-height: 1.45;
	text-align: left;
	scroll-margin-top: 90px;
}
.cct *, .cct *::before, .cct *::after { box-sizing: border-box; }
.cct [hidden] { display: none !important; }
.cct p { margin: 0; }
.cct button, .cct textarea, .cct input { font: inherit; color: inherit; }
.cct a { color: var(--cct-ink); }
.cct :focus-visible { outline: 3px solid var(--cct-ink); outline-offset: 2px; }
.cct-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Header */
.cct__head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 0 24px; padding-top: 16px; border-bottom: 4px solid var(--cct-yellow); }
.cct__heading { padding-bottom: 12px; min-width: 0; }
.cct .cct__title { margin: 0; padding: 0; border: 0; font-family: inherit; font-size: 44px; font-weight: 900; line-height: 1.02; letter-spacing: -0.02em; color: var(--cct-ink); text-transform: none; }
.cct__count { font-size: 18px; font-weight: 700; }
.cct__art { flex: none; display: block; width: 260px; line-height: 0; margin-bottom: -1px; }
.cct__art img { display: block; width: 100%; height: auto; max-width: none; border: 0; border-radius: 0; box-shadow: none; }

.cct__body { padding: 20px 24px 26px; }

/* Buttons */
.cct-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin: 0; padding: 0 18px; background: var(--cct-card); color: var(--cct-ink); border: 2px solid var(--cct-ink); border-radius: 8px; font-weight: 800; font-size: 16px; line-height: 1.1; text-decoration: none; cursor: pointer; text-transform: none; letter-spacing: 0; }
.cct-btn:hover { background: var(--cct-soft); color: var(--cct-ink); }
.cct-btn--primary { background: var(--cct-yellow); box-shadow: 3px 3px 0 var(--cct-ink); }
.cct-btn--primary:hover { background: var(--cct-yellow); filter: brightness(0.96); }
.cct-btn--primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--cct-ink); }
.cct-btn--small { min-height: 38px; padding: 0 14px; font-size: 15px; }
.cct-btn[disabled] { opacity: 0.6; cursor: default; }
.cct-btn--tab[aria-pressed="true"] { background: var(--cct-yellow); box-shadow: 2px 2px 0 var(--cct-ink); }

.cct__bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cct__barlabel { font-weight: 700; font-size: 16px; }

/* Avatars: round in comments */
.cct-av { flex: none; display: block; width: var(--cct-av); height: var(--cct-av); overflow: hidden; border-radius: 50%; border: 2px solid var(--cct-ink); background: var(--cct-yellow); }
.cct-av--small { width: var(--cct-av-small); height: var(--cct-av-small); }
.cct-av img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; border: 0; border-radius: 0; margin: 0; }
.cct-av--guest { background: var(--cct-card); border-style: dashed; }
.cct-av--guest svg { display: block; width: 100%; height: 100%; padding-top: 12%; fill: var(--cct-muted); }

/* Guest prompt and comment box */
.cct__composer { margin-top: 18px; }
.cct-join { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 16px; padding: 16px; background: var(--cct-soft); border: 2px dashed var(--cct-ink); border-radius: 10px; }
.cct-join__text { flex: 1 1 220px; min-width: 0; }
.cct-join__h { font-size: 20px; font-weight: 900; line-height: 1.2; }
.cct-join__p { font-size: 15px; color: var(--cct-muted); }
.cct-signin { margin-top: 10px; font-size: 15px; color: var(--cct-muted); }
.cct-signin summary { display: inline-block; padding: 8px 0; cursor: pointer; list-style: none; font-style: italic; }
.cct-signin summary::-webkit-details-marker { display: none; }
.cct-signin summary span { color: var(--cct-ink); font-weight: 800; font-style: normal; text-decoration: underline; text-decoration-color: var(--cct-yellow); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.cct-signin .ccm-authform { display: flex; flex-direction: column; gap: 10px; max-width: 420px; margin: 6px 0 4px; padding: 16px; background: var(--cct-card); border: 2px solid var(--cct-ink); border-radius: 10px; color: var(--cct-ink); font-style: normal; }
.cct-signin .ccm-authform__label { font-weight: 800; }
.cct-signin .ccm-authform__input { width: 100%; min-height: 46px; padding: 0 12px; background: #fff; border: 2px solid var(--cct-ink); border-radius: 8px; font-size: 16px; }
.cct-signin .ccm-check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; }
.cct-signin .ccm-check input { margin-top: 4px; }
.cct-signin .ccm-authform__go { align-self: flex-start; min-height: 46px; padding: 0 18px; background: var(--cct-yellow); border: 2px solid var(--cct-ink); border-radius: 8px; box-shadow: 3px 3px 0 var(--cct-ink); font-weight: 800; font-size: 16px; cursor: pointer; }
.cct-signin .ccm-help, .cct-signin .ccm-msg { font-size: 14px; color: var(--cct-muted); }
.cct-closed { padding: 14px 16px; background: #F4F1EA; border-radius: 10px; font-weight: 700; }

.cct-form { display: flex; gap: 14px; margin: 0; }
.cct-form__main { flex: 1 1 auto; min-width: 0; }
.cct .cct-form__text { display: block; width: 100%; min-height: 56px; max-height: 320px; margin: 0; padding: 12px 14px; background: #fff; color: var(--cct-ink); border: 2px solid var(--cct-ink); border-radius: 8px; box-shadow: none; font-size: 17px; line-height: 1.4; resize: vertical; }
.cct-form__text::placeholder { color: var(--cct-muted); opacity: 1; }
.cct-form__row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.cct-form__hint { flex: 1 1 auto; font-size: 14px; font-style: italic; color: var(--cct-muted); }
.cct-form__count { font-size: 14px; font-weight: 700; }
.cct-form__msg { margin-top: 8px; font-size: 15px; font-weight: 700; color: #A01818; }
.cct-form__msg:empty { display: none; }
.cct-form__nudge { margin-top: 10px; font-size: 14px; color: var(--cct-muted); }
.cct-form--reply { margin-top: 12px; gap: 10px; }

.cct__status { min-height: 0; margin-top: 12px; font-size: 15px; font-weight: 700; }
.cct__status:empty { display: none; }
.cct__note { padding: 22px 0 6px; color: var(--cct-muted); }

/* Comments */
.cct__list { margin-top: 18px; border-top: 2px solid var(--cct-rule); transition: opacity 0.15s; }
.cct__list.is-busy { opacity: 0.5; }
.cct-c { display: flex; gap: 14px; padding: 18px 0; border-bottom: 2px solid var(--cct-rule); scroll-margin-top: 100px; }
.cct-c__main { flex: 1 1 auto; min-width: 0; }
.cct-badge { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 4px; padding: 2px 10px; background: var(--cct-yellow); border-radius: 4px; font-size: 13px; font-weight: 800; line-height: 1.5; }
.cct-badge svg { width: 13px; height: 13px; }
.cct-c__meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.cct-c__name { font-size: 19px; font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; }
.cct-tag { padding: 1px 7px; background: var(--cct-ink); color: #fff; border-radius: 4px; font-size: 12px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.cct-c__time { font-size: 14px; color: var(--cct-muted); white-space: nowrap; }
.cct .cct-c__text { margin-top: 2px; font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
.cct-c__acts { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; }
.cct svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cct svg.cct-solid, .cct svg.cct-dots, .cct-av--guest svg { fill: currentColor; stroke: none; }
.cct-av--guest svg { fill: var(--cct-muted); }
.cct-like, .cct-act { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; margin: 0; padding: 0 14px; background: none; color: var(--cct-ink); border: 0; border-radius: 22px; font-weight: 800; font-size: 16px; line-height: 1; cursor: pointer; text-transform: none; letter-spacing: 0; box-shadow: none; }
.cct-like svg, .cct-act svg { width: 20px; height: 20px; flex: none; }
.cct-like { background: #fff; border: 2px solid var(--cct-ink); }
.cct-like:hover, .cct-act:hover { background: var(--cct-soft); color: var(--cct-ink); }
.cct-like[aria-pressed="true"] { background: var(--cct-yellow); }
.cct-like[aria-pressed="true"] svg { fill: var(--cct-ink); }
.cct-like[disabled] { opacity: 0.55; cursor: default; background: #fff; }
.cct-menuwrap { position: relative; margin-left: auto; }
.cct-more { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0; background: none; color: var(--cct-muted); border: 2px solid transparent; border-radius: 50%; cursor: pointer; box-shadow: none; }
.cct-more svg { width: 20px; height: 20px; }
.cct-more:hover, .cct-more[aria-expanded="true"] { background: #F4F1EA; color: var(--cct-ink); border-color: var(--cct-ink); }
.cct-menu { position: absolute; right: 0; top: 48px; z-index: 20; display: flex; flex-direction: column; min-width: 190px; padding: 6px; background: #fff; border: 2px solid var(--cct-ink); border-radius: 8px; box-shadow: 4px 4px 0 var(--cct-ink); }
.cct-menu__item { min-height: 44px; margin: 0; padding: 0 12px; background: none; color: var(--cct-ink); border: 0; border-radius: 6px; font-weight: 700; font-size: 16px; text-align: left; cursor: pointer; text-transform: none; letter-spacing: 0; box-shadow: none; }
.cct-menu__item:hover { background: var(--cct-soft); color: var(--cct-ink); }
.cct-c__slot { position: relative; }
.cct-c__slot:empty { display: none; }

.cct-c__replies { margin-top: 6px; padding-left: 14px; border-left: 3px solid var(--cct-rule); }
.cct-c--reply { padding: 12px 0 4px; border-bottom: 0; gap: 12px; }
.cct-c--reply .cct-c__name { font-size: 17px; }
.cct-c--reply .cct-c__text { font-size: 16px; }
.cct-c--held { opacity: 0.85; }
.cct-c__held { margin-top: 8px; padding: 8px 12px; background: #F4F1EA; border-radius: 8px; font-size: 14px; font-weight: 700; }
.cct-c.is-focus { animation: cct-flash 2.4s ease-out 1; }
@keyframes cct-flash { 0%, 40% { background: var(--cct-soft); } 100% { background: transparent; } }

/* Report a comment */
.cct-report { margin: 12px 0 4px; padding: 14px; max-width: 420px; background: #fff; border: 2px solid var(--cct-ink); border-radius: 8px; }
.cct-report__reasons { margin: 0; padding: 0; border: 0; min-width: 0; }
.cct-report__reasons legend { padding: 0 0 6px; font-weight: 800; }
.cct-report__opt { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 16px; cursor: pointer; }
.cct-report__row { display: flex; gap: 8px; margin-top: 10px; }
.cct-report__msg { margin-top: 8px; font-size: 15px; font-weight: 700; }
.cct-report__msg:empty { display: none; }

.cct__more { width: 100%; margin-top: 18px; box-shadow: 3px 3px 0 var(--cct-ink); }

@media (max-width: 600px) {
	.cct { --cct-av: 44px; --cct-av-small: 36px; margin: 28px 0; font-size: 16px; box-shadow: 3px 3px 0 var(--cct-ink); }
	.cct__head { margin: 0 14px; padding-top: 10px; gap: 8px; border-bottom-width: 3px; }
	.cct__heading { padding-bottom: 8px; }
	.cct .cct__title { font-size: 30px; }
	.cct__count { font-size: 15px; }
	.cct__art { width: 132px; }
	.cct__body { padding: 14px 14px 20px; }
	.cct-join { padding: 14px; }
	.cct-join .cct-btn { flex: 1 1 100%; }
	.cct-form { gap: 10px; }
	.cct-form__hint { flex-basis: 100%; }
	.cct-form__row .cct-btn--primary { margin-left: auto; }
	.cct-c { gap: 10px; padding: 14px 0; }
	.cct-c__name { font-size: 17px; }
	.cct .cct-c__text { font-size: 16px; }
	.cct-like, .cct-act { padding: 0 11px; font-size: 15px; }
	.cct-c__acts { flex-wrap: nowrap; gap: 2px; }
	.cct-c--reply .cct-act { padding: 0 8px; }
	.cct-c__replies { padding-left: 10px; }
}

@media (prefers-reduced-motion: reduce) {
	.cct-c.is-focus { animation: none; background: var(--cct-soft); }
	.cct__list { transition: none; }
}
