/**
 * Portal community front-end UI.
 */

.portal-user-page {
	margin-top: clamp(18px, 3vw, 30px);
	margin-bottom: clamp(30px, 6vw, 64px);
}

.portal-user-page .page-article > .entry-header {
	margin-bottom: 18px;
}

.portal-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 10px 18px;
	background: var(--portal-blue);
	border: 1px solid var(--portal-blue);
	border-radius: 11px;
	color: #fff;
	font-weight: 700;
	line-height: 1.2;
}

.portal-button:hover {
	background: var(--portal-blue-deep);
	color: #fff;
}

.portal-button.is-secondary {
	background: #eef4ff;
	border-color: #d9e5fb;
	color: var(--portal-blue-deep);
}

.portal-text-button {
	background: transparent;
	border: 0;
	color: var(--portal-blue);
	cursor: pointer;
	font-size: .83rem;
	font-weight: 700;
}

.portal-alert {
	margin-bottom: 16px;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: .88rem;
	font-weight: 600;
}

.portal-alert.is-success {
	background: #e9f8ef;
	color: #11633b;
}

.portal-alert.is-error {
	background: #fff0f1;
	color: #ab2433;
}

.portal-auth-wrap {
	display: flex;
	justify-content: center;
	padding: clamp(10px, 3vw, 34px) 0;
}

.portal-auth-card,
.portal-profile-edit {
	width: min(470px, 100%);
	padding: clamp(20px, 5vw, 32px);
	background: #fff;
	border: 1px solid #e6edf8;
	border-radius: 18px;
	box-shadow: var(--portal-shadow);
}

.portal-form-kicker {
	color: var(--portal-blue);
	font-size: .69rem;
	font-weight: 800;
	letter-spacing: .13em;
	text-transform: uppercase;
}

.portal-auth-card h2,
.portal-profile-edit h2 {
	margin: 7px 0 8px;
	color: var(--portal-ink);
	font-size: 1.5rem;
}

.portal-auth-card > p {
	color: #64738d;
}

.portal-form label {
	display: block;
	margin: 13px 0;
	color: #1b2943;
	font-size: .82rem;
	font-weight: 700;
}

.portal-form input:not([type="checkbox"]),
.portal-form textarea {
	display: block;
	width: 100%;
	margin-top: 7px;
	padding: 12px 13px;
	background: #fff;
	border: 1px solid #d9e3f3;
	border-radius: 10px;
	color: #15233e;
	font: inherit;
	font-weight: 500;
}

.portal-form input:focus,
.portal-form textarea:focus {
	outline: 2px solid rgba(21, 94, 239, .18);
	border-color: var(--portal-blue);
}

.portal-form-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 15px 0;
	font-size: .82rem;
}

.portal-checkbox {
	display: inline-flex !important;
	align-items: flex-start;
	gap: 8px;
	font-weight: 500 !important;
}

.portal-checkbox input {
	margin-top: 2px;
}

.portal-auth-card .portal-button {
	width: 100%;
	margin-top: 8px;
}

.portal-auth-alt {
	margin: 18px 0 0 !important;
	text-align: center;
	font-size: .84rem;
}

.portal-profile-layout {
	display: grid;
	gap: 18px;
}

.portal-profile-summary {
	overflow: hidden;
	padding: 0 18px 20px;
	border-radius: 18px;
	text-align: center;
}

.portal-profile-cover {
	height: 152px;
	margin: 0 -18px;
	background: #eef4ff;
}

.portal-profile-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.portal-avatar {
	display: block;
	width: 104px;
	height: 104px;
	margin: -52px auto 10px;
	object-fit: cover;
	background: #fff;
	border: 4px solid #fff;
	border-radius: 50%;
	box-shadow: 0 7px 20px rgba(10, 32, 67, .16);
}

.portal-profile-summary h2 {
	margin: 0;
	color: var(--portal-ink);
	font-size: 1.25rem;
}

.portal-username {
	margin: 4px 0 12px;
	color: #70809c;
}

.portal-bio {
	color: #52627d;
	font-size: .88rem;
	line-height: 1.55;
}

.portal-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 7px;
	margin: 18px 0;
	padding: 13px 0;
	border-block: 1px solid #edf1f8;
}

.portal-stats strong,
.portal-stats span {
	display: block;
}

.portal-stats strong {
	color: var(--portal-ink);
	font-size: 1.1rem;
}

.portal-stats span {
	color: #77849b;
	font-size: .73rem;
}

.portal-profile-actions {
	display: flex;
	gap: 9px;
	justify-content: center;
}

.portal-profile-social {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 12px;
	margin-top: 17px;
	font-size: .8rem;
	font-weight: 700;
}

.portal-profile-content {
	display: grid;
	gap: 16px;
}

.portal-panel {
	padding: clamp(16px, 2vw, 21px);
	background: #fff;
	border: 1px solid #e6edf8;
	border-radius: 18px;
	box-shadow: var(--portal-shadow);
}

.portal-panel h2 {
	margin: 0 0 13px;
	color: var(--portal-ink);
	font-size: 1.06rem;
}

.portal-panel-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-bottom: 8px;
}

.portal-panel-title h2 {
	margin: 0;
}

.portal-profile-posts {
	display: grid;
	gap: 9px;
}

.portal-profile-posts a {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 13px;
	background: #f7faff;
	border-radius: 10px;
	color: #172743;
	font-weight: 600;
}

.portal-profile-posts time {
	flex: 0 0 auto;
	color: #72809b;
	font-size: .75rem;
}

.portal-profile-edit {
	width: 100%;
}

.portal-profile-edit header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
}

.portal-edit-grid {
	display: grid;
	gap: 0 16px;
}

.portal-members {
	display: grid;
	gap: 18px;
}

.portal-member-search {
	display: flex;
	gap: 10px;
	max-width: 480px;
}

.portal-member-search input {
	flex: 1;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid #d9e3f3;
	border-radius: 11px;
}

.portal-member-grid {
	display: grid;
	gap: 13px;
}

.portal-user-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 24px;
	color: #67758c;
	font-size: .9rem;
}

.portal-message-badge {
	display: grid;
	place-items: center;
	margin-left: auto;
	min-width: 21px;
	height: 21px;
	padding: 0 5px;
	background: var(--portal-blue);
	border-radius: 11px;
	color: #fff;
	font-size: .7rem;
}

.portal-member-card {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 15px;
	border-radius: 15px;
}

.portal-member-card img {
	object-fit: cover;
	border-radius: 50%;
}

.portal-member-card h2 {
	margin: 0 0 4px;
	font-size: .94rem;
}

.portal-member-card p {
	margin: 0 0 9px;
	color: #72809a;
	font-size: .76rem;
}

.portal-member-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.portal-member-actions .portal-button {
	min-height: 32px;
	padding: 6px 10px;
	font-size: .76rem;
}

.portal-inline-form {
	display: inline-flex;
	margin: 0;
}

.portal-messages {
	display: grid;
	gap: 16px;
}

.portal-inbox,
.portal-conversation {
	padding: 17px;
	border-radius: 18px;
}

.portal-inbox h2,
.portal-conversation h2 {
	margin: 0 0 14px;
	color: var(--portal-ink);
	font-size: 1.08rem;
}

.portal-inbox a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px;
	border-radius: 10px;
	color: #172743;
	font-weight: 600;
}

.portal-inbox a.is-active,
.portal-inbox a:hover {
	background: #f0f5ff;
}

.portal-inbox img {
	object-fit: cover;
	border-radius: 50%;
}

.portal-message-thread {
	display: grid;
	gap: 9px;
	margin-bottom: 16px;
}

.portal-message-thread p {
	width: fit-content;
	max-width: min(85%, 500px);
	margin: 0;
	padding: 10px 12px;
	background: #f0f4fb;
	border-radius: 13px 13px 13px 3px;
	color: #192842;
}

.portal-message-thread .is-mine {
	justify-self: end;
	background: var(--portal-blue);
	border-radius: 13px 13px 3px 13px;
	color: #fff;
}

.portal-message-thread time {
	display: block;
	margin-top: 5px;
	font-size: .67rem;
	opacity: .72;
}

.portal-compose textarea {
	resize: vertical;
}

.portal-notification-list {
	display: grid;
	gap: 8px;
}

.portal-notification {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	padding: 12px;
	background: #f8faff;
	border-radius: 11px;
	color: #182841;
}

.portal-notification.is-unread {
	background: #eef5ff;
	font-weight: 600;
}

.portal-notification-dot {
	flex: 0 0 8px;
	width: 8px;
	height: 8px;
	margin-top: 6px;
	background: #bdcadf;
	border-radius: 50%;
}

.portal-notification.is-unread .portal-notification-dot {
	background: var(--portal-blue);
}

.portal-notification time {
	display: block;
	margin-top: 3px;
	color: #70809b;
	font-size: .73rem;
}

.portal-empty {
	color: #72809a;
	font-size: .88rem;
}

@media (min-width: 760px) {
	.portal-edit-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.portal-edit-grid .is-wide {
		grid-column: 1 / -1;
	}

	.portal-member-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.portal-messages {
		grid-template-columns: minmax(220px, .34fr) minmax(0, 1fr);
	}
}

@media (min-width: 960px) {
	.portal-profile-layout {
		grid-template-columns: 312px minmax(0, 1fr);
		align-items: start;
	}
}

@media (max-width: 559px) {
	.portal-profile-actions {
		display: grid;
	}

	.portal-profile-actions .portal-button,
	.portal-profile-actions form {
		width: 100%;
	}
}

.atlas-dark .portal-auth-card,
.atlas-dark .portal-profile-edit,
.atlas-dark .portal-panel {
	background: #101c31;
	border-color: #22324c;
}

.atlas-dark .portal-auth-card h2,
.atlas-dark .portal-profile-summary h2,
.atlas-dark .portal-panel h2,
.atlas-dark .portal-inbox h2,
.atlas-dark .portal-conversation h2 {
	color: #eef4ff;
}
