/* =====================================================================
   TECH-ISH ANONYMOUS COMMENTS — styles
   Namespaced --tc-* tokens seeded from the design-system --ti-* tokens so
   nothing here can collide with Jannah or child.css. Dark mode keys off
   Jannah's own html.dark-skin class (same mechanism as the rest of the
   theme), so there is no separate toggle to maintain.
   ===================================================================== */

.techish-comments {
	--tc-ink:         var(--ti-ink-900);
	--tc-muted:       var(--ti-ink-600);
	--tc-faint:       var(--ti-ink-500);
	--tc-line:        var(--ti-ink-300);
	--tc-bg:          var(--ti-cream-50);
	--tc-card:        var(--ti-paper);
	--tc-field:       var(--ti-cream-50);
	--tc-chip:        var(--ti-cream-200);
	--tc-accent:      var(--ti-violet-500);
	--tc-accent-soft: var(--ti-violet-50);
	--tc-btn-bg:      var(--ti-violet-500);
	--tc-btn-fg:      #ffffff;

	--tc-like:        #1c7a5e;
	--tc-insight:     var(--ti-blue-400);
	--tc-funny:       #8a5e0c;
	--tc-disagree:    var(--ti-coral-500);
	--tc-link:        var(--ti-blue-400);

	font-family: var(--ti-font-sans);
	color: var(--tc-ink);
}

.dark-skin .techish-comments {
	--tc-ink:         var(--ti-cream-100);
	--tc-muted:       #a49b8c;
	--tc-faint:       #8b8475;
	--tc-line:        rgba(244, 236, 214, 0.12);
	--tc-bg:          rgba(255, 255, 255, 0.02);
	--tc-card:        rgba(255, 255, 255, 0.04);
	--tc-field:       rgba(255, 255, 255, 0.04);
	--tc-chip:        rgba(255, 255, 255, 0.06);
	--tc-accent:      var(--ti-violet-200);
	--tc-accent-soft: rgba(177, 137, 189, 0.14);
	--tc-btn-bg:      var(--ti-violet-200);
	--tc-btn-fg:      #1a1422;

	--tc-like:        #5dcaa5;
	--tc-insight:     #9db0e8;
	--tc-funny:       #e0b85c;
	--tc-disagree:    #e89a92;
	--tc-link:        #9db0e8;
}

.techish-comments * { box-sizing: border-box; }

/* All inline icons are Tabler-style OUTLINE glyphs: stroke, don't fill, and
   size to 16px so they never balloon (the unsized send arrow was inflating
   the Post button). Avatar <img> data-URIs are not inline <svg> — unaffected. */
.techish-comments svg {
	width: 16px; height: 16px; flex: none;
	fill: none; stroke: currentColor;
	stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.techish-comments__inner {
	background: var(--tc-bg);
	border: 1px solid var(--tc-line);
	border-radius: var(--ti-radius-md);
	padding: var(--ti-sp-5);
}

/* --- Header (branded // pill) ----------------------------------------- */
.techish-comments__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ti-sp-3);
	flex-wrap: wrap;
	margin-bottom: var(--ti-sp-5);
}
.techish-comments__titlebar {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px 10px 16px;
	border-radius: var(--ti-radius-pill);
	background: var(--ti-violet-500); /* fallback for no-gradient */
	background: var(--ti-gradient);
	box-shadow: var(--ti-shadow-2);
}
.techish-comments__slash {
	font-family: var(--ti-font-mono);
	font-weight: 600;
	font-size: 19px;
	line-height: 1;
	letter-spacing: -1px;
	color: rgba(255, 255, 255, 0.78);
}
.techish-comments__title {
	font-family: var(--ti-font-sans);
	font-size: 18px;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1;
	margin: 0;
	color: #ffffff;
}
.techish-comments__count {
	font-family: var(--ti-font-mono);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--tc-muted);
}

/* --- Avatars (disc + initials) --------------------------------------- */
.techish-cmt__avatar {
	flex: none;
	width: 38px; height: 38px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 14px; font-weight: 600;
	background: var(--tc-chip); /* fallback for no color-mix() support */
	background: color-mix(in srgb, var(--tc-ac) 18%, var(--tc-card));
	color: var(--tc-ac);
}
.techish-cmt__row > .techish-cmt__avatar { width: 36px; height: 36px; }
.av-0 { --tc-ac: #c25a52; } .av-1 { --tc-ac: #2e8b70; } .av-2 { --tc-ac: #639922; }
.av-3 { --tc-ac: #2a3c8a; } .av-4 { --tc-ac: #7b3f8c; } .av-5 { --tc-ac: #ba7517; }
.dark-skin .av-0 { --tc-ac: #e89a92; } .dark-skin .av-1 { --tc-ac: #5dcaa5; }
.dark-skin .av-2 { --tc-ac: #97c459; } .dark-skin .av-3 { --tc-ac: #9db0e8; }
.dark-skin .av-4 { --tc-ac: #cba9d4; } .dark-skin .av-5 { --tc-ac: #e0b85c; }

/* --- Composer --------------------------------------------------------- */
.techish-composer {
	background: var(--tc-card);
	border: 1px solid var(--tc-line);
	border-radius: var(--ti-radius-sm);
	padding: 14px;
	margin: 0 0 var(--ti-sp-4);
}
.techish-composer__row { display: flex; gap: 11px; }
.techish-composer__main { flex: 1; min-width: 0; }
.techish-composer__identity {
	display: flex; align-items: center; gap: 8px;
	flex-wrap: wrap; margin-bottom: 8px;
}
.techish-composer__as { font-size: 13px; color: var(--tc-muted); }
.techish-composer__handle { font-size: 13px; font-weight: 600; color: var(--tc-ink); }

.techish-ghost {
	border: none; background: transparent; cursor: pointer;
	width: 24px; height: 24px; padding: 3px; border-radius: 50%;
	color: var(--tc-muted);
	display: inline-flex; align-items: center; justify-content: center;
}
.techish-ghost:hover { color: var(--tc-ink); }

.techish-namebtn {
	margin-left: auto;
	border: 1px solid var(--tc-line);
	background: transparent; color: var(--tc-ink);
	border-radius: var(--ti-radius-pill);
	padding: 5px 11px; font-size: 12px; cursor: pointer;
	display: inline-flex; align-items: center; gap: 5px;
}
.techish-namebtn:hover { border-color: var(--tc-accent); }

.techish-composer input[type="text"],
.techish-composer input[type="email"],
.techish-composer textarea {
	width: 100%;
	font-family: var(--ti-font-sans);
	color: var(--tc-ink);
	background: var(--tc-field);
	border: 1px solid var(--tc-line);
	border-radius: 10px;
	transition: border-color var(--ti-dur) var(--ti-ease),
	            box-shadow var(--ti-dur) var(--ti-ease);
}
.techish-composer input[type="text"],
.techish-composer input[type="email"] { height: 36px; padding: 0 12px; font-size: 14px; }
.techish-composer textarea { padding: 10px 12px; font-size: 15px; line-height: 1.5; resize: vertical; min-height: 46px; }
.techish-composer input[type="text"]:focus,
.techish-composer input[type="email"]:focus,
.techish-composer textarea:focus {
	outline: none;
	border-color: var(--tc-accent);
	box-shadow: 0 0 0 3px var(--tc-accent-soft);
}

.techish-composer__turnstile { margin: 10px 0 0; }

.techish-composer__foot {
	display: flex; align-items: center; justify-content: space-between;
	gap: 10px; flex-wrap: wrap; margin-top: 10px;
}
.techish-composer__trust {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 12px; color: var(--tc-faint);
}
.techish-composer__trust svg { width: 15px; height: 15px; color: #3fa37d; }

.techish-post-btn {
	border: none; cursor: pointer;
	background: var(--tc-btn-bg); color: var(--tc-btn-fg);
	border-radius: var(--ti-radius-pill);
	padding: 8px 18px; font-size: 14px; font-weight: 600;
	display: inline-flex; align-items: center; gap: 6px;
}
.techish-post-btn[disabled] { opacity: 0.55; cursor: default; }

.techish-composer__msg { margin: 10px 0 0; font-size: 13px; color: var(--tc-disagree); }
.techish-composer__msg.is-ok { color: var(--tc-like); }

/* Anonymity + privacy note (always) and a live personal-info nudge. */
.techish-composer__note,
.techish-composer__warn {
	display: flex; align-items: flex-start; gap: 6px;
	margin: 9px 0 0; font-size: 12px; line-height: 1.45;
}
.techish-composer__note { color: var(--tc-faint); }
.techish-composer__warn { color: var(--tc-funny); font-size: 12.5px; }
.techish-composer__note svg { color: var(--tc-faint); margin-top: 1px; }
.techish-composer__warn svg { color: var(--tc-funny); margin-top: 1px; }
/* An explicit display: overrides the [hidden] attribute — re-assert it so
   the warning only appears when the JS detects a phone/email. */
.techish-composer__warn[hidden] { display: none; }

/* Honeypot — kept in the layout but out of sight and out of the a11y tree. */
.techish-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px; height: 1px; overflow: hidden;
}

/* --- Sort toggle ------------------------------------------------------ */
.techish-comments__sort { display: flex; gap: 6px; margin: 4px 0 2px; }
.techish-sort-btn {
	border: none; background: transparent; cursor: pointer;
	font-size: 12px; color: var(--tc-muted);
	padding: 4px 10px; border-radius: var(--ti-radius-pill);
}
.techish-sort-btn.is-on { color: var(--tc-ink); background: var(--tc-chip); font-weight: 500; }

/* --- Comment list ----------------------------------------------------- */
.techish-comment-list, .techish-comment-list .children {
	list-style: none; margin: 0; padding: 0;
}
/* Replies: indent + a brand thread line so it's obvious what answers what. */
.techish-comment-list .children {
	margin: 4px 0 4px 18px;
	padding-left: 18px;
	border-left: 2px solid var(--tc-accent-soft);
}
.dark-skin .techish-comment-list .children { border-left-color: var(--tc-line); }
.techish-comments li.techish-cmt { padding: 16px 2px; border-top: 1px solid var(--tc-line); }
.techish-comment-list .children li.techish-cmt:first-child { border-top: none; }
/* Smaller avatars deeper in a thread. */
.techish-comment-list .children .techish-cmt__avatar { width: 30px; height: 30px; font-size: 12px; }

.techish-cmt__row { display: flex; gap: 11px; }
.techish-cmt__main { flex: 1; min-width: 0; }
.techish-cmt__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.techish-cmt__name { font-size: 14px; font-weight: 600; color: var(--tc-ink); }
.techish-cmt__time { font-size: 12px; color: var(--tc-faint); }
.techish-cmt__tag {
	font-size: 11px; font-weight: 500; color: var(--tc-accent);
	background: var(--tc-accent-soft); padding: 2px 8px; border-radius: 10px;
}
.techish-cmt__pending {
	font-size: 11px; color: var(--tc-funny);
	background: var(--tc-chip); /* fallback for no color-mix() support */
	background: color-mix(in srgb, var(--tc-funny) 16%, transparent);
	padding: 2px 8px; border-radius: 10px;
}
.techish-cmt__body { font-size: 15px; line-height: 1.55; color: var(--tc-ink); margin: 7px 0 11px; }
.techish-cmt__body p { margin: 0 0 8px; }
.techish-cmt__body p:last-child { margin-bottom: 0; }

/* --- Reactions + actions --------------------------------------------- */
.techish-cmt__actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.techish-cmt__sep { width: 1px; height: 16px; background: var(--tc-line); margin: 0 2px; }

.techish-rx, .techish-act {
	border: none; cursor: pointer; line-height: 1;
	background: var(--tc-chip);
	border-radius: 16px; padding: 5px 11px;
	display: inline-flex; align-items: center; gap: 5px;
	transition: background var(--ti-dur-fast) var(--ti-ease);
}
.techish-rx svg, .techish-act svg { width: 16px; height: 16px; }
.techish-rx svg { color: var(--tc-muted); }
.techish-rx .n { font-size: 13px; font-weight: 500; color: var(--tc-ink); min-width: 0; }
.techish-rx:hover { background: var(--tc-chip); }
.techish-rx:hover { background: color-mix(in srgb, var(--tc-sig, var(--tc-ink)) 12%, var(--tc-chip)); }

.rx-like     { --tc-sig: var(--tc-like); }
.rx-insight  { --tc-sig: var(--tc-insight); }
.rx-funny    { --tc-sig: var(--tc-funny); }
.rx-disagree { --tc-sig: var(--tc-disagree); }
.techish-rx.is-on { background: var(--tc-accent-soft); }
.techish-rx.is-on { background: color-mix(in srgb, var(--tc-sig) 18%, var(--tc-chip)); }
.techish-rx.is-on svg, .techish-rx.is-on .n { color: var(--tc-sig); }

.techish-act { font-size: 13px; font-weight: 500; color: var(--tc-ink); }
.techish-act svg { color: var(--tc-ink); }
.techish-act:hover { background: var(--tc-chip); }
.techish-act:hover { background: color-mix(in srgb, var(--tc-ink) 10%, var(--tc-chip)); }
.techish-act--del:hover { color: var(--tc-disagree); background: var(--tc-chip); }
.techish-act--del:hover { background: color-mix(in srgb, var(--tc-disagree) 16%, var(--tc-chip)); color: var(--tc-disagree); }
.techish-act--del:hover svg { color: var(--tc-disagree); }

/* --- Inline reply / edit boxes (injected by JS) ---------------------- */
.techish-inline {
	margin: 10px 0 2px;
	display: flex; flex-direction: column; gap: 8px;
}
.techish-inline textarea {
	width: 100%; font-family: var(--ti-font-sans);
	color: var(--tc-ink); background: var(--tc-field);
	border: 1px solid var(--tc-line); border-radius: 10px;
	padding: 10px 12px; font-size: 15px; line-height: 1.5; resize: vertical;
}
.techish-inline textarea:focus { outline: none; border-color: var(--tc-accent); box-shadow: 0 0 0 3px var(--tc-accent-soft); }
.techish-inline__btns { display: flex; gap: 8px; }
.techish-inline__btns .techish-post-btn { padding: 6px 14px; font-size: 13px; }
.techish-inline__cancel {
	border: 1px solid var(--tc-line); background: transparent; color: var(--tc-muted);
	border-radius: var(--ti-radius-pill); padding: 6px 14px; font-size: 13px; cursor: pointer;
}

.techish-cmt.is-removing { opacity: 0; transition: opacity var(--ti-dur) var(--ti-ease); }
.techish-cmt.is-new {
	animation: techish-fade var(--ti-dur-slow) var(--ti-ease-out),
	           techish-flash 2.6s var(--ti-ease);
	border-radius: var(--ti-radius-sm);
}
@keyframes techish-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes techish-flash { 0% { background: var(--tc-accent-soft); } 100% { background: transparent; } }

/* --- Mobile ----------------------------------------------------------- */
@media (max-width: 600px) {
	.techish-comments__inner { padding: var(--ti-sp-4); }
	.techish-comment-list .children { margin-left: 8px; padding-left: 12px; }
	.techish-cmt__row, .techish-composer__row { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
	.techish-cmt.is-new { animation: none; }
	.techish-cmt.is-removing { transition: none; }
}

/* --- Author / Techish-team badges ------------------------------------- */
.techish-cmt__badge {
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 11px; font-weight: 600; line-height: 1;
	padding: 3px 9px 3px 7px;
	border-radius: var(--ti-radius-pill);
	color: #fff;
	background: var(--ti-violet-500); /* fallback before gradient */
	background: var(--ti-gradient);
	white-space: nowrap;
}
.techish-cmt__badge svg { width: 13px; height: 13px; }
.techish-cmt__badge.is-staff {
	color: var(--tc-accent);
	background: none;
	border: 1px solid var(--tc-accent);
	padding: 2px 9px 2px 7px;
}

/* Accent ring on a badged commenter's avatar (works on any background via
   a transparent outline gap). */
.techish-cmt__avatar.is-team {
	outline: 2px solid var(--tc-accent);
	outline-offset: 2px;
}

/* Real Gravatar photo (shown when a commenter left an optional email). */
.techish-cmt__avatar--photo {
	width: 36px; height: 36px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--tc-chip);
}
.techish-composer__row > .techish-cmt__avatar--photo { width: 38px; height: 38px; }
.techish-comment-list .children .techish-cmt__avatar--photo { width: 30px; height: 30px; }

/* --- Links inside comment bodies -------------------------------------- */
.techish-cmt__body a {
	color: var(--tc-link);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
	overflow-wrap: anywhere;
	word-break: break-word;
}
.techish-cmt__body a:hover { text-decoration-thickness: 2px; }
/* Internal/external comment links are decorated by the .ti-ilink / .ti-xlink
   treatment in child.css (Phase 15); the rules above are the baseline fallback
   for any link the tagger skips. */

/* --- Optional name + email panel -------------------------------------- */
.techish-composer__idfields {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 9px;
}
/* Collapsed by default — an explicit display: would otherwise override the
   [hidden] attribute, showing the fields before "add name or email" is clicked. */
.techish-composer__idfields[hidden] { display: none; }
.techish-composer__idnote {
	margin: 0;
	font-size: 12px;
	line-height: 1.45;
	color: var(--tc-faint);
}
