/* Modern Profile for Kalona.chat
 * Everything is scoped to #viewprofile so no other page is touched.
 */

#viewprofile {
	--kp-green: #2f4a3a;
	--kp-green-2: #3e6149;
	--kp-wheat: #e3c46f;
	--kp-barn: #8e3b2e;
	--kp-tint: #e6efe8;
	--kp-card: #ffffff;
	--kp-soft: #f3f5f2;
	--kp-line: #dde3dc;
	--kp-text: #1f2a24;
	--kp-muted: #5c6b61;
	color: var(--kp-text);
}

/* Page title: quieter */
.section-memberlist h2.memberlist-title {
	font-family: Georgia, "Times New Roman", serif;
	font-weight: normal;
	color: var(--kp-muted, #5c6b61);
	border-bottom: 0;
	margin-bottom: 12px;
}

/* ---------- Header card with quilt cover ---------- */
#viewprofile > .panel:first-child {
	position: relative;
	background: var(--kp-card);
	border: 1px solid var(--kp-line);
	border-radius: 14px;
	padding: 0;
	overflow: hidden;
	margin-bottom: 14px;
}

#viewprofile > .panel:first-child::before {
	content: "";
	display: block;
	height: 130px;
	background-color: var(--kp-green);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%232F4A3A'/%3E%3Cpath d='M0 0L40 0L0 40Z' fill='%233E6149'/%3E%3Cpath d='M20 10L30 20L20 30L10 20Z' fill='%23E3C46F'/%3E%3Cpath d='M40 40L40 20L20 40Z' fill='%238E3B2E'/%3E%3C/svg%3E");
	background-size: 40px 40px;
}

/* prosilver draws an "online" corner image; replace with a dot */
#viewprofile > .panel.online {
	background-image: none;
}
#viewprofile > .panel.online .profile-avatar {
	position: relative;
}
#viewprofile > .panel.online .profile-avatar::after {
	content: "";
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #3f9b5a;
	border: 3px solid var(--kp-card);
}

#viewprofile > .panel:first-child > .inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 8px 24px;
	padding: 0 24px 22px;
}

/* Avatar + rank column */
#viewprofile > .panel:first-child dl.left-box:not(.details) {
	float: none;
	margin: -56px 0 0;
	width: auto;
	text-align: center;
}
#viewprofile .profile-avatar img {
	width: 112px;
	height: 112px;
	object-fit: cover;
	border-radius: 50%;
	border: 5px solid var(--kp-card);
	background: var(--kp-wheat);
	box-shadow: 0 2px 8px rgba(31, 42, 36, 0.15);
}
#viewprofile > .panel:first-child dl.left-box:not(.details) dd {
	margin: 8px 0 0;
	font-size: 12px;
}
#viewprofile > .panel:first-child dl.left-box:not(.details) dd:first-of-type {
	display: inline-block;
	background: var(--kp-tint);
	color: var(--kp-green);
	padding: 3px 12px;
	border-radius: 999px;
	font-weight: bold;
}

/* Details list: two tidy columns */
#viewprofile dl.details {
	display: grid;
	grid-template-columns: minmax(90px, max-content) minmax(0, 1fr);
	gap: 8px 16px;
	float: none;
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
}
#viewprofile dl.details dt {
	float: none;
	width: auto;
	margin: 0;
	text-align: left;
	font-weight: normal;
	color: var(--kp-muted);
}
#viewprofile dl.details dd {
	margin: 0;
	padding: 0;
	overflow-wrap: anywhere;
}

#viewprofile > .panel:first-child dl.profile-details {
	flex: 1 1 320px;
	margin-top: 18px;
}

/* Username row gets the spotlight */
#viewprofile dl.profile-details dt:first-of-type,
#viewprofile dl.profile-details dd:first-of-type {
	align-self: center;
}
#viewprofile dl.profile-details dd:first-of-type > span,
#viewprofile dl.profile-details dd:first-of-type > .username,
#viewprofile dl.profile-details dd:first-of-type > .username-coloured {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 24px;
	font-weight: normal;
}

/* ---------- Second panel: contact + statistics ---------- */
#viewprofile > .panel:nth-child(2) {
	background: transparent;
	border: 0;
	padding: 0;
	margin-bottom: 14px;
}
#viewprofile > .panel:nth-child(2) > .inner {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 14px;
}
#viewprofile .column1,
#viewprofile .column2 {
	float: none;
	width: auto;
	margin: 0;
	background: var(--kp-card);
	border: 1px solid var(--kp-line);
	border-radius: 14px;
	padding: 18px 20px;
}
#viewprofile .column1 h3,
#viewprofile .column2 h3,
#viewprofile .panel h3 {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 17px;
	font-weight: normal;
	text-transform: none;
	color: var(--kp-green);
	border-bottom: 1px solid var(--kp-line);
	padding-bottom: 8px;
	margin: 0 0 12px;
}

/* Contact links as soft buttons */
#viewprofile .column1 dd a {
	display: inline-block;
	padding: 3px 12px;
	border-radius: 8px;
	background: var(--kp-soft);
	color: var(--kp-green);
	text-decoration: none;
}
#viewprofile .column1 dd a:hover,
#viewprofile .column1 dd a:focus-visible {
	background: var(--kp-tint);
}

/* Any later panels (signature, custom fields, notes) */
#viewprofile > .panel:nth-child(n+3) {
	background: var(--kp-card);
	border: 1px solid var(--kp-line);
	border-radius: 14px;
	padding: 18px 20px;
	margin-bottom: 14px;
}
#viewprofile .signature {
	font-family: Georgia, "Times New Roman", serif;
	color: var(--kp-muted);
	border-top: 0;
	margin-top: 0;
}

/* Focus visibility */
#viewprofile a:focus-visible,
#viewprofile button:focus-visible,
#viewprofile input:focus-visible {
	outline: 2px solid var(--kp-green-2);
	outline-offset: 2px;
}

/* ---------- Mobile ---------- */
@media (max-width: 700px) {
	#viewprofile > .panel:first-child::before {
		height: 96px;
	}
	#viewprofile > .panel:first-child > .inner {
		justify-content: center;
		padding: 0 16px 18px;
	}
	#viewprofile > .panel:first-child dl.left-box:not(.details) {
		margin-top: -48px;
	}
	#viewprofile .profile-avatar img {
		width: 92px;
		height: 92px;
	}
	#viewprofile dl.details {
		grid-template-columns: minmax(0, 1fr);
		gap: 2px;
	}
	#viewprofile dl.details dd {
		margin-bottom: 8px;
	}
}

/* ---------- UCP cover picture page ---------- */
.kp-cover-preview {
	height: 130px;
	max-width: 760px;
	border-radius: 12px;
	border: 1px solid #dde3dc;
	margin: 8px 0 6px;
	background-color: #2f4a3a;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Crect width='40' height='40' fill='%232F4A3A'/%3E%3Cpath d='M0 0L40 0L0 40Z' fill='%233E6149'/%3E%3Cpath d='M20 10L30 20L20 30L10 20Z' fill='%23E3C46F'/%3E%3Cpath d='M40 40L40 20L20 40Z' fill='%238E3B2E'/%3E%3C/svg%3E");
	background-size: 40px 40px;
}
.kp-cover-preview.has-image {
	background-size: cover;
	background-position: center;
}
.kp-cover-note {
	color: #5c6b61;
	margin-bottom: 12px;
}
