/* ===========================================================================
   chat.css - the site chat page (/sohbet), in site.css's language

   Three columns on a wide screen (rooms, messages, who is online); the
   online column drops below on a narrow one and the rooms fold above
   the messages. Loaded by the chat page's "head" block only; every
   colour is a site.css token.
   =========================================================================== */

.chat-section { padding-top: 24px; }
.chat-guest { max-width: 560px; margin: 40px auto; text-align: center; }
.chat-guest h1 { margin-bottom: 12px; }

.chat {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr) 200px;
	gap: 16px;
	min-height: 70vh;
}
.chat.hide-online { grid-template-columns: 220px minmax(0, 1fr); }
.chat.hide-online .chat__online { display: none; }

.chat__side, .chat__online, .chat__main {
	background: var(--ink-2);
	border: 1px solid var(--line);
	padding: 12px;
	min-width: 0;
}
.chat__h {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 6px;
	margin: 14px 0 6px;
	font-family: var(--mono);
	font-size: 12px;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--gold);
}
.chat__h:first-child { margin-top: 0; }
.chat__add {
	background: none;
	border: 0;
	color: var(--paper-dim);
	font: inherit;
	font-size: 11px;
	letter-spacing: .04em;
	text-transform: none;
	cursor: pointer;
}
.chat__add:hover { color: var(--gold-hi); }
.chat__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.chat__links a { display: block; padding: 4px 8px; color: var(--paper-dim); }
.chat__links a:hover { color: var(--gold-hi); }
.chat__settings { margin-top: 16px; width: 100%; }

.chat-room {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 100%;
	padding: 5px 8px;
	background: none;
	border: 0;
	border-inline-start: 2px solid transparent;
	color: var(--paper-dim);
	font: inherit;
	text-align: start;
	cursor: pointer;
}
.chat-room:hover { color: var(--paper); background: var(--ink-3); }
.chat-room.is-active { color: var(--gold-hi); border-inline-start-color: var(--gold); background: var(--ink-3); }
.chat-room.is-guest { opacity: .7; }
.chat-room__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-room__tag { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; }
.chat-room__unread {
	min-width: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--red);
	color: #fff;
	font-size: 11px;
	text-align: center;
}

.chat__main { display: flex; flex-direction: column; min-height: 0; }
.chat__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-start;
	gap: 8px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--line);
}
.chat__title h1 { font-size: 1.3rem; margin: 0; overflow-wrap: anywhere; }
.chat__title p { margin: 2px 0 0; }
.chat__tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chat__tools > span { display: contents; }
.chat__mute, .chat__note { margin: 10px 0 0; }

.chat__msgs {
	list-style: none;
	margin: 0;
	padding: 8px 0;
	flex: 1;
	min-height: 320px;
	max-height: 62vh;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.chat-empty { padding: 24px 4px; }
.chat-msg { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.chat-msg:last-child { border-bottom: 0; }
.chat-msg.is-market { border-inline-start: 2px solid var(--gold); padding-inline-start: 8px; }
.chat-msg__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.chat-msg__name { font-weight: 700; color: var(--gold-hi); }
.chat-msg.is-mine .chat-msg__name { color: var(--jade); }
.chat-msg__time { font-size: 11px; color: var(--mute); }
.chat-msg__acts { margin-inline-start: auto; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.chat-msg:hover .chat-msg__acts, .chat-msg:focus-within .chat-msg__acts { opacity: 1; }
.chat-msg__body { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-msg__body a { color: var(--gold-hi); text-decoration: underline; }
.chat-mention { color: var(--gold); }
.chat-mention.is-me { color: var(--ink); background: var(--gold-hi); padding: 0 3px; }

.chat-act {
	background: none;
	border: 1px solid var(--line);
	color: var(--paper-dim);
	font: inherit;
	font-size: 11px;
	padding: 1px 6px;
	cursor: pointer;
}
.chat-act:hover { color: var(--gold-hi); border-color: var(--line-2); }

.chat__compose { display: grid; gap: 6px; margin-top: 8px; }
.chat__compose textarea { width: 100%; resize: vertical; min-height: 52px; }
.chat__compose.is-muted { opacity: .5; }
.chat__send { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat__rules { margin: 8px 0 0; }

.chat-user { display: flex; align-items: center; gap: 6px; padding: 3px 4px; }
.chat-user__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--paper); }
.chat-user .chat-act { opacity: .6; }
.chat-user:hover .chat-act { opacity: 1; }

.chat-dlg {
	max-width: 420px;
	width: calc(100% - 32px);
	background: var(--ink-2);
	color: var(--paper);
	border: 1px solid var(--line-2);
	padding: 20px;
}
.chat-dlg::backdrop { background: rgba(0, 0, 0, .6); }
.chat-dlg h2 { margin: 0 0 12px; font-size: 1.1rem; }
.chat-dlg label { display: block; margin-bottom: 10px; }
.chat-dlg input:not([type=radio]):not([type=checkbox]), .chat-dlg select { display: block; width: 100%; margin-top: 4px; }
.chat-dlg .hint { display: block; font-size: 12px; color: var(--mute); margin-top: 4px; }
.chat-radio { display: flex !important; gap: 8px; align-items: center; }
.chat-dlg__btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

@media (max-width: 960px) {
	.chat, .chat.hide-online { grid-template-columns: minmax(0, 1fr); }
	.chat__side { order: 1; }
	.chat__main { order: 2; }
	.chat__online { order: 3; }
	.chat__msgs { max-height: 60vh; }
	.chat-msg__acts { opacity: 1; }
}
